unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Alan Mackenzie <acm@muc.de>
To: Stefan Kangas <stefan@marxist.se>
Cc: 18072@debbugs.gnu.org, "Juhani Åhman" <juhanipm@gmail.com>
Subject: bug#18072: 24.3; cc-mode indentation is broken
Date: 2 Nov 2019 12:23:05 -0000	[thread overview]
Message-ID: <20191102122305.50439.qmail@mail.muc.de> (raw)
In-Reply-To: <mailman.384.1572692163.13325.bug-gnu-emacs@gnu.org>

Hello, Stefan and Juhani.

In article <mailman.384.1572692163.13325.bug-gnu-emacs@gnu.org> you wrote:
> Juhani Åhman <juhanipm@gmail.com> writes:

>> I can't reliably reproduce the bug. 
>> All I can say that the auto-indentation thingymajig in cc-mode stops working at 
>> random every 5-15 minutes or so. 
>> I can get it working again by reloading the file I am editing. 
>> When the indentation is broken, pressing enter will leave no indentation 
>> space for braces and such. 
>>
>> it looks like this 
>>
>> if(1) { 
>> foo(); 
>> bar(); 
>> zot(); 
>> } 
>>
>> when it should look like this 
>>
>> if(1) { 
>>     foo(); 
>>     bar(); 
>>     zot(); 
>> } 
>>
>> I'm pretty sure the indentation was working in some previous version, 
>> about two years ago or so, but not in any of the newer versions of Emacs.

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

-- 
Alan Mackenzie (Nuremberg, Germany).






  parent reply	other threads:[~2019-11-02 12:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-21 19:23 bug#18072: 24.3; cc-mode indentation is broken Juhani Åhman
2019-11-02 10:52 ` Stefan Kangas
     [not found] ` <mailman.384.1572692163.13325.bug-gnu-emacs@gnu.org>
2019-11-02 12:23   ` Alan Mackenzie [this message]
2019-11-10 21:13     ` Stefan Kangas
2019-11-10 21:24       ` Juhani Ahman
2019-11-11 20:43       ` Alan Mackenzie

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=20191102122305.50439.qmail@mail.muc.de \
    --to=acm@muc.de \
    --cc=18072@debbugs.gnu.org \
    --cc=juhanipm@gmail.com \
    --cc=stefan@marxist.se \
    /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).