Subject: bug#71205: 29.3; Automatic indentation of c-ts-mode doesn't work well for me.

From: Stefan Kangas <[email-masked]>
Date: Fri, 28 Feb 2025 18:18:45 -0800

Yuan Fu <[email-masked]> writes:

>> On May 26, 2024, at 1:12 AM, Eli Zaretskii <[email-masked]> wrote:
>>
>>> Date: Sun, 26 May 2024 13:32:37 +0900
>>> From: 川本 琢二
>>> (Dr.Sc.KAWAMOTO, Takuji) <[email-masked]>
>>>
>>> 1. Start emacs.
>>> 2. Open the C source code file and write the following content.
>>>
>>> ----------- c source code file begins -------------
>>> void test(void)
>>> {
>>>   do🔳
>>> ----------- c source code file ends ---------------
>>>
>>> 3. Place the cursor after `do` and press Return.
>>>
>>> Expected behaviour is automatic indentation. I want to move the cursor
>>> to the 5th column of the next line.
>>> However, the observed behavior is NOT indentation. The cursor moves to
>>> the 1st column of the next line.
>>
>> I think this is because the above source code fails to parse.  If you
>> add a closing brace after the "do" line, and then repeat your recipe,
>> the cursor goes to column 3.
>>
>> Yuan, can you please look into this?
>
> Thanks for your detailed report, Kawamoto san. Yes, this is due to the source
> code not being complete (missing closing brackets). For the moment, I suggest
> turning on electric-pair-mode which automatically adds closing brackets.
>
> Yuan

Should we therefore close this bug report, or is there more to do here?

Thanks in advance.