From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Tassilo Horn <tsdh@gnu.org>
Cc: 20096@debbugs.gnu.org
Subject: bug#20096: 25.0.50; Add Font-Lock support for subr-x macros
Date: Sat, 14 Mar 2015 09:56:33 -0400 [thread overview]
Message-ID: <jwvy4mzofdi.fsf-monnier+emacsbugs@gnu.org> (raw)
In-Reply-To: <87sid8vvbm.fsf@gnu.org> (Tassilo Horn's message of "Sat, 14 Mar 2015 09:26:21 +0100")
>> 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
next prev parent reply other threads:[~2015-03-14 13:56 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-12 8:42 bug#20096: 25.0.50; Add Font-Lock support for subr-x macros Tassilo Horn
2015-03-12 14:52 ` Stefan Monnier
2015-03-14 8:26 ` Tassilo Horn
2015-03-14 13:56 ` Stefan Monnier [this message]
2015-03-15 8:25 ` Tassilo Horn
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=jwvy4mzofdi.fsf-monnier+emacsbugs@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=20096@debbugs.gnu.org \
--cc=tsdh@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.