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: Tue, 11 Oct 2022 22:08:52 -0700

> 
> Now, concerning font-lock-ignore: why do you say you think something
> like it is not needed in tree-sitter?  Do you see no need for a
> fine-grained customization option for font lock, or do you have a better
> implementation of fine-grained customization in mind?
> 
> I'd say a fine-grained customization option is very much needed.
> Requiring the user to advice `treesit-font-lock-rules' is to high of a
> bar.  `font-lock-ignore' may not be incredibly easy to use (the user
> still has to look at the font-lock rule definitions), but it's flexible,
> has a simple implementation, and imposes no extra work on the major-mode
> developer.
> 
> You can probably just stick a call to font-lock--filter-keywords
> somewhere in treesit.el and call it a day.

Currently we have :toggle variable, which let variable control whether to 
enable a query. Major modes could sever font-lock into categories, each 
controlled by a variable. Eg, python-font-lock-type, 
python-font-lock-assignment, etc. I think that should be more than enough as 
long as developers bother to create these toggles.

Yuan


reply via email to

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