Fontify special forms and macros the same

* lisp/emacs-lisp/lisp-mode.el (lisp--el-match-keyword): Handle
special forms and macros the same way (bug#43265).  This makes
things like (setq a '(if a b)) be fontified correctly (i.e., not
fontified as a keyword).
This commit is contained in:
Lars Ingebrigtsen 2021-01-25 07:44:29 +01:00
parent 9503f8d96c
commit a10c74fbea
2 changed files with 3 additions and 5 deletions

View file

@ -257,10 +257,9 @@
(concat "(\\(" lisp-mode-symbol-regexp "\\)\\_>"))
limit t)
(let ((sym (intern-soft (match-string 1))))
(when (or (special-form-p sym)
(and (macrop sym)
(not (get sym 'no-font-lock-keyword))
(lisp--el-funcall-position-p (match-beginning 0))))
(when (and (or (special-form-p sym) (macrop sym))
(not (get sym 'no-font-lock-keyword))
(lisp--el-funcall-position-p (match-beginning 0)))
(throw 'found t))))))
(defmacro let-when-compile (bindings &rest body)

View file

@ -871,7 +871,6 @@ to (xref-elisp-test-descr-to-target xref)."
'font-lock-keyword-face)))
(ert-deftest test-elisp-font-keywords-3 ()
:expected-result :failed ; FIXME bug#43265
(should (eq (test--font '(setq a '(if when zot))
"(\\(if\\)")
nil)))