@@ -352,6 +352,20 @@ Called by `imenu--generic-function'."
352
352
(set-match-data (list def-beg def-end)))))
353
353
(goto-char start)))))
354
354
355
+ (eval-and-compile
356
+ (defconst clojure-sym-rest-chars " ^][\" ;\' @\\ ^`~\(\)\{\} \\ "
357
+ " A black list of chars a clojure symbol must not contain. See
358
+ definiton of 'macros': URL `http://git.io/vRGLD' ." )
359
+ (defconst clojure-sym-1st-chars (concat clojure-sym-rest-chars " 0-9" )
360
+ " A black list of chars a clojure symbol must not start with. See
361
+ the for-loop: URL `http://git.io/vRGTj' lines:
362
+ URL `http://git.io/vRGIh' , URL `http://git.io/vRGLE'
363
+ and value definition of 'macros': URL `http://git.io/vRGLD' ." )
364
+ (defconst clojure-sym
365
+ (concat " [" clojure-sym-1st-chars " ][" clojure-sym-rest-chars " ]+" )
366
+ " A concatenation of black lists:
367
+ `clojure-sym-1st-chars' , `clojure-sym-rest-chars' ." ))
368
+
355
369
(defconst clojure-font-lock-keywords
356
370
(eval-when-compile
357
371
`(; ; Top-level variable definition
@@ -381,7 +395,8 @@ Called by `imenu--generic-function'."
381
395
(2 font-lock-type-face nil t ))
382
396
; ; Function definition (anything that starts with def and is not
383
397
; ; listed above)
384
- (,(concat " (\\ (?:[a-z\. -]+/\\ )?\\ (def[^ \r\n\t ]*\\ )"
398
+ (,(concat " (\\ (?:" clojure-sym " /\\ )?"
399
+ " \\ (def[^ \r\n\t ]*\\ )"
385
400
; ; Function declarations
386
401
" \\ >"
387
402
; ; Any whitespace
@@ -461,7 +476,8 @@ Called by `imenu--generic-function'."
461
476
; ; Character literals - \1, \a, \newline, \u0000
462
477
(" \\\\\\ ([[:punct:]]\\ |[a-z0-9]+\\ >\\ )" 0 'clojure-character-face )
463
478
; ; foo/ Foo/ @Foo/ /FooBar
464
- (" \\ (?:\\ <:?\\ |\\ .\\ )@?\\ ([a-zA-Z][.a-zA-Z0-9$_-]*\\ )\\ (/\\ )" (1 font-lock-type-face ) (2 'default ))
479
+ (,(concat " \\ (?:\\ <:?\\ |\\ .\\ )@?\\ (" clojure-sym " \\ )\\ (/\\ )" )
480
+ (1 font-lock-type-face ) (2 'default ))
465
481
; ; Constant values (keywords), including as metadata e.g. ^:static
466
482
(" \\ <^?\\ (:\\ (\\ sw\\ |\\ s_\\ )+\\ (\\ >\\ |\\ _>\\ )\\ )" 1 'clojure-keyword-face append )
467
483
; ; Java interop highlighting
0 commit comments