unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* Is there a prefix that performs from: and to: simultaneously?
@ 2017-09-22  1:54 Attic Hermit
  2017-09-22  2:10 ` David Bremner
  0 siblings, 1 reply; 6+ messages in thread
From: Attic Hermit @ 2017-09-22  1:54 UTC (permalink / raw)
  To: notmuch

Batch file of my initial tagging script includes queries like below:

+john +friend -- tag:new AND from:john@example.tld
+john +friend -- tag:new AND to:john@example.tld

But I want to compress the above in one line like:

+john +friend -- tag:new AND from_or_to:john@example.tld

I know that I can achieve it approximately by querying without prefix,
but it'll also include the mails that include the string
"john@example.tld".

I look through the manual, man:notmuch-search-terms, but I couldn't find
the prefix I want.

-- 
Attic Hermit

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

* Re: Is there a prefix that performs from: and to: simultaneously?
  2017-09-22  1:54 Is there a prefix that performs from: and to: simultaneously? Attic Hermit
@ 2017-09-22  2:10 ` David Bremner
  2017-09-22  2:18   ` Attic Hermit
  0 siblings, 1 reply; 6+ messages in thread
From: David Bremner @ 2017-09-22  2:10 UTC (permalink / raw)
  To: Attic Hermit, notmuch

Attic Hermit <fjdksl@cock.li> writes:

> Batch file of my initial tagging script includes queries like below:
>
> +john +friend -- tag:new AND from:john@example.tld
> +john +friend -- tag:new AND to:john@example.tld
>
> But I want to compress the above in one line like:
>
> +john +friend -- tag:new AND from_or_to:john@example.tld
>

How about

+john +friend -- tag:new AND (to:john@example.tld OR from:john@example.tld)

?

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

* Re: Is there a prefix that performs from: and to: simultaneously?
  2017-09-22  2:10 ` David Bremner
@ 2017-09-22  2:18   ` Attic Hermit
  2017-09-22 11:54     ` David Bremner
  0 siblings, 1 reply; 6+ messages in thread
From: Attic Hermit @ 2017-09-22  2:18 UTC (permalink / raw)
  To: David Bremner, notmuch


> +john +friend -- tag:new AND (to:john@example.tld OR
> from:john@example.tld)

First did I tried that form, but I felt that wasn't up to snuff because
I still have to write the same address two times.

-- 
Attic Hermit

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

* Re: Is there a prefix that performs from: and to: simultaneously?
  2017-09-22  2:18   ` Attic Hermit
@ 2017-09-22 11:54     ` David Bremner
  2017-09-22 12:07       ` David Bremner
  2017-09-23  7:47       ` Attic Hermit
  0 siblings, 2 replies; 6+ messages in thread
From: David Bremner @ 2017-09-22 11:54 UTC (permalink / raw)
  To: Attic Hermit, notmuch

Attic Hermit <fjdksl@cock.li> writes:

>> +john +friend -- tag:new AND (to:john@example.tld OR
>> from:john@example.tld)
>
> First did I tried that form, but I felt that wasn't up to snuff because
> I still have to write the same address two times.

Currently I think that's the best you can do. You may be interested in
defining a predefined query

notmuch config query.fromtojohn "to:john@example.tld OR from:john@example.tld"

then you can use

+john +friend -- tag:new AND (to:john@example.tld OR from:john@example.tld) query:fromtojohn

Hypothetically it would be possible to extend the query: syntax to
support parameters, but I'm not sure it's worth the extra complexity.

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

* Re: Is there a prefix that performs from: and to: simultaneously?
  2017-09-22 11:54     ` David Bremner
@ 2017-09-22 12:07       ` David Bremner
  2017-09-23  7:47       ` Attic Hermit
  1 sibling, 0 replies; 6+ messages in thread
From: David Bremner @ 2017-09-22 12:07 UTC (permalink / raw)
  To: Attic Hermit, notmuch

David Bremner <david@tethera.net> writes:

> Attic Hermit <fjdksl@cock.li> writes:
>
>>> +john +friend -- tag:new AND (to:john@example.tld OR
>>> from:john@example.tld)
>>
>> First did I tried that form, but I felt that wasn't up to snuff because
>> I still have to write the same address two times.
>
> Currently I think that's the best you can do. You may be interested in
> defining a predefined query
>
> notmuch config query.fromtojohn "to:john@example.tld OR from:john@example.tld"
>
> then you can use
>
> +john +friend -- tag:new AND (to:john@example.tld OR from:john@example.tld) query:fromtojohn

that should be

+john +friend -- tag:new AND query:fromtojohn

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

* Re: Is there a prefix that performs from: and to: simultaneously?
  2017-09-22 11:54     ` David Bremner
  2017-09-22 12:07       ` David Bremner
@ 2017-09-23  7:47       ` Attic Hermit
  1 sibling, 0 replies; 6+ messages in thread
From: Attic Hermit @ 2017-09-23  7:47 UTC (permalink / raw)
  To: David Bremner, notmuch

> I'm not sure it's worth the extra complexity.
Maybe you're right. I'll take the option, combinding `from' and `to'
headers to get the jobs done.

Thanks!

-- 
Attic Hermit

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

end of thread, other threads:[~2017-09-23  7:47 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-22  1:54 Is there a prefix that performs from: and to: simultaneously? Attic Hermit
2017-09-22  2:10 ` David Bremner
2017-09-22  2:18   ` Attic Hermit
2017-09-22 11:54     ` David Bremner
2017-09-22 12:07       ` David Bremner
2017-09-23  7:47       ` Attic Hermit

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

	https://yhetil.org/notmuch.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).