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#18072: 24.3; cc-mode indentation is broken Date: 2 Nov 2019 12:23:05 -0000 Organization: muc.de e.V. Message-ID: <20191102122305.50439.qmail@mail.muc.de> References: <53CD68CE.40805@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="160465"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: tin/2.4.2-20171224 ("Lochhead") (UNIX) (FreeBSD/11.3-RELEASE-p3 (amd64)) Cc: 18072@debbugs.gnu.org, Juhani =?UTF-8?Q?=C3=85hman?= To: Stefan Kangas Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Nov 02 13:24:13 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 1iQsRw-000fbZ-GO for geb-bug-gnu-emacs@m.gmane.org; Sat, 02 Nov 2019 13:24:12 +0100 Original-Received: from localhost ([::1]:47232 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iQsRv-0004te-BY for geb-bug-gnu-emacs@m.gmane.org; Sat, 02 Nov 2019 08:24:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58488) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iQsRp-0004tW-Ca for bug-gnu-emacs@gnu.org; Sat, 02 Nov 2019 08:24:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iQsRo-0003F5-9N for bug-gnu-emacs@gnu.org; Sat, 02 Nov 2019 08:24:05 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:49479) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iQsRm-00038Z-3C; Sat, 02 Nov 2019 08:24:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iQsRl-0001OJ-T9; Sat, 02 Nov 2019 08:24:01 -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: Sat, 02 Nov 2019 12:24:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 18072 X-GNU-PR-Package: emacs,cc-mode Original-Received: via spool by 18072-submit@debbugs.gnu.org id=B18072.15726973895275 (code B ref 18072); Sat, 02 Nov 2019 12:24:01 +0000 Original-Received: (at 18072) by debbugs.gnu.org; 2 Nov 2019 12:23:09 +0000 Original-Received: from localhost ([127.0.0.1]:58300 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iQsQu-0001N1-9x for submit@debbugs.gnu.org; Sat, 02 Nov 2019 08:23:08 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:43720 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1iQsQs-0001Mr-TG for 18072@debbugs.gnu.org; Sat, 02 Nov 2019 08:23:07 -0400 Original-Received: (qmail 50440 invoked by uid 3782); 2 Nov 2019 12:23:05 -0000 In-Reply-To: X-Newsgroups: gnu.emacs.bug 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:170792 Archived-At: Hello, Stefan and Juhani. In article you wrote= : > Juhani =C3=85hman writes: >> I can't reliably reproduce the bug.=20 >> All I can say that the auto-indentation thingymajig in cc-mode stops w= orking at=20 >> random every 5-15 minutes or so.=20 >> I can get it working again by reloading the file I am editing.=20 >> When the indentation is broken, pressing enter will leave no indentati= on=20 >> space for braces and such.=20 >> >> it looks like this=20 >> >> if(1) {=20 >> foo();=20 >> bar();=20 >> zot();=20 >> }=20 >> >> when it should look like this=20 >> >> if(1) {=20 >> foo();=20 >> bar();=20 >> zot();=20 >> }=20 >> >> I'm pretty sure the indentation was working in some previous version,=20 >> about two years ago or so, but not in any of the newer versions of Ema= cs. Is this C++ Mode, by any chance? > I'm not seeing this here. Can you reproduce this when running under > "emacs -Q"? This looks like having the same cause as bug #37910 "CC Mode 5.33.2 (C++//l); CC-mode inconsistently indents everything as topmost-intro after a while". I'm pretty sure it's a defect in a particular CC Mode cache (the "state cache"), which tracks parentheses, braces, and brackets containing and near point. Somehow, it's missing the critical {, believing that foo();, etc., are at top level. A C-c C-s on that line would likely show "topmost-intro". > Best regards, > Stefan Kangas --=20 Alan Mackenzie (Nuremberg, Germany).