Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

c++ indentation gets messed up quite often

32 views
Skip to first unread message

su...@equityoms.com

unread,
Sep 19, 2012, 10:43:12 PM9/19/12
to
emacs : 24.1.1
GNU Emacs 24.1.1 (x86_64-redhat-linux-gnu, GTK+ Version 2.24.10) of 2012-07-13 on x86-04.phx2.fedoraproject.org

Fedora 17
C++ mode


The indentation gets quite messed up while in the middle of editing a file.
eg: The new code will get indented to the column 0.

Usually, in the past, this has meant that i had typed something syntactically incorrect. Now this is not the case.
Even the tab which is set to indent shifts the line to column 0.

If I restart emacs, i can then correctly indent the line and things are back to normal. Bug ?

Has anyone seen this behaviour in this recent versions of emacs ?

tia,

Sunil

Sohail Somani

unread,
Sep 19, 2012, 11:31:13 PM9/19/12
to help-gn...@gnu.org
On 19/09/2012 10:43 PM, su...@equityoms.com wrote:
> If I restart emacs, i can then correctly indent the line and things are back to normal. Bug ?
>
> Has anyone seen this behaviour in this recent versions of emacs ?

Yes, I see this on a regular basis. It's VERY annoying. I can't
reproduce it of course :-/

However, the easiest way to get it to fix itself is to revert the
buffer. You probably don't need to restart emacs, or at least I don't.


Tima

unread,
Sep 20, 2012, 12:34:12 AM9/20/12
to help-gn...@gnu.org
Yes, same here.

GNU Emacs 24.1.1 (x86_64-apple-darwin, NS apple-appkit-1038.36)

On Sep 19, 2012, at 8:31 PM, Sohail Somani wrote:

> On 19/09/2012 10:43 PM, su...@equityoms.com wrote:
>> If I restart emacs, i can then correctly indent the line and things are back to normal. Bug ?
>>
>> Has anyone seen this behaviour in this recent versions of emacs ?
>

Stefan Monnier

unread,
Sep 20, 2012, 9:48:40 AM9/20/12
to
> If I restart emacs, i can then correctly indent the line and things
> are back to normal. Bug ?

Yes, it's a bug. CC-mode's maintainer has fixed a few problems in that
area since 24.1, so 24.2 might work better for you, but there has been
further fixes since, so you might want to try a recent snapshot of the
Emacs trunk. Also, those problems are difficult to track down and fix
because they're usually difficult to reproduce, but there are some flags
you can set that make CC-mode do extra work to double-check what it does
so that any problem is caught early and results in useful
debug information.

IOW, please try the Emacs trunk and if you still bump into such
problems, use M-x report-emacs-bug.


Stefan

Stefan Monnier

unread,
Sep 20, 2012, 9:58:13 AM9/20/12
to
> The indentation gets quite messed up while in the middle of editing a file.
> eg: The new code will get indented to the column 0.

If you can reproduce this more or less easily, please try and
(setq c-debug-parse-state t). You have to do this before loading
c-mode, so either do it in your .emacs, or do
M-x load-library RET cc-engine RET afterwards for it to take effect.

This should hopefully catch the problem right when it shows up and log
some debug info in your *Messages* buffer, which you can then send via
M-x report-emacs-bug.


Stefan

Sohail Somani

unread,
Sep 20, 2012, 11:01:57 AM9/20/12
to help-gn...@gnu.org
Thank you Stefan! I'm going to try this today.


Lowell Gilbert

unread,
Sep 20, 2012, 12:21:12 PM9/20/12
to
24.2 isn't any better on this (for me) than 24.1. Unfortunately, it only
recurs on the order of dozens of hours, so I haven't been able to do
much in the way of diagnostics on it.

- Lowell
0 new messages