all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alan Mackenzie <acm@muc.de>
To: emacs-devel@gnu.org
Subject: Swapping of C-j and RET bindings is dependent on electric-indent-mode; it shouldn't be.
Date: Sun, 9 Feb 2014 16:35:58 +0000	[thread overview]
Message-ID: <20140209163558.GB3593@acm.acm> (raw)

Hello, Emacs.

In the recent past, a consensus was reached that for programming modes,
C-j should be bound to `newline' and RET to `newline-and-indent'.

The current implementation of "this" works by changing traditional
bindings in `global-map' when electric-indent-mode is enabled, and
changing them back again when e-i-m is disabled.  Apologies if I've
misunderstood the source code.  This code is in electric-indent-mode
itself, in electric.el.

Thus the bindings of C-j and RET appear to swap each time e-i-m is
{en,dis}abled.  This is surely not the Right Thing.

A better way would be to put the new bindings for C-j and RET into
prog-mode-map and any necessary individual modes which, e.g., don't
derive from prog-mode.

These binding changes are also made _globally_ when
electric-indent-local-mode is enabled for a buffer.  They are not
restored again when that mode is disabled for the buffer.  This is
confusing and suboptimal.

-- 
Alan Mackenzie (Nuremberg, Germany).



                 reply	other threads:[~2014-02-09 16:35 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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

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

  git send-email \
    --in-reply-to=20140209163558.GB3593@acm.acm \
    --to=acm@muc.de \
    --cc=emacs-devel@gnu.org \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.