[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master b190309 133/271: Update documentation to be language-agnos
From: |
Jackson Ray Hamilton |
Subject: |
[elpa] master b190309 133/271: Update documentation to be language-agnostic. |
Date: |
Thu, 05 Feb 2015 18:30:32 +0000 |
branch: master
commit b19030972e53b3043d57b2a81ff644925745a9e1
Author: Jackson Ray Hamilton <address@hidden>
Commit: Jackson Ray Hamilton <address@hidden>
Update documentation to be language-agnostic.
---
README.md | 30 +++++++++++++++++-------------
context-coloring.el | 28 +++++++++++++++++-----------
2 files changed, 34 insertions(+), 24 deletions(-)
diff --git a/README.md b/README.md
index 2c28844..cf1deff 100644
--- a/README.md
+++ b/README.md
@@ -4,7 +4,7 @@
<img alt="Screenshot of JavaScript code highlighted by context."
src="screenshot.png" title="Screenshot">
</p>
-Highlights JavaScript code according to function context.
+Highlights code according to function context.
- Code in the global scope is one color. Code in functions within the global
scope is a different color, and code within such functions is another color,
@@ -12,19 +12,21 @@ Highlights JavaScript code according to function context.
- Identifiers retain the color of the scope in which they were declared.
- Comments are gray.
-JavaScript programmers often leverage closures to bind nearby data to
-functions. Lexical scope information at-a-glance can assist a programmer in
-understanding the overall structure of a program. It can also help curb nasty
-bugs like implicit globals and name shadowing. A rainbow can indicate excessive
+Lexical scope information at-a-glance can assist a programmer in understanding
+the overall structure of a program. It can also help curb nasty bugs like name
+shadowing or unexpected assignment. A rainbow can indicate excessive
complexity. A spot of contrast followed by an assignment expression could be a
-side-effect... or, a specially-constructed object's private state could be
-undergoing change.
+side-effect... or, the state of a closure could be undergoing change.
-This coloring scheme is probably more useful than conventional JavaScript
-*syntax* highlighting. Highlighting keywords can help one to detect spelling
-errors, and highlighting the content between quotation marks can alert one to
-unclosed string literals. But a [linter][] can also spot these errors, along
-with many others, and can be [seamlessly integrated via flycheck][integration].
+This coloring strategy is probably more useful than conventional *syntax*
+highlighting. Highlighting keywords can help one to detect spelling errors, and
+highlighting the content between quotation marks can alert one to unclosed
+string literals. But a [linter][] could also spot those errors, and if
+[integrated via flycheck][integration], an extra spot opens up in your editing
+toolbelt.
+
+Give context coloring a try; you may find that it *changes the way you write
+code*.
## Features
@@ -37,7 +39,9 @@ with many others, and can be [seamlessly integrated via
flycheck][integration].
## Usage
-Requires Emacs 24+ and [Node.js 0.10+][node].
+Requires Emacs 24+.
+
+JavaScript language support requires [Node.js 0.10+][node].
- Clone this repository.
diff --git a/context-coloring.el b/context-coloring.el
index b5ad9bc..b492288 100644
--- a/context-coloring.el
+++ b/context-coloring.el
@@ -1,9 +1,9 @@
-;;; context-coloring.el --- JavaScript syntax highlighting, except not for
syntax. -*- lexical-binding: t; -*-
+;;; context-coloring.el --- Syntax highlighting, except not for syntax. -*-
lexical-binding: t; -*-
;; Copyright (C) 2014 Jackson Ray Hamilton
;; Author: Jackson Ray Hamilton <address@hidden>
-;; Keywords: context coloring highlighting js javascript
+;; Keywords: context coloring syntax highlighting
;; Version: 1.0.0
;; Package-Requires: ((emacs "24"))
@@ -22,15 +22,19 @@
;;; Commentary:
-;; Highlights JavaScript code according to function context.
-;;
-;; Usage:
-;;
-;; Install Node.js 0.10+.
-;; In your ~/.emacs:
-;;
+;; Colors code by scope, rather than by syntax.
+
+;; A range of characters encompassing a scope is colored according to its
level;
+;; the global scope is white, scopes within the global scope are yellow, scopes
+;; within scopes within the global scope are green, etc. Variables defined in
a
+;; parent scope which are referenced from child scopes retain the same color as
+;; the scope in which they are defined; a variable defined in the global scope
+;; will be the same color when referenced from nested scopes.
+
+;; To use, add the following to your ~/.emacs:
+
;; (require 'context-coloring)
-;; (add-hook 'js-mode-hook 'context-coloring-mode)
+;; (add-hook 'js-mode-hook 'context-coloring-mode) ; Requires Node.js 0.10+.
;;; Code:
@@ -91,6 +95,8 @@
"Context coloring face, level 6."
:group 'context-coloring-faces)
+;;; Additional 6 faces as placeholders for potential (insane) levels of
nesting.
+
(defface context-coloring-level-7-face
'((t (:inherit context-coloring-level-1-face)))
"Context coloring face, level 7."
@@ -300,7 +306,7 @@ colorizing would be redundant."
;;;###autoload
(define-minor-mode context-coloring-mode
- "Context-based code coloring for JavaScript, inspired by Douglas Crockford."
+ "Context-based code coloring, inspired by Douglas Crockford."
nil " Context" nil
(if (not context-coloring-mode)
(progn
- [elpa] master e58833f 120/271: Refactor and document., (continued)
- [elpa] master e58833f 120/271: Refactor and document., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 3031e54 119/271: Extend range; fix modulo bug., Jackson Ray Hamilton, 2015/02/05
- [elpa] master d78046d 098/271: Include external libraries., Jackson Ray Hamilton, 2015/02/05
- [elpa] master f7f4fe8 126/271: Improve elisp tests., Jackson Ray Hamilton, 2015/02/05
- [elpa] master fe2bd04 128/271: Multiple vars., Jackson Ray Hamilton, 2015/02/05
- [elpa] master b51c36d 118/271: New experimental color scheme., Jackson Ray Hamilton, 2015/02/05
- [elpa] master c595539 111/271: Shift and darken colors for light color scheme., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 146c096 114/271: Merge branch 'develop' into feature/color-schemer, Jackson Ray Hamilton, 2015/02/05
- [elpa] master aa5cca3 129/271: Multiple vars. Rename., Jackson Ray Hamilton, 2015/02/05
- [elpa] master fae85f9 117/271: Add code samples., Jackson Ray Hamilton, 2015/02/05
- [elpa] master b190309 133/271: Update documentation to be language-agnostic.,
Jackson Ray Hamilton <=
- [elpa] master 6f34a6a 134/271: Update screenshot., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 5a7fc32 138/271: Documentation., Jackson Ray Hamilton, 2015/02/05
- [elpa] master f77870d 137/271: Add language support documentation., Jackson Ray Hamilton, 2015/02/05
- [elpa] master faea355 123/271: Cleanup and improve tests., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 4b2e1db 140/271: Documentation., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 3f1bae9 142/271: Make js2-mode read-only., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 1ceb460 139/271: Documentation., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 1b7e0a5 122/271: Make context-coloring-face-count customizable. Add some dummy faces., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 459987e 131/271: Generalize for different major modes. Remove dirty benchmarking., Jackson Ray Hamilton, 2015/02/05
- [elpa] master 2341708 132/271: Reorganize JavaScript files., Jackson Ray Hamilton, 2015/02/05