- The beginning of <search-terms> is recognized by the first argument
- that begins with neither '+' nor '-'. Support for an initial search
- term beginning with '+' or '-' is provided by allowing the user to
- specify a "--" argument to separate the tags from the search terms.
+ The input must consist of lines of the format:
+
+ +<<u>tag</u>>|-<<u>tag</u>> [...] [--] <<u>query</u>>
+
+ Each line is interpreted similarly to <b>notmuch</b> <b>tag</b> command line argu-
+ ments. The delimiter is one or more spaces ' '. Any characters in <<u>tag</u>>
+ <b>may</b> be hex-encoded with %NN where NN is the hexadecimal value of the
+ character. To hex-encode a character with a multi-byte UTF-8 encoding,
+ hex-encode each byte. Any spaces in <tag> <b>must</b> be hex-encoded as %20.
+ Any characters that are not part of <<u>tag</u>> <b>must</b> <b>not</b> be hex-encoded.
+
+ In the future tag:"tag with spaces" style quoting may be supported for
+ <<u>tag</u>> as well; for this reason all double quote characters in <<u>tag</u>>
+ <b>should</b> be hex-encoded.
+
+ The <<u>query</u>> should be quoted using Xapian boolean term quoting rules:
+ if a term contains whitespace or a close paren or starts with a double
+ quote, it must be enclosed in double quotes (not including any prefix)
+ and double quotes inside the term must be doubled (see below for exam-
+ ples).
+
+ Leading and trailing space ' ' is ignored. Empty lines and lines begin-
+ ning with '#' are ignored.