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: Stefan Monnier
Subject: Re: make `occur' use word at point as default
Date: Thu, 01 Sep 2005 09:08:38 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

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

These are pretty much the same.  More specifically the tag should include
the current-word as a substring, so I'd drop the number 1 and just keep
number 2.

> 3. active region - (and transient-mark-mode mark-active
>                         (buffer-substring-no-properties
>                          (region-beginning) (region-end)))

You could have done M-w before the current operation.  Much simpler/quicker
than doing M-n M-n M-n searching for it.

> 4. last isearch regexp - (car regexp-search-ring)

This one makes sense.  Maybe we could simply use the same ring for occur as
for regexp-search so that it is available as M-p.

> 5. last kill from the kill ring - (current-kill 0)

C-y brings it more quickl;y and reliably than M-n M-n M-n M-n.

I.e. there are really only 2 different useful values and we could make one
of the two available via M-p.


        Stefan




reply via email to

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