diff --git a/CHANGELOG.md b/CHANGELOG.md index 78354744..98210219 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## master (unreleased) +### Bugs fixed + +* Dynamic vars whose names contain non-alphanumeric characters are now font-locked correctly. + ## 5.10.0 (2019-01-05) ### New features diff --git a/clojure-mode.el b/clojure-mode.el index 7940b800..a9ea8e2c 100644 --- a/clojure-mode.el +++ b/clojure-mode.el @@ -847,7 +847,8 @@ any number of matches of `clojure--sym-forbidden-rest-chars'.")) "\\>") 0 font-lock-builtin-face) ;; Dynamic variables - *something* or @*something* - ("\\(?:\\<\\|/\\)@?\\(\\*[a-z-]*\\*\\)\\>" 1 font-lock-variable-name-face) + (,(concat "\\(?:\\<\\|/\\)@?\\(\\*" clojure--sym-regexp "\\*\\)\\>") + 1 font-lock-variable-name-face) ;; Global constants - nil, true, false (,(concat "\\<" diff --git a/test/clojure-mode-font-lock-test.el b/test/clojure-mode-font-lock-test.el index f97c30f9..2eb1fa15 100644 --- a/test/clojure-mode-font-lock-test.el +++ b/test/clojure-mode-font-lock-test.el @@ -822,6 +822,8 @@ POS." (should (eq (clojure-test-face-at 2 11 "@*some-var*") 'font-lock-variable-name-face)) (should (eq (clojure-test-face-at 9 13 "some.ns/*var*") + 'font-lock-variable-name-face)) + (should (eq (clojure-test-face-at 1 11 "*some-var?*") 'font-lock-variable-name-face))) (provide 'clojure-mode-font-lock-test)