GNU bug report logs -
#20096
25.0.50; Add Font-Lock support for subr-x macros
Previous Next
Reported by: Tassilo Horn <tsdh <at> gnu.org>
Date: Thu, 12 Mar 2015 08:43:02 UTC
Severity: wishlist
Tags: fixed
Found in version 25.0.50
Fixed in version 25.1
Done: Noam Postavsky <npostavs <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
Message #14 received at 20096 <at> debbugs.gnu.org (full text, mbox):
>> Instead, The Right Thing to do, might be to change elisp-mode's
>> font-lock rules so they check obarray for macros (i.e. use mapatoms +
>> regexp-opt to generate a regexp matching all macros, and probably
>> update it from after-load-functions)?
> I don't understant what you mean with generating a macro matching all
> macros,
That's because I said "generate a regexp matching all macros", as you
can clearly see in the excerpt you quoted (see above).
> but the attached patch uses a regexp defconst with a matcher
> function for font-lock-keywords.
Looks good.
> +(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.
Other than that, the patch looks good.
Have you tried it? Does it work well in practice?
Stefan
This bug report was last modified 6 years and 38 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.