lang/emacs-lisp: optimize symbol fontification
By ignoring symbols in comments and strings.
This commit is contained in:
parent
97bc69b9e5
commit
1cb31d7cb5
1 changed files with 22 additions and 19 deletions
|
@ -64,6 +64,9 @@ Functions are differentiated into special forms, built-in functions and
|
||||||
library/userland functions"
|
library/userland functions"
|
||||||
(catch 'matcher
|
(catch 'matcher
|
||||||
(while (re-search-forward "\\_<.+?\\_>" end t)
|
(while (re-search-forward "\\_<.+?\\_>" end t)
|
||||||
|
(unless (save-excursion
|
||||||
|
(let ((ppss (syntax-ppss)))
|
||||||
|
(or (nth 3 ppss) (nth 4 ppss))))
|
||||||
(let ((symbol (intern-soft (match-string-no-properties 0))))
|
(let ((symbol (intern-soft (match-string-no-properties 0))))
|
||||||
(and (cond ((null symbol) nil)
|
(and (cond ((null symbol) nil)
|
||||||
((eq symbol t) nil)
|
((eq symbol t) nil)
|
||||||
|
@ -82,7 +85,7 @@ library/userland functions"
|
||||||
(if (subrp unaliased)
|
(if (subrp unaliased)
|
||||||
'font-lock-constant-face
|
'font-lock-constant-face
|
||||||
'font-lock-function-name-face))))))
|
'font-lock-function-name-face))))))
|
||||||
(throw 'matcher t))))
|
(throw 'matcher t)))))
|
||||||
nil))
|
nil))
|
||||||
(eval-when-compile
|
(eval-when-compile
|
||||||
(byte-compile #'+emacs-lisp-highlight-vars-and-faces))
|
(byte-compile #'+emacs-lisp-highlight-vars-and-faces))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue