From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Wilhelm Kirschbaum Newsgroups: gmane.emacs.bugs Subject: bug#64275: 30.0.50; [PATCH] Improve sigil font-lock match for elixir-ts-mode Date: Sat, 07 Oct 2023 10:46:57 +0200 Message-ID: <87edi6reyf.fsf@gmail.com> References: <87zg4od38w.fsf@gmail.com> <87ttuvorbw.fsf@epfl.ch> <87y1k7j4ov.fsf@gmail.com> <68d19873-5c5f-894a-080f-b2e1bacc449a@gutov.dev> <87cz0995eq.fsf@gmail.com> <77c5df43-6a3f-b99b-ed33-2094376e16e7@gutov.dev> <87leew7d7u.fsf@gmail.com> <9c5eb888-f2df-5243-53d4-95d1d1b2e2f4@gutov.dev> <87leeuvtft.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27316"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.9.3; emacs 30.0.50 Cc: Basil Contovounesios , 64275@debbugs.gnu.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Oct 07 10:53:58 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1qp34P-0006ul-KA for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 07 Oct 2023 10:53:57 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qp34D-00030L-99; Sat, 07 Oct 2023 04:53:45 -0400 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 1qp34A-00030A-Sa for bug-gnu-emacs@gnu.org; Sat, 07 Oct 2023 04:53:42 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qp34A-0001WV-K2 for bug-gnu-emacs@gnu.org; Sat, 07 Oct 2023 04:53:42 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qp34T-0006Vl-SN for bug-gnu-emacs@gnu.org; Sat, 07 Oct 2023 04:54:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Wilhelm Kirschbaum Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 07 Oct 2023 08:54:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64275 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 64275-submit@debbugs.gnu.org id=B64275.169666883925021 (code B ref 64275); Sat, 07 Oct 2023 08:54:01 +0000 Original-Received: (at 64275) by debbugs.gnu.org; 7 Oct 2023 08:53:59 +0000 Original-Received: from localhost ([127.0.0.1]:53300 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qp34R-0006VV-26 for submit@debbugs.gnu.org; Sat, 07 Oct 2023 04:53:59 -0400 Original-Received: from mail-lj1-x230.google.com ([2a00:1450:4864:20::230]:55323) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qp34Q-0006VH-0V for 64275@debbugs.gnu.org; Sat, 07 Oct 2023 04:53:58 -0400 Original-Received: by mail-lj1-x230.google.com with SMTP id 38308e7fff4ca-2b9338e4695so36151381fa.2 for <64275@debbugs.gnu.org>; Sat, 07 Oct 2023 01:53:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696668812; x=1697273612; darn=debbugs.gnu.org; h=mime-version:message-id:in-reply-to:date:subject:cc:to:from :user-agent:references:from:to:cc:subject:date:message-id:reply-to; bh=eawcmST76VC+GEiuRHhVS7JUB+/KEiBRhk8SQMh7Ib8=; b=fZMHcDKRdBo0zMLpygIChvcZQr9X+ZSgkd4WdibL0tOz9nqRWNCsWcuV+iURlji5bx WI/PL8bo8Njodw91stVOoy9wJTwmD0SsyMHBUgRS6umR36NQ6dn+AbuvOP9RVxBv+wx9 aGqemnMdBdEIjipLvIPHDfSX2PNy5/qLxufD1Kw5JOvAVo+EpAIbfIOs/i6a5At5JtSL uwideCgD4baQOgwxGbZWhht0FIM1871guVMoR8vymR3zQcfawlPLnCUcXEtAPp/v91/M Av+z21H0LY2QOp30Vz4Mz3RYqkFi8pcYNz7B4TxBb1FLw5JSyn1W4mVNYPtkXZG0ap+F v6iQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696668812; x=1697273612; h=mime-version:message-id:in-reply-to:date:subject:cc:to:from :user-agent:references:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=eawcmST76VC+GEiuRHhVS7JUB+/KEiBRhk8SQMh7Ib8=; b=LCv67dP76H8iqgKkBpaLjNQJUoAqtBfe6WwlcMbmtLeaqSFB4z5Ps2+xo/p6lTvNPo IqZP/c3sI+3TpSQFRDbuhDS9GMNEZWqzdLlBKX4G++FrfiezvNJh4a7FWPS/+Z4Viud1 RyPytYSacuV6UEt0LKiGGa2g0Tlo6fBhkyMnwe3QyG8ecHA9NGO3hdyM/scGEZYjq+c2 lmiQhbATkOmzu+w1Bv9CJQ2HrXzPEpAAn1j8A0LcnnNFEpuxNvToS1MxP5fa8mpxKud6 22rp6f6tAthwq6EjiAkzVwbkN05XBEXcQvtTxwFRc9cZyLLGY64AFiWhYfsZ01ssextC QHfg== X-Gm-Message-State: AOJu0YyQ8+Slr6irTLZEaznckil3Hj4tIScuhx8PmEiK8X8DoW52EDsK HCZ49vDrUv46XuFZa8bd9zntXR3wxvWVSbYG X-Google-Smtp-Source: AGHT+IFBC8tcwPUxXGw/awu4cyzJ89mv9IyodEI+PZxeaNqWe4oeG4zNk6QYEbCyb/NKpDciBPDaPg== X-Received: by 2002:ac2:446b:0:b0:4fe:3724:fdae with SMTP id y11-20020ac2446b000000b004fe3724fdaemr8212427lfl.66.1696668812036; Sat, 07 Oct 2023 01:53:32 -0700 (PDT) Original-Received: from melissa.local ([2c0f:ef18:1431:0:b09:9616:db04:c248]) by smtp.gmail.com with ESMTPSA id w14-20020a05600c474e00b003fd2d3462fcsm2142809wmo.1.2023.10.07.01.53.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Oct 2023 01:53:31 -0700 (PDT) In-reply-to: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:271984 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Dmitry Gutov writes: > On 02/08/2023 09:38, Wilhelm Kirschbaum wrote: >> Dmitry Gutov writes: >>=20 >>> On 31/07/2023 10:22, Wilhelm Kirschbaum wrote: >>>> I think it is worth keeping the default/fallback case as=20 >>>> simple as >>>> possible and if there is a need to add special font to more=20 >>>> specific >>>> cases. >>> >>> But the font is called elixir-ts-font-sigil-name-face. It=20 >>> should apply >>> to all sigils, shouldn't it? >>> >>> At least if we just go by the name. >> Sure, but need to tweak it a bit when I have time.=C2=A0 Maybe there=20 >> is a >> way >> to match in the query without applying a font, then it will=20 >> look a bit >> more sensible. > > I'm not sure what you meant by the last sentence, sorry. What do=20 > you > think about the below? > > (sigil (sigil_name) @elixir-ts-font-sigil-name-face) > @font-lock-string-face) Sorry for the late reply. I believe the following patch is more appropriate as it will apply the sigil font to the entire sigil,=20 but also respect the regex face. We can add string specific matches=20 later, but happy just to simplify what we have and fix apply appropriate=20 font to previously unmatched sigils. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Simplify-sigil-font-lock-match-for-elixir-ts-mode.patch >From 9f6e5f143c2d247541172851ac9f09dcc6add010 Mon Sep 17 00:00:00 2001 From: Wilhelm H Kirschbaum Date: Sat, 7 Oct 2023 10:37:49 +0200 Subject: [PATCH] Simplify sigil font-lock match for elixir-ts-mode There is no need to match on specific sigils, except for regex. * lisp/progmodes/elixir-ts-mode.el (elixir-ts--font-lock-settings): Update sigil match. --- lisp/progmodes/elixir-ts-mode.el | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/lisp/progmodes/elixir-ts-mode.el b/lisp/progmodes/elixir-ts-mode.el index 2ddce3de105..8a678b110e2 100644 --- a/lisp/progmodes/elixir-ts-mode.el +++ b/lisp/progmodes/elixir-ts-mode.el @@ -468,21 +468,10 @@ elixir-ts--font-lock-settings :feature 'elixir-sigil :override t `((sigil - (sigil_name) @elixir-ts-font-sigil-name-face - (:match "^[sSwWpPUD]$" @elixir-ts-font-sigil-name-face)) - @font-lock-string-face - (sigil - "~" @font-lock-string-face - (sigil_name) @elixir-ts-font-sigil-name-face - (:match "^[rR]$" @elixir-ts-font-sigil-name-face)) + (sigil_name) @font-lock-regexp-face + (:match "^[rR]$" @font-lock-regexp-face)) @font-lock-regexp-face - (sigil - "~" @font-lock-string-face - (sigil_name) @elixir-ts-font-sigil-name-face - quoted_start: _ @font-lock-string-face - quoted_end: _ @font-lock-string-face - (:match "^[HF]$" @elixir-ts-font-sigil-name-face))) - + (sigil) @elixir-ts-font-sigil-name-face) :language 'elixir :feature 'elixir-string-escape :override t -- 2.42.0 --=-=-=--