emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: key to yank text at point into minibuffer?


From: Drew Adams
Subject: RE: key to yank text at point into minibuffer?
Date: Sun, 12 Feb 2006 09:22:48 -0800

        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.
        ...
        Any interest in adding such a feature?

    I like the idea.  I use C-w in isearch a lot, and this is similar.

Yes. `C-w' in isearch was one inspiration for this; the other was ffap.

But there is no need, I think, for the analog of isearch's repeated `C-w'
yanking successive words. That's one reason I instead use repeating to
employ alternative text-grabbing functions.

    I cannot see many cases I would use it right now, but I think it would
    be useful when doing C-h f and when the word to the left of point is
    just a partial function name.

    For example, if point is just after `string-match' and I do C-h f I
    get string-match suggested as default value.  That is good.  Sometimes
    I start writing a function name but I don't know the whole name.  In
    those cases C-h f will not help me at all, even if I have written the
    first characters of the function name.  In that case, this M-. key
    would have been useful to me.

Yes. However:

. Cursor after (complete function name) "string-match" `C-h f' already
proposes `string-match' as the default. The proposal is useful in cases
where the default value is *not* the text at point.

. Wrt the case of a partial name like "string-ma": yes, this would help.
(You also have `ESC-TAB' (`lisp-complete-symbol').)

    I am curious, what do you use this for?

Uh, as I said, to pick up a file name or URL (or other name) in a buffer,
for use as minibuffer input. I use it as a poor-man's ffap.

Example: You're in a SQL script on a line like "@some-long-file-name.sql".
You use `C-x 4 f M-.' to pull that text into the minibuffer, to visit that
file. This saves you selecting the text and pasting it into the minibuffer;
that's all.

This example also points out the "poor-man" aspect: the symbol name at point
is not exactly what you want here, because it includes the `@', which you
must then delete. And if the script didn't explicitly include ".sql" in the
file name, then you would need to add that in the minibuffer (perhaps via
completion). In many cases, this mechanism gives you exactly the text you
need; in some cases you must tweak what it gives you.






reply via email to

[Prev in Thread] Current Thread [Next in Thread]