From 73b8237c19200e7d8d3739b99ef1e4dc86f51873 Mon Sep 17 00:00:00 2001 From: Tassilo Horn Date: Fri, 20 Mar 2015 23:35:22 +0100 Subject: [PATCH] Fix CL function name font-lock bug. * emacs-lisp/lisp-mode.el (lisp-cl-font-lock-keywords-1): Fix false positive in function name font-locking. --- lisp/ChangeLog | 1 + lisp/emacs-lisp/lisp-mode.el | 11 +++++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 85e62be80c2..025941f809c 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -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 diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el index d8901ac017d..a3bb1a709f6 100644 --- a/lisp/emacs-lisp/lisp-mode.el +++ b/lisp/emacs-lisp/lisp-mode.el @@ -341,13 +341,16 @@ `( ;; 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.") -- 2.11.4.GIT