<b>tax()</b>. Support for this syntax is currently optional, you can test if
your build of notmuch supports it with
- $ notmuch config get built_with.sexpr_query
+ $ notmuch config get built_with.sexp_queries
</pre>
<h3> S-EXPRESSIONS</h3>
s-expressions inside parentheses. Atoms are either
<u>basic</u> <u>value</u>
- A basic value is an unquoted string containing no whitespace,
- double quotes, or parentheses.
+ A basic value is an unquoted string containing no whitespace, double
+ quotes, or parentheses.
<u>quoted</u> <u>string</u>
- Double quotes (") delimit strings possibly containing whitespace
- or parentheses. These can contain double quote characters by es‐
- caping with backslash. E.g. <b>"this</b> <b>is</b> <b>a</b> <b>quote</b> <b>\""</b>.
+ Double quotes (") delimit strings possibly containing whitespace or
+ parentheses. These can contain double quote characters by escaping
+ with backslash. E.g. <b>"this</b> <b>is</b> <b>a</b> <b>quote</b> <b>\""</b>.
</pre>
<h3> S-EXPRESSION QUERIES</h3>
<u>query</u> consisting of a prefix atom (first element) defining a <u>field</u>,
<u>logical</u> <u>operation</u>, or <u>modifier</u>, and 0 or more subqueries.
- <b>*</b> "*" matches any non-empty string in the current field.
+ <b>*</b>
+ "*" matches any non-empty string in the current field.
- <b>()</b> The empty list matches all messages
+ <b>()</b>
+ The empty list matches all messages
<u>term</u>
Match all messages containing <u>term</u>, possibly after stemming or
values) in s-expression queries. For information on phrase split‐
ting see <u>FIELDS</u>.
- <b>(</b> <u>field</u> <b>q</b>_<b>1</b> <b>q</b>_<b>2</b> <b>...</b> <b>q</b>_<b>n</b> <b>)</b>
- Restrict the queries q_1 to q_n to <u>field</u>, and combine with <u>and</u>
- (for most fields) or <u>or</u>. See <u>FIELDS</u> for more information.
-
- <b>(</b> <u>operator</u> <b>q</b>_<b>1</b> <b>q</b>_<b>2</b> <b>...</b> <b>q</b>_<b>n</b> <b>)</b>
- Combine queries q_1 to q_n. Currently supported operators are
- <b>and</b>, <b>or</b>, and <b>not</b>. <b>(not</b> q_1 ... q_n <b>)</b> is equivalent to <b>(and</b> <b>(not</b>
- q_1 <b>)</b> <b>...</b> <b>(not</b> q_n <b>))</b>.
-
- <b>(</b> <u>modifier</u> <b>q</b>_<b>1</b> <b>q</b>_<b>2</b> <b>...</b> <b>q</b>_<b>n</b> <b>)</b>
- Combine queries q_1 to q_n, and reinterpret the result (e.g. as
- a regular expression). See <u>MODIFIERS</u> for more information.
-
- <b>(macro</b> <b>(</b> <b>p</b>_<b>1</b> <b>...</b> <b>p</b>_<b>n</b> <b>)</b> <b>body)</b>
- Define saved query with parameter substitution. The syntax is
- recognized only in saved s-expression queries (see <b>squery.*</b> in
- <a href='../notmuch-config-1/'>notmuch-config</a>(1)). Parameter names in <b>body</b> must be prefixed
- with <b>,</b> to be expanded (see <u>MACRO</u> <u>EXAMPLES</u>). Macros may refer to
- other macros, but only to their own parameters [1].
+ <b>(</b> <u>field</u> <u>q</u>1 <u>q</u>2 ... <u>q</u>n <b>)</b>
+ Restrict the queries <u>q</u>1 to <u>q</u>n to <u>field</u>, and combine with <u>and</u> (for
+ most fields) or <u>or</u>. See <u>FIELDS</u> for more information.
+
+ <b>(</b> <u>operator</u> <u>q</u>1 <u>q</u>2 ... <u>q</u>n <b>)</b>
+ Combine queries <u>q</u>1 to <u>q</u>n. Currently supported operators are <b>and</b>, <b>or</b>,
+ and <b>not</b>. <b>(not</b> <u>q</u>1 ... <u>q</u>n <b>)</b> is equivalent to <b>(and</b> <b>(not</b> <u>q</u>1 <b>)</b> <b>...</b> <b>(not</b>
+ <u>q</u>n <b>))</b>.
+
+ <b>(</b> <u>modifier</u> <u>q</u>1 <u>q</u>2 ... <u>q</u>n <b>)</b>
+ Combine queries <u>q</u>1 to <u>q</u>n, and reinterpret the result (e.g. as a reg‐
+ ular expression). See <u>MODIFIERS</u> for more information.
+
+ <b>(macro</b> <b>(</b> <u>p</u>1 ... <u>p</u>n <b>)</b> <b>body)</b>
+ Define saved query with parameter substitution. The syntax is recog‐
+ nized only in saved s-expression queries (see <b>squery.*</b> in <a href='../notmuch-config-1/'>not‐</a>
+ <a href='../notmuch-config-1/'>much-config</a>(1)). Parameter names in <b>body</b> must be prefixed with <b>,</b> to
+ be expanded (see <u>MACRO</u> <u>EXAMPLES</u>). Macros may refer to other macros,
+ but only to their own parameters [1].
</pre>
<h3> FIELDS</h3>
that are neither operators nor fields.
<b>(infix</b> <u>atom</u> <b>)</b>
- Interpret <u>atom</u> as an infix notmuch query (see <a href='../notmuch-search-terms-7/'>not‐</a>
- <a href='../notmuch-search-terms-7/'>much-search-terms</a>(7)). Not supported inside fields.
+ Interpret <u>atom</u> as an infix notmuch query (see <a href='../notmuch-search-terms-7/'>not‐</a>
+ <a href='../notmuch-search-terms-7/'>much-search-terms</a>(7)). Not supported inside fields.
- <b>(matching</b> <b>q</b>_<b>1</b> <b>q</b>_<b>2</b> <b>...</b> <b>q</b>_<b>n</b> <b>)</b> <b>(of</b> <b>q</b>_<b>1</b> <b>q</b>_<b>2</b> <b>...</b> <b>q</b>_<b>n</b> <b>)</b>
- Match all messages have the same values of the current field as
- those matching all of q_1 ... q_n. Supported in most term [7] or
- phrase fields. Most commonly used in the <b>thread</b> field.
+ <b>(matching</b> <u>q</u>1 <u>q</u>2 ... <u>q</u>n <b>)</b> <b>(of</b> <u>q</u>1 <u>q</u>2 ... <u>q</u>n <b>)</b>
+ Match all messages have the same values of the current field as
+ those matching all of <u>q</u>1 ... <u>q</u>n. Supported in most term [7] or
+ phrase fields. Most commonly used in the <b>thread</b> field.
<b>(query</b> <u>atom</u> <b>)</b>
- Expand to the saved query named by <u>atom</u>. See <a href='../notmuch-config-1/'>notmuch-config</a>(1)
- for more. Note that the saved query must be in infix syntax
- (<a href='../notmuch-search-terms-7/'>notmuch-search-terms</a>(7)). Not supported inside fields.
+ Expand to the saved query named by <u>atom</u>. See <a href='../notmuch-config-1/'>notmuch-config</a>(1) for
+ more. Note that the saved query must be in infix syntax (<a href='../notmuch-search-terms-7/'>not‐</a>
+ <a href='../notmuch-search-terms-7/'>much-search-terms</a>(7)). Not supported inside fields.
<b>(regex</b> <u>atom</u> <b>)</b> <b>(rx</b> <u>atom</u> <b>)</b>
- Interpret <u>atom</u> as a POSIX.2 regular expression (see <b>regex</b>(7)).
- This applies in term fields and a subset [5] of phrase fields
- (see <u>Fields</u> <u>with</u> <u>supported</u> <u>modifiers</u>).
+ Interpret <u>atom</u> as a POSIX.2 regular expression (see <b>regex</b>(7)). This
+ applies in term fields and a subset [5] of phrase fields (see <u>Fields</u>
+ <u>with</u> <u>supported</u> <u>modifiers</u>).
<b>(starts-with</b> <u>subword</u> <b>)</b>
- Matches any term starting with <u>subword</u>. This applies in either
- phrase or term <u>fields</u>, or outside of fields [6]. Note that a
- <b>starts-with</b> query cannot be part of a phrase. The atom <b>*</b> is a
- synonym for <b>(starts-with</b> <b>"")</b>.
+ Matches any term starting with <u>subword</u>. This applies in either
+ phrase or term <u>fields</u>, or outside of fields [6]. Note that a
+ <b>starts-with</b> query cannot be part of a phrase. The atom <b>*</b> is a syn‐
+ onym for <b>(starts-with</b> <b>"")</b>.
</pre>
<h2>EXAMPLES</h2>
<pre>
- <b>Wizard</b> Match all messages containing the word "wizard", ignoring case.
+ <b>Wizard</b>
+ Match all messages containing the word "wizard", ignoring case.
- <b>added</b> Match all messages containing "added", but also those containing
- "add", "additional", "Additional", "adds", etc... via stemming.
+ <b>added</b>
+ Match all messages containing "added", but also those containing
+ "add", "additional", "Additional", "adds", etc... via stemming.
<b>(and</b> <b>Bob</b> <b>Marley)</b>
- Match messages containing words "Bob" and "Marley", or their
- stems The words need not be adjacent.
+ Match messages containing words "Bob" and "Marley", or their stems
+ The words need not be adjacent.
<b>(not</b> <b>Bob</b> <b>Marley)</b>
- Match messages containing neither "Bob" nor "Marley", nor their
- stems,
+ Match messages containing neither "Bob" nor "Marley", nor their
+ stems,
<b>"quick</b> <b>fox"</b> <b>quick-fox</b> <b>quick@fox</b>
- Match the <u>phrase</u> "quick" followed by "fox" in phrase fields (or
- outside a field). Match the literal string in a term field.
+ Match the <u>phrase</u> "quick" followed by "fox" in phrase fields (or out‐
+ side a field). Match the literal string in a term field.
<b>(folder</b> <b>(of</b> <b>(id</b> <b>1234@invalid)))</b>
- Match any message in the same folder as the one with Message-Id
- "<u>1234@invalid</u>"
+ Match any message in the same folder as the one with Message-Id "‐
+ <u>1234@invalid</u>"
<b>(id</b> <b>1234@invalid</b> <b>blah@test)</b>
- Matches Message-Id "<u>1234@invalid</u>" <u>or</u> Message-Id "<u>blah@test</u>"
+ Matches Message-Id "<u>1234@invalid</u>" <u>or</u> Message-Id "<u>blah@test</u>"
- <b>(and</b> <b>(infix</b> <b>date:2009-11-18..2009-11-18</b> <b>)</b> <b>(tag</b> <b>unread))</b>
- Match messages in the given date range with tag unread.
+ <b>(and</b> <b>(infix</b> <b>"date:2009-11-18..2009-11-18")</b> <b>(tag</b> <b>unread))</b>
+ Match messages in the given date range with tag unread.
<b>(starts-with</b> <b>prelim)</b>
- Match any words starting with "prelim".
+ Match any words starting with "prelim".
- <b>(subject</b> <b>quick</b> <b>brown</b> <b>fox</b> <b>)</b>
- Match messages whose subject contains "quick" (anywhere,
- stemmed) and the phrase "brown fox".
+ <b>(subject</b> <b>quick</b> <b>"brown</b> <b>fox")</b>
+ Match messages whose subject contains "quick" (anywhere, stemmed)
+ and the phrase "brown fox".
<b>(subject</b> <b>(starts-with</b> <b>prelim))</b>
- Matches any word starting with "prelim", inside a message sub‐
- ject.
+ Matches any word starting with "prelim", inside a message subject.
- <b>(subject</b> <b>(starts-wih</b> <b>quick)</b> <b>brown</b> <b>fox</b> <b>)</b>
- Match messages whose subject contains "quick brown fox", but
- also "brown fox quicksand".
+ <b>(subject</b> <b>(starts-wih</b> <b>quick)</b> <b>"brown</b> <b>fox")</b>
+ Match messages whose subject contains "quick brown fox", but also
+ "brown fox quicksand".
<b>(thread</b> <b>(of</b> <b>(id</b> <b>1234@invalid)))</b>
- Match any message in the same thread as the one with Message-Id
- "<u>1234@invalid</u>"
+ Match any message in the same thread as the one with Message-Id "‐
+ <u>1234@invalid</u>"
<b>(thread</b> <b>(matching</b> <b>(from</b> <b>bob@example.com)</b> <b>(to</b> <b>bob@example.com)))</b>
- Match any (messages in) a thread containing a message from "‐
- <u>bob@example.com</u>" and a (possibly distinct) message to "bob at
- example.com")
+ Match any (messages in) a thread containing a message from "‐
+ <u>bob@example.com</u>" and a (possibly distinct) message to "bob at exam‐
+ ple.com")
- <b>(to</b> <b>(or</b> <b>bob@example.com</b> <b>mallory@example.org))</b> <b>(or</b> <b>(to</b> <b>bob@example.com)</b>
+ <b>(to</b> <b>(or</b> <b>bob@example.com</b> <b>mallory@example.org))</b> <b>(or</b> <b>(to</b> <b>bob@example.com)</b>
<b>(to</b> <b>mallory@example.org))</b>
- Match in the "To" or "Cc" headers, "<u>bob@example.com</u>", "‐
- <u>mallory@example.org</u>", and also "<u>bob@example.com.au</u>" since it
- contains the adjacent triple "bob", "example", "com".
+ Match in the "To" or "Cc" headers, "<u>bob@example.com</u>", "‐
+ <u>mallory@example.org</u>", and also "<u>bob@example.com.au</u>" since it con‐
+ tains the adjacent triple "bob", "example", "com".
<b>(not</b> <b>(to</b> <b>*))</b>
- Match messages with an empty or invalid 'To' and 'Cc' field.
+ Match messages with an empty or invalid 'To' and 'Cc' field.
<b>(List</b> <b>*)</b>
- Match messages with a non-empty List-Id header, assuming config‐
- uration <b>index.header.List=List-Id</b>
+ Match messages with a non-empty List-Id header, assuming configura‐
+ tion <b>index.header.List=List-Id</b>
</pre>
<h3> MACRO EXAMPLES</h3>
$ notmuch config set squery.Outer '(macro (x y) (and (tag ,x) (Inner ,y)))'
$ notmuch search --query=sexp '(Outer inbox maildir)'
- Parameters can be re-used to reduce boilerplate. Any field, including
+ Parameters can be re-used to reduce boilerplate. Any field, including
user defined fields is permitted within a macro.
$ notmuch config set squery.About '(macro (name) (or (subject ,name) (List ,name)))'
<h2>NOTES</h2>
<pre>
- [1] Technically macros impliment lazy evaluation and lexical scope.
+ [1] Technically macros implement lazy evaluation and lexical scope.
There is one top level scope containing all macro definitions, but
all parameter definitions are local to a given macro.
[4] a.k.a. boolean prefixes
- [5] Due to the implemention of phrase fields in Xapian, regex queries
+ [5] Due to the implementation of phrase fields in Xapian, regex queries
could only match individual words.
- [6] Due the the way <b>body</b> is implemented in notmuch, this modifier is
+ [6] Due the the way <b>body</b> is implemented in notmuch, this modifier is
not supported in the <b>body</b> field.
- [7] Due to the way recursive <b>path</b> queries are implemented in notmuch,
+ [7] Due to the way recursive <b>path</b> queries are implemented in notmuch,
this modifier is not supported in the <b>path</b> field.
</pre>
<h2>COPYRIGHT</h2>
<pre>
- 2009-2021, Carl Worth and many others
+ 2009-2022, Carl Worth and many others
</pre>
-<h2>0.34</h2>
+<h2>0.35</h2>