## Features
-- Supported languages: JavaScript
- Light and dark (customizable) color schemes.
-- Very fast for files under 1000 lines.
+- JavaScript support:
+ - Script, function and block scopes (and even `catch` block scopes).
+ - Very fast for files under 1000 lines.
+- Emacs Lisp support:
+ - `defun`, `lambda`, `let`, `let*`, `cond`, `condition-case`, `defadvice`,
+ `dolist`, `quote`, `backquote` and backquote splicing.
+ - Instantaneous lazy coloring, 8000 lines-per-second full coloring.
## Installation
(require 'context-coloring)
```
-### scopifier (for non-js2-mode users)
+### Dependencies (js-mode)
```bash
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
comments using `font-lock`.
- `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.
+- `context-coloring-default-delay` (default: `0.25`; supported modes: `js-mode`,
+ `js3-mode`): Default (sometimes overridden) 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.
```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.
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