unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* apropos search
@ 2010-06-02 15:00 sable
  2010-06-02 15:15 ` David Kastrup
  0 siblings, 1 reply; 5+ messages in thread
From: sable @ 2010-06-02 15:00 UTC (permalink / raw)
  To: help-gnu-emacs

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".
Thanks,


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: apropos search
  2010-06-02 15:00 apropos search sable
@ 2010-06-02 15:15 ` David Kastrup
  2010-06-02 15:23   ` sable
  0 siblings, 1 reply; 5+ messages in thread
From: David Kastrup @ 2010-06-02 15:15 UTC (permalink / raw)
  To: help-gnu-emacs

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: apropos search
  2010-06-02 15:15 ` David Kastrup
@ 2010-06-02 15:23   ` sable
  2010-06-02 19:22     ` Andreas Politz
  0 siblings, 1 reply; 5+ messages in thread
From: sable @ 2010-06-02 15:23 UTC (permalink / raw)
  To: help-gnu-emacs

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"?


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: apropos search
  2010-06-02 15:23   ` sable
@ 2010-06-02 19:22     ` Andreas Politz
  2010-06-04 13:13       ` sable
  0 siblings, 1 reply; 5+ messages in thread
From: Andreas Politz @ 2010-06-02 19:22 UTC (permalink / raw)
  To: help-gnu-emacs

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: apropos search
  2010-06-02 19:22     ` Andreas Politz
@ 2010-06-04 13:13       ` sable
  0 siblings, 0 replies; 5+ messages in thread
From: sable @ 2010-06-04 13:13 UTC (permalink / raw)
  To: help-gnu-emacs

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-06-04 13:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-02 15:00 apropos search sable
2010-06-02 15:15 ` David Kastrup
2010-06-02 15:23   ` sable
2010-06-02 19:22     ` Andreas Politz
2010-06-04 13:13       ` sable

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).