(lisp--el-match-keyword): Use new font-lock-keyword symbol property

Add new `font-lock-keyword' symbol property, which does the opposite
of the existing `no-font-lock-keyword'; allowing to highlight certain
functions, like macros and special-forms, as opposed to allowing to
not highlight certain macros.

* lisp/emacs-lisp/lisp-mode.el (lisp--el-match-keyword): Use new
`font-lock-keyword'.
This commit is contained in:
Jonas Bernoulli 2026-09-09 10:53:30 +02:00
parent cfc72c30b5
commit 9ced94569d
No known key found for this signature in database
GPG key ID: 230C2EFBB326D927

View file

@ -271,7 +271,9 @@ to a package-local <package>-loaddefs.el file.")
limit t)
;; FIXME: Doesn't properly un-escape \ in the symbol name.
(let ((sym (shorthands-intern-soft (match-string 1))))
(when (and (or (special-form-p sym) (macrop sym))
(when (and (or (special-form-p sym)
(macrop sym)
(get sym 'font-lock-keyword))
(not (get sym 'no-font-lock-keyword))
(lisp--el-funcall-position-p (match-beginning 0)))
(throw 'found t))))))