GNU bug report logs -
#18072
24.3; cc-mode indentation is broken
Previous Next
Reported by: Juhani Åhman <juhanipm <at> gmail.com>
Date: Mon, 21 Jul 2014 20:52:03 UTC
Severity: normal
Found in version 24.3
Done: Stefan Kangas <stefan <at> marxist.se>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
Hello, Stefan and Juhani.
In article <mailman.384.1572692163.13325.bug-gnu-emacs <at> gnu.org> you wrote:
> Juhani Åhman <juhanipm <at> 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).
This bug report was last modified 4 years and 281 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.