File tree Expand file tree Collapse file tree 3 files changed +20
-1
lines changed Expand file tree Collapse file tree 3 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -426,6 +426,12 @@ Called by `imenu--generic-function'."
426
426
" declare" ) t )
427
427
" \\ >" )
428
428
1 font-lock-keyword-face )
429
+ ; ; Macros similar to let, when, and while
430
+ (,(rx symbol-start
431
+ (or " let" " when" " while" ) " -"
432
+ (1+ (or (syntax word) (syntax symbol)))
433
+ symbol-end)
434
+ 0 font-lock-keyword-face )
429
435
(,(concat
430
436
" \\ <"
431
437
(regexp-opt
@@ -667,7 +673,10 @@ symbol properties."
667
673
(or (get (intern-soft (match-string 1 function-name))
668
674
'clojure-indent-function )
669
675
(get (intern-soft (match-string 1 function-name))
670
- 'clojure-backtracking-indent )))))
676
+ 'clojure-backtracking-indent )))
677
+ (when (string-match (rx (or " let" " when" " while" ) (syntax symbol))
678
+ function-name)
679
+ (clojure--get-indent-method (substring (match-string 0 function-name) 0 -1 )))))
671
680
672
681
(defvar clojure--current-backtracking-depth 0 )
673
682
Original file line number Diff line number Diff line change @@ -124,6 +124,12 @@ POS."
124
124
(should (equal (clojure-test-face-at 8 8 " {:a.ias/some 20}" ) '(default clojure-keyword-face)))
125
125
(should (equal (clojure-test-face-at 9 12 " {:a.ias/some 20}" ) '(clojure-keyword-face))))
126
126
127
+ (ert-deftest clojure-mode-syntax-table/fontify-let-when-while-type-forms ()
128
+ :tags '(fontification syntax-table)
129
+ (should (equal (clojure-test-face-at 2 11 " (when-alist [x 1]\n ())" ) 'font-lock-keyword-face ))
130
+ (should (equal (clojure-test-face-at 2 11 " (while-alist [x 1]\n ())" ) 'font-lock-keyword-face ))
131
+ (should (equal (clojure-test-face-at 2 11 " (let-alist [x 1]\n ())" ) 'various-faces )))
132
+
127
133
(ert-deftest clojure-mode-syntax-table/type ()
128
134
:tags '(fontification syntax-table)
129
135
(should (eq (clojure-test-face-at 1 9 " SomeClass" ) 'font-lock-type-face )))
Original file line number Diff line number Diff line change @@ -335,6 +335,10 @@ values of customisable variables."
335
335
" (msg' 1
336
336
10)" )
337
337
338
+ (def-full-indent-test let-when-while-forms
339
+ " (let-alist [x 1]\n ())"
340
+ " (while-alist [x 1]\n ())"
341
+ " (when-alist [x 1]\n ())" )
338
342
339
343
(defun indent-cond (indent-point state )
340
344
(goto-char (elt state 1 ))
You can’t perform that action at this time.
0 commit comments