GNU bug report logs -
#43265
28.0.50; Inconsistent fontifying in elisp-mode
Previous Next
Reported by: Mauro Aranda <maurooaranda <at> gmail.com>
Date: Mon, 7 Sep 2020 20:06:02 UTC
Severity: minor
Tags: confirmed
Found in version 28.0.50
Fixed in version 28.1
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
Message #57 received at 43265 <at> debbugs.gnu.org (full text, mbox):
> >> (setq a '(if a b)) is currently fontified incorrectly, while
> >> (setq a '(when a b)) is fontified correctly.
> >
> > Really? Are you sure one is correct and the other not,
> > and that you have it the right way round?
> >
> > (setq a '(setq b d))
> > (setq a '(if a b))
> > (setq a '(when a b))
> > (setq a '(and a b))
> >
> > Nowadays, all of those `setq's, the `if', and the `and'
> > are highlighted; poor-boy `when' isn't. :-(
>
> All but `when' are special forms, so Lars is right that the distinction
> is between special forms vs. macros.
That may be the distinction now, but the behavior has
changed over time.
The real question about that distinction should be
whether it's helpful/useful for users? Typically
for Lisp whether a special form is implemented at
a lower-than-Lisp level or as a macro or in some
other way is only an implementation detail.
What's most helpful, for a user, in terms of
font-lock? I'm guessing that the aim behind this
distinguishing special forms from macros by
highlighting is really aimed at distinguishing
user-defined macros from predefined macros.
To me, as one user, highlighting predefined
macros the same as special forms makes sense.
But so does highlighting all macros differently
from functions and special forms. To me, it's
not so helpful to not highlight macros at all.
> > But is it really "correct" to fontify _any_ of the names
> > in those quoted sexps as if they were being used with
> > their active meanings - as code? In that context they're
> > just data - list elements.
>
> Yeah, the special forms should probably not be highlighted here.
That was my main point, yes. To do that correctly
in the general case is maybe hard (when is something
"used" as a function/macro/special-form?). But a
first approximation should be pretty easy and helpful.
Users can be helped by not highlighting such things
when quoted (e.g. in quoted lists). Highlighting
them in such contexts is misleading. That's the main
highlighting change I'd like to see made.
This bug report was last modified 4 years and 172 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.