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, 27 Oct 2019 15:39:56 +0000	[thread overview]
Message-ID: <20191027153956.GB27906@ACM> (raw)
In-Reply-To: <CANJXwL=WHfvFSAHxxNQ=92_R193gFPU7Hu7zwXCCEO3Z0Nyn3A@mail.gmail.com>

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





       reply	other threads:[~2019-10-27 15:39 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 ` Alan Mackenzie [this message]
2019-11-10 10:48   ` 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 17:47     ` Eric Scrivner
2019-11-10 17:50       ` Eric Scrivner
2019-11-10 19:02       ` Alan Mackenzie
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=20191027153956.GB27906@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).