[Top][All Lists]

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

Re: Tree sitter support for C-like languages

From: Theodor Thornhill
Subject: Re: Tree sitter support for C-like languages
Date: Fri, 11 Nov 2022 06:50:38 +0100

On 11 November 2022 01:43:27 CET, Randy Taylor <dev@rjt.dev> wrote:
>On Thursday, November 10th, 2022 at 12:45, Theodor Thornhill via "Emacs 
>development discussions." <emacs-devel@gnu.org> wrote:
>> Hi all,
>> See the attached patch for support for several C-like languages.
>> They all support:
>> - Font locking
>> - Indentation (with styles for c/c++)
>> - Movement
>> - Imenu
>> - Which-func
>> These modes are meant as a supplement to tree-sitter.
>> I'm hopeful for some constructive criticism, and some testing. This
>> patch needs to be applied to the feature/tree-sitter branch, and should
>> hopefully be applied there before we merge the branch to master, well
>> before Emacs 29 is cut.
>> I hope you like it,
>> Theo
>Thanks Theo! I was actually just about to email you about this stuff.
>I will test drive the C and C++ stuff.
>A few comments:
>- (This one is for everyone) For lists of things (like keywords, etc.) and the 
>font-lock rules, can we consider alphabetizing them (for the font-lock rules 
>it would be by feature)? It would make them a lot easier to scan for what's 
>there/not there and give them some order (and we could then be consistent 
>everywhere). I am happy to send a patch for this.
>- I recently added some new font-lock faces for tree-sitter that you may wish 
>to make use of: 
>  - I am happy to send a patch adding support for them.
>- For my C++ configuration, my treesit font lock rules has 2 queries: one for 
>C and one for C++. The C one has all the usual C stuff, and the C++ one has 
>ONLY C++-related things. Could we do something similar here? That would really 
>reduce the duplication in the C++ file.

Yeah, I'm interested in reducing duplication, but not for that reason only. But 
I'm thinking of ways to make one inherit the other.

How about we first get this merged, then new faces on top of that?

reply via email to

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