emacs-devel
[Top][All Lists]
Advanced

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

Re: Define treesit-font-lock-level as buffer local


From: Yuan Fu
Subject: Re: Define treesit-font-lock-level as buffer local
Date: Sat, 9 Nov 2024 00:36:31 -0800


> On Nov 7, 2024, at 3:08 AM, Vincenzo Pupillo <v.pupillo@gmail.com> wrote:
> 
> In data giovedì 7 novembre 2024 12:03:49 Ora standard dell’Europa centrale, 
> Eli Zaretskii ha scritto:
>>> From: Vincenzo Pupillo <v.pupillo@gmail.com>
>>> Date: Thu, 07 Nov 2024 11:30:03 +0100
>>> 
>>> Ciao,
>>> I use tree-sitter for different languages, for some of them I prefer font 
>>> lock level 3, for others I prefer level 4. 
>>> treesit-font-lock-level, however, is not defined as buffer local and so 
>>> there is no elegant way to have 
>>> different levels for different languages. 
>>> Would it be possible to define treesit-font-lock-level as a buffer local?
>> 
>> Is it a problem for you to do that in your init file?
> 
> No, it's not a problem.
> 
>> Also, we could support a value of that variable which is a list, like
>> we do with font-lock-maximum-decoration.  This will be more useful
>> than making the variable buffer-local, since presumably your
>> preferences are per-mode, not per-buffer.  
> Yes, this would be a better solution.
> 
>> Yuan, WDYT?
>> 

Perhaps even per-language, for multi-language modes. I think it’s a valid use 
case. IMO, specify the level by language is better than mode. For single 
language modes, using the language is equivalent to using the mode; for 
multi-language modes, using the language allows more flexibility. 

Yuan


reply via email to

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