Before Emacs 24.4, indentation in c-mode
happened after typing things like ;
, ,
and so on and I like this behavior.
But in Emacs 24.4, c-mode
also indents on RET. This causes a lot of problems for me because if I want to insert a blank line, I need to press RET and then delete any spaces or tabs that electric-
inserts.
So I would like to disable indent on RET, but keep all other electric-indent functionality, like indent on ;
.
How can I achieve this?
I tried calling (electric-indent-local-mode -1)
in c-mode
hooks,
but this disabled not only indent on RET, but also indent on ;
, ,
and so on.
electric-indent-mode
is now enabled by default;RET
now inserts a newline and indents, whileC-j
inserts a newline but does not indent (basically swapping the functionality ofRET
andC-j
from previous versions).