unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
Subject: RE: key to yank text at point into minibuffer?
Date: Fri, 24 Feb 2006 08:44:13 -0800	[thread overview]
Message-ID: <DNEMKBNJBGPAOPIJOOICKEPLDCAA.drew.adams@oracle.com> (raw)
In-Reply-To: <871wxtldw6.fsf@jurta.org>

    > `M-x foobar M-- M-. M-. M-. C-b C-f C-u 1 M-.' will yank
    > three words to the left of point and one word to the right of it.

    Repeating `M-.' many times to find the necessary thing to yank doesn't
    seem very convenient.  What do you think about using `M-.' as a
    prefix key?

    `M-. s' - yank symbol at point to the minibuffer
    `M-. u' - yank URL at point
    `M-. w' - yank word at point
    `M-. c' - yank character at point

1. I think you missed the point of that example. It was in the cumulative
mode where `M-.' grabs and yanks successive words, not the mode where `M-.'
cycles among various kinds of thing. Making `M-.' a prefix key would make
matters worse, not better. The above example would then become: `M-x foobar
M-- M-. w  M-. w  M-. w  C-b C-f C-u 1 M-.' - note the added `w's.

Without a prefix binding, you can simply press and hold `M-.' until you've
accumulated as much text (e.g. as many words) as you want. In my
implementation, this single-grabber-function (words), append/accumulate
behavior is the default. (You proposed this cumulative behavior, and I agree
that it is very useful.)


2. Ignoring the cumulative example, and replying to your point (which speaks
to the non-cumulative mode, where `M-.' cycles among various kinds of
thing):

This kind of decision (prefix key or not) really rests on determining the
most common use pattern(s). As I said, in my case I use only a single `M-.'
(yank symbol) 90% of the time, so I have never experienced the inconvenience
you cite. Symbol syntax also picks up file names and URLs. (The separate
URL-grabbing function goes to the trouble of prefixing "http://" if it's
missing.)

In your proposal, I would need to use two keystrokes (`M-. <whatever>')
instead of one (`M-.') 90% of the time, which is less, not more, convenient.

And, just as in the cumulative mode, a prefix key works against ease of
repetition. If the binding is simply `M-.' (my proposal), then, in the case
where `M-.' cycles among alternative grab+yank functions, you can just hold
down Meta and repeatedly hit `.' to cycle among the alternatives. With a
prefix key (your proposal), you must remember, find, and hit a separate key
(s, u, w, or c).

With an alternatives list of length 3, the worst case for my approach is
hitting `.' 3 times. That's still quicker, for me, than coming up with the
correct two-key sequence `M-. <whatever>'. Even if the list were length 20,
I would probably still find repetition of the same key `.' 20 times to be
more convenient than remembering 20 different bindings. But different people
have different ideas of convenience.

To make an analogy, imagine that, instead of having `C-s M-p' cycle among
search-ring elements, you had a separate binding for each element, and `M-p'
was just a prefix key to indicate that you wanted to use the search-ring.
You would use one of `C-s M-p 1', `C-s M-p 2', and so on, instead of simply
repeating `M-p': `C-s M-p M-p M-p'. Would you find that more convenient?
(Granted, the analogy is not entirely fair, because 1, 2, ... are not
mnemonic as are s, u, w, c, or, rather, even if 3 clearly stands for the
third history element, it's unlikely that you would know that you wanted the
third element, without seeing what it is.)

Anyway, as I say, it's the various use cases, and especially the most common
use case, that should guide us here. Try the implementation I pointed to,
and see what you think. You can easily change the bindings to those that you
proposed (prefix key) and compare. Try a few different scenarios and let us
know what you find.

Meta-anyway: It sounds like you and I, Juri, think similarly about this
general idea, but no one else has spoken up about it. Perhaps that's because
people are concentrating on putting out the release (that would be good). Or
perhaps it's because everyone agrees with the idea (also good). Or perhaps
we (like the answer, my friend) are blowin' in the wind.

  reply	other threads:[~2006-02-24 16:44 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-11 17:17 key to yank text at point into minibuffer? Drew Adams
2006-02-12 14:51 ` Mathias Dahl
2006-02-12 17:22   ` Drew Adams
2006-02-12 21:07     ` Mathias Dahl
2006-02-12 21:24       ` Drew Adams
2006-02-13 18:00 ` Kevin Rodgers
2006-02-13 18:22   ` Drew Adams
2006-02-13 21:39     ` Kevin Rodgers
2006-02-13 21:50       ` Drew Adams
2006-02-14 15:53         ` Kevin Rodgers
2006-02-14 21:24           ` Drew Adams
2006-02-16 17:16             ` Kevin Rodgers
2006-02-19 17:27               ` Juri Linkov
2006-02-14  1:45 ` Juri Linkov
2006-02-14 16:55   ` Drew Adams
2006-02-17 21:57     ` Juri Linkov
2006-02-18  2:55       ` Drew Adams
2006-02-19 17:28         ` Juri Linkov
2006-02-19 19:53           ` Drew Adams
2006-02-20  9:03             ` Drew Adams
2006-02-20 19:34               ` Juri Linkov
2006-02-20 23:10                 ` Drew Adams
2006-02-21 13:43                   ` Mathias Dahl
2006-02-21 13:46                   ` Mathias Dahl
2006-02-22  6:10                     ` Miles Bader
2006-02-22 15:31                   ` Johan Bockgård
2006-02-24 15:48                     ` Drew Adams
2006-02-26  1:31                     ` Miles Bader
2006-02-26 15:35                       ` Drew Adams
2006-02-26 23:42                         ` Miles Bader
2006-02-27  1:17                           ` Drew Adams
2006-02-28  0:09                           ` Thien-Thi Nguyen
2006-02-28  1:55                             ` Miles Bader
2006-03-02 19:44                               ` Richard Stallman
2006-03-03  7:19                                 ` Miles Bader
2006-03-03 18:30                                 ` Luc Teirlinck
2006-03-04  2:00                                   ` Miles Bader
2006-03-04 13:38                                   ` Richard Stallman
2006-03-04 16:00                                     ` Luc Teirlinck
2006-03-06  0:48                                       ` Richard Stallman
2006-03-06  8:06                                         ` Miles Bader
2006-03-07  8:18                                           ` Kim F. Storm
2006-02-24  0:34                   ` Juri Linkov
2006-02-24 16:44                     ` Drew Adams [this message]
2006-02-25  8:06                       ` Mathias Dahl
2006-02-25 16:36                         ` Drew Adams

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=DNEMKBNJBGPAOPIJOOICKEPLDCAA.drew.adams@oracle.com \
    --to=drew.adams@oracle.com \
    /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).