all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Swapping of C-j and RET bindings is dependent on electric-indent-mode; it shouldn't be.
@ 2014-02-09 16:35 Alan Mackenzie
  0 siblings, 0 replies; only message in thread
From: Alan Mackenzie @ 2014-02-09 16:35 UTC (permalink / raw)
  To: emacs-devel

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



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2014-02-09 16:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-09 16:35 Swapping of C-j and RET bindings is dependent on electric-indent-mode; it shouldn't be Alan Mackenzie

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.