Subject: bug#65006: 29.1.50; c-ts-mode: else block not indented right on TAB

From: Yuan Fu <[email-masked]>
Date: Wed, 2 Aug 2023 09:46:54 -0700

> On Aug 2, 2023, at 4:32 AM, Eli Zaretskii <[email-masked]> wrote:
> 
>> Date: Wed, 02 Aug 2023 08:13:08 +0530
>> From: Mohammed Sadiq <[email-masked]>
>> 
>> The else block in the following code is not indented on TAB:
>> 
>> int
>> main (void)
>> {
>>   if (true)
>>     do_something ();
>>   else
>> do_something_else ();
>> }
>> 
>> How to reproduce:
>> 1. Select the complete buffer
>> 2. Press TAB
>> 
>> Expected result:
>> do_something_else() should be indented
>> 
>> afair, this did seem to work in the past.  May be this
>> happened after I updated treesitter-c module, idk.

Yeah, (sign) I can reproduce this with the latest tree-sitter-c grammar but not the old one. Someone decides to add an else_clause node into the grammar [1] two weeks ago.

> 
> Thank you for your report.
> 
> Yuan, can you look into this, please?

Should the fix go into emacs-29 or master?

We really need some way to mandate a version of grammar. These breaking changes are far more frequent than I originally thought.

Yuan

[1] https://github.com/tree-sitter/tree-sitter-c/pull/115