unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* key to yank text at point into minibuffer?
@ 2006-02-11 17:17 Drew Adams
  2006-02-12 14:51 ` Mathias Dahl
                   ` (2 more replies)
  0 siblings, 3 replies; 46+ messages in thread
From: Drew Adams @ 2006-02-11 17:17 UTC (permalink / raw)


Perhaps something like this already exists and I'm unaware of it. If not,
perhaps it could be added - it represents a trivial change for users and
implementers. If users don't use it, then it means no change to them.

Some people use ffap.el. It tries to DTRT by placing some text at point
(with sometimes minor changes) into the minibuffer to serve as initial
input. It does this with file names, URLS, etc. in the buffer text.

I tried ffap.el for a while and found I didn't care much for it. In
particular, in Dired I rarely want to use the file name at point when I use
`C-x f' - if I want that then I just use `RET'.  Anyway, if people find
ffap.el handy that's fine. I realize that it also does other things,
including mailto: prefixing and remote-file handling.

Anyway, as a poor-man's replacement for some of the ffap functionality, I
added a minibuffer key (I use `M-.') to all minibuffer maps. This command
just yanks the symbol name at point into the minibuffer, replacing what was
there. It uses Emacs-Lisp symbol syntax, so, in practice, this also picks up
file names and URLs in the buffer. IOW, it provides some of what ffap
provides (the part I want), but without its DTRT second-guessing and only
upon demand (like setting `ffap-require-prefix' to t). Also, the symbol name
at point can be useful input even when it is not a file name or URL.

Sometimes, you might want the word at point (no symbol syntax) instead. So,
I use a user option that is a list of text-grabber functions - by default,
the first function grabs the symbol name at point, the second grabs the word
at point, and the third grabs the URL at point, prefixing it with http:// if
needed. In the minibuffer, a single `M-.' yanks the symbol name at point, a
second `M-.' replaces that with the word at point, and a third yanks the
URL. Other functions could be added to the list to do things like add
mailto: - the list is customizable.  In practice, I use a single `M-.' 90%
of the time, a second `M-.' 10% of the time, and a third `M-.' 0% of the
time (so far). A symbol name is usually the text I want to yank.

The other thing to mention is that many commands offer a default value that
is the word or symbol name at point. But other commands instead offer a
different default value that is deemed better most of the time. 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.

Any interest in adding such a feature?  Who will be the first to let me know
that it already exists in some (better) form ;-)?

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

end of thread, other threads:[~2006-03-07  8:18 UTC | newest]

Thread overview: 46+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2006-02-25  8:06                       ` Mathias Dahl
2006-02-25 16:36                         ` Drew Adams

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