GNU bug report logs - #25480
cc-mode: open-paren-in-column-0 of comment affects non-comment indentation

Previous Next

Packages: emacs, cc-mode;

Reported by: Dima Kogan <dima <at> secretsauce.net>

Date: Wed, 18 Jan 2017 22:10:02 UTC

Severity: normal

Found in version 26.0.50

Done: Noam Postavsky <npostavs <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 25480 in the body.
You can then email your comments to 25480 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#25480; Package emacs. (Wed, 18 Jan 2017 22:10:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Dima Kogan <dima <at> secretsauce.net>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 18 Jan 2017 22:10:02 GMT) Full text and rfc822 format available.

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

From: Dima Kogan <dima <at> secretsauce.net>
To: bug-gnu-emacs <at> gnu.org
Subject: 26.0.50;
 cc-mode: punctuation in comments can affect non-comment indentation
Date: Wed, 18 Jan 2017 14:09:07 -0800
[Message part 1 (text/plain, inline)]
Hi. Found another possibly-obscure issue. I'm running a very recent
build of emacs: af3db69ee64

I have the attached minimized C source. If I

- load this source with emacs -Q
- move the point to 'struct'
- hit TAB

I would expect that line to be indented "correctly", with "correctly"
meaning starting at column 0 in this case. Instead, I see it indented to
column 2. This appears to be affected by the text in the preceding
comment. If I change "aaa)" to "aaa" then I get the desired behavior.

Thanks

[tst.h (text/x-chdr, inline)]
/*
aaa). bbb ccc <=
(dd >= f)
*/

struct S { int x; };

Information forwarded to bug-gnu-emacs <at> gnu.org, bug-cc-mode <at> gnu.org:
bug#25480; Package emacs,cc-mode. (Wed, 29 Nov 2017 02:25:02 GMT) Full text and rfc822 format available.

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

From: Noam Postavsky <npostavs <at> users.sourceforge.net>
To: Dima Kogan <dima <at> secretsauce.net>
Cc: 25480 <at> debbugs.gnu.org
Subject: Re: bug#25480: 26.0.50;
 cc-mode: punctuation in comments can affect non-comment indentation
Date: Tue, 28 Nov 2017 21:24:38 -0500
retitle 25480 cc-mode: open-paren-in-column-0 of comment affects non-comment indentation
quit

Dima Kogan <dima <at> secretsauce.net> writes:

> /*
> aaa). bbb ccc <=
> (dd >= f)
> */
>
> struct S { int x; };

Doing (setq open-paren-in-column-0-is-defun-start nil) fixes it.

Alternatively, keeping the open paren out of column 0:

/*
aaa). bbb ccc <=
 (dd >= f)
*/

struct S { int x; };





Changed bug title to 'cc-mode: open-paren-in-column-0 of comment affects non-comment indentation' from '26.0.50; cc-mode: punctuation in comments can affect non-comment indentation' Request was from Noam Postavsky <npostavs <at> users.sourceforge.net> to control <at> debbugs.gnu.org. (Wed, 29 Nov 2017 02:25:03 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org, bug-cc-mode <at> gnu.org:
bug#25480; Package emacs,cc-mode. (Sat, 10 Feb 2018 09:05:01 GMT) Full text and rfc822 format available.

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

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Noam Postavsky <npostavs <at> users.sourceforge.net>,
 Dima Kogan <dima <at> secretsauce.net>
Cc: 25480 <at> debbugs.gnu.org
Subject: Re: bug#25480: 26.0.50; cc-mode: punctuation in comments can affect
 non-comment indentation
Date: Sat, 10 Feb 2018 12:04:42 +0300
On 11/29/17 5:24 AM, Noam Postavsky wrote:

> Doing (setq open-paren-in-column-0-is-defun-start nil) fixes it.
> 
> Alternatively, keeping the open paren out of column 0:
> 
> /*
> aaa). bbb ccc <=
>   (dd >= f)
> */
> 
> struct S { int x; };

Seems fixed on master (likely to be released as Emacs 27 someday)




Information forwarded to bug-gnu-emacs <at> gnu.org, bug-cc-mode <at> gnu.org:
bug#25480; Package emacs,cc-mode. (Thu, 24 May 2018 03:26:01 GMT) Full text and rfc822 format available.

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

From: Noam Postavsky <npostavs <at> gmail.com>
To: Dmitry Gutov <dgutov <at> yandex.ru>
Cc: 25480 <at> debbugs.gnu.org, Dima Kogan <dima <at> secretsauce.net>,
 Noam Postavsky <npostavs <at> users.sourceforge.net>
Subject: Re: bug#25480: 26.0.50;
 cc-mode: punctuation in comments can affect non-comment indentation
Date: Wed, 23 May 2018 23:24:51 -0400
close 25480
quit

Dmitry Gutov <dgutov <at> yandex.ru> writes:

> On 11/29/17 5:24 AM, Noam Postavsky wrote:
>
>> Doing (setq open-paren-in-column-0-is-defun-start nil) fixes it.
>>
>> Alternatively, keeping the open paren out of column 0:
>>
>> /*
>> aaa). bbb ccc <=
>>   (dd >= f)
>> */
>>
>> struct S { int x; };
>
> Seems fixed on master (likely to be released as Emacs 27 someday)

Actually, I can't reproduce it on emacs-26 now either.  Anyway, I don't
see any need to keep this open.




bug closed, send any further explanations to 25480 <at> debbugs.gnu.org and Dima Kogan <dima <at> secretsauce.net> Request was from Noam Postavsky <npostavs <at> gmail.com> to control <at> debbugs.gnu.org. (Thu, 24 May 2018 03:26:02 GMT) Full text and rfc822 format available.

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

This bug report was last modified 7 years and 78 days ago.

Previous Next


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