GNU bug report logs - #20096
25.0.50; Add Font-Lock support for subr-x macros

Previous Next

Package: emacs;

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 #17 received at 20096 <at> debbugs.gnu.org (full text, mbox):

From: Tassilo Horn <tsdh <at> gnu.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 20096 <at> debbugs.gnu.org
Subject: Re: bug#20096: 25.0.50; Add Font-Lock support for subr-x macros
Date: Sun, 15 Mar 2015 09:25:38 +0100
Stefan Monnier <monnier <at> 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




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.