From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#37910: CC Mode 5.33.2 (C++//l); CC-mode inconsistently indents everything as topmost-intro after a while Date: Sun, 10 Nov 2019 19:02:54 +0000 Message-ID: <20191110190254.GC6614@ACM> References: <20191027153956.GB27906@ACM> <20191110104811.GA6614@ACM> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="204803"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mutt/1.10.1 (2018-07-13) Cc: 37910@debbugs.gnu.org To: Eric Scrivner Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Nov 10 20:04:21 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iTsVW-000r7p-Ka for geb-bug-gnu-emacs@m.gmane.org; Sun, 10 Nov 2019 20:04:18 +0100 Original-Received: from localhost ([::1]:44686 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iTsVV-0000aL-9O for geb-bug-gnu-emacs@m.gmane.org; Sun, 10 Nov 2019 14:04:17 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34995) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iTsVJ-0000WO-4v for bug-gnu-emacs@gnu.org; Sun, 10 Nov 2019 14:04:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iTsVH-0003FC-FC for bug-gnu-emacs@gnu.org; Sun, 10 Nov 2019 14:04:05 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:43714) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iTsVG-0003Er-Qz; Sun, 10 Nov 2019 14:04:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iTsVG-0000fl-Hc; Sun, 10 Nov 2019 14:04:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Sun, 10 Nov 2019 19:04:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 37910 X-GNU-PR-Package: emacs,cc-mode Original-Received: via spool by 37910-submit@debbugs.gnu.org id=B37910.15734125832517 (code B ref 37910); Sun, 10 Nov 2019 19:04:02 +0000 Original-Received: (at 37910) by debbugs.gnu.org; 10 Nov 2019 19:03:03 +0000 Original-Received: from localhost ([127.0.0.1]:52535 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iTsUJ-0000eX-08 for submit@debbugs.gnu.org; Sun, 10 Nov 2019 14:03:03 -0500 Original-Received: from colin.muc.de ([193.149.48.1]:25776 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1iTsUG-0000e6-Cy for 37910@debbugs.gnu.org; Sun, 10 Nov 2019 14:03:01 -0500 Original-Received: (qmail 31141 invoked by uid 3782); 10 Nov 2019 19:02:58 -0000 Original-Received: from acm.muc.de (p2E5D5FC7.dip0.t-ipconnect.de [46.93.95.199]) by colin.muc.de (tmda-ofmipd) with ESMTP; Sun, 10 Nov 2019 20:02:57 +0100 Original-Received: (qmail 10755 invoked by uid 1000); 10 Nov 2019 19:02:54 -0000 Content-Disposition: inline In-Reply-To: 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:171387 Archived-At: Hello, Eric. On Sun, Nov 10, 2019 at 09:47:35 -0800, Eric Scrivner wrote: > I've applied the patch and run emacs with it. Unfortunately, it doesn't > seem to solve the issue. That's a pity. But I think I will commit that patch anyway, since it is an accident waiting to happen if I don't. > On the bright side, I believe I had buffers which can reliably > reproduce the issue (at least locally). THAT'S ABSOLUTELY BRILLIANT!!! :-) > I've copied one such file below. The issue can be reproduced by simply > going to the end of `main` and attempting to indent the `SQL_Quit()` > statement. At first it attempts to overindent the line as > `statement-cont`, then if I go up and attempt to indent the > `PlatformLog` in the else statement then return to the SDL_Quit and > indent it, it has become `topmost-intro`. Apologies for the long > length of the file, but hopefully it can help with reproduction: No need for any apology whatsoever. I can indeed reproduce the bug. I was right, in that the bug is in the c-state-cache mechanism. As you mentioned in your other post, the bug is triggered by C++ raw strings. When I had a look at some CC Mode debugging output, it was apparent that some of the braces inside a raw string had been recorded as brace positions, which is clearly wrong. So this bug, which was up till recently unreproducible, is now just a matter of (tedious) debugging. That's a tremendous advance! If we were on the same continent, I'd ask you over for a drink! Have a great Sunday afternoon! [ .... ] -- Alan Mackenzie (Nuremberg, Germany).