[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:
>http://git.savannah.gnu.org/cgit/emacs.git/commit/?h=feature/tree-sitter&id=e06953b02a0e7b26b33c511a22896d0db4e5d63d
> - 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?
- Re: Tree sitter support for C-like languages, (continued)
- Re: Tree sitter support for C-like languages, Yuan Fu, 2022/11/15
- Re: Tree sitter support for C-like languages, Stefan Monnier, 2022/11/14
- Re: Tree sitter support for C-like languages, Dmitry Gutov, 2022/11/14
- Re: Tree sitter support for C-like languages, Yuan Fu, 2022/11/14
- Re: Tree sitter support for C-like languages, Dmitry Gutov, 2022/11/14
- Re: Tree sitter support for C-like languages, Yuan Fu, 2022/11/15
- Re: Tree sitter support for C-like languages, Dmitry Gutov, 2022/11/15
- Re: Tree sitter support for C-like languages, Eli Zaretskii, 2022/11/14
- Re: Tree sitter support for C-like languages, Yuan Fu, 2022/11/14
Re: Tree sitter support for C-like languages, Randy Taylor, 2022/11/10
Re: Tree sitter support for C-like languages, Yuan Fu, 2022/11/16