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: Yuan Fu
Subject: Re: Tree-sitter integration in python.el
Date: Fri, 7 Oct 2022 15:10:10 -0700


> On Oct 7, 2022, at 3:03 AM, Augusto Stoffel <arstoffel@gmail.com> wrote:
> 
> On Fri,  7 Oct 2022 at 01:25, Yuan Fu wrote:
> 
>> Yeah, with tree-sitter, fortifying types is trivial. In fact all types
>> should be fortified already. (I tested with some simple examples.)
>> Should we provide some variables to toggle fontification for different
>> things? Like python-fontify-type/f-string/assignment/built-in/etc.
> 
> Looking at the screenshots posted a few messages back, which are VERY
> busy, I would really appreciate an option to disable a few fontification
> rules or, conversely, disable all but a few of them.  Ideally, this
> should be done through a generic mechanism that works across major
> modes.
> 
> Have you seen the new `font-lock-ignore' option?  Tree-sitter could
> provide something similar (and much better/less hacky).

The complaint for font-lock-maximum-decoration is that it’s obscure and too 
corse-grained. So my idea is for each major mode to provide fined-grained 
controls like python-fontify-type/f-string/assignment/built-in/etc. And 
tree-sitter makes it easy to implement this kind of toggle. But I guess a 
global control is also nice, I can make tree-sitter respect 
font-lock-maximum-decoration, in addition to the fined grained local-control.

Since we are designing a new system, I don’t think we need to resort to the 
likes of font-lock-ignore.

Yuan


reply via email to

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