[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Default behaviour of RET.
From: |
Josh |
Subject: |
Re: Default behaviour of RET. |
Date: |
Tue, 22 Oct 2013 21:36:21 -0700 |
On Tue, Oct 22, 2013 at 7:02 AM, Stefan Monnier
<address@hidden> wrote:
>> If the default binding of RET changes, please do make sure that there
>> is a simple and easily accessible way of toggling this, to enable
>> correct pasting of multi-line text in tty versions of Emacs.
>
> Indeed, very good point.
> So we have the following issues if we want to enable electric-indent-mode:
> - C-j's default binding becomes useless.
> - need for a new tty-paste command.
I'm not sure that follows. In visual-line-mode, the problem of how
to specialize functions' interactive behavior while leaving their
programmatic behavior unchanged is solved thusly:
(defvar visual-line-mode-map
(let ((map (make-sparse-keymap)))
(define-key map [remap kill-line] 'kill-visual-line)
(define-key map [remap move-beginning-of-line] 'beginning-of-visual-line)
...
map))
Is there some reason why electric-mode could not employ a similar
approach using a new electric-mode-map, for example by removing ?\n
from electric-indent-chars and remapping newline to
newline-and-indent? Alternatively, electric-mode could abandon use
of post-self-insert-hook entirely, instead remapping
self-insert-command to a new self-insert-and-reindent-command that
would first perform the insertion as usual and then reindent iff
electric-indent-chars contained the inserted character. Both of these
approaches would perform electric reindentation after interactive
newline insertion while leaving the newline function's programmatic
behavior unchanged. If electric-mode were enabled by default for
programming modes, both of these approaches would also result in
the "modern" reindentation behavior advocated by many here without
the necessity of any changes to default key bindings.
Josh
- Re: Default behaviour of RET., (continued)
- Re: Default behaviour of RET., chad, 2013/10/21
- Re: Default behaviour of RET., Daniel Colascione, 2013/10/21
- RE: Default behaviour of RET., Drew Adams, 2013/10/21
- Re: Default behaviour of RET., Lars Brinkhoff, 2013/10/22
- Re: Default behaviour of RET., Alan Mackenzie, 2013/10/23
- Re: Default behaviour of RET., Davis Herring, 2013/10/21
- RE: Default behaviour of RET., Drew Adams, 2013/10/21
- Re: Default behaviour of RET., Jorgen Schaefer, 2013/10/21
- Re: Default behaviour of RET., Stefan Monnier, 2013/10/22
- Re: Default behaviour of RET., Richard Stallman, 2013/10/22
- Re: Default behaviour of RET.,
Josh <=
- Re: Default behaviour of RET., Stefan Monnier, 2013/10/23
- Re: Default behaviour of RET., Josh, 2013/10/23
- Re: Default behaviour of RET., Stefan Monnier, 2013/10/24
- RE: Default behaviour of RET., Drew Adams, 2013/10/21
- Re: Default behaviour of RET., Jarek Czekalski, 2013/10/22
- Re: Default behaviour of RET., Rustom Mody, 2013/10/22
- Re: Default behaviour of RET., Alan Mackenzie, 2013/10/23
- Re: Default behaviour of RET., Stephen J. Turnbull, 2013/10/23
- Re: Default behaviour of RET., Dmitry Gutov, 2013/10/23
- Re: Default behaviour of RET., Xue Fuqiao, 2013/10/21