Skip to content

Commit 28a8286

Browse files
committed
Merge pull request #333 from maio/patch-2
Improve clojure-find-def matching (support hyphens)
2 parents e45a095 + 2a3a0e8 commit 28a8286

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

Diff for: clojure-mode.el

+1-1
Original file line numberDiff line numberDiff line change
@@ -1109,7 +1109,7 @@ Useful if a file has been renamed."
11091109
Returns a list pair, e.g. (\"defn\" \"abc\") or (\"deftest\" \"some-test\")."
11101110
(let ((re (concat "(\\(?:\\(?:\\sw\\|\\s_\\)+/\\)?"
11111111
;; Declaration
1112-
"\\(def\\sw*\\)\\>"
1112+
"\\(def\\(?:\\sw\\|\\s_\\)*\\)\\>"
11131113
;; Any whitespace
11141114
"[ \r\n\t]*"
11151115
;; Possibly type or metadata

Diff for: test/clojure-mode-font-lock-test.el

+6
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,12 @@ POS."
226226
(should (eq (clojure-test-face-at 2 14) 'font-lock-keyword-face))
227227
(should (eq (clojure-test-face-at 16 18) 'font-lock-function-name-face))))
228228

229+
(ert-deftest clojure-mode-syntax-table/custom-def-with-special-chars3 ()
230+
:tags '(fontification syntax-table)
231+
(clojure-test-with-temp-buffer "(def-something foo [x] x)"
232+
(should (eq (clojure-test-face-at 2 14) 'font-lock-keyword-face))
233+
(should (eq (clojure-test-face-at 16 18) 'font-lock-function-name-face))))
234+
229235
(ert-deftest clojure-mode-syntax-table/lambda-params ()
230236
:tags '(fontification syntax-table)
231237
(clojure-test-with-temp-buffer "#(+ % %2 %3)"

0 commit comments

Comments
 (0)