[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
electric-indent-mode: abolition of `newline' function is not the Right T
From: |
Alan Mackenzie |
Subject: |
electric-indent-mode: abolition of `newline' function is not the Right Thing. |
Date: |
Sun, 13 Oct 2013 10:13:25 +0000 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
Hi, Emacs.
`electric-indent-post-self-insert-function' effectively redefines
`newline' to `newline-and-indent'. So, whilst `electric-indent-mode' is
enabled, there is no easy way to invoke the traditional functionality of
`newline'. This is a Bad Thing.
I discovered this whilst trying `electric-indent-mode' in Text Mode.
I have a command which starts a new paragraph thusly:
(i) It calls `newline' and inserts, e.g. "(vi) ".
(ii) It calls `fill-paragraph' for the text in the new paragraph.
Unfortunately, `newline' indents the "(vi) " to the level of the
old paragraph, so that the following `fill-paragraph' joins the old and
new paragraphs together. This is bad.
`newline-and-indent' exists as its own command, traditionally bound to
C-j. A better way for `electric-indent-mode' to achieve the effect it
wants is to get users to rebind <CR> to `newline-and-indent' or suggest
the use of C-j.
`newline' must continue to exist, both as a command and as a lisp
function.
--
Alan Mackenzie (Nuremberg, Germany).
- electric-indent-mode: abolition of `newline' function is not the Right Thing.,
Alan Mackenzie <=
- Re: electric-indent-mode: abolition of `newline' function is not the Right Thing., Stefan Monnier, 2013/10/13
- Re: electric-indent-mode: abolition of `newline' function is not the Right Thing., Alan Mackenzie, 2013/10/13
- Re: electric-indent-mode: abolition of `newline' function is not the Right Thing., martin rudalics, 2013/10/15
- Re: electric-indent-mode: abolition of `newline' function is not the Right Thing., Alan Mackenzie, 2013/10/16
- Re: electric-indent-mode: abolition of `newline' function is not the Right Thing., Stefan Monnier, 2013/10/16
- Re: electric-indent-mode: abolition of `newline' function is not the Right Thing., Alan Mackenzie, 2013/10/16