unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Alan Mackenzie <acm@muc.de>
To: Eric Scrivner <eric.t.scrivner@gmail.com>
Cc: 37910@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	[thread overview]
Message-ID: <20191110190254.GC6614@ACM> (raw)
In-Reply-To: <CANJXwLnYXJ1+G56rTvJ5KsrRLOQpxRvOtqD-HHhg_R47a9CrNA@mail.gmail.com>

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).





  parent reply	other threads:[~2019-11-10 19:02 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CANJXwL=WHfvFSAHxxNQ=92_R193gFPU7Hu7zwXCCEO3Z0Nyn3A@mail.gmail.com>
2019-10-27 15:39 ` bug#37910: CC Mode 5.33.2 (C++//l); CC-mode inconsistently indents everything as topmost-intro after a while Alan Mackenzie
2019-11-10 10:48   ` Alan Mackenzie
2019-11-10 17:47     ` Eric Scrivner
2019-11-10 17:50       ` Eric Scrivner
2019-11-10 19:02       ` Alan Mackenzie [this message]
2019-11-13 18:38       ` Alan Mackenzie
2019-11-14  0:12         ` Eric Scrivner
2019-11-14 20:11           ` bug#5490: " Alan Mackenzie
2019-11-15  3:11             ` bug#18072: " Stefan Kangas
2020-08-12 18:50             ` Stefan Kangas
2020-08-13 18:35               ` Alan Mackenzie
2020-08-13 19:50                 ` Stefan Kangas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191110190254.GC6614@ACM \
    --to=acm@muc.de \
    --cc=37910@debbugs.gnu.org \
    --cc=eric.t.scrivner@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).