You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+6-2Lines changed: 6 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -305,11 +305,15 @@ conservative and minimalistic.
305
305
Precise font-locking requires additional data that can obtained from a running
306
306
REPL (that's how CIDER's [dynamic font-locking](https://docs.cider.mx/cider/config/syntax_highlighting.html) works) or from static code analysis.
307
307
308
-
When it comes to definitions, `clojure-mode` employs a simple heuristic and will treat every symbol named `def`something as a built-in keyword. Still, you'll need to
309
-
teach `clojure-mode` manually how to handle the docstrings of non built-in definition forms. Here's an example:
308
+
When it comes to non built-in definitions, `clojure-mode` needs to be manually instructed how to handle the docstrings and highlighting. Here's an example:
310
309
311
310
```emacs-lisp
312
311
(put '>defn 'clojure-doc-string-elt 2)
312
+
313
+
(font-lock-add-keywords 'clojure-mode
314
+
`((,(concat "(\\(?:" clojure--sym-regexp "/\\)?"
315
+
"\\(>defn\\)\\>")
316
+
1 font-lock-keyword-face)))
313
317
```
314
318
315
319
**Note:** The `clojure-doc-string-elt` attribute is processed by the function `clojure-font-lock-syntactic-face-function`.
0 commit comments