bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#20096: 25.0.50; Add Font-Lock support for subr-x macros


From: Tassilo Horn
Subject: bug#20096: 25.0.50; Add Font-Lock support for subr-x macros
Date: Sun, 15 Mar 2015 09:25:38 +0100
User-agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/25.0.50 (gnu/linux)

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> but the attached patch uses a regexp defconst with a matcher
>> function for font-lock-keywords.
>
> Looks good.

Committed as 51e7e463e93708a0e40688f91200e9e9869ec662 on master.

>> +(defun lisp--el-update-after-load (_file)
>> +  "Update `lisp--el-macro-regexp' and adjust font-lock in existing buffers."
>> +  (lisp--el-update-macro-regexp)
>> +  (dolist (buf (buffer-list))
>> +    (when (derived-mode-p 'emacs-lisp-mode)
>> +      (font-lock-flush))))
>
> I think we should only flush if the set of macros has changed.

Ok, I'm doing that now.

> Other than that, the patch looks good.
> Have you tried it?

Yes, but not long enough.  Some non-important special forms such as `if'
and `progn' weren't highlighted anymore.  So now I consider both macros
and special forms.

> Does it work well in practice?

IMO, yes.  The difference is that there are some macros which haven't
been highlighted previously, e.g., `push'.

Bye,
Tassilo





reply via email to

[Prev in Thread] Current Thread [Next in Thread]