]> git.eshelyaron.com Git - emacs.git/commitdiff
Highlight CL `with-' (context) and `do-' (iteration)
authorSam Steingold <sds@gnu.org>
Tue, 31 Oct 2017 19:33:40 +0000 (15:33 -0400)
committerSam Steingold <sds@gnu.org>
Tue, 31 Oct 2017 19:33:40 +0000 (15:33 -0400)
* 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.

lisp/emacs-lisp/lisp-mode.el

index 0e1d370919414dbbe9badd80a8a1530fb6b58c54..aeeea2178b3116bab3d7cc949a2ce65a55f4286e 100644 (file)
@@ -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?")))