bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#60983: 29.0.60; Tree-sitter user-level control


From: Yuan Fu
Subject: bug#60983: 29.0.60; Tree-sitter user-level control
Date: Sun, 5 Feb 2023 01:42:57 -0800


> On Feb 5, 2023, at 1:23 AM, Eli Zaretskii <eliz@gnu.org> wrote:
> 
>> From: Yuan Fu <casouri@gmail.com>
>> Date: Sat, 4 Feb 2023 23:54:56 -0800
>> Cc: Bug Report Emacs <bug-gnu-emacs@gnu.org>,
>> theo@thornhill.no
>> 
>>> Yes, that's how I understood what you were saying: changing the list
>>> of features enabled/disabled by specific levels.  This is not a
>>> user-level thing, so describing it in the ELisp manual is good enough,
>>> I think.  (If it turns out users want to do this kind of thing too
>>> often, it probably means our design of the user-facing features is
>>> sub-optimal and should be improved.)
>> 
>> I see, my description and the documentation is still not clear enough, I’m 
>> afraid. treesit-font-lock-recompute-feature does not add/remove features 
>> that belongs to a level. The design is that, the user uses decoration level 
>> to set the rough level, which enables a set of features, then use 
>> treesit-font-lock-recompute-feature to do more fine-grained control by 
>> additionally enabling/disabling features. 
>> 
>> For example in c-ts-mode, if I set the decoration level to 2, I’d have these 
>> features: comment, definition, keyword, preprocessor, string, type. If I 
>> also want the assignment features, which is in level 3, but don’t want other 
>> features in level 3, I would use treesit-font-lock-recompute-feature to 
>> enable that feature. Similarly, I can use 
>> treesit-font-lock-recompute-feature to disable the preprocessor which is at 
>> level 2, without affecting other features status.
> 
> That's exactly what I understood, and that was what I responded to.  I
> don't think it's a user-level feature to tweak the list of features
> that are enabled/disables by a certain decoration level.  It is on the
> level of Lisp programming, and therefore should be described in the
> ELisp manual.

Oh! All is well, then :-)

Yuan




reply via email to

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