diff options
| author | Tassilo Horn | 2015-03-20 23:09:06 +0100 |
|---|---|---|
| committer | Tassilo Horn | 2015-03-20 23:09:06 +0100 |
| commit | c9998fcbf40c533004533dee96f2eb67349d55ae (patch) | |
| tree | edf31ccc5fa2df9431bc2bba9e113a72704ed3a9 | |
| parent | 4cd31cf01964059ab29f735c7856c65631c46c28 (diff) | |
| download | emacs-c9998fcbf40c533004533dee96f2eb67349d55ae.tar.gz emacs-c9998fcbf40c533004533dee96f2eb67349d55ae.zip | |
Fix elisp function name font-lock bug.
* emacs-lisp/lisp-mode.el (lisp-el-font-lock-keywords-1): Fix
false positive in function name font-locking.
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/emacs-lisp/lisp-mode.el | 18 |
2 files changed, 16 insertions, 7 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index ee4e021b940..85e62be80c2 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2015-03-20 Tassilo Horn <tsdh@gnu.org> | ||
| 2 | |||
| 3 | * emacs-lisp/lisp-mode.el (lisp-el-font-lock-keywords-1): Fix | ||
| 4 | false positive in function name font-locking. | ||
| 5 | |||
| 1 | 2015-03-20 Stefan Monnier <monnier@iro.umontreal.ca> | 6 | 2015-03-20 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 7 | ||
| 3 | * emacs-lisp/cl-macs.el (cl-defsubst): Ignore false-positive | 8 | * emacs-lisp/cl-macs.el (cl-defsubst): Ignore false-positive |
diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el index 6b3077302ed..d8901ac017d 100644 --- a/lisp/emacs-lisp/lisp-mode.el +++ b/lisp/emacs-lisp/lisp-mode.el | |||
| @@ -320,14 +320,18 @@ | |||
| 320 | `( ;; Definitions. | 320 | `( ;; Definitions. |
| 321 | (,(concat "(" el-defs-re "\\_>" | 321 | (,(concat "(" el-defs-re "\\_>" |
| 322 | ;; Any whitespace and defined object. | 322 | ;; Any whitespace and defined object. |
| 323 | "[ \t'\(]*" | 323 | "[ \t']*" |
| 324 | "\\(\\(?:\\sw\\|\\s_\\)+\\)?") | 324 | ;; With cl-defstruct, the name may follow a paren, |
| 325 | ;; e.g. (cl-defstruct (foo-struct opts)...). | ||
| 326 | "\\(([ \t']*\\)?\\(\\(?:\\sw\\|\\s_\\)+\\)?") | ||
| 325 | (1 font-lock-keyword-face) | 327 | (1 font-lock-keyword-face) |
| 326 | (2 (let ((type (get (intern-soft (match-string 1)) 'lisp-define-type))) | 328 | (3 (let ((type (get (intern-soft (match-string 1)) 'lisp-define-type))) |
| 327 | (cond ((eq type 'var) font-lock-variable-name-face) | 329 | (cond ((eq type 'var) font-lock-variable-name-face) |
| 328 | ((eq type 'type) font-lock-type-face) | 330 | ((eq type 'type) font-lock-type-face) |
| 329 | (t font-lock-function-name-face))) | 331 | ;; If match-string 2 is non-nil, we encountered a |
| 330 | nil t)) | 332 | ;; form like (defalias (intern (concat s "-p"))). |
| 333 | ((not (match-string 2)) font-lock-function-name-face))) | ||
| 334 | nil t)) | ||
| 331 | ;; Emacs Lisp autoload cookies. Supports the slightly different | 335 | ;; Emacs Lisp autoload cookies. Supports the slightly different |
| 332 | ;; forms used by mh-e, calendar, etc. | 336 | ;; forms used by mh-e, calendar, etc. |
| 333 | ("^;;;###\\([-a-z]*autoload\\)" 1 font-lock-warning-face prepend)) | 337 | ("^;;;###\\([-a-z]*autoload\\)" 1 font-lock-warning-face prepend)) |