unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Yuan Fu <casouri@gmail.com>
To: Randy Taylor <dev@rjt.dev>
Cc: emacs-devel <emacs-devel@gnu.org>
Subject: Re: Standardizing tree-sitter fontification features
Date: Fri, 25 Nov 2022 12:55:48 -0800	[thread overview]
Message-ID: <46533EA2-1CC5-40E8-8726-94A0BAD0C919@gmail.com> (raw)
In-Reply-To: <nPjAC-6sCldMltf7l_MbQQjCtP7afkTj18GaX9mhiNvSdti7-OV65y2BUohdIAjILITi4vPZ5g0cp4ym5nN6vVBWCOXisKqcXZ48tqhPHn4=@rjt.dev>



> On Nov 25, 2022, at 11:03 AM, Randy Taylor <dev@rjt.dev> wrote:
> 
> On Friday, November 25th, 2022 at 01:15, Yuan Fu <casouri@gmail.com> wrote:
> 
>> 
>>> On Nov 24, 2022, at 5:13 PM, Randy Taylor dev@rjt.dev wrote:
>>> 
>> 
>>> I wonder if assignment and definition are really worth having (and would prefer to do without them), since they should be covered by the variable, function, type and property features.
>> 
>> 
>> They are definitely useful. They are the things we currently highlight, and for a reason. Personally I only want to highlight identifiers in definition and assignment, not every occurrence of them. Since so much of a program consists of variable and function identifiers, highlighting all of them looks almost like highlighting everything. I just want some visual cues on the program structure, not programming in skittles :-)
> 
> Fair enough. In that case, are we going to end up with duplication in the variable and function features? So long as I can program in skittles, I am happy :).

I don’t think duplication would be a problem. You can disable them, or just left it on: the face would be the same, the difference is only one _which_ ones to highlight.

> 
>> 
>>> I would also add:
>>> - misc-punctuation, for anything not considered a delimiter or bracket. Most modes would use this for any special punctuation they've got.
>> 
>> 
>> Is there any examples? Maybe just merge delimiter and punctuation together?
>> 
> 
> Yes, see sh-script.el. $ is used for misc-punctuation. neovim and the Emacs dynamic module tree-sitter implementation have more examples (they call it special punctuation).
> 
> I think we should keep them all separate.

Ok, then delimiter and misc-punctuation it is.

> 
>>> - (maybe) literal instead of number? That way there is a group for chars too (and any other literals if there are any?). Or a char feature in addition to the existing number one. I'm undecided...
>> 
>> 
>> Literal seems to encompass numbers, strings, chars, and constants. So I don’t know how does it fit. We could add char to string feature.
>> 
> 
> Sounds good. I think I've seen char also end up in constant in some of our tree-sitter modes. Doesn't matter to me where it goes.

Hmm, what does neovim and emacs-tree-sitter do? (If you happen to know)


>>> Maybe a slight tangent but I also suggest we alphabetize all of these; both the queries and the list of features. I'll send a patch to do that myself once things cool down a bit. Although anything that overrides will need to go at the bottom to make sure it gets applied.
>> 
>> 
>> Good idea :-) A tangent of your tangent: how did you alphabetize them? Did you use the sort-word package on EmacsWiki?
>> 
>> Yuan
> 
> Manually ;) (except for the keyword and such lists, those I use the built-in sort-lines on). I really like saying the alphabet over and over.

Well that’s a very convenient hobby :-)

Yuan




  reply	other threads:[~2022-11-25 20:55 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-24 22:16 Standardizing tree-sitter fontification features Yuan Fu
2022-11-25  1:13 ` Randy Taylor
2022-11-25  6:15   ` Yuan Fu
2022-11-25 19:03     ` Randy Taylor
2022-11-25 20:55       ` Yuan Fu [this message]
2022-11-26  3:35         ` Randy Taylor
2022-12-05 21:17           ` Yuan Fu
2022-11-25  8:13   ` Eli Zaretskii
2022-11-25 19:14     ` Randy Taylor
2022-11-26 14:07     ` Stephen Leake
2022-11-25  2:56 ` Stefan Monnier
2022-11-25  6:34   ` Yuan Fu
2022-11-25 14:52     ` Stefan Monnier
2022-11-26 14:03 ` Stephen Leake
2022-11-26 14:29   ` [SPAM UNSURE] " Stephen Leake
2022-11-26 22:05     ` [SPAM UNSURE] " Yuan Fu
     [not found] ` <2AEA8AB6-593E-4D89-AB05-0C8EB2BCE327@gmail.com>
2022-12-03  1:12   ` Yuan Fu
2022-12-03 14:34     ` Mattias Engdegård
2022-12-05  8:58       ` Theodor Thornhill
2022-12-05 10:26         ` Mattias Engdegård
2022-12-05 11:30           ` Theodor Thornhill
2022-12-05 21:02             ` Yuan Fu

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=46533EA2-1CC5-40E8-8726-94A0BAD0C919@gmail.com \
    --to=casouri@gmail.com \
    --cc=dev@rjt.dev \
    --cc=emacs-devel@gnu.org \
    /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).