18
votes

I'm running Emacs 24 on Ubuntu 10.04, coding c++ in the default c++ environment. Periodically after a while coding, my indentation engine seems to break -- pressing "tab" to indent places places any line at the beginning of the line. Selecting the entire buffer result in the entire buffer being un-indented. This problem effects all buffers, current or later opened. So far the only way I have found to repair it is the (highly inconvenient) step of restarting emacs. Is there another way to reboot my indentation engine? Attempting to load different indentation styles does not fix the problem.

4
I have noticed this happens when I #include specific headers (particularly template-heavy headers; commenting out the offending #include or restarting Emacs seems to fix the issue). I'm leaving this comment here to help people try to isolate this issue so it can be properly fixed, as Emacs 24.3 still has issues. If I find something conclusive I'll update.Cornstalks
Always not fixed ? Its really annoying...ArthurLambert

4 Answers

4
votes

Have you read this thread?

http://lists.gnu.org/archive/html/help-gnu-emacs/2012-09/msg00216.html

It sounds like you can fix your problem by updating cc-mode.

3
votes

I see the same with 24.3 but I found that closing and re-opening the affected buffer also solves the issue.

2
votes

This is a recurring issue on my system (Emacs 24.3 x86_64 Red Hat Linux) and could possibly be a bug introduced in Emacs 24 judging from the link posted by event_jr. I encounter the issue fairly often and usually resolve it by reloading whatever buffer I'm working in:

M-x revert-buffer RET yes RET

This way you don't have to close neither buffer nor Emacs.

0
votes

I found unbalanced preprocessor directives (#ifdef etc) can throw it into this sort of behaviour