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, 21 Oct 2023 09:39:38 +0200 Message-ID: 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> <87edi6reyf.fsf@gmail.com> <87jzryg370.fsf@gmail.com> <871qe6wxle.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="00000000000004cf1806083518f6" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16332"; mail-complaints-to="usenet@ciao.gmane.io" 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 21 09:40:45 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 1qu6bE-00049A-F2 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 21 Oct 2023 09:40:44 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qu6b6-0007Fc-PW; Sat, 21 Oct 2023 03:40:36 -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 1qu6b5-0007EC-50 for bug-gnu-emacs@gnu.org; Sat, 21 Oct 2023 03:40:35 -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 1qu6b4-0005zj-Sb for bug-gnu-emacs@gnu.org; Sat, 21 Oct 2023 03:40:34 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qu6bW-0006tG-1v for bug-gnu-emacs@gnu.org; Sat, 21 Oct 2023 03:41:02 -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, 21 Oct 2023 07:41:02 +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.169787402526427 (code B ref 64275); Sat, 21 Oct 2023 07:41:02 +0000 Original-Received: (at 64275) by debbugs.gnu.org; 21 Oct 2023 07:40:25 +0000 Original-Received: from localhost ([127.0.0.1]:42123 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qu6av-0006sB-02 for submit@debbugs.gnu.org; Sat, 21 Oct 2023 03:40:25 -0400 Original-Received: from mail-qk1-x72a.google.com ([2607:f8b0:4864:20::72a]:59753) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qu6as-0006rv-UQ for 64275@debbugs.gnu.org; Sat, 21 Oct 2023 03:40:23 -0400 Original-Received: by mail-qk1-x72a.google.com with SMTP id af79cd13be357-778a6c440faso87988185a.3 for <64275@debbugs.gnu.org>; Sat, 21 Oct 2023 00:39:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697873989; x=1698478789; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=ysYqvY1pT8rKU/SmOYjtjFBK/7hU6hZeTnV+KVf/I5o=; b=DTUaowwqD2GgI7qf4kfJ+e78jrW4IlHdQrfCPYgTr1Bh5DRpb9qYGs80+7uf6kuuTO +50Wfh6NL+5ixHRCtB/aYT7c5HbFXI/ZKvHMteFGP/LLjx8lSdf7DtqfGdcuYR/LqAaL af4s2rea3SaOsp/aEZQiICGMhwHQAi0zq+kJ4isbKJ7BNJfbaqQHeGOSviEHb7l0OgJ1 3IPVXaNH075dLwOP+0qmpso0SysO5bXf2h9crP3vJHMNkHA17vvogXAadYyZM5itTPRg W/61VQG2doHTk0/7OvimY0VcL7gyHnw7AxP6u+JKLSMGIM/aDN5YLwF6PigDE6j5W285 TTvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697873989; x=1698478789; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ysYqvY1pT8rKU/SmOYjtjFBK/7hU6hZeTnV+KVf/I5o=; b=lF9YIS6d6Zc8tVgUxUEJS4fTFtY3ImFIQg/GUFXzF5PUG1+8b4rVlUTN2MJ/m3KL9O IRn+aCM6MDxehDEt3V0jiqtSazZIdv/DavMJKN7CIEdwbB28F9RU6uHEC/MAmnCTO4v4 FtZycV1c9OqH5MOQpMY6UnCnGRA566TDWlvs8KZY345qLkKFH94uONmLKyl6bc++NQf1 YdLmiw/JZ6GRG6jQNhFqQQeiEbQiatWKQWE4bLri8QhZkdKlX/ZZtVXE8afQqruQEPJ/ pDm01s3SsarN3CJq1/tGFNA1TZWGtMijUogKp4ndVgwJnkA7pJwxkD72Avrpn0TkbDZ4 TMxg== X-Gm-Message-State: AOJu0YxUxF4hArLpHFa5Mf/dmbGv72xXzAfS58I1OCfjyLESP2JwT1fY hwm2yF5CTAm5eYeCqJaoFqcanl2e31OaqXdtrKM= X-Google-Smtp-Source: AGHT+IF90YAmTnMUtfBa/l6FOG6r+H1PQohlE6jNaOWMTeelNOqDzY4WM2LogX5mVfpk8Js20HWClwzug12mYe9OYy0= X-Received: by 2002:a0c:dd89:0:b0:66d:a22a:464f with SMTP id v9-20020a0cdd89000000b0066da22a464fmr680640qvk.16.1697873989507; Sat, 21 Oct 2023 00:39:49 -0700 (PDT) In-Reply-To: <871qe6wxle.fsf@gmail.com> 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:272837 Archived-At: --00000000000004cf1806083518f6 Content-Type: multipart/alternative; boundary="00000000000004cf1406083518f4" --00000000000004cf1406083518f4 Content-Type: text/plain; charset="UTF-8" > >>> > >>> I'm not sure what you meant by the last sentence, sorry. What > >>> do > >>> 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, but > >> also respect the regex face. We can add string specific > >> matches > >> later, > >> but happy just to simplify what we have and fix apply > >> appropriate > >> font > >> to previously unmatched sigils. > >> > >> [2. text/x-patch; > >> 0001-Simplify-sigil-font-lock-match-for-elixir-ts-mode.patch]... > > > > Actually, the above patch breaks the embedded HEEx sigils' > > font. We > > have to exclude it when doing a general match. Attached works > > with ~H > > sigils as well. Please ignore the previous patch and install > > this > > one. > > > > [2. text/x-patch; > > 0001-Simplify-sigil-font-lock-match-for-elixir-ts-mode(1).patch]... > > > Sorry :(. I am finding more edge cases. Maybe let me test it this > properly this week before we make any changes. > I tested this patch for a while now and it looks like the best approach for handling regex sigils, but with an appropriate fallback. If this can be installed, it will be appreciated. --00000000000004cf1406083518f4 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
=C2=A0
>>>
>>> I'm not sure what you meant by the last sentence, sorry. W= hat
>>> do
>>> you
>>> think about the below?
>>>
>>>=C2=A0 =C2=A0(sigil (sigil_name) @elixir-ts-font-sigil-name-fac= e)
>>>=C2=A0 =C2=A0@font-lock-string-face)
>>
>> Sorry for the late reply.=C2=A0 I believe the following patch is <= br> >> more
>> appropriate as it will apply the sigil font to the entire
>> sigil, but
>> also respect the regex face.=C2=A0 We can add string specific
>> matches
>> later,
>> but happy just to simplify what we have and fix apply
>> appropriate
>> font
>> to previously unmatched sigils.
>>
>> [2. text/x-patch;
>> 0001-Simplify-sigil-font-lock-match-for-elixir-ts-mode.patch]... >
> Actually, the above patch breaks the embedded HEEx sigils'
> font. We
> have to exclude it when doing a general match.=C2=A0 Attached works > with ~H
> sigils as well.=C2=A0 Please ignore the previous patch and install > this
> one.
>
> [2. text/x-patch;
> 0001-Simplify-sigil-font-lock-match-for-elixir-ts-mode(1).patch]...

Sorry :(. I am finding more edge cases.=C2=A0 Maybe let me test it this
properly this week before we make any changes.

I tested this patch for a while now and it looks like the best appr= oach
for handling regex sigils, but with an appropriate fallback.
If this can be installed, it will be appreciated.
=C2=A0
--00000000000004cf1406083518f4-- --00000000000004cf1806083518f6 Content-Type: text/x-patch; charset="US-ASCII"; name="0001-Simplify-sigil-font-lock-match-for-elixir-ts-mode.patch" Content-Disposition: attachment; filename="0001-Simplify-sigil-font-lock-match-for-elixir-ts-mode.patch" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_lnzqasxb0 RnJv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