[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Swapping of C-j and RET bindings is dependent on electric-indent-mode; i
From: |
Alan Mackenzie |
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 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
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).
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Swapping of C-j and RET bindings is dependent on electric-indent-mode; it shouldn't be.,
Alan Mackenzie <=