GNU bug report logs - #61997
30.0.50; c++-ts-mode;cannot indent in an empty function body

Previous Next

Package: emacs;

Reported by: xhcoding <xhcoding <at> foxmail.com>

Date: Mon, 6 Mar 2023 07:52:02 UTC

Severity: normal

Found in version 30.0.50

Done: Stefan Kangas <stefankangas <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 61997 in the body.
You can then email your comments to 61997 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#61997; Package emacs. (Mon, 06 Mar 2023 07:52:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to xhcoding <xhcoding <at> foxmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 06 Mar 2023 07:52:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: xhcoding <xhcoding <at> foxmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 30.0.50; c++-ts-mode;cannot indent in an empty function body
Date: Mon, 06 Mar 2023 11:03:51 +0800
When the cursor is at the position of the following code,
pressing tab cannot indent to the correct position.

int add() {
|  <-- pressing tab can not indent
}

The expected position after pressing the tab:

int add() {
  |
}



In GNU Emacs 30.0.50 (build 6, x86_64-w64-mingw32)
Repository revision: 6fb8a4dff7ef22f96ebe1a775240617aabac6526
Repository branch: master
Windowing system distributor 'Microsoft Corp.', version 10.0.22621
System Description: Microsoft Windows 10 Home China (v10.0.2009.22621.1105)





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#61997; Package emacs. (Mon, 06 Mar 2023 12:58:02 GMT) Full text and rfc822 format available.

Message #8 received at 61997 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: xhcoding <xhcoding <at> foxmail.com>
Cc: 61997 <at> debbugs.gnu.org
Subject: Re: bug#61997: 30.0.50; c++-ts-mode;
 cannot indent in an empty function body
Date: Mon, 06 Mar 2023 14:57:09 +0200
> Date: Mon, 06 Mar 2023 11:03:51 +0800
> From: xhcoding <xhcoding <at> foxmail.com>
> 
> 
> When the cursor is at the position of the following code,
> pressing tab cannot indent to the correct position.
> 
> int add() {
> |  <-- pressing tab can not indent
> }
> 
> The expected position after pressing the tab:
> 
> int add() {
>   |
> }

I think you are supposed to switch the indentation style to bsd, and
then it will work.  The default is gnu.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#61997; Package emacs. (Mon, 06 Mar 2023 13:12:02 GMT) Full text and rfc822 format available.

Message #11 received at 61997 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Eli Zaretskii <eliz <at> gnu.org>, xhcoding <xhcoding <at> foxmail.com>
Cc: 61997 <at> debbugs.gnu.org
Subject: Re: bug#61997: 30.0.50; c++-ts-mode; cannot indent in an empty
 function body
Date: Mon, 6 Mar 2023 15:11:03 +0200
On 06/03/2023 14:57, Eli Zaretskii wrote:
>> Date: Mon, 06 Mar 2023 11:03:51 +0800
>> From: xhcoding<xhcoding <at> foxmail.com>
>>
>>
>> When the cursor is at the position of the following code,
>> pressing tab cannot indent to the correct position.
>>
>> int add() {
>> |  <-- pressing tab can not indent
>> }
>>
>> The expected position after pressing the tab:
>>
>> int add() {
>>    |
>> }
> I think you are supposed to switch the indentation style to bsd, and
> then it will work.  The default is gnu.

Using the gnu style, most of the expressions that the user will type 
will indent with OFFET number of characters, right?

Then it makes sense to indent the open line like that, too.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#61997; Package emacs. (Mon, 06 Mar 2023 15:46:05 GMT) Full text and rfc822 format available.

Message #14 received at 61997 <at> debbugs.gnu.org (full text, mbox):

From: xhcoding <xhcoding <at> foxmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: xhcoding <xhcoding <at> foxmail.com>, 61997 <at> debbugs.gnu.org
Subject: Re: bug#61997: 30.0.50; c++-ts-mode;
 cannot indent in an empty function body
Date: Mon, 06 Mar 2023 21:13:57 +0800
On Tue, 07 Mar 2023 04:57:09 +0800,
Eli Zaretskii wrote:
> 
> > Date: Mon, 06 Mar 2023 11:03:51 +0800
> > From: xhcoding <xhcoding <at> foxmail.com>
> > 
> > 
> > When the cursor is at the position of the following code,
> > pressing tab cannot indent to the correct position.
> > 
> > int add() {
> > |  <-- pressing tab can not indent
> > }
> > 
> > The expected position after pressing the tab:
> > 
> > int add() {
> >   |
> > }
> 
> I think you are supposed to switch the indentation style to bsd, and
> then it will work.  The default is gnu.

Thank you very much, the bsd style is what I want.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#61997; Package emacs. (Wed, 08 Mar 2023 00:46:01 GMT) Full text and rfc822 format available.

Message #17 received at 61997 <at> debbugs.gnu.org (full text, mbox):

From: Yuan Fu <casouri <at> gmail.com>
To: Dmitry Gutov <dgutov <at> yandex.ru>
Cc: xhcoding <at> foxmail.com, Eli Zaretskii <eliz <at> gnu.org>, 61997 <at> debbugs.gnu.org
Subject: Re: bug#61997: 30.0.50; c++-ts-mode;cannot indent in an empty 
 function body
Date: Tue, 7 Mar 2023 16:44:52 -0800
Dmitry Gutov <dgutov <at> yandex.ru> writes:

> On 06/03/2023 14:57, Eli Zaretskii wrote:
>>> Date: Mon, 06 Mar 2023 11:03:51 +0800
>>> From: xhcoding<xhcoding <at> foxmail.com>
>>>
>>>
>>> When the cursor is at the position of the following code,
>>> pressing tab cannot indent to the correct position.
>>>
>>> int add() {
>>> |  <-- pressing tab can not indent
>>> }
>>>
>>> The expected position after pressing the tab:
>>>
>>> int add() {
>>>    |
>>> }
>> I think you are supposed to switch the indentation style to bsd, and
>> then it will work.  The default is gnu.
>
> Using the gnu style, most of the expressions that the user will type
> will indent with OFFET number of characters, right?
>
> Then it makes sense to indent the open line like that, too.

Right. I fixed this regression on emacs-29.

Yuan




Reply sent to Stefan Kangas <stefankangas <at> gmail.com>:
You have taken responsibility. (Tue, 12 Sep 2023 00:53:03 GMT) Full text and rfc822 format available.

Notification sent to xhcoding <xhcoding <at> foxmail.com>:
bug acknowledged by developer. (Tue, 12 Sep 2023 00:53:03 GMT) Full text and rfc822 format available.

Message #22 received at 61997-done <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefankangas <at> gmail.com>
To: Yuan Fu <casouri <at> gmail.com>
Cc: xhcoding <at> foxmail.com, Eli Zaretskii <eliz <at> gnu.org>,
 61997-done <at> debbugs.gnu.org, Dmitry Gutov <dgutov <at> yandex.ru>
Subject: Re: bug#61997: 30.0.50; c++-ts-mode;cannot indent in an empty
 function body
Date: Mon, 11 Sep 2023 17:52:46 -0700
Yuan Fu <casouri <at> gmail.com> writes:

> Right. I fixed this regression on emacs-29.

It seems like this issue was fixed, but it was left open in the bug
tracker.  I'm therefore closing it now.

Please remember to close bug reports when they are fixed.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 10 Oct 2023 11:24:21 GMT) Full text and rfc822 format available.

This bug report was last modified 170 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.