emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: font-lock-delimiter-face - what for?


From: Randy Taylor
Subject: Re: font-lock-delimiter-face - what for?
Date: Thu, 29 Dec 2022 03:46:43 +0000

On Wednesday, December 28th, 2022 at 13:32, Dmitry Gutov <dgutov@yandex.ru> 
wrote:
> 
> On 28/12/2022 19:06, Randy Taylor wrote:
> 
> > On Wednesday, December 28th, 2022 at 10:13, Dmitry Gutov dgutov@yandex.ru 
> > wrote:
> > 
> > > Maybe it would be better to remove font-lock-misc-punctuation-face, 
> > > though?
> > > 
> > > People can still use font-lock-punctuation-face for everything
> > > punctuation-like that doesn't match the category of "brackets" or
> > > "delimiters".
> > > 
> > > Just like font-lock-doc-face inherits from font-lock-string-face, or
> > > font-lock-comment-delimiter-face inherits from font-lock-comment-face.
> > > 
> > > We don't seem to have a practice of "parent faces" which are otherwise
> > > unused. font-lock-punctuation-face's docstring doesn't suggest this kind
> > > of purpose either.
> > 
> > Then we should get rid of font-lock-punctuation-face instead. If we keep it 
> > and use it in place of misc-punctuation, then changing punctuation-face 
> > would also change the bracket and delimiter faces, since they inherit from 
> > it.
> 
> 
> That's usually how inheriting works, yes.
> 
> Do we anticipate misc-punctuation to often have unique attributes? If
> so, it might be at least some reason to keep that face.

It depends on the language. A few modes already make use of it: bash-ts-mode, 
cmake-ts-mode, and yaml-ts-mode. We should also probably use it for string 
interpolation characters (e.g. { and }, or whatever the language uses).

> 
> > font-lock-punctuation-face wouldn't be a great name either since it's no 
> > longer referring to all punctuation (which is its current goal, and the 
> > docstring can always be updated).
> 
> 
> Why wouldn't it be referring to all punctuation? All attributes that are
> not overridden by bracket- and delimiter- faces will show up in them.

That was assuming the bracket and delimiter faces would no longer be inheriting 
font-lock-punctuation-face. If they still are, and font-lock-punctuation-face 
is taking the place of font-lock-misc-punctuation-face, then changing that face 
also affects the bracket and delimiter faces too. What if the user just wants 
misc. punctuation to be different? They should all be separated IMO.

If we want to get rid of font-lock-punctuation-face because we don't really do 
that parent face stuff and/or there doesn't seem to be a use for it, then I'm 
not against that. But I think font-lock-misc-punctuation-face should certainly 
stay (and can be renamed if people don't like the name and have a better idea 
for it).



reply via email to

[Prev in Thread] Current Thread [Next in Thread]