GNU bug report logs - #60983
29.0.60; Tree-sitter user-level control

Previous Next

Package: emacs;

Reported by: Eli Zaretskii <eliz <at> gnu.org>

Date: Sat, 21 Jan 2023 11:12:01 UTC

Severity: normal

Found in version 29.0.60

Full log


Message #20 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Yuan Fu <casouri <at> gmail.com>
To: Theodor Thornhill <theo <at> thornhill.no>
Cc: Eli Zaretskii <eliz <at> gnu.org>, Bug Report Emacs <bug-gnu-emacs <at> gnu.org>
Subject: Re: 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



This bug report was last modified 2 years and 193 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.