From unknown Tue Jun 17 20:10:46 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#4187 <4187@debbugs.gnu.org> To: bug#4187 <4187@debbugs.gnu.org> Subject: Status: Bug with indentation / parens matching in C++-mode Reply-To: bug#4187 <4187@debbugs.gnu.org> Date: Wed, 18 Jun 2025 03:10:46 +0000 retitle 4187 Bug with indentation / parens matching in C++-mode reassign 4187 emacs21,cc-mode submitter 4187 "Tobias.Schlueter" severity 4187 normal thanks From Tobias.Schlueter@physik.uni-muenchen.de Tue Aug 18 05:04:37 2009 Received: (at submit) by emacsbugs.donarmstrong.com; 18 Aug 2009 12:04:38 +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.14.3/8.14.3/Debian-5) with ESMTP id n7IC4Zr0008430 for ; Tue, 18 Aug 2009 05:04:37 -0700 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MdNQY-0007dL-Mn for bug-gnu-emacs@gnu.org; Tue, 18 Aug 2009 08:04:34 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MdNQQ-0007YK-HE for bug-gnu-emacs@gnu.org; Tue, 18 Aug 2009 08:04:33 -0400 Received: from [199.232.76.173] (port=50867 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MdNQQ-0007YH-By for bug-gnu-emacs@gnu.org; Tue, 18 Aug 2009 08:04:26 -0400 Received: from mail.physik.uni-muenchen.de ([192.54.42.129]:59753) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MdNQP-0002nF-ID for bug-gnu-emacs@gnu.org; Tue, 18 Aug 2009 08:04:25 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.physik.uni-muenchen.de (Postfix) with ESMTP id 0F7B127EC5 for ; Tue, 18 Aug 2009 14:04:22 +0200 (CEST) X-Virus-Scanned: amavisd-new at physik.uni-muenchen.de Received: from mail.physik.uni-muenchen.de ([127.0.0.1]) by localhost (mail.physik.uni-muenchen.de [127.0.0.1]) (amavisd-new, port 10024) with LMTP id rKMQjiw1PY0i for ; Tue, 18 Aug 2009 14:04:21 +0200 (CEST) Received: from zuppc13.physik.uni-muenchen.de (zuppc13.garching.physik.uni-muenchen.de [129.187.180.11]) by mail.physik.uni-muenchen.de (Postfix) with ESMTP id EC47627EC2 for ; Tue, 18 Aug 2009 14:04:21 +0200 (CEST) Received: by zuppc13.physik.uni-muenchen.de (Postfix, from userid 10690) id D52BD58182; Tue, 18 Aug 2009 14:04:21 +0200 (CEST) From: "Tobias.Schlueter" To: bug-gnu-emacs@gnu.org Subject: Bug with indentation / parens matching in C++-mode MIME-version: 1.0 Content-type: text/plain; charset=iso-8859-1 Message-Id: <20090818120421.D52BD58182@zuppc13.physik.uni-muenchen.de> Date: Tue, 18 Aug 2009 14:04:21 +0200 (CEST) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) This bug report will be sent to the Free Software Foundation, not to your local site managers! Please write in English, because the Emacs maintainers do not have translators to read other languages for them. Your bug report will be posted to the bug-gnu-emacs@gnu.org mailing list, and to the gnu.emacs.bug news group. In GNU Emacs 21.4.1 (i686-redhat-linux-gnu, X toolkit, Xaw3d scroll bars) of 2008-01-04 on norob.fnal.gov configured using `configure --build=3Di686-redhat-linux-gnu --host=3Di68= 6-redhat-linux-gnu --target=3Di386-redhat-linux-gnu --program-prefix=3D -= -prefix=3D/usr --exec-prefix=3D/usr --bindir=3D/usr/bin --sbindir=3D/usr/= sbin --sysconfdir=3D/etc --datadir=3D/usr/share --includedir=3D/usr/inclu= de --libdir=3D/usr/lib --libexecdir=3D/usr/libexec --localstatedir=3D/var= --sharedstatedir=3D/usr/com --mandir=3D/usr/share/man --infodir=3D/usr/s= hare/info --with-pop --with-sound' Important settings: value of $LC_ALL: nil value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: en_US.UTF-8 locale-coding-system: utf-8 default-enable-multibyte-characters: t Please describe exactly what actions triggered the bug and the precise symptoms of the bug: Type the following into a buffer which is in C++ mode. Try to get correct indentation for the second line of the while condition or the line following it by hitting the TAB key. In my case this fails miserably. Modifying the while condition to fix this behaves rather erratically, adding parentheses at least doesn't fix it. { do { } while (fabs(chi2 - oldChi2) > 0 && count < iterMax); x=3D 1; } You can reach me under tobi@schlueters.de, I don't know if this interface will place the right sender address on the mail. I guess the stuff emacs put below will not be of much help, so I'm cutting it (recent input, the bug appears independent of my input). Cheers, - Tobias Schl=FCter From rgm@gnu.org Thu Aug 20 18:09:19 2009 Received: (at control) by emacsbugs.donarmstrong.com; 21 Aug 2009 01:09:19 +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=-4.9 required=4.0 tests=AWL,ONEWORD,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.14.3/8.14.3/Debian-5) with ESMTP id n7L19H7w000999 for ; Thu, 20 Aug 2009 18:09:19 -0700 Received: from rgm by fencepost.gnu.org with local (Exim 4.67) (envelope-from ) id 1MeId3-0004Zc-5w; Thu, 20 Aug 2009 21:09:17 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <19085.62397.105518.639079@fencepost.gnu.org> Date: Thu, 20 Aug 2009 21:09:17 -0400 From: Glenn Morris To: control Subject: control X-Debbugs-No-Ack: yes merge 4185 4202 merge 4186 4201 severity 4192 wishlist reassign 4192 emacs,cc-mode reassign 4143 emacs,ns reassign 4146 emacs,cc-mode severity 4164 minor reassign 4180 emacs,ns reassign 4187 emacs,cc-mode forcemerge 2868 4194 From acm@muc.de Fri Aug 21 07:54:07 2009 Received: (at submit) by emacsbugs.donarmstrong.com; 21 Aug 2009 14:54:07 +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=-4.4 required=4.0 tests=AWL,FOURLA,HAS_BUG_NUMBER autolearn=unavailable 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.14.3/8.14.3/Debian-5) with ESMTP id n7LEs5XD020803 for ; Fri, 21 Aug 2009 07:54:07 -0700 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MeVVF-0004xV-CL for bug-gnu-emacs@gnu.org; Fri, 21 Aug 2009 10:54:05 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MeVVB-0004wh-Uv for bug-gnu-emacs@gnu.org; Fri, 21 Aug 2009 10:54:05 -0400 Received: from [199.232.76.173] (port=34955 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MeVVB-0004we-Nx for bug-gnu-emacs@gnu.org; Fri, 21 Aug 2009 10:54:01 -0400 Received: from colin.muc.de ([193.149.48.1]:2702 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 1MeVVB-00042Y-1E for bug-gnu-emacs@gnu.org; Fri, 21 Aug 2009 10:54:01 -0400 Received: (qmail 45277 invoked by uid 3782); 21 Aug 2009 14:53:58 -0000 Received: from acm.muc.de (pD9E51B5C.dip.t-dialin.net [217.229.27.92]) by colin2.muc.de (tmda-ofmipd) with ESMTP; Fri, 21 Aug 2009 16:53:56 +0200 Received: (qmail 7737 invoked by uid 1000); 21 Aug 2009 14:56:54 -0000 Date: Fri, 21 Aug 2009 14:56:54 +0000 To: "Tobias.Schlueter" , 4187@debbugs.gnu.org Cc: bug-gnu-emacs@gnu.org, tobi@schlueters.de, bug-cc-mode@gnu.org Subject: Re: bug#4187: Bug with indentation / parens matching in C++-mode Message-ID: <20090821145654.GA1897@muc.de> Reply-To: bug-cc-mode@gnu.org References: <20090818120421.D52BD58182@zuppc13.physik.uni-muenchen.de> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20090818120421.D52BD58182@zuppc13.physik.uni-muenchen.de> 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 Hi, Tobias! On Tue, Aug 18, 2009 at 02:04:21PM +0200, Tobias.Schlueter wrote: > In GNU Emacs 21.4.1 (i686-redhat-linux-gnu, X toolkit, Xaw3d scroll bars) > of 2008-01-04 on norob.fnal.gov OK, Emacs 21.4. That's very old. Emacs 22 was released in June 2007. Emacs 23 was released a few weeks ago, on 30th July. You could do worse than upgrading (or persuading your sysadmins to upgrade). Emacs 21 contained CC Mode 28, which is so old as to be barely supportable. If you can't upgrade your Emacs, you could certainly install a newer version of CC Mode in one of your own directories (see ). > Type the following into a buffer which is in C++ mode. What version of CC Mode are you using (M-x c-version)? Have you or anybody else customised CC Mode at all? It might well help to see your complete CC Mode configuration (C-c C-b from within your C++ buffer, followed by cutting and pasting). > Try to get correct indentation for the second line of the while > condition or the line following it by hitting the TAB key. In my case > this fails miserably. Modifying the while condition to fix this > behaves rather erratically, adding parentheses at least doesn't fix it. Just as a suggestion, it might help things if you put a proper function header before the opening "{". It might not, though. People's opinions differ on what "correct" indentation is, which is why you can (and, sadly, MUST) configure it. So could you please say how you would like the line to be indented. One thing you could do is, with point on the "&& count" line, C-c C-s. This will give the syntactic analysis of the line, something like: Syntactic analysis: ((arglist-cont-nonempty 347 355)) . This says "the line is a continued argument list whose "anchor points" are at buffer positions 347 and 355". This is explained in the CC Mode manual in full detail. Now try C-c C-o. It will prompt you with something like: Syntactic symbol to change: arglist-cont-nonempty , and when you hit , you'll get, say,: arglist-cont-nonempty offset (default (c-lineup-gcc-asm-reg c-lineup-arglist)): , where you can type the new "offset" that you want. Try entering "+", or "++" or "*" or "-" here, just to get an idea of how this works. Then hit the key. Again, the full details of all this stuff are in the CC Mode manual. I can give you better help once you've replied with the details I've asked for. > { > do { > } while (fabs(chi2 - oldChi2) > 0 > && count < iterMax); > x= 1; > } > You can reach me under tobi@schlueters.de, I don't know if this > interface will place the right sender address on the mail. It didn't, but I have. :-) I've also directed your reply to bug-cc-mode@gnu.org, which is a more specific mailing list. > I guess the stuff emacs put below will not be of much help, so I'm > cutting it (recent input, the bug appears independent of my input). Thanks! > Cheers, > - Tobias Schlüter Schöne Grüße aus Nürnberg! -- Alan Mackenzie. From rgm@gnu.org Sat Aug 22 13:12:25 2009 Received: (at control) by emacsbugs.donarmstrong.com; 22 Aug 2009 20:12:25 +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=-4.4 required=4.0 tests=AWL,ONEWORD,VALID_BTS_CONTROL autolearn=no 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.14.3/8.14.3/Debian-5) with ESMTP id n7MKCOZx011554 for ; Sat, 22 Aug 2009 13:12:25 -0700 Received: from rgm by fencepost.gnu.org with local (Exim 4.67) (envelope-from ) id 1Mewwp-0005Dg-I0; Sat, 22 Aug 2009 16:12:23 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <19088.20775.468560.840754@fencepost.gnu.org> Date: Sat, 22 Aug 2009 16:12:23 -0400 From: Glenn Morris To: control Subject: control reassign 4187 emacs21,cc-mode forwarded 4208 https://bugzilla.redhat.com/show_bug.cgi?id=518659 forcemerge 458 4237 From tobias.schlueter@physik.uni-muenchen.de Tue Sep 22 01:51:47 2009 Received: (at submit) by emacsbugs.donarmstrong.com; 22 Sep 2009 08:51:47 +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=-3.0 required=4.0 tests=AWL,HAS_BUG_NUMBER autolearn=unavailable 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.14.3/8.14.3/Debian-5) with ESMTP id n8M8pjV0032692 for ; Tue, 22 Sep 2009 01:51:46 -0700 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mq169-0001J5-BI for bug-gnu-emacs@gnu.org; Tue, 22 Sep 2009 04:51:45 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mq163-0001HE-AJ for bug-gnu-emacs@gnu.org; Tue, 22 Sep 2009 04:51:44 -0400 Received: from [199.232.76.173] (port=38416 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mq163-0001HB-5b for bug-gnu-emacs@gnu.org; Tue, 22 Sep 2009 04:51:39 -0400 Received: from mail.physik.uni-muenchen.de ([192.54.42.129]:36155) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Mq15y-0001EH-KB; Tue, 22 Sep 2009 04:51:34 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.physik.uni-muenchen.de (Postfix) with ESMTP id 14D8B27E01; Tue, 22 Sep 2009 10:51:31 +0200 (CEST) X-Virus-Scanned: amavisd-new at physik.uni-muenchen.de Received: from mail.physik.uni-muenchen.de ([127.0.0.1]) by localhost (mail.physik.uni-muenchen.de [127.0.0.1]) (amavisd-new, port 10024) with LMTP id ZhK5EXZ6U1Ib; Tue, 22 Sep 2009 10:51:31 +0200 (CEST) Received: from 0017f2e907a6.dfn.mwn.de (0017f2e907a6.dfn.mwn.de [138.246.18.14]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.physik.uni-muenchen.de (Postfix) with ESMTP id EAC9427DFB; Tue, 22 Sep 2009 10:51:30 +0200 (CEST) Message-ID: <4AB89010.70904@physik.uni-muenchen.de> Date: Tue, 22 Sep 2009 10:51:28 +0200 From: =?ISO-8859-1?Q?Tobias_Schl=FCter?= User-Agent: Thunderbird 2.0.0.23 (Macintosh/20090812) MIME-Version: 1.0 To: bug-cc-mode@gnu.org CC: 4187@debbugs.gnu.org, bug-gnu-emacs@gnu.org, tobi@schlueters.de Subject: Re: bug#4187: Bug with indentation / parens matching in C++-mode References: <20090818120421.D52BD58182@zuppc13.physik.uni-muenchen.de> <20090821145654.GA1897@muc.de> In-Reply-To: <20090821145654.GA1897@muc.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Hi, sorry for not getting back to you earlier, and thank you very much for=20 the detailed reply. Alan Mackenzie wrote: > Hi, Tobias! >=20 > On Tue, Aug 18, 2009 at 02:04:21PM +0200, Tobias.Schlueter wrote: >=20 >> In GNU Emacs 21.4.1 (i686-redhat-linux-gnu, X toolkit, Xaw3d scroll ba= rs) >> of 2008-01-04 on norob.fnal.gov >=20 > OK, Emacs 21.4. That's very old. Whoops, yes, of course, everything works as expected with a newer=20 version. Hence I don't think it's worth wasting your time with a=20 detailed answer. Just for the record, I'm perfectly happy with GNU-style indentation, and=20 my old version of cc-mode failed to do this for the example I quoted=20 again below, maybe it's something for the cc-mode testsuite, if=20 something like that exists. >> { >> do { >> } while (fabs(chi2 - oldChi2) > 0 >> && count < iterMax); >> x=3D 1; >> } >=20 Cheers, - Tobias Schl=FCter From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 01 00:31:39 2011 Received: (at control) by debbugs.gnu.org; 1 Mar 2011 05:31:39 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PuIBP-0002k1-09 for submit@debbugs.gnu.org; Tue, 01 Mar 2011 00:31:39 -0500 Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PuIBN-0002jo-7G for control@debbugs.gnu.org; Tue, 01 Mar 2011 00:31:37 -0500 Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1PuIBI-0006GK-2P for control@debbugs.gnu.org; Tue, 01 Mar 2011 00:31:32 -0500 Date: Tue, 01 Mar 2011 00:31:32 -0500 Message-Id: Subject: control message for bug 4187 To: X-Mailer: mail (GNU Mailutils 2.1) From: Glenn Morris X-Spam-Score: -6.3 (------) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.3 (------) close 4187 From unknown Tue Jun 17 20:10:46 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 29 Mar 2011 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator