Subject: bug#2141 closed by Alan Mackenzie <[email-masked]> (Re: bug#2141: C mode indentation problem)

From: [email-masked] (Emacs bug Tracking System)
Date: Sat, 21 Feb 2009 16:30:04 +0000

This is an automatic notification regarding your bug report
which was filed against the emacs,cc-mode package:

#2141: C mode indentation problem

It has been closed by Alan Mackenzie <[email-masked]>.

Their explanation is attached below along with your original report.
If this explanation is unsatisfactory and you have not received a
better one in a separate message then please contact Alan Mackenzie <[email-masked]> by
replying to this email.

-- 
2141: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=2141
Emacs Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#2141: C mode indentation problem
From: Alan Mackenzie <[email-masked]>
To: [email-masked]
Date: Sat, 21 Feb 2009 16:44:48 +0000

On Sun, Feb 01, 2009 at 07:38:54PM +0000, Reuben Thomas wrote:
> Running Emacs from CVS head as "./emacs -Q foo.c" to create a new buffer 
> foo.c in C mode, if I enter the following text, indenting as I go:

> ----cut here----
> int main (void)
> {
>   int foo;

>   switch (foo)
>     {
>     case BLAH | 'a':
>       bar = 0;
>     break;
> ---cut here----

> it is indented as above, which I believe is wrong, as the "break" should be 
> indented to the same column as the previous line. If I change the case line 
> to simply "case BLAH:" then this does indeed happen.

Fixed by enhancing c-beginning-of-statement-1 to handle (compile-time)
expressions as case labels.

-- 
Alan Mackenzie (Nuremberg, Germany).

Subject: C mode indentation problem
From: Reuben Thomas <[email-masked]>
To: [email-masked]
Date: Sun, 1 Feb 2009 19:38:54 +0000 (GMT)

Running Emacs from CVS head as "./emacs -Q foo.c" to create a new buffer 
foo.c in C mode, if I enter the following text, indenting as I go:

----cut here----
int main (void)
{
   int foo;

   switch (foo)
     {
     case BLAH | 'a':
       bar = 0;
     break;
---cut here----

it is indented as above, which I believe is wrong, as the "break" should be 
indented to the same column as the previous line. If I change the case line 
to simply "case BLAH:" then this does indeed happen.

-- 
http://rrt.sc3d.org/ | That's about as useful as a paper wok