unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#2141: C mode indentation problem
@ 2009-02-01 19:38 ` Reuben Thomas
  2009-02-01 21:23   ` Alan Mackenzie
                     ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Reuben Thomas @ 2009-02-01 19:38 UTC (permalink / raw)
  To: bug-emacs

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







^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#2141: C mode indentation problem
  2009-02-01 19:38 ` bug#2141: C mode indentation problem Reuben Thomas
@ 2009-02-01 21:23   ` Alan Mackenzie
  2009-02-21 16:30   ` bug#2141: marked as done (C mode indentation problem) Emacs bug Tracking System
  2009-02-21 16:35   ` bug#2141: C mode indentation problem Alan Mackenzie
  2 siblings, 0 replies; 4+ messages in thread
From: Alan Mackenzie @ 2009-02-01 21:23 UTC (permalink / raw)
  To: Reuben Thomas, 2141; +Cc: bug-cc-mode, bug-emacs

Hi, Reuben,

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.

This is indeed a bug.  I'm looking into it now.

Thanks for reporting it!

-- 
Alan Mackenzie (Nuremberg, Germany).







^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#2141: marked as done (C mode indentation problem)
  2009-02-01 19:38 ` bug#2141: C mode indentation problem Reuben Thomas
  2009-02-01 21:23   ` Alan Mackenzie
@ 2009-02-21 16:30   ` Emacs bug Tracking System
  2009-02-21 16:35   ` bug#2141: C mode indentation problem Alan Mackenzie
  2 siblings, 0 replies; 4+ messages in thread
From: Emacs bug Tracking System @ 2009-02-21 16:30 UTC (permalink / raw)
  To: Alan Mackenzie

[-- Attachment #1: Type: text/plain, Size: 850 bytes --]


Your message dated Sat, 21 Feb 2009 16:44:48 +0000
with message-id <20090221164448.GB3027@muc.de>
and subject line Re: bug#2141: C mode indentation problem
has caused the Emacs bug report #2141,
regarding C mode indentation problem
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@emacsbugs.donarmstrong.com
immediately.)


-- 
2141: http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=2141
Emacs Bug Tracking System
Contact owner@emacsbugs.donarmstrong.com with problems

[-- Attachment #2: Type: message/rfc822, Size: 3666 bytes --]

From: Reuben Thomas <rrt@sc3d.org>
To: bug-emacs@gnu.org
Subject: C mode indentation problem
Date: Sun, 1 Feb 2009 19:38:54 +0000 (GMT)
Message-ID: <alpine.DEB.2.00.0902011936050.14863@mord.config>

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




[-- Attachment #3: Type: message/rfc822, Size: 2175 bytes --]

From: Alan Mackenzie <acm@muc.de>
To: 2141-done@emacsbugs.donarmstrong.com
Subject: Re: bug#2141: C mode indentation problem
Date: Sat, 21 Feb 2009 16:44:48 +0000
Message-ID: <20090221164448.GB3027@muc.de>

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).


^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#2141: C mode indentation problem
  2009-02-01 19:38 ` bug#2141: C mode indentation problem Reuben Thomas
  2009-02-01 21:23   ` Alan Mackenzie
  2009-02-21 16:30   ` bug#2141: marked as done (C mode indentation problem) Emacs bug Tracking System
@ 2009-02-21 16:35   ` Alan Mackenzie
  2 siblings, 0 replies; 4+ messages in thread
From: Alan Mackenzie @ 2009-02-21 16:35 UTC (permalink / raw)
  To: Reuben Thomas, 2141; +Cc: bug-emacs

Hi, Reuben!

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.

It should be fixed now in the CVS at savannah.

CC Mode was lacking code to parse (compile-time) expressions as case
labels.

-- 
Alan Mackenzie (Nuremberg, Germany).







^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-02-21 16:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20090221164448.GB3027@muc.de>
2009-02-01 19:38 ` bug#2141: C mode indentation problem Reuben Thomas
2009-02-01 21:23   ` Alan Mackenzie
2009-02-21 16:30   ` bug#2141: marked as done (C mode indentation problem) Emacs bug Tracking System
2009-02-21 16:35   ` bug#2141: C mode indentation problem Alan Mackenzie

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).