@@ -352,6 +352,20 @@ Called by `imenu--generic-function'."
352352 (set-match-data (list def-beg def-end)))))
353353 (goto-char start)))))
354354
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+
355369(defconst clojure-font-lock-keywords
356370 (eval-when-compile
357371 `(; ; Top-level variable definition
@@ -381,7 +395,8 @@ Called by `imenu--generic-function'."
381395 (2 font-lock-type-face nil t ))
382396 ; ; Function definition (anything that starts with def and is not
383397 ; ; listed above)
384- (,(concat " (\\ (?:[a-z\. -]+/\\ )?\\ (def[^ \r\n\t ]*\\ )"
398+ (,(concat " (\\ (?:" clojure-sym " /\\ )?"
399+ " \\ (def[^ \r\n\t ]*\\ )"
385400 ; ; Function declarations
386401 " \\ >"
387402 ; ; Any whitespace
@@ -461,7 +476,8 @@ Called by `imenu--generic-function'."
461476 ; ; Character literals - \1, \a, \newline, \u0000
462477 (" \\\\\\ ([[:punct:]]\\ |[a-z0-9]+\\ >\\ )" 0 'clojure-character-face )
463478 ; ; 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 ))
465481 ; ; Constant values (keywords), including as metadata e.g. ^:static
466482 (" \\ <^?\\ (:\\ (\\ sw\\ |\\ s_\\ )+\\ (\\ >\\ |\\ _>\\ )\\ )" 1 'clojure-keyword-face append )
467483 ; ; Java interop highlighting
0 commit comments