emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Tree-sitter integration in python.el


From: Stefan Monnier
Subject: Re: Tree-sitter integration in python.el
Date: Wed, 12 Oct 2022 13:52:15 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

> One problem I can see is that the same level could give very different
> busyness across modes. That would defeat the purpose of having a single
> setting. Say mode 1 has (A B C D E F G H I), where ABC are very basic, DEF
> moderate, and GHI fancy, mode 2 has (A B C D E F G), A basic, BCDEF
> moderate, G fancy. Then 80 would give a fancy font-lock in mode 1 and
> a moderate font-lock in mode 2. You get the idea.

Yup.  We could be more explicit, then, e.g. use things like ((A B C) (D
E F) (G H I)) for the first and ((A) (B C D E F) (G)) for the second.

> Currently tree-sitter supports both :level and :toggle. When defining
> queries you can say :toggle python-fontify-types, and python-fontify-types
> can control this query. :level would be the global rough settings, :toggle
> would be the local, fine-grained setting. Instead of variables, :toggle
> could be changed to use symbols as you suggested, so it doesn’t create
> a gazillion variables. But WDYT of the general design?

I definitely prefer symbols to variables: this way they can use their
own namespace and don't need the long package prefix and can be
shared/reused between different modes without conflict.

And I would prefer not to include :level in the rules themselves and
instead rely on a separate mapping between features and levels.


        Stefan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]