From: Lars Ingebrigtsen Date: Mon, 25 Jan 2021 06:44:29 +0000 (+0100) Subject: Fontify special forms and macros the same X-Git-Tag: emacs-28.0.90~4120 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=a10c74fbea46d5299e19167248383c69fd30648c;p=emacs.git 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). --- diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el index 22435d59659..c96d849d442 100644 --- a/lisp/emacs-lisp/lisp-mode.el +++ b/lisp/emacs-lisp/lisp-mode.el @@ -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) diff --git a/test/lisp/progmodes/elisp-mode-tests.el b/test/lisp/progmodes/elisp-mode-tests.el index e84184ff07d..badcad670c2 100644 --- a/test/lisp/progmodes/elisp-mode-tests.el +++ b/test/lisp/progmodes/elisp-mode-tests.el @@ -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)))