Hi Emacs/clojure-mode users,
Below is a small patch to enable docstring highlighting. Currently docstrings
default to 'font-lock-string-face' rather than using 'font-lock-doc-face'.
Also, if there's a way of contributing patches to clojure-mode that's preferred
to posting here, please let me know. Thanks!
- Jeff
diff --git a/clojure-mode.el b/clojure-mode.el
index aab4389..61b2ff7 100644
--- a/clojure-mode.el
+++ b/clojure-mode.el
@@ -147,6 +147,8 @@ if that value is non-nil."
"\\(\\(^\\|[^\\\\\n]\\)\\(\\\\\\\\\\)*\\)\\(;+\\|#|\\) *")
(set (make-local-variable 'lisp-indent-function)
'clojure-indent-function)
+ (set (make-local-variable 'lisp-doc-string-elt-property)
+ 'clojure-doc-string-elt)
(set (make-local-variable 'font-lock-multiline) t)
(setq lisp-imenu-generic-expression
@@ -338,6 +340,12 @@ elements of a def* forms."
("\\<io\\!\\>" 0 font-lock-warning-face)))
"Default expressions to highlight in Clojure mode.")
+;; Docstring positions
+(put 'defn 'clojure-doc-string-elt 2)
+(put 'defn- 'clojure-doc-string-elt 2)
+(put 'defmulti 'clojure-doc-string-elt 2)
+(put 'defmacro 'clojure-doc-string-elt 2)
+
(defun clojure-indent-function (indent-point state)
"This function is the normal value of the variable `lisp-indent-function'.
It is used when indenting a line within a function call, to see if the
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---