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: Mon, 23 Jan 2023 11:37:24 -0800

Sorry for the delay, overall I agree with your changes.

> 
> . How does one use treesit-font-lock-level?
> 
>   - It is not a customizable user option (unlike
>     font-lock-maximum-decoration), so it cannot be set via
>     customize-variable.  Is there a reason not to make it a
>     defcustom?
>   - It automatically becomes buffer-local when set, and OTOH setting
>     it in a buffer does not produce fontifications according to the
>     level, and neither does setting it in a mode hook.  So the only
>     way to change its value is by using setq-default, which I don't
>     think is the intent?
>   - Should we make the variable a defcustom?

Yeah it should be a defcustom. 

>   - Should it be possible to customize it separately for each mode?
>   - Should we allow to change the level and then call some function
>     to re-fontify the current buffer according to the new level?

You can set this variable and call treesit-font-lock-recompute-features with no 
argument, which enables/disables features according to the current level.

> Ok, I'll make a bugreport for this.
> 
>>> However, going over it I see there are lots of regressions after the new
>>> bracket-counting code added recently, effectively making the indent
>>> styles pretty broken right now...

Sorry about that :-(
> 
> 
>>>> . What commands are affected by treesit-defun-tactic?
>>> 
>>> 'treesit--navigate-thing' uses it, so 'beginning-of-defun',
>>> 'forward-sentence' etc uses it through 'treesit-beginning-of-thing'.
>> 
>> What commands except those that call treesit--navigate-thing call
>> beginning-of-defun and treesit-beginning-of-thing?
> 
> I'll defer to Yuan for this :)

treesit-beginning/end-of-defun are called by beginning/end-of-defun, so other 
functions like mark-defund are also affected by treesit-defun-tactic. 
Treesit-beginning-of-thing is on master, not on emacs-29.


Yuan




reply via email to

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