Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Emacs version 24.4: New obnoxious loss of indentation on hitting RETURN

Starting with Emacs 24.4, when I type a line beginning with white space (a typical way to denote a new paragraph) and at the end of it I hit RETURN, the white space disappears. This problem appears also with 'emacs -Q'. My .emacs file uses a rather plain text-mode paragraphing scheme, namely,

(setq default-major-mode 'text-mode)
(add-hook 'text-mode-hook 'paragraph-indent-minor-mode)

which has been working without problems for a dozen years. The bug appeared when I installed the current (24.4) version.

Basically, I type:

   This is a line beginning with four spaces

and as soon as I type RETURN my line immediately becomes

This is a line beginning with four spaces

That is, the indentation vanishes. I'd much appreciate some advice. Should I post a bug?

like image 387
user13049 Avatar asked Dec 31 '14 08:12

user13049


1 Answers

In Emacs 24.4, electric-indent-mode is enabled by default. It seems like that's what's causing this problem in combination with paragraph-indent-minor-mode. You can avoid that by turning off Electric Indent mode everywhere (M-x electric-indent-mode) or just in the local buffer (M-x electric-indent-local-mode).

like image 134
legoscia Avatar answered Oct 01 '22 01:10

legoscia