From: "Drew Adams" <drew.adams@oracle.com>
Subject: RE: key to yank text at point into minibuffer?
Date: Tue, 14 Feb 2006 08:55:49 -0800 [thread overview]
Message-ID: <DNEMKBNJBGPAOPIJOOICEEKEDCAA.drew.adams@oracle.com> (raw)
In-Reply-To: <87oe1apv8y.fsf@jurta.org>
> Providing `M-.' lets you get the text at point even when the command's
> default value is something else. You can think of it as an
> extension to `M-n' in this respect.
Then why not use `M-n' directly,
Because it often makes sense for a given command to use a default value that
is *not* the word/symbol/whatever at point - the command provides a value
that is (in principle) smarter, more specific to that command (DTRT). The
thing at point can sometimes be useful, but there is sometimes a better
default value, which might be totally unrelated to the buffer text.
There is no reason not to have both available: 1) an intelligent,
command-specific default value and 2) something at point (available always).
with every successive `M-n' inserting the next symbol/URL/file
name to the minibuffer?
Do you mean insert (so, accumulate) or replace what's in the minibuffer?
Your grep example below makes me think the former.
Successive `M-n' have the meaning now of traversing the history list. There
is no reason to confuse people by mapping an additional meaning onto
successive `M-n'. And there is no reason not to provide this orthogonal
feature (value) via a different key.
Also, assuming you mean to accumulate (not replace) successive words, there
are relatively few commands that expect/accept minibuffer input of multiple
words - `grep' is one such (provided you quote the string). For those
exceptional commands, users could simply select the words and then paste
them into the minibuffer.
This is a design choice - whether successive `M-.' (or `M-n', in your
suggestion) should accumulate text at point, as you suggest, or should
provide alternative kinds of thing at point, as I suggested. I can see
arguments for each approach.
I admitted, for instance, that 90% of the time I use simply the symbol at
point, and the other 9-10% of the time I use the word at point. One might
argue, then, that there is not much need for providing alternative
text-grabbing functions. I expect that such alternatives can be useful,
especially with buffer-local values specific to particular modes, but that's
just my intuition speaking.
My guess is that being able to grab successive words at point is less useful
than being able to grab different kinds of thing at point.
Note too that one could have a particular text-grabbing function that would
do just what you describe: it could, itself, let you grab successive words.
There are several ways it could do this. So, in this sense, your approach
could be a particular implementation of mine (just use a particular
text-grabbing function).
I have a simple patch that does this for the grep prompt, but
it was held due to the feature freeze.
However, to implement a replacement for ffap,
To be clear about my proposal, anyway: I wasn't suggesting to get rid of
ffap. I meant only that (even independently of employing it as a poor-man's
ffap) using `M-.' to retrieve something at point would be useful. We can
forget about ffap in this discussion.
it should be improved further to allow extending the list of
default values with more user-defined values.
I.e. instead of giving the list of default values as an
argument of one of the minibuffer functions, there should be
a new buffer-local variable with a user-defined function to
get some text from the buffer and add it to
the list of default values.
I don't follow you completely. Could you give an example of what you mean,
contrasting it with the behavior I described?
I think (but please clarify) that you're saying a few things: 1) Use a
single buffer-local function, not a list of functions, to retrieve the thing
at point; 2) Make the function buffer-local; 3) Add the retrieved thing to
the standard list of default values.
I spoke to #3 above: I'd prefer to keep the default-value list separate from
this text-grabbing feature. They are logically independent: one is decided
by the command; the other is decided by the text at point and the user.
Wrt #1: I'd prefer a list of different grab functions, as I said (with
successive `M-.' using successive functions), rather than a single function.
Wrt #2: Nothing would prevent a library or user from making the list of
functions buffer-local and giving it different values in particular buffers.
That is, I don't see the "further improvement" needed: Just have a variable
that is the list of grab functions. Users and programs can always make it
buffer-local and give it different values. (Yes, I know, there is a conflict
between having the variable be a user option and letting programs modify it,
but that can be resolved in different ways.)
next prev parent reply other threads:[~2006-02-14 16:55 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 [this message]
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
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=DNEMKBNJBGPAOPIJOOICEEKEDCAA.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).