GNU bug report logs - #37910
CC Mode 5.33.2 (C++//l); CC-mode inconsistently indents everything as topmost-intro after a while

Previous Next

Packages: emacs, cc-mode;

Reported by: Eric Scrivner <eric.t.scrivner <at> gmail.com>

Date: Thu, 24 Oct 2019 19:49:02 UTC

Severity: normal

Done: Alan Mackenzie <acm <at> muc.de>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Alan Mackenzie <acm <at> muc.de>
To: Eric Scrivner <eric.t.scrivner <at> gmail.com>
Cc: 37910 <at> debbugs.gnu.org
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
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).




This bug report was last modified 5 years and 186 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.