emacs-orgmode
[Top][All Lists]
Advanced

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

[Orgmode] Re: Sparse trees and searching for multiple words


From: Matt Lundin
Subject: [Orgmode] Re: Sparse trees and searching for multiple words
Date: Tue, 21 Sep 2010 22:46:35 -0400
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/24.0.50 (gnu/linux)

Tom <address@hidden> writes:

> I see sparse trees can be constructed by searching for a regexp, but I
> can't find the same ability for multiple searches.
>
> For example, I'd like to see entries which contains the words 'cat' and
> 'dog' in any order. Or 'apple', 'orange', 'melon', 'plum' and 'pear'
> in any order.
>
> Searching for multiple keywords in a single operation is a pretty
>  basic feature. I recommend adding it if currently there is no way to
>  do it in org.

For such searches, I use org-search-view:

C-c a s +cat +dog [RET]

This will pull up the headlines for all entries that contain the
substrings cat and dog in any order.

By default, org-search-view treats the entry as a single substring if
there are no plus or minus signs. E.g.,

C-c a s cat dog [RET]

...will find only those entries that have the precise string "cat dog".

For searches more like Google's (i.e., lazy booleans), you can set the
variable org-agenda-search-view-always-boolean to t. Then, a search such
as:

C-c a s cat dog [RET]

...will find all entries that have the words cat and dog in any order.

,----[ C-h v org-agenda-search-view-always-boolean ]
| When this is non-nil, the string will be split on whitespace, and each
| snippet will be searched individually, and all must match in order to
| select an entry.
`----

If you want to force "cat" and "dog" to match full words only, you can
set the variable org-agenda-search-view-force-full-words to t.

Best,
Matt



reply via email to

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