]> code.delx.au - gnu-emacs-elpa/blobdiff - packages/context-coloring/README.md
Merge commit '3bf805df83fe6f110f3e7e8ce2dc37e0cf6c14cb' from context-coloring
[gnu-emacs-elpa] / packages / context-coloring / README.md
index 6c895de91619765240608069594b515113fa1a4b..39c15cfd5d3a81b099a7093a43c4dcf41e5a6c27 100644 (file)
@@ -13,9 +13,12 @@ By default, comments and strings are still highlighted syntactically.
 
 ## Features
 
-- Supported languages: JavaScript
 - Light and dark (customizable) color schemes.
-- Very fast for files under 1000 lines.
+- JavaScript support:
+  - Very fast for files under 1000 lines.
+  - Script, function and block scopes (and even `catch` block scopes).
+- Emacs Lisp support:
+  - `defun`, `lambda`, `let`, `let*`, quotes, backticks, commas.
 
 ## Installation
 
@@ -51,7 +54,7 @@ make compile
 (require 'context-coloring)
 ```
 
-### scopifier (for non-js2-mode users)
+### Dependencies (js-mode)
 
 ```bash
 npm install -g scopifier
@@ -62,12 +65,15 @@ npm install -g scopifier
 Add the following to your init file:
 
 ```lisp
-;; non-js2-mode users:
+;; js-mode:
 (add-hook 'js-mode-hook 'context-coloring-mode)
 
-;; js2-mode users:
+;; js2-mode:
 (add-to-list 'auto-mode-alist '("\\.js\\'" . js2-mode))
 (add-hook 'js2-mode-hook 'context-coloring-mode)
+
+;; emacs-lisp-mode:
+(add-hook 'emacs-lisp-mode-hook 'context-coloring-mode)
 ```
 
 ## Customizing
@@ -79,7 +85,8 @@ Add the following to your init file:
 - `context-coloring-syntactic-strings` (default: `t`): If non-nil, also color
   strings using `font-lock`.
 - `context-coloring-delay` (default: `0.25`; supported modes: `js-mode`,
-  `js3-mode`): Delay between a buffer update and colorization.
+  `js3-mode`, `emacs-lisp-mode`): Delay between a buffer update and
+  colorization.
 - `context-coloring-js-block-scopes` (default: `nil`; supported modes:
   `js2-mode`): If non-nil, also color block scopes in the scope hierarchy in
   JavaScript.
@@ -96,17 +103,17 @@ You can define your own theme colors too:
 ```lisp
 (context-coloring-define-theme
  'zenburn
- :colors '("#DCDCCC"
-           "#93E0E3"
-           "#BFEBBF"
-           "#F0DFAF"
-           "#DFAF8F"
-           "#CC9393"
-           "#DC8CC3"
-           "#94BFF3"
-           "#9FC59F"
-           "#D0BF8F"
-           "#DCA3A3"))
+ :colors '("#dcdccc"
+           "#93e0e3"
+           "#bfebbf"
+           "#f0dfaf"
+           "#dfaf8f"
+           "#cc9393"
+           "#dc8cc3"
+           "#94bff3"
+           "#9fc59f"
+           "#d0bf8f"
+           "#dca3a3"))
 ```
 
 See `C-h f context-coloring-define-theme` for more info on theme parameters.
@@ -170,6 +177,11 @@ When a `--version` argument is passed, a scopifier should print its version
 number and exit.  This allows context-coloring to determine if an update is
 required.
 
+Alternatively, you could implement a "colorizer" in Emacs Lisp.  A colorizer
+also handles the job of calling `context-coloring-colorize-region` to apply
+colors to a buffer.  A colorizer may have better performance than a scopifier
+when parsing and coloring can be performed in the same pass.
+
 [js2-mode]: https://github.com/mooz/js2-mode
 [node]: http://nodejs.org/download/
 [scopifier]: https://github.com/jacksonrayhamilton/scopifier