unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Randy Taylor <dev@rjt.dev>
To: Dmitry Gutov <dgutov@yandex.ru>
Cc: Stefan Monnier <monnier@iro.umontreal.ca>,
	emacs-devel <emacs-devel@gnu.org>
Subject: Re: font-lock-delimiter-face - what for?
Date: Thu, 29 Dec 2022 03:46:43 +0000	[thread overview]
Message-ID: <-KaE9PLXI4_nlKIMnP1AL_TwhjpJy5q8KnmZMlePPemiOPsOsoItOkl9HXHY2xIccGR6rJCiG2bDwbUW3h3D7BFYZ7Wm7fJ0Eo1VqOYfxnY=@rjt.dev> (raw)
In-Reply-To: <52efe7a5-af9d-5db6-2584-456173d46ec5@yandex.ru>

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	other threads:[~2022-12-29  3:46 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-27 15:44 font-lock-delimiter-face - what for? Dmitry Gutov
2022-12-27 16:44 ` Randy Taylor
2022-12-27 16:54   ` Dmitry Gutov
2022-12-27 18:20     ` Randy Taylor
2022-12-27 19:45       ` Dmitry Gutov
2022-12-27 21:01         ` Stefan Monnier
2022-12-27 21:34           ` Dmitry Gutov
2022-12-28 15:13             ` Dmitry Gutov
2022-12-28 17:06               ` Randy Taylor
2022-12-28 18:32                 ` Dmitry Gutov
2022-12-29  3:46                   ` Randy Taylor [this message]
2022-12-29 15:57                     ` Dmitry Gutov
2022-12-29 18:41                       ` Randy Taylor
2022-12-30  4:59                         ` Yuan Fu
2022-12-27 17:00 ` Eli Zaretskii
2022-12-27 19:46   ` Dmitry Gutov

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='-KaE9PLXI4_nlKIMnP1AL_TwhjpJy5q8KnmZMlePPemiOPsOsoItOkl9HXHY2xIccGR6rJCiG2bDwbUW3h3D7BFYZ7Wm7fJ0Eo1VqOYfxnY=@rjt.dev' \
    --to=dev@rjt.dev \
    --cc=dgutov@yandex.ru \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).