[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: apropos search
From: |
sable |
Subject: |
Re: apropos search |
Date: |
Wed, 08 Dec 2010 15:11:36 -0000 |
User-agent: |
G2/1.0 |
On Jun 2, 3:22 pm, Andreas Politz <poli...@fh-trier.de> wrote:
> sable <zxcv_...@hotmail.com> writes:
> > On Jun 2, 11:15 am, David Kastrup <d...@gnu.org> wrote:
> >> sable <zxcv_...@hotmail.com> writes:
> >> > Hi,
> >> > When you're doing an apropos search, is there a way to tell Emacs to
> >> > search for "whole words only". E.g, if you use the keyword "change"
> >> > and you only want command names that contain the word change, and not
> >> > "changes" or "exchange".
>
> >> C-h a \<change\> RET
>
> >> --
> >> David Kastrup
>
> > Interesting, thanks. Is there a way (variable) to change the default
> > search to "whole words only"?
>
> I don't think so, but we can try to create it.
>
> (defcustom apropos-whole-words t
> "Whether the apropos commands should search for whole words."
> :group 'apropos
> :type 'boolean)
>
> (defadvice apropos-parse-pattern (before rewrite-pattern-ad activate)
> (when (and apropos-whole-words
> (consp (ad-get-arg 0)))
> (ad-set-arg 0 (mapcar (lambda (p)
> (format "\\<%s\\>" p))
> (ad-get-arg 0)))))
>
> -ap- Hide quoted text -
>
> - Show quoted text -
Whoa, that's a little over my head at this point, but I'll keep that
for future reference, thanks! I assume you would put this code in
the .emacs file or something...