Skip to content

Commit 71c19e1

Browse files
committed
Introduce clojure-global-constant-face
1 parent 118c197 commit 71c19e1

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
### New features
66

7+
* Introduce `clojure-global-constant-face`.
78
* Add imenu support for multimethods.
89
* Make imenu recognize indented def-forms.
910
* New interactive command `clojure-cycle-when`.

clojure-mode.el

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,11 @@
9797
"Face used to font-lock interop method names (camelCase)."
9898
:package-version '(clojure-mode . "3.0.0"))
9999

100+
(defface clojure-global-constant-face
101+
'((t (:inherit font-lock-constant-face)))
102+
"Face used to font-lock the Clojure global constants: nil, true, false."
103+
:package-version '(clojure-mode . "3.0.0"))
104+
100105
(defcustom clojure-indent-style :always-align
101106
"Indentation style to use for function forms and macro forms.
102107
There are two cases of interest configured by this variable.
@@ -844,7 +849,7 @@ any number of matches of `clojure--sym-forbidden-rest-chars'."))
844849
(regexp-opt
845850
'("true" "false" "nil") t)
846851
"\\>")
847-
0 font-lock-constant-face)
852+
0 'clojure-global-constant-face)
848853
;; Character literals - \1, \a, \newline, \u0000
849854
("\\\\\\([[:punct:]]\\|[a-z0-9]+\\>\\)" 0 'clojure-character-face)
850855
;; foo/ Foo/ @Foo/ /FooBar

test/clojure-mode-font-lock-test.el

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -281,16 +281,16 @@ POS."
281281

282282
(ert-deftest clojure-mode-syntax-table/nil ()
283283
:tags '(fontification syntax-table)
284-
(should (eq (clojure-test-face-at 4 6 "(= nil x)") 'font-lock-constant-face))
285-
(should-not (eq (clojure-test-face-at 3 5 "(fnil x)") 'font-lock-constant-face)))
284+
(should (eq (clojure-test-face-at 4 6 "(= nil x)") 'clojure-global-constant-face))
285+
(should-not (eq (clojure-test-face-at 3 5 "(fnil x)") 'clojure-global-constant-face)))
286286

287287
(ert-deftest clojure-mode-syntax-table/true ()
288288
:tags '(fontification syntax-table)
289-
(should (eq (clojure-test-face-at 4 7 "(= true x)") 'font-lock-constant-face)))
289+
(should (eq (clojure-test-face-at 4 7 "(= true x)") 'clojure-global-constant-face)))
290290

291291
(ert-deftest clojure-mode-syntax-table/false ()
292292
:tags '(fontification syntax-table)
293-
(should (eq (clojure-test-face-at 4 8 "(= false x)") 'font-lock-constant-face)))
293+
(should (eq (clojure-test-face-at 4 8 "(= false x)") 'clojure-global-constant-face)))
294294

295295
(ert-deftest clojure-mode-syntax-table/keyword-meta ()
296296
:tags '(fontification syntax-table)

0 commit comments

Comments
 (0)