unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Alan Mackenzie <acm@muc.de>
To: raman <raman@google.com>
Cc: 19272@debbugs.gnu.org
Subject: bug#19272: 25.0.50; electric-indent-mode: Appears to do the opposite
Date: 4 Dec 2014 22:11:39 -0000	[thread overview]
Message-ID: <20141204221139.86993.qmail@mail.muc.de> (raw)
In-Reply-To: <mailman.15269.1417714586.1147.bug-gnu-emacs@gnu.org>

In article <mailman.15269.1417714586.1147.bug-gnu-emacs@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).






  parent reply	other threads:[~2014-12-04 22:11 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-04 17:34 bug#19272: 25.0.50; electric-indent-mode: Appears to do the opposite raman
     [not found] ` <mailman.15269.1417714586.1147.bug-gnu-emacs@gnu.org>
2014-12-04 22:11   ` Alan Mackenzie [this message]
2014-12-04 22:54     ` T.V Raman
2014-12-05 15:58       ` Alan Mackenzie
2014-12-05 17:44         ` T.V Raman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20141204221139.86993.qmail@mail.muc.de \
    --to=acm@muc.de \
    --cc=19272@debbugs.gnu.org \
    --cc=raman@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).