GNU bug report logs - #16763
24.3.50; electric-indent annoyance: C-j doesn't indent

Previous Next

Package: emacs;

Reported by: "T. V. Raman" <tv.raman.tv <at> gmail.com>

Date: Sat, 15 Feb 2014 16:09:02 UTC

Severity: normal

Tags: notabug

Merged with 19272

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


View this message in rfc822 format

From: Alan Mackenzie <acm <at> muc.de>
To: gnu-emacs-bug <at> moderators.isc.org
Subject: bug#16763: 24.3.50; electric-indent annoyance: C-j doesn't indent
Date: Sat, 15 Feb 2014 22:18:57 +0000 (UTC)
Hi, Drew.

Drew Adams <drew.adams <at> oracle.com> wrote:
>> This has been bothering me for a while when writing lisp code --
>> started happening roughly a few months ago.

> Yup.

>> I always hit C-j for newline, and a couple of months ago, this
>> stopped indenting -- by default C-j runs control j  runs the
>> command electric-indent-just-newline when electric-indent-mode
>> is on.
>> 
>> The documentation for electric-mode indicates that indentation
>> will be invoked when you type any of the chars in
>> electric-indent-chars  -- and that variable is set to a list
>> containing ?\n which is  ascii 10; yet, C-j invokes a command
>> that explicitly only inserts a newline? (feeling very confused)

> It is not yet reflected in NEWS or the manuals, but `C-j' and
> `RET' have been effectively swapped: `RET' now indents and `C-j'
> does not indent.

No, it's a lot worse than that.  What you say only applies when
electric-indent-mode is active (which is currently is, by default).

If you enable e-i-mode in a single buffer using
electric-indent-local-mode, then that binding reversal will apply in all
buffers.  (That's assuming that function works, which I strongly suspect
isn't the case.)  If you then disable e-i-m, whether the bindings stay
swapped depends on how you do the disabling.

If you advise `newline-and-indent', the results will be unexpected and
suboptimal when e-i-mode is enabled.

> The new behavior was apparently adopted to make Emacs correspond
> better with what newbie users expect, based on their experience
> with other editors and IDEs.

Sort of.  I suspect the newbie users who don't like e-i-mode would also
like to have these bindings reversed.  Or maybe not.  Who can say?

> You are not alone in "feeling very confused".  Hopefully, the
> NEWS entry covering this, and perhaps the manuals, will explain
> the best and simplest way to restore the previous, longstanding
> behavior for those who might prefer it.  Otherwise, you can
> just retrain your fingers. ;-)

I'm not confused about this issue.  Just very, very unhappy.

-- 
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.