Skip to content
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
7 changes: 3 additions & 4 deletions clojure-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -878,10 +878,9 @@ any number of matches of `clojure--sym-forbidden-rest-chars'."))
"\\(?:#?^\\(?:{[^}]*}\\|\\sw+\\)[ \r\n\t]*\\)*"
"\\(\\sw+\\)?")
(2 font-lock-type-face nil t))
;; Function definition (anything that starts with def and is not
;; listed above)
(,(concat "(\\(?:" clojure--sym-regexp "/\\)?"
"\\(def[^ \r\n\t]*\\)"
;; Function definition
(,(concat "(\\(?:clojure.core/\\)?"
"\\(defn\\)"
;; Function declarations
"\\>"
;; Any whitespace
Expand Down
22 changes: 11 additions & 11 deletions test/clojure-mode-font-lock-test.el
Original file line number Diff line number Diff line change
Expand Up @@ -776,17 +776,17 @@ DESCRIPTION is the description of the spec."
(6 42 clojure-keyword-face)))

(when-fontifying-it "should handle namespaced defs"
("(_c4/defn bar [] nil)"
(2 4 font-lock-type-face)
(5 5 nil)
(6 9 font-lock-keyword-face)
(11 13 font-lock-function-name-face))

("(clo/defrecord foo nil)"
(2 4 font-lock-type-face)
(5 5 nil)
(6 14 font-lock-keyword-face)
(16 18 font-lock-function-name-face))
("(clojure.core/defn bar [] nil)"
(2 13 font-lock-type-face)
(14 14 nil)
(15 18 font-lock-keyword-face)
(20 22 font-lock-function-name-face))

("(clojure.core/defrecord foo nil)"
(2 13 font-lock-type-face)
(14 14 nil)
(15 23 font-lock-keyword-face)
(25 27 font-lock-type-face))

("(s/def ::keyword)"
(2 2 font-lock-type-face)
Expand Down