unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Juri Linkov <juri@linkov.net>, Stefan Monnier <monnier@iro.umontreal.ca>
Cc: Daniel Colascione <dancol@dancol.org>, emacs-devel@gnu.org
Subject: RE: Multi-line input
Date: Fri, 5 Dec 2014 19:20:09 -0800 (PST)	[thread overview]
Message-ID: <901a3a0c-f29d-4977-843b-5b303f8a6a3a@default> (raw)
In-Reply-To: <871todslvt.fsf@mail.linkov.net>

> The only downside of S-RET is that it's not available on a tty.
> But on a graphical display S-RET is a common key to insert a
> newline.

Nope.  As I mentioned in thread "Losing minibuffer input", Emacs
should not sacrifice `S-RET' to just inserting a newline char,
as some other, lesser programs do.

Emacs should reserve `S-RET' for behavior similar to Emacs
`RET' behavior.  And depending on the context that can mean
things like choosing a completion candidate.  Like `TAB',
`RET' does more in Emacs than it does in other programs.
As I said:

 Modifiers used with RET and TAB should be reserved for
 actions similar or analogous to what RET and TAB are used
 for without modifiers (as we have done with M-TAB, for
 instance).  In particular, in the minibuffer they should be
 reserved for actions similar to what RET and TAB do in the
 minibuffer.

Besides which, Emacs already has a perfectly good, canonical
way to insert a newline char: `C-j'.  Make `C-j' self-inserting
in more keymaps and you will not need to waste `S-RET' for that,
nor will you need a `C-q C-j' workaround.  You are making things
complicated for nothing.

>   *** `electric-indent-mode' is now enabled by default.
>   Typing RET reindents the current line and indents the new
>   line.  `C-j' inserts a newline but does not indent.
> 
> But e.g. in *scratch* typing `C-j' evaluates the last expression.
> S-RET could help here as well, after agreeing on its universal
> meaning of inserting a newline.

There is no such "universal meaning".  For Emacs use, this is
backward.  `C-j' in *scratch* should self-insert (newline char).
If anything should, it is `S-RET' that should have a special
behavior here, such as evaluating.

Are you going to be consistent, and swap `C-j' with `S-RET'
for specifying a newline char everywhere?  Will users who want
to search for a newline char now need to use `S-RET' during
Isearch? [*]  No?  So users will sometimes use `C-j' to insert
a newline, and sometimes use `S-RET'?  So much for "universal"
consistency.

What would be gained by that, besides a supposed consistency
with a few simplistic text-editing contexts?  Why not keep
Emacs consistent with itself instead - and with UNIX, GNU/Linux,...

Let newline (`C-j') be newline - across Emacs, by default.
Save `S-RET' for more complex behavior, just as we do (but
other, simpler edit contexts do not) for `RET' and `TAB'.


[*] Yes, FWIW, I would be in favor of having `C-j' self-insert
in Isearch also, instead of needing to use `C-q C-j'.  Just as
for a character such as `b' or `?', `C-j' would behave the same
within search and outside search: it would self-insert.  But
`C-q C-j' is anyway better than `S-RET' during search - it makes
clear that you are, well, inserting a `C-j' (newline) character.



      reply	other threads:[~2014-12-06  3:20 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-09 17:57 Losing minibuffer input Juri Linkov
2014-11-09 18:17 ` Óscar Fuentes
2014-11-09 18:33   ` Juri Linkov
2014-11-09 18:53     ` Drew Adams
2014-11-13 20:23       ` Juri Linkov
2014-11-14 11:16         ` Dmitry Gutov
2014-11-18 21:36           ` Juri Linkov
2014-11-20 22:38             ` Johan Bockgård
2014-11-20 23:58               ` Juri Linkov
2014-11-21  7:37               ` previous-line, next-line at the first, last lines of the buffer Ivan Shmakov
2014-11-21  8:49                 ` Eli Zaretskii
2014-11-21  9:12                   ` Ivan Shmakov
2014-11-30 13:31                     ` Stefan Monnier
2014-11-09 18:52   ` Losing minibuffer input Drew Adams
2014-11-09 18:52 ` Drew Adams
2014-11-13 21:14 ` Stefan Monnier
2014-11-18 21:40   ` Juri Linkov
2014-11-19  4:22     ` Drew Adams
2014-11-20 23:52       ` Juri Linkov
2014-11-21  0:24         ` Drew Adams
2014-11-20 16:35     ` Daniel Colascione
2014-11-20 23:55       ` Juri Linkov
2014-12-05  0:38       ` Multi-line input (was: Losing minibuffer input) Juri Linkov
2014-12-05  2:03         ` Multi-line input Stefan Monnier
2014-12-05 16:24           ` Yuri Khan
2014-12-05 18:45             ` Stefan Monnier
2014-12-05 22:43           ` Richard Stallman
     [not found]           ` <<E1Xx1bN-0007f9-Ut@fencepost.gnu.org>
2014-12-05 23:02             ` Drew Adams
2014-12-06 12:06               ` Richard Stallman
     [not found]             ` <<94e0230f-c396-4266-8ada-9816d8118946@default>
     [not found]               ` <<E1XxE8T-0002OE-U9@fencepost.gnu.org>
2014-12-06 16:44                 ` Drew Adams
2014-12-05 23:43           ` Juri Linkov
2014-12-06  3:20             ` Drew Adams [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=901a3a0c-f29d-4977-843b-5b303f8a6a3a@default \
    --to=drew.adams@oracle.com \
    --cc=dancol@dancol.org \
    --cc=emacs-devel@gnu.org \
    --cc=juri@linkov.net \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).