GNU bug report logs - #19272
25.0.50; electric-indent-mode: Appears to do the opposite

Previous Next

Package: emacs;

Reported by: raman <raman <at> google.com>

Date: Thu, 4 Dec 2014 17:36:02 UTC

Severity: normal

Tags: notabug

Merged with 16763

Found in versions 24.3.50, 25.0.50

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #11 received at 19272 <at> debbugs.gnu.org (full text, mbox):

From: raman <at> google.com (T.V Raman)
To: acm <at> muc.de
Cc: 19272 <at> debbugs.gnu.org, raman <at> google.com
Subject: Re: bug#19272: 25.0.50; electric-indent-mode: Appears to do the
 opposite
Date: Thu, 4 Dec 2014 14:54:44 -0800
Thanks for the explanation -- this is super helpful.

One suggestion:  couldn't we just have both C-j and RET   do newline-and-then-indent?

Alan Mackenzie writes:
 > In article <mailman.15269.1417714586.1147.bug-gnu-emacs <at> gnu.org> you wrote:
 > 
 > > In both Emacs 24.4 -- as well as Emacs 25 built from head:
 > 
 > > In lisp buffers electric-indent-mode is on by default.
 > 
 > electric-indent-mode is now enabled everywhere, by default.
 > 
 > > But if it is on, then hitting C-j does not indent -- it ends up leaving
 > > point on the first column in the newly inserted line.
 > 
 > This is deliberate - the swapping of the actions of C-j and RET.  Most
 > people on the developers' mailing list agreed it was time to do this, for
 > the benefit of new users who expect auto indentation of the new line, but
 > who aren't used to typing C-j for it.
 > 
 > However, this change in key actions has been conflated with
 > electric-indent-mode.  En/dis-able that minor mode, and the action of your
 > keys is swapped.
 > 
 > > I do have 10 in the list electric-indent-chars.
 > 
 > 10 is <LF>, aka C-j.  When you type a character which is in
 > electric-indent-chars, that causes electric indentation of the current
 > line (not the new one you may create).  I think that 10 causes
 > indentation of that line regardless of whether you type C-j or RET.
 > 
 > > Even stranger, turning off electric-indent-mode results in the behavior
 > > I want, ie C-j inserts a newline then inserts.
 > 
 > This is indeed strange, but is deliberate.  The two behaviours
 > (electric-indent-mode and the transpositions of the key actions) were
 > linked together "for simplicity".  If you want to have
 > electric-indent-mode enabled at the same time as having C-j and RET
 > behave traditionally, you're going to have to swap the key bindings or
 > start hacking the Emacs lisp code.
 > 
 > This situation is a big part of why I personally haven't upgraded to
 > Emacs 24.4.
 > 
 > > In GNU Emacs 25.0.50.1 (x86_64-unknown-linux-gnu, X toolkit, Xaw scroll bars)
 > > of 2014-12-02 on raman-glaptop
 > > Repository revision: cb2257edc4a4b74ce9b566edc2d15a54e1ce2f22
 > > System Description:     Ubuntu 14.04 LTS
 > 
 > -- 
 > Alan Mackenzie (Nuremberg, Germany).




This bug report was last modified 9 years and 113 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.