Skip to content

Improve clojure-find-def matching (support hyphens) #333

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 26, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion clojure-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -1103,7 +1103,7 @@ Useful if a file has been renamed."
Returns a list pair, e.g. (\"defn\" \"abc\") or (\"deftest\" \"some-test\")."
(let ((re (concat "(\\(?:\\(?:\\sw\\|\\s_\\)+/\\)?"
;; Declaration
"\\(def\\sw*\\)\\>"
"\\(def\\(?:\\sw\\|\\s_\\)*\\)\\>"
;; Any whitespace
"[ \r\n\t]*"
;; Possibly type or metadata
Expand Down
6 changes: 6 additions & 0 deletions test/clojure-mode-font-lock-test.el
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,12 @@ POS."
(should (eq (clojure-test-face-at 2 14) 'font-lock-keyword-face))
(should (eq (clojure-test-face-at 16 18) 'font-lock-function-name-face))))

(ert-deftest clojure-mode-syntax-table/custom-def-with-special-chars3 ()
:tags '(fontification syntax-table)
(clojure-test-with-temp-buffer "(def-something foo [x] x)"
(should (eq (clojure-test-face-at 2 14) 'font-lock-keyword-face))
(should (eq (clojure-test-face-at 16 18) 'font-lock-function-name-face))))

(ert-deftest clojure-mode-syntax-table/lambda-params ()
:tags '(fontification syntax-table)
(clojure-test-with-temp-buffer "#(+ % %2 %3)"
Expand Down