lang/emacs-lisp: polish symbol fontification

Follow up on 76b4af99; resolves "flickering christmas lights" issue
where symbols were incorrectly fontified with the last face while typing
them.
This commit is contained in:
Henrik Lissner 2018-08-10 23:30:36 +02:00
parent e348e32cbc
commit 631f075a82
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -63,7 +63,8 @@ library/userland functions"
(catch 'matcher
(while (re-search-forward "\\_<.+?\\_>" end t)
(let ((symbol (intern-soft (match-string-no-properties 0))))
(and (cond ((null symbol))
(and (cond ((null symbol) nil)
((eq symbol t) nil)
((special-variable-p symbol)
(setq +emacs-lisp--face 'font-lock-variable-name-face))
((and (fboundp symbol)
@ -71,14 +72,14 @@ library/userland functions"
(let ((unaliased (indirect-function symbol t)))
(unless (or (macrop unaliased)
(special-form-p unaliased))
(let ((orig (let (unadvised)
(let (unadvised)
(while (not (eq (setq unadvised (ad-get-orig-definition unaliased))
(setq unaliased (indirect-function unadvised t)))))
unaliased)))
unaliased)
(setq +emacs-lisp--face
(if (subrp orig)
(if (subrp unaliased)
'font-lock-constant-face
'font-lock-function-name-face)))))))
'font-lock-function-name-face))))))
(throw 'matcher t))))
nil))
(eval-when-compile