From: Wilhelm Kirschbaum <wkirschbaum@gmail.com>
To: Dmitry Gutov <dmitry@gutov.dev>
Cc: Basil Contovounesios <contovob@tcd.ie>, 64275@debbugs.gnu.org
Subject: bug#64275: 30.0.50; [PATCH] Improve sigil font-lock match for elixir-ts-mode
Date: Sat, 07 Oct 2023 11:59:36 +0200 [thread overview]
Message-ID: <87jzryg370.fsf@gmail.com> (raw)
In-Reply-To: <87edi6reyf.fsf@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 831 bytes --]
>>
>> 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.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Simplify-sigil-font-lock-match-for-elixir-ts-mode(1).patch --]
[-- Type: text/x-patch, Size: 1750 bytes --]
From 12b7227185e22923d1e67e3f5a47af97879e2ad2 Mon Sep 17 00:00:00 2001
From: Wilhelm H Kirschbaum <wkirschbaum@gmail.com>
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 | 16 ++++++----------
1 file changed, 6 insertions(+), 10 deletions(-)
diff --git a/lisp/progmodes/elixir-ts-mode.el b/lisp/progmodes/elixir-ts-mode.el
index 2ddce3de105..de078454463 100644
--- a/lisp/progmodes/elixir-ts-mode.el
+++ b/lisp/progmodes/elixir-ts-mode.el
@@ -466,23 +466,19 @@ elixir-ts--font-lock-settings
:language 'elixir
: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_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
- (:match "^[rR]$" @elixir-ts-font-sigil-name-face))
- @font-lock-regexp-face
+ (:match "^[^HF]$" @elixir-ts-font-sigil-name-face))
+ @elixir-ts-font-sigil-name-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)))
-
+ quoted_end: _ @font-lock-string-face))
:language 'elixir
:feature 'elixir-string-escape
:override t
--
2.42.0
next prev parent reply other threads:[~2023-10-07 9:59 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-24 20:14 bug#64275: 30.0.50; [PATCH] Improve sigil font-lock match for elixir-ts-mode Wilhelm Kirschbaum
2023-06-25 8:53 ` Basil Contovounesios via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-25 9:00 ` Wilhelm Kirschbaum
2023-07-29 18:31 ` Wilhelm Kirschbaum
2023-07-30 2:06 ` Dmitry Gutov
2023-07-30 7:53 ` Wilhelm Kirschbaum
2023-07-30 12:09 ` Dmitry Gutov
2023-07-31 7:22 ` Wilhelm Kirschbaum
2023-08-01 11:59 ` Dmitry Gutov
2023-08-02 6:38 ` Wilhelm Kirschbaum
2023-08-16 2:11 ` Dmitry Gutov
2023-10-07 8:46 ` Wilhelm Kirschbaum
2023-10-07 9:59 ` Wilhelm Kirschbaum [this message]
2023-10-07 10:10 ` Wilhelm Kirschbaum
2023-10-21 7:39 ` Wilhelm Kirschbaum
2023-10-26 0:27 ` 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=87jzryg370.fsf@gmail.com \
--to=wkirschbaum@gmail.com \
--cc=64275@debbugs.gnu.org \
--cc=contovob@tcd.ie \
--cc=dmitry@gutov.dev \
/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).