Skip to content

Commit a85f190

Browse files
committed
Fix font-locking of namespace-prefixed dynamic vars
1 parent 99e6d2e commit a85f190

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
* Prevent error when calling `indent-for-tab-command` at the start of
88
the buffer at end of line.
99
* [#274](https://github.com/clojure-emacs/clojure-mode/issues/274): Correct font-locking of certain punctuation character literals.
10+
* Fix font-locking of namespace-prefixed dynamic vars (e.g. `some.ns/*var*`).
1011

1112
## 4.0.1 (19/12/2014)
1213

clojure-mode.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ Called by `imenu--generic-function'."
444444
"\\>")
445445
0 font-lock-builtin-face)
446446
;; Dynamic variables - *something* or @*something*
447-
("\\<@?\\(\\*[a-z-]*\\*\\)\\>" 1 font-lock-variable-name-face)
447+
("\\(?:\\<\\|/\\)@?\\(\\*[a-z-]*\\*\\)\\>" 1 font-lock-variable-name-face)
448448
;; Global constants - nil, true, false
449449
(,(concat
450450
"\\<"

test/clojure-mode-test.el

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,8 @@ POS."
222222
(ert-deftest clojure-mode-syntax-table/dynamic-var ()
223223
:tags '(fontification syntax-table)
224224
(should (eq (clojure-test-face-at 1 10 "*some-var*") 'font-lock-variable-name-face))
225-
(should (eq (clojure-test-face-at 2 11 "@*some-var*") 'font-lock-variable-name-face)))
225+
(should (eq (clojure-test-face-at 2 11 "@*some-var*") 'font-lock-variable-name-face))
226+
(should (eq (clojure-test-face-at 9 13 "some.ns/*var*") 'font-lock-variable-name-face)))
226227

227228
(ert-deftest clojure-mode-syntax-table/ns-macro ()
228229
:tags '(fontification syntax-table)

0 commit comments

Comments
 (0)