|
1 | 1 | = Syntax highlighting
|
2 | 2 |
|
| 3 | +`clojure-mode` provides basic syntax highlighting for Clojure(Script) code, but |
| 4 | +CIDER builds upon this in several ways. The biggest limitation of `clojure-mode` |
| 5 | +is that the syntax highlighting there is based on the usage of regular expressions |
| 6 | +to figure out what's the syntactic category of the various identifiers (e.g. constants, |
| 7 | +macros, types, etc). CIDER, however, has access to all the data about identifiers from |
| 8 | +code that has already been loaded into nREPL, so it can provide a richer and more accurate |
| 9 | +syntax highlighting. We call this functionality "dynamic syntax highlighting" (as opposed to |
| 10 | +the somewhat static syntax highlighting you'd get from `clojure-mode`). |
| 11 | + |
3 | 12 | == Dynamic syntax highlighting
|
4 | 13 |
|
| 14 | +NOTE: The Emacs term for "syntax highlighting" is "font-locking". That's why |
| 15 | +all configuration variables that have something to do with syntax highlighting have |
| 16 | +"font-locking" in their names. |
| 17 | + |
5 | 18 | CIDER can syntax highlight symbols that are known to be defined. By default,
|
6 |
| -this is done on symbols from the `clojure.core`/`cljs.core` namespaces, as well as macros |
7 |
| -from any namespace. If you'd like CIDER to also colorize usages of functions |
8 |
| -and variables from any namespace, do: |
| 19 | +this is done from symbols from the `clojure.core` and `cljs.core` namespaces, as |
| 20 | +well as macros from any namespace. If you'd like CIDER to also colorize usages |
| 21 | +of functions and variables from any namespace, do: |
9 | 22 |
|
10 | 23 | [source,lisp]
|
11 | 24 | ----
|
|
0 commit comments