Subject: bug#17128: 24.3.50; `newline-and-indent' should not indent the current line

From: Dmitry Gutov <[email-masked]>
Date: Tue, 01 Apr 2014 08:37:44 +0300

On 28.03.2014 16:17, Stefan Monnier wrote:
>> There's `reindent-then-newline-and-indent' for that.
>
> Agreed.

Hmm, I'm not sure about the patch, though.

If `newline-and-indent' shouldn't reindent the current line [even when 
electric-indent-mode is enabled] because there's 
`reindent-then-newline-and-indent', then `newline' likewise probably 
shouldn't (re)indent either of the lines because of the existence of the 
former two functions.

In that case, my suggestion to separate the electric indent on RET from 
indenting after newline wouldn't exactly work.

Could we define new commands in electric-mode, and bind them when it's on?

Something like `electric-maybe-indent-then-newline' and 
`electric-maybe-reindent-then-newline-and-indent'.