unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* electric-indent-mode: abolition of `newline' function is not the Right Thing.
@ 2013-10-13 10:13 Alan Mackenzie
  2013-10-13 13:23 ` Stefan Monnier
  2013-10-13 20:00 ` electric-indent-mode: abolition of `newline' function is not the Right Thing Matthias Meulien
  0 siblings, 2 replies; 39+ messages in thread
From: Alan Mackenzie @ 2013-10-13 10:13 UTC (permalink / raw)
  To: emacs-devel

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



^ permalink raw reply	[flat|nested] 39+ messages in thread

end of thread, other threads:[~2013-10-21  2:38 UTC | newest]

Thread overview: 39+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-13 10:13 electric-indent-mode: abolition of `newline' function is not the Right Thing Alan Mackenzie
2013-10-13 13:23 ` Stefan Monnier
2013-10-13 14:09   ` Alan Mackenzie
2013-10-13 16:22     ` Stefan Monnier
2013-10-13 17:28       ` Alan Mackenzie
2013-10-14 12:56         ` Stefan Monnier
2013-10-16 18:46           ` Alan Mackenzie
2013-10-15 18:28         ` martin rudalics
2013-10-16 17:12           ` Alan Mackenzie
2013-10-16 17:59             ` Stefan Monnier
2013-10-16 18:58               ` Alan Mackenzie
2013-10-16 20:55                 ` chad
2013-10-16 21:07                   ` Daniel Colascione
2013-10-18 16:51                   ` Alan Mackenzie
2013-10-16 23:22               ` Stephen J. Turnbull
2013-10-16 18:34             ` martin rudalics
2013-10-16 19:26               ` Default behaviour of RET Alan Mackenzie
2013-10-16 19:47                 ` Eli Zaretskii
2013-10-16 23:17                 ` Stephen J. Turnbull
2013-10-17  0:47                   ` Stefan Monnier
2013-10-18 17:03                     ` Alan Mackenzie
2013-10-18 19:52                       ` Stefan Monnier
2013-10-18 20:45                         ` Alan Mackenzie
2013-10-19  1:59                           ` Stefan Monnier
2013-10-19 10:58                             ` Alan Mackenzie
2013-10-19 15:07                               ` Drew Adams
2013-10-20 14:55                                 ` Alan Mackenzie
2013-10-20 22:26                                   ` Richard Stallman
2013-10-21  2:38                                     ` Eli Zaretskii
2013-10-19 22:20                               ` Stefan Monnier
2013-10-20 15:00                                 ` Alan Mackenzie
2013-10-18 16:57                   ` Alan Mackenzie
2013-10-13 20:00 ` electric-indent-mode: abolition of `newline' function is not the Right Thing Matthias Meulien
2013-10-14 13:21   ` Stefan Monnier
2013-10-14 13:31     ` Matthias Meulien
2013-10-14 16:46       ` Stefan Monnier
2013-10-15 15:54         ` Davis Herring
2013-10-15 20:03         ` Matthias Meulien
2013-10-16  2:44           ` Stefan Monnier

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).