all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Ihor Radchenko <yantar92@gmail.com>
To: Yuan Fu <casouri@gmail.com>
Cc: emacs-devel <emacs-devel@gnu.org>,
	 Theodor Thornhill <theo@thornhill.no>
Subject: Re: Recent updates to tree-sitter branch
Date: Sun, 02 Oct 2022 15:33:44 +0800	[thread overview]
Message-ID: <87zgeeznl3.fsf@localhost> (raw)
In-Reply-To: <59AE5D4B-39D2-4C18-BAC6-9C71B736F0D0@gmail.com>

Yuan Fu <casouri@gmail.com> writes:

>> I disagree. The current default in font-lock-keywords is not to
>> override. If programmatic font-lock behaves differently, it will be
>> confusing.
>
> I think the tree-sitter queries are different enough from font-lock keywords that it will not bring confusion. Further more, default to override should make things easier, especially to delicate things like string interpolation, or other nested constructs, where tree-sitter shines. By default, if the to-be-fontified region has any existing face, the whole fontification is given up instead of filling in new fontification. That would be IMO confusing because user would think the match failed.

I do agree that it may be confusing. Yet, it is how the default
fontification works. I do not think that tree-sitter matching is
conceptually different compared to regexp matching. (And this particular
area is not even limited to tree-sitter, AFAIU).

I do not insist on my idea being actually used, but wanted to leave a
data point to be considered.

> Also bear in mind that the override flag can only be applied to the whole query, rather than individual captured nodes.

How does it change anything? I may be misunderstanding something---can
you provide some illustrative example clarifying whole query vs.
individual notes?

-- 
Ihor Radchenko,
Org mode contributor,
Learn more about Org mode at https://orgmode.org/.
Support Org development at https://liberapay.com/org-mode,
or support my work at https://liberapay.com/yantar92



  reply	other threads:[~2022-10-02  7:33 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-25  4:27 Recent updates to tree-sitter branch Yuan Fu
2022-09-25  6:17 ` Ihor Radchenko
2022-09-26  8:35   ` Yuan Fu
2022-09-26  9:43     ` Ihor Radchenko
2022-09-27 22:28       ` Yuan Fu
2022-09-29  4:01         ` Ihor Radchenko
2022-09-30 21:03           ` Yuan Fu
2022-10-01  4:20             ` Ihor Radchenko
2022-10-02  3:46               ` Yuan Fu
2022-10-02  7:33                 ` Ihor Radchenko [this message]
2022-10-02 22:54                   ` Yuan Fu
2022-10-03  5:58                     ` Ihor Radchenko
2022-10-04 16:58                       ` Yuan Fu
2022-09-29 10:13 ` Aurélien Aptel

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=87zgeeznl3.fsf@localhost \
    --to=yantar92@gmail.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.