Skip to content

Commit 043a290

Browse files
committed
Move the cljx specific font-locking to clojurex-mode
1 parent 20356bc commit 043a290

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

clojure-mode.el

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -456,8 +456,6 @@ Called by `imenu--generic-function'."
456456
("\\\\\\([[:punct:]]\\|[a-z0-9]+\\>\\)" 0 'clojure-character-face)
457457
;; Constant values (keywords), including as metadata e.g. ^:static
458458
("\\<^?\\(:\\(\\sw\\|\\s_\\)+\\(\\>\\|\\_>\\)\\)" 1 'clojure-keyword-face)
459-
;; cljx annotations (#+clj and #+cljs)
460-
("#\\+cljs?\\>" 0 font-lock-preprocessor-face)
461459
;; Java interop highlighting
462460
;; CONST SOME_CONST (optionally prefixed by /)
463461
("\\(?:\\<\\|/\\)\\([A-Z]+\\|\\([A-Z]+_[A-Z1-9_]+\\)\\)\\>" 1 font-lock-constant-face)
@@ -1098,11 +1096,16 @@ This will skip over sexps that don't represent objects, so that ^hints and
10981096
10991097
\\{clojurec-mode-map}")
11001098

1099+
(defconst clojurex-font-lock-keywords
1100+
;; cljx annotations (#+clj and #+cljs)
1101+
'(("#\\+cljs?\\>" 0 font-lock-preprocessor-face)))
1102+
11011103
;;;###autoload
11021104
(define-derived-mode clojurex-mode clojure-mode "ClojureX"
11031105
"Major mode for editing ClojureX code.
11041106
1105-
\\{clojurex-mode-map}")
1107+
\\{clojurex-mode-map}"
1108+
(font-lock-add-keywords nil clojurex-font-lock-keywords))
11061109

11071110
;;;###autoload
11081111
(progn

0 commit comments

Comments
 (0)