From unknown Thu Sep 11 20:36:33 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#2141 <2141@debbugs.gnu.org> To: bug#2141 <2141@debbugs.gnu.org> Subject: Status: C mode indentation problem Reply-To: bug#2141 <2141@debbugs.gnu.org> Date: Fri, 12 Sep 2025 03:36:33 +0000 retitle 2141 C mode indentation problem reassign 2141 emacs,cc-mode submitter 2141 Reuben Thomas severity 2141 normal thanks From rrt@sc3d.org Sun Feb 1 11:39:11 2009 Received: (at submit) by emacsbugs.donarmstrong.com; 1 Feb 2009 19:39:11 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=0.1 required=4.0 tests=FOURLA autolearn=no version=3.2.5-bugs.debian.org_2005_01_02 Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n11Jd3Qp001148 for ; Sun, 1 Feb 2009 11:39:04 -0800 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LTi9m-0001d2-Nf for bug-gnu-emacs@gnu.org; Sun, 01 Feb 2009 14:39:02 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LTi9l-0001ba-D8 for bug-gnu-emacs@gnu.org; Sun, 01 Feb 2009 14:39:01 -0500 Received: from [199.232.76.173] (port=48451 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LTi9k-0001bJ-J1 for bug-gnu-emacs@gnu.org; Sun, 01 Feb 2009 14:39:00 -0500 Received: from fencepost.gnu.org ([140.186.70.10]:47525) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LTi9k-0000ZF-3j for bug-gnu-emacs@gnu.org; Sun, 01 Feb 2009 14:39:00 -0500 Received: from mx10.gnu.org ([199.232.76.166]:45573) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1LTi83-0000iH-90 for bug-emacs@gnu.org; Sun, 01 Feb 2009 14:37:15 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1LTi9i-0000Z5-Qm for bug-emacs@gnu.org; Sun, 01 Feb 2009 14:38:59 -0500 Received: from exprod7og110.obsmtp.com ([64.18.2.173]:35652) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1LTi9i-0000Yt-C3 for bug-emacs@gnu.org; Sun, 01 Feb 2009 14:38:58 -0500 Received: from source ([209.85.219.20]) by exprod7ob110.postini.com ([64.18.6.12]) with SMTP ID DSNKSYX6UDtvfAmYw8olsqEsonhpHp0CL6th@postini.com; Sun, 01 Feb 2009 11:38:58 PST Received: by ewy13 with SMTP id 13so1492474ewy.17 for ; Sun, 01 Feb 2009 11:38:55 -0800 (PST) Received: by 10.67.115.15 with SMTP id s15mr1138689ugm.56.1233517135404; Sun, 01 Feb 2009 11:38:55 -0800 (PST) Received: from mord.config (78-105-4-25.zone3.bethere.co.uk [78.105.4.25]) by mx.google.com with ESMTPS id 34sm2955323ugh.10.2009.02.01.11.38.54 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 01 Feb 2009 11:38:55 -0800 (PST) Date: Sun, 1 Feb 2009 19:38:54 +0000 (GMT) From: Reuben Thomas To: bug-emacs@gnu.org Subject: C mode indentation problem Message-ID: User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; format=flowed; charset=US-ASCII X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) 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 From acm@muc.de Sun Feb 1 13:04:29 2009 Received: (at submit) by emacsbugs.donarmstrong.com; 1 Feb 2009 21:04:29 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-2.9 required=4.0 tests=FOURLA,HAS_BUG_NUMBER autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n11L4P3m023282 for ; Sun, 1 Feb 2009 13:04:26 -0800 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LTjUP-00026t-9z for bug-gnu-emacs@gnu.org; Sun, 01 Feb 2009 16:04:25 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LTjUN-00026e-RG for bug-gnu-emacs@gnu.org; Sun, 01 Feb 2009 16:04:25 -0500 Received: from [199.232.76.173] (port=35978 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LTjUN-00026b-IK for bug-gnu-emacs@gnu.org; Sun, 01 Feb 2009 16:04:23 -0500 Received: from fencepost.gnu.org ([140.186.70.10]:33420) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LTjUN-0007GQ-9s for bug-gnu-emacs@gnu.org; Sun, 01 Feb 2009 16:04:23 -0500 Received: from mx10.gnu.org ([199.232.76.166]:47836) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1LTjSf-0002bl-Qg for bug-emacs@gnu.org; Sun, 01 Feb 2009 16:02:37 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1LTjUK-0007Fx-1K for bug-emacs@gnu.org; Sun, 01 Feb 2009 16:04:22 -0500 Received: from colin.muc.de ([193.149.48.1]:4522 helo=mail.muc.de) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LTjUJ-0007FX-9k for bug-emacs@gnu.org; Sun, 01 Feb 2009 16:04:19 -0500 Received: (qmail 82777 invoked by uid 3782); 1 Feb 2009 21:04:15 -0000 Received: from acm.muc.de (pD9E23E45.dip.t-dialin.net [217.226.62.69]) by colin2.muc.de (tmda-ofmipd) with ESMTP; Sun, 01 Feb 2009 22:04:12 +0100 Received: (qmail 6346 invoked by uid 1000); 1 Feb 2009 21:23:42 -0000 Date: Sun, 1 Feb 2009 21:23:42 +0000 To: Reuben Thomas , 2141@debbugs.gnu.org Cc: bug-emacs@gnu.org, bug-cc-mode@gnu.org Subject: Re: bug#2141: C mode indentation problem Message-ID: <20090201212342.GA4969@muc.de> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.9i X-Delivery-Agent: TMDA/1.1.5 (Fettercairn) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-detected-operating-system: by monty-python.gnu.org: FreeBSD 4.6-4.9 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-CrossAssassin-Score: 2 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). From rgm@gnu.org Sun Feb 1 23:11:53 2009 Received: (at control) by emacsbugs.donarmstrong.com; 2 Feb 2009 07:11:53 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-5.0 required=4.0 tests=MURPHY_DRUGS_REL8, VALID_BTS_CONTROL,X_DEBBUGS_NO_ACK autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n127Bpnq013959 for ; Sun, 1 Feb 2009 23:11:52 -0800 Received: from rgm by fencepost.gnu.org with local (Exim 4.67) (envelope-from ) id 1LTswV-0000VE-Ll; Mon, 02 Feb 2009 02:10:03 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <18822.40011.133086.730105@fencepost.gnu.org> Date: Mon, 2 Feb 2009 02:10:03 -0500 From: Glenn Morris To: control Subject: control message X-Debbugs-No-Ack: yes reassign 2139 spam reassign 2142 spam reassign 2143 spam reassign 2141 emacs,cc-mode reassign 2135 emacs,rmail reassign 2137 emacs,rmail reassign 2150 emacs,rmail severity 2145 wishlist tags 2134 - patch merge 801 2134 From acm@muc.de Sat Feb 21 08:13:56 2009 Received: (at submit) by emacsbugs.donarmstrong.com; 21 Feb 2009 16:13:57 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-2.9 required=4.0 tests=FOURLA,HAS_BUG_NUMBER autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n1LGDoZD014752 for ; Sat, 21 Feb 2009 08:13:51 -0800 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LauU9-0003H3-VX for bug-gnu-emacs@gnu.org; Sat, 21 Feb 2009 11:13:50 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LauU8-0003FH-CL for bug-gnu-emacs@gnu.org; Sat, 21 Feb 2009 11:13:49 -0500 Received: from [199.232.76.173] (port=38741 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LauU7-0003F9-VB for bug-gnu-emacs@gnu.org; Sat, 21 Feb 2009 11:13:48 -0500 Received: from fencepost.gnu.org ([140.186.70.10]:43695) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LauU7-00063F-Ot for bug-gnu-emacs@gnu.org; Sat, 21 Feb 2009 11:13:47 -0500 Received: from mail.gnu.org ([199.232.76.166]:41347 helo=mx10.gnu.org) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1LauS0-00085b-UZ for bug-emacs@gnu.org; Sat, 21 Feb 2009 11:11:37 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1LauU5-00062n-Al for bug-emacs@gnu.org; Sat, 21 Feb 2009 11:13:46 -0500 Received: from colin.muc.de ([193.149.48.1]:1219 helo=mail.muc.de) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LauU4-000621-RM for bug-emacs@gnu.org; Sat, 21 Feb 2009 11:13:45 -0500 Received: (qmail 10585 invoked by uid 3782); 21 Feb 2009 16:13:40 -0000 Received: from acm.muc.de (pD9E52826.dip.t-dialin.net [217.229.40.38]) by colin2.muc.de (tmda-ofmipd) with ESMTP; Sat, 21 Feb 2009 17:13:38 +0100 Received: (qmail 10269 invoked by uid 1000); 21 Feb 2009 16:35:17 -0000 Date: Sat, 21 Feb 2009 16:35:17 +0000 To: Reuben Thomas , 2141@debbugs.gnu.org Cc: bug-emacs@gnu.org Subject: Re: bug#2141: C mode indentation problem Message-ID: <20090221163517.GA3027@muc.de> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.9i X-Delivery-Agent: TMDA/1.1.5 (Fettercairn) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-detected-operating-system: by monty-python.gnu.org: FreeBSD 4.6-4.9 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) 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). From acm@muc.de Sat Feb 21 08:23:13 2009 Received: (at 2141-done) by emacsbugs.donarmstrong.com; 21 Feb 2009 16:23:13 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-2.9 required=4.0 tests=FOURLA,HAS_BUG_NUMBER autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from mail.muc.de (qmailr@colin.muc.de [193.149.48.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n1LGNAwm017165 for <2141-done@emacsbugs.donarmstrong.com>; Sat, 21 Feb 2009 08:23:11 -0800 Received: (qmail 11679 invoked by uid 3782); 21 Feb 2009 16:23:09 -0000 Received: from acm.muc.de (pD9E52826.dip.t-dialin.net [217.229.40.38]) by colin2.muc.de (tmda-ofmipd) with ESMTP; Sat, 21 Feb 2009 17:23:08 +0100 Received: (qmail 10403 invoked by uid 1000); 21 Feb 2009 16:44:48 -0000 Date: Sat, 21 Feb 2009 16:44:48 +0000 To: 2141-done@debbugs.gnu.org Subject: Re: bug#2141: C mode indentation problem Message-ID: <20090221164448.GB3027@muc.de> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.9i X-Delivery-Agent: TMDA/1.1.5 (Fettercairn) From: Alan Mackenzie X-Primary-Address: acm@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). From unknown Thu Sep 11 20:36:33 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: $requester Subject: Internal Control Message-Id: bug archived. Date: Sun, 22 Mar 2009 14:24:05 +0000 User-Agent: Fakemail v42.6.9 # A New Hope # A log time ago, in a galaxy far, far away # something happened. # # Magically this resulted in the following # action being taken, but this fake control # message doesn't tell you why it happened # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator