Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

emacs 24 c++ auto-indentation broken

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.

like image 947
WorldsEndless Avatar asked Oct 24 '12 15:10

WorldsEndless


3 Answers

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.

like image 65
event_jr Avatar answered Nov 20 '22 05:11

event_jr


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

like image 21
choeger Avatar answered Nov 20 '22 05:11

choeger


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.

like image 2
Caterpillar Avatar answered Nov 20 '22 05:11

Caterpillar