Skip to content

Commit c933a4e

Browse files
sulamibbatsov
authored andcommitted
Support multiple consecutive reader comments (#_#_a b)
Modified the default regexps and the heuristic to find the end of the region to comment out. Previously Emacs would treat the second `#_` as the commented form, and then highlight the following two forms as usual. Now it (mostly) matches what Clojure actually evaluates. Things get weird when you start mixing `#_` and forms, but this fixes the most common use cases, like key-value-pairs.
1 parent 93b9e7e commit c933a4e

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

clojure-mode-font-lock-test.el

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,11 +133,35 @@ DESCRIPTION is the description of the spec."
133133
("#_"
134134
(1 2 nil))
135135

136+
("#_#_"
137+
(1 2 nil))
138+
139+
("#_#_"
140+
(3 2 font-lock-comment-face))
141+
142+
("#_ #_"
143+
(1 3 nil))
144+
145+
("#_ #_"
146+
(4 2 font-lock-comment-face))
147+
136148
("#_ \n;; some crap\n (lala 0101\n lao\n\n 0 0i)"
137149
(1 2 nil))
138150

139151
("#_ \n;; some crap\n (lala 0101\n lao\n\n 0 0i)"
140-
(5 41 font-lock-comment-face)))
152+
(5 41 font-lock-comment-face))
153+
154+
("#_#_ \n;; some crap\n (lala 0101\n lao\n\n 0 0i)\n;; more crap\n (foobar tnseriao)"
155+
(1 4 nil))
156+
157+
("#_ #_ \n;; some crap\n (lala 0101\n lao\n\n 0 0i)\n;; more crap\n (foobar tnseriao)"
158+
(1 5 nil))
159+
160+
("#_#_ \n;; some crap\n (lala 0101\n lao\n\n 0 0i)\n;; more crap\n (foobar tnseriao)"
161+
(7 75 font-lock-comment-face))
162+
163+
("#_ #_ \n;; some crap\n (lala 0101\n lao\n\n 0 0i)\n;; more crap\n (foobar tnseriao)"
164+
(8 75 font-lock-comment-face)))
141165

142166
(when-fontifying-it "should handle namespace declarations"
143167
("(ns .validns)"

0 commit comments

Comments
 (0)