Skip to content

Commit fc856ba

Browse files
author
m00nlight
committed
[Fix #274] Correct font-locking of punctuation character literals
1 parent 4b6d876 commit fc856ba

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

clojure-mode.el

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -441,8 +441,7 @@ Called by `imenu--generic-function'."
441441
"\\>")
442442
0 font-lock-constant-face)
443443
;; Character literals - \1, \a, \newline, \u0000
444-
;; FIXME: handle properly some punctuation characters (like commas and semicolumns)
445-
("\\\\\\([[:punct:]]\\|[a-z0-9]+\\)\\>" 0 'clojure-character-face)
444+
("\\\\\\([[:punct:]]\\|[a-z0-9]+\\>\\)" 0 'clojure-character-face)
446445
;; Constant values (keywords), including as metadata e.g. ^:static
447446
("\\<^?\\(:\\(\\sw\\|\\s_\\)+\\(\\>\\|\\_>\\)\\)" 1 'clojure-keyword-face)
448447
;; cljx annotations (#+clj and #+cljs)

test/clojure-mode-test.el

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,9 @@ POS."
205205
(should (eq (clojure-test-face-at 1 2 "\\1") 'clojure-character-face))
206206
(should (eq (clojure-test-face-at 1 6 "\\u0032") 'clojure-character-face))
207207
(should (eq (clojure-test-face-at 1 2 "\\+") 'clojure-character-face))
208-
(should (eq (clojure-test-face-at 1 2 "\\.") 'clojure-character-face)))
208+
(should (eq (clojure-test-face-at 1 2 "\\.") 'clojure-character-face))
209+
(should (eq (clojure-test-face-at 1 2 "\\,") 'clojure-character-face))
210+
(should (eq (clojure-test-face-at 1 2 "\\;") 'clojure-character-face)))
209211

210212
(ert-deftest clojure-mode-syntax-table/cljx ()
211213
:tags '(fontification syntax-table)

0 commit comments

Comments
 (0)