@@ -352,6 +352,13 @@ Called by `imenu--generic-function'."
352
352
(set-match-data (list def-beg def-end)))))
353
353
(goto-char start)))))
354
354
355
+ (eval-when-compile
356
+ ; ; See clojure.lang.LispReader definition and getMacro invocation(s)
357
+ (defconst clojure-sym-rest-chars " ^][\" ;\' @\\ ^`~\(\)\{\} \\ " )
358
+ (defconst clojure-sym-1st-chars (concat clojure-sym-rest-chars " 0-9" ))
359
+ (defconst clojure-sym
360
+ (concat " [" clojure-sym-1st-chars " ][" clojure-sym-rest-chars " ]+" )))
361
+
355
362
(defconst clojure-font-lock-keywords
356
363
(eval-when-compile
357
364
`(; ; Top-level variable definition
@@ -381,7 +388,8 @@ Called by `imenu--generic-function'."
381
388
(2 font-lock-type-face nil t ))
382
389
; ; Function definition (anything that starts with def and is not
383
390
; ; listed above)
384
- (,(concat " (\\ (?:[a-z\. -]+/\\ )?\\ (def[^ \r\n\t ]*\\ )"
391
+ (,(concat " (\\ (?:" clojure-sym " /\\ )?"
392
+ " \\ (def[^ \r\n\t ]*\\ )"
385
393
; ; Function declarations
386
394
" \\ >"
387
395
; ; Any whitespace
@@ -461,7 +469,8 @@ Called by `imenu--generic-function'."
461
469
; ; Character literals - \1, \a, \newline, \u0000
462
470
(" \\\\\\ ([[:punct:]]\\ |[a-z0-9]+\\ >\\ )" 0 'clojure-character-face )
463
471
; ; foo/ Foo/ @Foo/ /FooBar
464
- (" \\ (?:\\ <:?\\ |\\ .\\ )@?\\ ([a-zA-Z][.a-zA-Z0-9$_-]*\\ )\\ (/\\ )" (1 font-lock-type-face ) (2 'default ))
472
+ (,(concat " \\ (?:\\ <:?\\ |\\ .\\ )@?\\ (" clojure-sym " \\ )\\ (/\\ )" )
473
+ (1 font-lock-type-face ) (2 'default ))
465
474
; ; Constant values (keywords), including as metadata e.g. ^:static
466
475
(" \\ <^?\\ (:\\ (\\ sw\\ |\\ s_\\ )+\\ (\\ >\\ |\\ _>\\ )\\ )" 1 'clojure-keyword-face append )
467
476
; ; Java interop highlighting
0 commit comments