From: Trey Peacock <gpg@treypeacock.com>
To: Yuan Fu <casouri@gmail.com>, Theodor Thornhill <theo@thornhill.no>
Cc: emacs-devel@gnu.org
Subject: Re: Disable tree-sitter font-locking for smaller ranges
Date: Tue, 18 Oct 2022 01:23:09 +0000 [thread overview]
Message-ID: <87k04ykjrc.fsf@treypeacock.com> (raw)
In-Reply-To: <1001F2D8-5976-4E39-BC7B-9EF2A2714B61@gmail.com>
"Yuan Fu" <casouri@gmail.com> writes:
> Actually, thinking more of it, it working relies on the exact order of which these rules are applied:
> 1. Outer template_string
> 2. Outer template_substitution
> 3. Inner template_string
> 4. Inner template_substitution
>
If it's useful, I believe the reason why the queries you were using
didn't work was because you were using the alternation which only allows
for selecting a single option. This should work, regardless of the
order:
(template_substitution
"${" @font-lock-constant-face
"}" @font-lock-constant-face) @default
(escape_sequence) @font-lock-constant-face
(template_string) @font-lock-string-face
However, I am unsure how to address potentially nested template
substitutions. Perhaps a function could assist in that.
Trey
prev parent reply other threads:[~2022-10-18 1:23 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-16 10:32 Disable tree-sitter font-locking for smaller ranges Theodor Thornhill
2022-10-17 5:04 ` Yuan Fu
2022-10-17 5:49 ` Theodor Thornhill
2022-10-17 6:01 ` Yuan Fu
2022-10-17 6:33 ` Theodor Thornhill
2022-10-17 9:00 ` Yuan Fu
2022-10-17 9:41 ` Theodor Thornhill
2022-10-17 11:02 ` Theodor Thornhill via Emacs development discussions.
2022-10-18 0:20 ` Yuan Fu
2022-10-18 5:04 ` Theodor Thornhill
2022-10-18 20:07 ` Theodor Thornhill
2022-10-18 20:44 ` Yuan Fu
2022-10-18 5:06 ` Yuan Fu
2022-10-18 1:23 ` Trey Peacock [this message]
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87k04ykjrc.fsf@treypeacock.com \
--to=gpg@treypeacock.com \
--cc=casouri@gmail.com \
--cc=emacs-devel@gnu.org \
--cc=theo@thornhill.no \
/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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.