emacs-devel
[Top][All Lists]
Advanced

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

Re: make `occur' use word at point as default


From: Juri Linkov
Subject: Re: make `occur' use word at point as default
Date: Thu, 01 Sep 2005 08:47:09 +0300
User-agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux)

> We could conceivably make a second M-n insert another possible input
> that one might want.  In effect, this would mean putting another
> element at the "front" of the history list.  That could be a new
> convention that could be generalized to other things.

This is already implemented by a small 9-line patch I proposed in
http://lists.gnu.org/archive/html/emacs-devel/2004-05/msg01755.html
It allows M-n in the minibuffer to insert input from the list of
default values.  Each consecutive M-n inserts a new default value
from the list.

For `grep' and `occur' there are at least five useful default values:

1. word at point - (current-word t)
2. tag at point - (funcall (or find-tag-default-function
                           (get major-mode 'find-tag-default-function)
                           'find-tag-default))
3. active region - (and transient-mark-mode mark-active
                        (buffer-substring-no-properties
                         (region-beginning) (region-end)))
4. last isearch regexp - (car regexp-search-ring)
5. last kill from the kill ring - (current-kill 0)

With this patch, it is possible to make a list of all these default
values accessible in the minibuffer via M-n.

-- 
Juri Linkov
http://www.jurta.org/emacs/





reply via email to

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