From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#39891: 26.3; C++ indenting error Date: Sat, 7 Mar 2020 11:05:35 +0000 Message-ID: <20200307110535.GA7219@ACM> References: <874kv5ksn1.fsf@js.i-did-not-set--mail-host-address--so-tickle-me> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="41170"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mutt/1.10.1 (2018-07-13) Cc: 39891@debbugs.gnu.org To: altlockg@gmail.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Mar 07 12:06:23 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jAXHh-000AY9-9l for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 07 Mar 2020 12:06:21 +0100 Original-Received: from localhost ([::1]:47278 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jAXHf-00060X-WE for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 07 Mar 2020 06:06:20 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42192) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jAXHQ-000608-01 for bug-gnu-emacs@gnu.org; Sat, 07 Mar 2020 06:06:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jAXHO-0001Vq-R0 for bug-gnu-emacs@gnu.org; Sat, 07 Mar 2020 06:06:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:40320) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jAXHO-0001VS-Mx for bug-gnu-emacs@gnu.org; Sat, 07 Mar 2020 06:06:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jAXHO-0005iX-Gq for bug-gnu-emacs@gnu.org; Sat, 07 Mar 2020 06:06:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 07 Mar 2020 11:06:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 39891 X-GNU-PR-Package: emacs Original-Received: via spool by 39891-submit@debbugs.gnu.org id=B39891.158357914121950 (code B ref 39891); Sat, 07 Mar 2020 11:06:02 +0000 Original-Received: (at 39891) by debbugs.gnu.org; 7 Mar 2020 11:05:41 +0000 Original-Received: from localhost ([127.0.0.1]:46293 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jAXH2-0005hx-6L for submit@debbugs.gnu.org; Sat, 07 Mar 2020 06:05:41 -0500 Original-Received: from colin.muc.de ([193.149.48.1]:60178 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1jAXH0-0005ho-NF for 39891@debbugs.gnu.org; Sat, 07 Mar 2020 06:05:39 -0500 Original-Received: (qmail 94717 invoked by uid 3782); 7 Mar 2020 11:05:37 -0000 Original-Received: from acm.muc.de (p4FE15C0D.dip0.t-ipconnect.de [79.225.92.13]) by colin.muc.de (tmda-ofmipd) with ESMTP; Sat, 07 Mar 2020 12:05:35 +0100 Original-Received: (qmail 7320 invoked by uid 1000); 7 Mar 2020 11:05:35 -0000 Content-Disposition: inline In-Reply-To: <874kv5ksn1.fsf@js.i-did-not-set--mail-host-address--so-tickle-me> X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:177000 Archived-At: Hello, altlockg On Tue, Mar 03, 2020 at 22:58:26 +0100, altlockg@gmail.com wrote: > I was trying to reindent my file, but got the error, visible in the > recent messages below. Thanks for taking the trouble to report this bug. > I tracked it down to a single line, line 34 of the following file: > https://pastebin.com/kVJATcsF > The line containing "rec.x + rec.width - MOUSE_SCALE_MARK_SIZE, ", > to be exact. > When I remove the newline before this line, the issue does not occur. The bug has actually already been fixed in the CC Mode and Emacs repositories, although the fix hasn't yet appeared in a released version. > I wouldn't have a clue on how to dig deeper, so that's why I'm sending > you this report. If it helps, my configuration is available here: > https://github.com/Altlock/EmacsDots What is happening is that the older CC Mode isn't recognising the brace on L33 as a block containing data fields, and tries to parse it as though it contained statements. It thus gets horribly confused. To get your CC Mode working until our next release happens, would you please apply the following patch to .../lisp/progmodes/cc-engine.el in your Emacs 26.3: diff -r 26668f1829ba -r cc69c3edb59b cc-engine.el --- a/cc-engine.el Fri Nov 10 17:28:29 2017 +0000 +++ b/cc-engine.el Fri Nov 10 17:32:55 2017 +0000 @@ -12558,7 +12558,11 @@ (save-excursion (goto-char containing-sexp) (c-looking-at-special-brace-list))) - (c-inside-bracelist-p containing-sexp paren-state t)))) + (c-inside-bracelist-p containing-sexp paren-state t) + (save-excursion + (goto-char containing-sexp) + (and (eq (char-after) ?{) + (not (c-looking-at-statement-block))))))) (cond ;; CASE 9A: In the middle of a special brace list opener. Then, please byte-compile cc-engine.el, and replace the current cc-engine.elc with the one you've just built. This should fix the bug. (If you want any help with applying the patch or byte compiling, feel free to send me personal email.) > Thank you for your time. Again, thank you for the report. > In GNU Emacs 26.3 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.10) > of 2019-08-29 built on juergen > Windowing system distributor 'The X.Org Foundation', version 11.0.12007000 [ .... ] -- Alan Mackenzie (Nuremberg, Germany).