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

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

Re: apropos search


From: Andreas Politz
Subject: Re: apropos search
Date: Wed, 08 Dec 2010 15:11:19 -0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

sable <zxcv_890@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


reply via email to

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