From fc856ba3d7edcbd95b4706fb70ae320f4af34178 Mon Sep 17 00:00:00 2001 From: m00nlight Date: Thu, 5 Mar 2015 20:47:32 +0800 Subject: [PATCH] [Fix #274] Correct font-locking of punctuation character literals --- clojure-mode.el | 3 +-- test/clojure-mode-test.el | 4 +++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/clojure-mode.el b/clojure-mode.el index 6fb4c47f..4ffdc0df 100644 --- a/clojure-mode.el +++ b/clojure-mode.el @@ -441,8 +441,7 @@ Called by `imenu--generic-function'." "\\>") 0 font-lock-constant-face) ;; Character literals - \1, \a, \newline, \u0000 - ;; FIXME: handle properly some punctuation characters (like commas and semicolumns) - ("\\\\\\([[:punct:]]\\|[a-z0-9]+\\)\\>" 0 'clojure-character-face) + ("\\\\\\([[:punct:]]\\|[a-z0-9]+\\>\\)" 0 'clojure-character-face) ;; Constant values (keywords), including as metadata e.g. ^:static ("\\<^?\\(:\\(\\sw\\|\\s_\\)+\\(\\>\\|\\_>\\)\\)" 1 'clojure-keyword-face) ;; cljx annotations (#+clj and #+cljs) diff --git a/test/clojure-mode-test.el b/test/clojure-mode-test.el index 41d32985..d7d8747b 100644 --- a/test/clojure-mode-test.el +++ b/test/clojure-mode-test.el @@ -205,7 +205,9 @@ POS." (should (eq (clojure-test-face-at 1 2 "\\1") 'clojure-character-face)) (should (eq (clojure-test-face-at 1 6 "\\u0032") 'clojure-character-face)) (should (eq (clojure-test-face-at 1 2 "\\+") 'clojure-character-face)) - (should (eq (clojure-test-face-at 1 2 "\\.") 'clojure-character-face))) + (should (eq (clojure-test-face-at 1 2 "\\.") 'clojure-character-face)) + (should (eq (clojure-test-face-at 1 2 "\\,") 'clojure-character-face)) + (should (eq (clojure-test-face-at 1 2 "\\;") 'clojure-character-face))) (ert-deftest clojure-mode-syntax-table/cljx () :tags '(fontification syntax-table)