From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Yuan Fu Newsgroups: gmane.emacs.devel Subject: Re: font-lock-delimiter-face - what for? Date: Thu, 29 Dec 2022 20:59:08 -0800 Message-ID: References: <361ac1e9-c1b3-824a-834b-39832a4fe2b7@yandex.ru> <8de4913a-f508-9acc-76ba-a2590e16f33f@yandex.ru> <010a042a-cfd5-517b-cd2a-cb797c3390e5@yandex.ru> <328c8aa9-4a5d-218e-92d0-94ca27a709ca@yandex.ru> <52efe7a5-af9d-5db6-2584-456173d46ec5@yandex.ru> <-KaE9PLXI4_nlKIMnP1AL_TwhjpJy5q8KnmZMlePPemiOPsOsoItOkl9HXHY2xIccGR6rJCiG2bDwbUW3h3D7BFYZ7Wm7fJ0Eo1VqOYfxnY=@rjt.dev> Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19884"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Dmitry Gutov , Stefan Monnier , emacs-devel To: Randy Taylor Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Dec 30 05:59:44 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pB7Ud-00051P-Sj for ged-emacs-devel@m.gmane-mx.org; Fri, 30 Dec 2022 05:59:43 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pB7UA-0002Cq-PI; Thu, 29 Dec 2022 23:59:14 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pB7U9-0002Ca-Dy for emacs-devel@gnu.org; Thu, 29 Dec 2022 23:59:13 -0500 Original-Received: from mail-pj1-x102f.google.com ([2607:f8b0:4864:20::102f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pB7U7-000548-M5 for emacs-devel@gnu.org; Thu, 29 Dec 2022 23:59:13 -0500 Original-Received: by mail-pj1-x102f.google.com with SMTP id m7-20020a17090a730700b00225ebb9cd01so12953980pjk.3 for ; Thu, 29 Dec 2022 20:59:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=v2sygADNmEjIHNq+7P+Q1Z0lG8/2SvHva/fgoPsTtKw=; b=AN4WFupn4gZ3hEfpCZbuEBtegv/Om5IV6LedKa/kOPRK7k3jm0YOGpkSJSz1A3U660 2DsanHfAJtEkC0UxoVPcTUzeF3PYsY66u5Jm5SaEMKWK9MaPfyhYP2KZ/oJ++EZjRtFU zoOoApk3fil4Z+IWRRow4YfKltCKNNtDV8bEjlAwGlGQVtOpq8UOQkAYp865HOURIzbv BbloXadnarJ4N+3Ge+gbNMoerNLZ9BwMTXzBBM0IuWgskPnJ5y3GSi79UjnDZ7Hr91Jt iZs9Zaen26PTH9ZyuBxHTBvlHCN4y7eeCJldV7p/PxtHqIkqh0ZVGEnPu1UmtJPNfZYk BA4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=v2sygADNmEjIHNq+7P+Q1Z0lG8/2SvHva/fgoPsTtKw=; b=gxohd/Jqv+PgfWREshgeawUDo1n9cQuY43dJb1eS07bdIOtBhOvAbV4oeyp5L4DyEj k4IizpfQ/A146VInenY24Ly6P0Zcsmyg8ffqlGaAsRY6MBA96E6bPcdaoiezOuJ98pWs 8uZPAmoKIO67U8OOEIvfDPXWDE9DFSLYMcqlQDci9tPVzLCWtQemhJF3X1Rmq6micT3a KMfCMn3e7lgWQ6V2SZ4zyiz/S5j8FiJ9uIoXz0RFY4u3GvqZtIdHra5iW992ssiN3WQY lpTVRxA2BKJyyPi5oAUEx0K+PqBb4FfqOco+bFzCf8ZDsSzxVeybMVCZPribJJFo7U/o 9kyA== X-Gm-Message-State: AFqh2kq5hPknNis990oQ92Odq4h+H07QA6nJUvZp6zllUnfT9P9o/Eu9 xq8yf+8s5D1W+m1nRcfKn1w= X-Google-Smtp-Source: AMrXdXtKQTGb6qwctrX1aVN2zW8xcsxMd3Tp3DNBZBbdlhiLkC084oOrcrU9R2kwI9UB7R3owgGKJA== X-Received: by 2002:a17:90b:4a82:b0:213:8ad:8df1 with SMTP id lp2-20020a17090b4a8200b0021308ad8df1mr33336567pjb.6.1672376350185; Thu, 29 Dec 2022 20:59:10 -0800 (PST) Original-Received: from smtpclient.apple (cpe-172-117-161-177.socal.res.rr.com. [172.117.161.177]) by smtp.gmail.com with ESMTPSA id d7-20020a17090ab30700b0021904307a53sm12268178pjr.19.2022.12.29.20.59.09 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 29 Dec 2022 20:59:09 -0800 (PST) In-Reply-To: X-Mailer: Apple Mail (2.3696.120.41.1.1) Received-SPF: pass client-ip=2607:f8b0:4864:20::102f; envelope-from=casouri@gmail.com; helo=mail-pj1-x102f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:302079 Archived-At: > On Dec 29, 2022, at 10:41 AM, Randy Taylor wrote: >=20 > On Thursday, December 29th, 2022 at 10:57, Dmitry Gutov = wrote: >>=20 >> On 29/12/2022 05:46, Randy Taylor wrote: >>=20 >>>>> 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. >>>>=20 >>>> That's usually how inheriting works, yes. >>>>=20 >>>> Do we anticipate misc-punctuation to often have unique attributes? = If >>>> so, it might be at least some reason to keep that face. >>>=20 >>> 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). >>=20 >>=20 >> They can use font-lock-punctuation-face in its place. >>=20 >>>>> 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). >>>>=20 >>>> 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. >>>=20 >>> 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. >>=20 >>=20 >> Yes. >>=20 >>> What if the user just wants misc. punctuation to be different? >>=20 >>=20 >> Do they actually want that? >>=20 >> Suppose they do, though. If a user theme (user settings) or a named >> theme changes some attribute in font-lock-punctuation-face which it >> doesn't want to have in its descendants, they can go ahead and = customize >> the same attribute in descendants (all 2 of them) to have a different >> value. Yes, that takes a little more effort. >>=20 >> Do we anticipate this to be the common case? If we have some evidence >> toward that, then sure, having a separate face makes sense. And >> font-lock-punctuation-face's docstring should mention that it's not = to >> be used directly. >=20 > I don't know about common but there's certainly a use case. I would = say even more so for misc-punctuation than the others because special = symbols can fall into that category. >=20 > To me it doesn't make sense to have font-lock-punctuation-face be = inherited by bracket and delimiter and also be used for misc. = punctuation purposes. Misc. punctuation is a distinctly separate = category IMO (especially since it has a corresponding tree-sitter = feature for syntax highlighting). I added font-lock-punctuation-face = primarily to control all of the different kinds of punctuation (same as = what the previous Emacs tree-sitter dynamic module did). I tend to think of the inheritance in font-lock faces as a convenient = placeholder more than actual inheritance. Ie, if a theme/user doesn=E2=80=99= t bother to set separate values for every font-lock face, some faces = simply use other face=E2=80=99s value. This is especially true for new = font-lock faces, since themes and users don=E2=80=99t need to update = their config. Yuan=