help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Insert word at point in minibuffer


From: Nick Sandow
Subject: Re: Insert word at point in minibuffer
Date: Mon, 18 Aug 2008 17:20:02 -0700
User-agent: Thunderbird 2.0.0.16 (Windows/20080708)

Drew Adams wrote:
yank into the minibuffer the word at point.

Really, what I want to know is, can this be done "out of the 
box" in Emacs?
    

1. I don't believe that Emacs has anything that lets you do this out of the box.

There have been discussions in emacs-devel@gnu.org about providing such a
facility - see, for instance,
http://lists.gnu.org/archive/html/emacs-devel/2006-02/msg01074.html. But nothing
has come of it so far, AFAIK.


2. Sometimes commands provide some text at or near the cursor as the default
value, which can be inserted in the minibuffer using `M-n'.

The OP mentioned `query-replace', for instance. The versions of commands such as
`query-replace' provided by library `replace+.el' do this - see
http://www.emacswiki.org/cgi-bin/wiki/ReplacePlus. Library ffap.el does this for
file names and URLs at point - see
http://www.emacswiki.org/cgi-bin/wiki/FindFileAtPoint.


3. The code you sent generalizes this idea, letting you insert some text at
point into the minibuffer at any time.

Icicles does this too, but you can also repeat the key (`M-.') to retrieve and
insert additional bits of text (e.g. words, filenames, etc.) successively, or
you can repeat it to retrieve alternative kinds of thing (words, filenames,
etc.) at point. See
http://www.emacswiki.org/cgi-bin/wiki/Icicles_-_Inserting_Text_from_Cursor.


  
Thanks for some useful links.  I will definitely check out replace+.el and icicles.  Icicles in particular seems to offer a lot of functionality and thus may take some time to digest.

Will any of this stuff end up in Emacs itself?  It seems to me some things - such as M-x query-replace suggesting a default where currently it does not - are just plain good ideas.

cheers


reply via email to

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