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, 27 Oct 2019 15:39:56 +0000 Message-ID: <20191027153956.GB27906@ACM> References: 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="100504"; 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 Oct 27 16:41:15 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 1iOkfK-000Pyy-Fh for geb-bug-gnu-emacs@m.gmane.org; Sun, 27 Oct 2019 16:41:14 +0100 Original-Received: from localhost ([::1]:45720 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iOkfI-0007t8-Q0 for geb-bug-gnu-emacs@m.gmane.org; Sun, 27 Oct 2019 11:41:12 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42580) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iOkfB-0007t1-9m for bug-gnu-emacs@gnu.org; Sun, 27 Oct 2019 11:41:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iOkfA-0002cu-79 for bug-gnu-emacs@gnu.org; Sun, 27 Oct 2019 11:41:05 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:34593) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iOkf8-0002cG-Hi; Sun, 27 Oct 2019 11:41:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iOkf8-0002zj-AD; Sun, 27 Oct 2019 11:41:02 -0400 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, 27 Oct 2019 15:41: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.157219080211416 (code B ref 37910); Sun, 27 Oct 2019 15:41:02 +0000 Original-Received: (at 37910) by debbugs.gnu.org; 27 Oct 2019 15:40:02 +0000 Original-Received: from localhost ([127.0.0.1]:43414 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iOke9-0002xq-Md for submit@debbugs.gnu.org; Sun, 27 Oct 2019 11:40:02 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:29311 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1iOke7-0002xT-TT for 37910@debbugs.gnu.org; Sun, 27 Oct 2019 11:40:00 -0400 Original-Received: (qmail 85208 invoked by uid 3782); 27 Oct 2019 15:39:57 -0000 Original-Received: from acm.muc.de (p2E5D5E17.dip0.t-ipconnect.de [46.93.94.23]) by colin.muc.de (tmda-ofmipd) with ESMTP; Sun, 27 Oct 2019 16:39:56 +0100 Original-Received: (qmail 29826 invoked by uid 1000); 27 Oct 2019 15:39:56 -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:170254 Archived-At: Hello, Eric. On Thu, Oct 24, 2019 at 12:06:18 -0700, Eric Scrivner wrote: > This seems related to (if not the same as) bug #5490. > - This happens randomly and then randomly stops happening (cache expiry > maybe?) > - M-x revert-buffer does not fix. Thanks for taking the trouble to report this bug, and thanks even more for including so much information. > Here's a snippet from the buffer at the time this happen, as you can see > there seems to be a region until the end where everything becomes > topmost-intro: > } // ((block-close 18328)) > // ((statement 9560)) > SDL_DestroyWindow(Window); // ((statement 9560)) > } // ((block-close 9490)) > else // ((else-clause 9466)) > { // > ((substatement-open 18464)) > PlatformLog("Failed to create window: %s", SDL_GetError()); // > ((statement-block-intro 18473)) > } // ((block-close 18473)) > // ((topmost-intro 18576)) > // ((topmost-intro 18576)) > SDL_Quit(); // ((topmost-intro 18541)) > } // ((topmost-intro 18548)) > else // ((else-clause 9188)) > { // ((substatement-open 18845)) > PlatformLog("Failed to initialize SDL: %s", SDL_GetError()); // > ((statement-block-intro 18901))((statement-block-intro 18724)) > } // > ((block-close 18901)) > // ((topmost-intro 19093)) > return EXIT_SUCCESS; // ((topmost-intro 19093)) > } // ((topmost-intro 19242)) At the moment, all I can do is acknowledge receipt of your report. It's obviously not an easy bug to diagnose. I can see two ways of making progress: (i) Inspecting c-guess-basic-syntax, the function which analyses code and produces (amongs other things) all these topmost-intro's. It is essentially a large cond form (Lisp's equivalent of a switch), and the single place which produces topmost-intro comes fairly early on in this cond form; (ii) Determine what aspects of a buffer do not get reinitialised after evaluating M-x revert-buffer. That could provide some clue. [ CC Mode config dump acknowledged with thanks, but snipped ] Just one thing. If you haven't already done so, could you make a backup copy of a buffer which triggers the bug, just in case after some future edit it no longer does so. Thanks! -- Alan Mackenzie (Nuremberg, Germany).