GNU bug report logs - #71225
30.0.50; [PATCH] c-ts-common-comment-indent-new-line does not behave like c/c++-mode in comments

Previous Next

Package: emacs;

Reported by: Vincenzo Pupillo <v.pupillo <at> gmail.com>

Date: Mon, 27 May 2024 14:10:01 UTC

Severity: normal

Tags: patch

Found in version 30.0.50

Fixed in version 30.1

Done: Eli Zaretskii <eliz <at> gnu.org>

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 71225 in the body.
You can then email your comments to 71225 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#71225; Package emacs. (Mon, 27 May 2024 14:10:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Vincenzo Pupillo <v.pupillo <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 27 May 2024 14:10:01 GMT) Full text and rfc822 format available.

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

From: Vincenzo Pupillo <v.pupillo <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 30.0.50;
 [PATCH] c-ts-common-comment-indent-new-line  does not behave like c/c++-mode
 in comments
Date: Mon, 27 May 2024 16:09:18 +0200
[Message part 1 (text/plain, inline)]
Hi, 
the c-ts-common-comment-indent-new-line does not behave like c/c++-mode in comments. 
M-j also behaves differently in different places.

// M-j wrong behavior.
int test(int a)
{
  /** (1)
  */
  int a;

  /* (1)
  */
  int b;
  // test (1)

  int c; // blah blah
         // (3)
}

/* (2)
 */

/** (2)
*/

// (2)

If you place the cursor at the positions indicated by (1) and (2), press M-j the result is different and is different from what happens with c/c++-mode. 

As a bonus, the attached patch also allows single-line comments placed at the end of a line to be indented as in c-mode (as in "(3)")

Thank you.
V.

[0001-tree-sitter-comment-indent-new-line-behave-more-like.patch (text/x-patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#71225; Package emacs. (Tue, 28 May 2024 18:16:01 GMT) Full text and rfc822 format available.

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

From: Andrea Corallo <acorallo <at> gnu.org>
To: Vincenzo Pupillo <v.pupillo <at> gmail.com>
Cc: 71225 <at> debbugs.gnu.org, Theodor Thornhill <theo <at> thornhill.no>
Subject: Re: bug#71225: 30.0.50; [PATCH] c-ts-common-comment-indent-new-line
 does not behave like c/c++-mode in comments
Date: Tue, 28 May 2024 14:15:20 -0400
Vincenzo Pupillo <v.pupillo <at> gmail.com> writes:

> Hi, 
> the c-ts-common-comment-indent-new-line does not behave like c/c++-mode in comments. 
> M-j also behaves differently in different places.
>
> // M-j wrong behavior.
> int test(int a)
> {
>   /** (1)
>   */
>   int a;
>
>   /* (1)
>   */
>   int b;
>   // test (1)
>
>   int c; // blah blah
>          // (3)
> }
>
> /* (2)
>  */
>
> /** (2)
> */
>
> // (2)
>
> If you place the cursor at the positions indicated by (1) and (2), press M-j the result is different and is different from what happens with c/c++-mode. 
>
> As a bonus, the attached patch also allows single-line comments placed at the end of a line to be indented as in c-mode (as in "(3)")
>
> Thank you.
> V.

Adding Theodor in.

Thanks

  Andrea




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#71225; Package emacs. (Tue, 28 May 2024 18:32:02 GMT) Full text and rfc822 format available.

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

From: Theodor Thornhill <theo <at> thornhill.no>
To: Andrea Corallo <acorallo <at> gnu.org>, Vincenzo Pupillo <v.pupillo <at> gmail.com>
Cc: 71225 <at> debbugs.gnu.org
Subject: Re: bug#71225: 30.0.50; [PATCH] c-ts-common-comment-indent-new-line does not behave like c/c++-mode in comments
Date: Tue, 28 May 2024 20:30:30 +0200
On May 28, 2024 8:15:20 PM GMT+02:00, Andrea Corallo <acorallo <at> gnu.org> wrote:
>Vincenzo Pupillo <v.pupillo <at> gmail.com> writes:
>
>> Hi, 
>> the c-ts-common-comment-indent-new-line does not behave like c/c++-mode in comments. 
>> M-j also behaves differently in different places.
>>
>> // M-j wrong behavior.
>> int test(int a)
>> {
>>   /** (1)
>>   */
>>   int a;
>>
>>   /* (1)
>>   */
>>   int b;
>>   // test (1)
>>
>>   int c; // blah blah
>>          // (3)
>> }
>>
>> /* (2)
>>  */
>>
>> /** (2)
>> */
>>
>> // (2)
>>
>> If you place the cursor at the positions indicated by (1) and (2), press M-j the result is different and is different from what happens with c/c++-mode. 
>>
>> As a bonus, the attached patch also allows single-line comments placed at the end of a line to be indented as in c-mode (as in "(3)")
>>
>> Thank you.
>> V.
>
>Adding Theodor in.
>
>Thanks
>
>  Andrea

Thanks for the ping, I'll take a look :)

Theo





bug Marked as fixed in versions 30.1. Request was from Theodor Thornhill <theo <at> thornhill.no> to control <at> debbugs.gnu.org. (Sun, 02 Jun 2024 08:12:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#71225; Package emacs. (Sun, 02 Jun 2024 08:13:02 GMT) Full text and rfc822 format available.

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

From: Theodor Thornhill <theo <at> thornhill.no>
To: Andrea Corallo <acorallo <at> gnu.org>
Cc: 71225 <at> debbugs.gnu.org, Vincenzo Pupillo <v.pupillo <at> gmail.com>
Subject: Re: bug#71225: 30.0.50; [PATCH] c-ts-common-comment-indent-new-line
 does not behave like c/c++-mode in comments
Date: Sun, 02 Jun 2024 10:11:27 +0200
Theodor Thornhill <theo <at> thornhill.no> writes:

> On May 28, 2024 8:15:20 PM GMT+02:00, Andrea Corallo <acorallo <at> gnu.org> wrote:
>>Vincenzo Pupillo <v.pupillo <at> gmail.com> writes:
>>
>>> Hi, 
>>> the c-ts-common-comment-indent-new-line does not behave like c/c++-mode in comments. 
>>> M-j also behaves differently in different places.
>>>
>>> // M-j wrong behavior.
>>> int test(int a)
>>> {
>>>   /** (1)
>>>   */
>>>   int a;
>>>
>>>   /* (1)
>>>   */
>>>   int b;
>>>   // test (1)
>>>
>>>   int c; // blah blah
>>>          // (3)
>>> }
>>>
>>> /* (2)
>>>  */
>>>
>>> /** (2)


Thanks, pushed to master.

Theo




Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Sun, 02 Jun 2024 08:31:01 GMT) Full text and rfc822 format available.

Notification sent to Vincenzo Pupillo <v.pupillo <at> gmail.com>:
bug acknowledged by developer. (Sun, 02 Jun 2024 08:31:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Theodor Thornhill <theo <at> thornhill.no>
Cc: v.pupillo <at> gmail.com, 71225-done <at> debbugs.gnu.org, acorallo <at> gnu.org
Subject: Re: bug#71225: 30.0.50;
 [PATCH] c-ts-common-comment-indent-new-line does not behave like
 c/c++-mode in comments
Date: Sun, 02 Jun 2024 11:30:34 +0300
> Cc: 71225 <at> debbugs.gnu.org, Vincenzo Pupillo <v.pupillo <at> gmail.com>
> Date: Sun, 02 Jun 2024 10:11:27 +0200
> From:  Theodor Thornhill via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
> 
> 
> Thanks, pushed to master.

Thanks, I'm therefore closing this bug.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 30 Jun 2024 11:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 26 days ago.

Previous Next


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