]> code.delx.au - gnu-emacs/commitdiff
Fix CL function name font-lock bug.
authorTassilo Horn <tsdh@gnu.org>
Fri, 20 Mar 2015 22:35:22 +0000 (23:35 +0100)
committerTassilo Horn <tsdh@gnu.org>
Fri, 20 Mar 2015 22:35:22 +0000 (23:35 +0100)
* emacs-lisp/lisp-mode.el (lisp-cl-font-lock-keywords-1): Fix
false positive in function name font-locking.

lisp/ChangeLog
lisp/emacs-lisp/lisp-mode.el

index 85e62be80c25e59c445e0a9f7dbd2629c76721cc..025941f809ccfb033e845a6b0e077b9c9ebe6d42 100644 (file)
@@ -2,6 +2,7 @@
 
        * emacs-lisp/lisp-mode.el (lisp-el-font-lock-keywords-1): Fix
        false positive in function name font-locking.
+       (lisp-cl-font-lock-keywords-1): Ditto.
 
 2015-03-20  Stefan Monnier  <monnier@iro.umontreal.ca>
 
index d8901ac017dd29ec310e7eef91031b7b81fbf233..a3bb1a709f68eca2ce01166d847a4f96163c7245 100644 (file)
     `( ;; Definitions.
       (,(concat "(" cl-defs-re "\\_>"
                 ;; Any whitespace and defined object.
-                "[ \t'\(]*"
-                "\\(setf[ \t]+\\(?:\\sw\\|\\s_\\)+\\|\\(?:\\sw\\|\\s_\\)+\\)?")
+                "[ \t']*"
+               "\\(([ \t']*\\)?" ;; An opening paren.
+                "\\(\\(setf\\)[ \t]+\\(?:\\sw\\|\\s_\\)+\\|\\(?:\\sw\\|\\s_\\)+\\)?")
        (1 font-lock-keyword-face)
-       (2 (let ((type (get (intern-soft (match-string 1)) 'lisp-define-type)))
+       (3 (let ((type (get (intern-soft (match-string 1)) 'lisp-define-type)))
             (cond ((eq type 'var) font-lock-variable-name-face)
                   ((eq type 'type) font-lock-type-face)
-                  (t font-lock-function-name-face)))
+                  ((or (not (match-string 2))  ;; Normal defun.
+                      (and (match-string 2)   ;; Setf-expander.
+                           (match-string 4))) font-lock-function-name-face)))
           nil t)))
     "Subdued level highlighting for Lisp modes.")