Skip to content

Commit 842b203

Browse files
committed
[Docs] Expand the font-locking documentation a bit
1 parent c8e9da9 commit 842b203

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

doc/modules/ROOT/pages/config/syntax_highlighting.adoc

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,24 @@
11
= Syntax highlighting
22

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+
312
== Dynamic syntax highlighting
413

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+
518
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:
922

1023
[source,lisp]
1124
----

0 commit comments

Comments
 (0)