emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* How to filter agenda for Word1 OR Word2?
@ 2014-07-11 11:26 Martin Beck
  2014-07-11 23:29 ` Alexander Baier
  0 siblings, 1 reply; 6+ messages in thread
From: Martin Beck @ 2014-07-11 11:26 UTC (permalink / raw)
  To: emacs orgmode-mailinglist

[-- Attachment #1: Type: text/html, Size: 1057 bytes --]

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

* Re: How to filter agenda for Word1 OR Word2?
  2014-07-11 11:26 How to filter agenda for Word1 OR Word2? Martin Beck
@ 2014-07-11 23:29 ` Alexander Baier
  2014-07-12  8:18   ` Thorsten Jolitz
  0 siblings, 1 reply; 6+ messages in thread
From: Alexander Baier @ 2014-07-11 23:29 UTC (permalink / raw)
  To: Martin Beck; +Cc: emacs orgmode-mailinglist

On 2014-07-11 13:26 Martin Beck wrote:
> I have a search result (created by a search agenda C-C a s) and I
> want to narrow it down further with additional criteria.
> I tried to use the "=" key for "Narrow to entries matching regexp",
> but I did not find out how to combine several terms in here.
>  
> As long as I only enter one word, it works. But if I want to filter
> for criteria like
>  
> Word1 OR Word2
> or (Word1 OR Word2) AND Word3
> or (Word1 OR Word2) AND NOT (Word3 OR Word4)
>  
> I get no results just by entering
> e.g. Word1|Word2
> or Word1&Word2
>  
> I'm sure this is trivial, but I'm not an expert in regular
> expressions and currently don't see how to solve that.
> :-(

Using \(Word1\)\|\(Word2\) works for me. If you find it troublesome to
type a lot of these escaped parens, you might want to try
smartparens-mode for auto insertion of the closing _escaped_ paren.

As an example, if you type "\(", smartparens will automatically insert
"\)" after point. You can even navigate over these groups via sexps
commands.

HTH,
-- 
Alexander Baier

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

* Re: How to filter agenda for Word1 OR Word2?
  2014-07-11 23:29 ` Alexander Baier
@ 2014-07-12  8:18   ` Thorsten Jolitz
  2014-07-12 12:25     ` Alexander Baier
  0 siblings, 1 reply; 6+ messages in thread
From: Thorsten Jolitz @ 2014-07-12  8:18 UTC (permalink / raw)
  To: emacs-orgmode

Alexander Baier <alexander.baier@mailbox.org> writes:

> On 2014-07-11 13:26 Martin Beck wrote:
>> I have a search result (created by a search agenda C-C a s) and I
>> want to narrow it down further with additional criteria.
>> I tried to use the "=" key for "Narrow to entries matching regexp",
>> but I did not find out how to combine several terms in here.
>>  
>> As long as I only enter one word, it works. But if I want to filter
>> for criteria like
>>  
>> Word1 OR Word2
>> or (Word1 OR Word2) AND Word3
>> or (Word1 OR Word2) AND NOT (Word3 OR Word4)
>>  
>> I get no results just by entering
>> e.g. Word1|Word2
>> or Word1&Word2
>>  
>> I'm sure this is trivial, but I'm not an expert in regular
>> expressions and currently don't see how to solve that.
>> :-(
>
> Using \(Word1\)\|\(Word2\) works for me. If you find it troublesome to
> type a lot of these escaped parens, you might want to try
> smartparens-mode for auto insertion of the closing _escaped_ paren.
>
> As an example, if you type "\(", smartparens will automatically insert
> "\)" after point. You can even navigate over these groups via sexps
> commands.

I always wondered how this C-c a s search should work. I can only enter
one word, just like the OP.

None of these (valid) regexps works here:

,----
| (foo|bar)
| \(foo\|bar\)
| \\(foo|bar\\)
`----

This does not work either

,----
| \(foo\)\|\(bar\)
`----

nor does 

,----
| \(\(foo\)\|\(bar\)\)
`----

or simply

,----
| foo|bar
`----

-- 
cheers,
Thorsten

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

* Re: How to filter agenda for Word1 OR Word2?
  2014-07-12  8:18   ` Thorsten Jolitz
@ 2014-07-12 12:25     ` Alexander Baier
  2014-07-12 12:40       ` Thorsten Jolitz
  2014-07-12 19:14       ` Samuel Wales
  0 siblings, 2 replies; 6+ messages in thread
From: Alexander Baier @ 2014-07-12 12:25 UTC (permalink / raw)
  To: Thorsten Jolitz; +Cc: emacs-orgmode

On 2014-07-12 10:18 Thorsten Jolitz wrote:
> Alexander Baier <alexander.baier@mailbox.org> writes:
>> Using \(Word1\)\|\(Word2\) works for me. If you find it troublesome to
>> type a lot of these escaped parens, you might want to try
>> smartparens-mode for auto insertion of the closing _escaped_ paren.
>>
> I always wondered how this C-c a s search should work. I can only enter
> one word, just like the OP.

I forgot to mention that I did not use C-c a s, but created an agenda
and pressed = to start a regexp-match.

Regards,
-- 
Alexander Baier

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

* Re: How to filter agenda for Word1 OR Word2?
  2014-07-12 12:25     ` Alexander Baier
@ 2014-07-12 12:40       ` Thorsten Jolitz
  2014-07-12 19:14       ` Samuel Wales
  1 sibling, 0 replies; 6+ messages in thread
From: Thorsten Jolitz @ 2014-07-12 12:40 UTC (permalink / raw)
  To: emacs-orgmode

Alexander Baier <alexander.baier@mailbox.org> writes:

> On 2014-07-12 10:18 Thorsten Jolitz wrote:
>> Alexander Baier <alexander.baier@mailbox.org> writes:
>>> Using \(Word1\)\|\(Word2\) works for me. If you find it troublesome to
>>> type a lot of these escaped parens, you might want to try
>>> smartparens-mode for auto insertion of the closing _escaped_ paren.
>>>
>> I always wondered how this C-c a s search should work. I can only enter
>> one word, just like the OP.
>
> I forgot to mention that I did not use C-c a s, but created an agenda
> and pressed = to start a regexp-match.

Yes, then the usual regexp syntax works:

,----
| \(foo\|bar\)
`----

but what about filtering in the agenda (in search view), using {} []?
Either this is broken and does nothing or I do not really understand what 

,----
| http://orgmode.org/manual/Filtering_002flimiting-agenda-items.html
`----

tries to tell me ...

-- 
cheers,
Thorsten

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

* Re: How to filter agenda for Word1 OR Word2?
  2014-07-12 12:25     ` Alexander Baier
  2014-07-12 12:40       ` Thorsten Jolitz
@ 2014-07-12 19:14       ` Samuel Wales
  1 sibling, 0 replies; 6+ messages in thread
From: Samuel Wales @ 2014-07-12 19:14 UTC (permalink / raw)
  To: emacs-orgmode

= \(word\) should work.

c-c a s {\(word\)} should work [possibly depending on text search settings]

the full power of org-agenda-filter-by-tag is not yet implemented with
text search.

if it were, that would be EXCELLENT.

even better would be searching the body text and not just the headline!

samuel

-- 
The Kafka Pandemic: http://thekafkapandemic.blogspot.com

The disease DOES progress.  MANY people have died from it.  And
ANYBODY can get it.

Denmark: free Karina Hansen NOW.

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

end of thread, other threads:[~2014-07-12 19:14 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-11 11:26 How to filter agenda for Word1 OR Word2? Martin Beck
2014-07-11 23:29 ` Alexander Baier
2014-07-12  8:18   ` Thorsten Jolitz
2014-07-12 12:25     ` Alexander Baier
2014-07-12 12:40       ` Thorsten Jolitz
2014-07-12 19:14       ` Samuel Wales

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

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