Subject: bug#43265: 28.0.50; Inconsistent fontifying in elisp-mode

From: Lars Ingebrigtsen <[email-masked]>
Date: Sat, 23 Jan 2021 19:42:52 +0100

Stefan Monnier <[email-masked]> writes:

>> All special forms get it (`if' is a special form), but macros (like
>> `when') only gets it if we're in a funcall position:
>
> Not sure why that is.  Seems like an accident.

The special form bit, or the macro bit?  :-)

Since special forms are always font-locked as keywords when appearing as
the first element in a list, you get stuff like:

So if would perhaps make sense to also do the `funcall-position-p' for
special forms?

> Sounds like a bug.  Note that in
>
>     (condition-case nil
>         (foo)
>       (error (when a (when b c))))
>
> the second `when` gets the keyword face, as it should.

Because then `condition-case' isn't the parent, presumably.

> BTW I suspect that part of the reason for this bug is because of the
> need to avoid using the keyword face on the `when` of:
>
>     (condition-case nil
>         (foo)
>       ((when error) ...))
>
> Adding corresponding tests for these things would be great.

Indeed.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no