summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/lisp-mode.el
diff options
context:
space:
mode:
authorSam Steingold <sds@gnu.org>2017-10-31 15:33:40 -0400
committerSam Steingold <sds@gnu.org>2017-10-31 15:33:40 -0400
commitaa091c546f413e8fa6e692dd861dcd1dfb78e7de (patch)
tree4c8ab719d6e26cd3cda3182f24be6d1eeacbdc27 /lisp/emacs-lisp/lisp-mode.el
parentbae7a63b808433073ad04ac64eff13e4b4facc01 (diff)
downloademacs-aa091c546f413e8fa6e692dd861dcd1dfb78e7de.tar.gz
emacs-aa091c546f413e8fa6e692dd861dcd1dfb78e7de.tar.bz2
emacs-aa091c546f413e8fa6e692dd861dcd1dfb78e7de.zip
Highlight CL `with-' (context) and `do-' (iteration)
* lisp/emacs-lisp/lisp-mode.el (lisp-cl-font-lock-keywords-2): Highlight the Common Lisp conventional names as described in http://www.cliki.net/Naming+conventions. (lisp-el-font-lock-keywords-2): Remove the already commented out code for `do-' and `with-' because Emacs Lisp does not have a similar convention.
Diffstat (limited to 'lisp/emacs-lisp/lisp-mode.el')
-rw-r--r--lisp/emacs-lisp/lisp-mode.el11
1 files changed, 4 insertions, 7 deletions
diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el
index 0e1d3709194..aeeea2178b3 100644
--- a/lisp/emacs-lisp/lisp-mode.el
+++ b/lisp/emacs-lisp/lisp-mode.el
@@ -461,11 +461,6 @@ This will generate compile-time constants from BINDINGS."
(throw 'found t)))))))
(1 'font-lock-regexp-grouping-backslash prepend)
(3 'font-lock-regexp-grouping-construct prepend))
- ;; This is too general -- rms.
- ;; A user complained that he has functions whose names start with `do'
- ;; and that they get the wrong color.
- ;; ;; CL `with-' and `do-' constructs
- ;;("(\\(\\(do-\\|with-\\)\\(\\s_\\|\\w\\)*\\)" 1 font-lock-keyword-face)
(lisp--match-hidden-arg
(0 '(face font-lock-warning-face
help-echo "Hidden behind deeper element; move to another line?")))
@@ -505,8 +500,10 @@ This will generate compile-time constants from BINDINGS."
;; This is too general -- rms.
;; A user complained that he has functions whose names start with `do'
;; and that they get the wrong color.
- ;; ;; CL `with-' and `do-' constructs
- ;;("(\\(\\(do-\\|with-\\)\\(\\s_\\|\\w\\)*\\)" 1 font-lock-keyword-face)
+ ;; That user has violated the http://www.cliki.net/Naming+conventions:
+ ;; CL (but not EL!) `with-' (context) and `do-' (iteration)
+ (,(concat "(\\(\\(do-\\|with-\\)" lisp-mode-symbol-regexp "\\)")
+ (1 font-lock-keyword-face))
(lisp--match-hidden-arg
(0 '(face font-lock-warning-face
help-echo "Hidden behind deeper element; move to another line?")))