1 .TH NOTMUCH-TAG 1 2013-12-28 "Notmuch 0.17~rc4"
3 notmuch-tag \- add/remove tags for all messages matching the search terms
7 .RI [ options "...] +<" tag ">|\-<" tag "> [...] [\-\-] <" search-term "> [...]"
11 .RI "[ --input=<" filename "> ]"
16 Add/remove tags for all messages matching the search terms.
18 See \fBnotmuch-search-terms\fR(7)
19 for details of the supported syntax for
22 Tags prefixed by '+' are added while those prefixed by '\-' are
23 removed. For each message, tag changes are applied in the order they
24 appear on the command line.
26 The beginning of the search terms is recognized by the first
27 argument that begins with neither '+' nor '\-'. Support for
28 an initial search term beginning with '+' or '\-' is provided
29 by allowing the user to specify a "\-\-" argument to separate
30 the tags from the search terms.
33 updates the maildir flags according to tag changes if the
34 .B "maildir.synchronize_flags"
35 configuration option is enabled. See \fBnotmuch-config\fR(1) for
45 Remove all tags from each message matching the search terms before
46 applying the tag changes appearing on the command line. This means
47 setting the tags of each message to the tags to be added. If there are
48 no tags to be added, the messages will have no tags.
55 Read batch tagging operations from a file (stdin by default). This is more
56 efficient than repeated
60 below for the input format. This option is not compatible with
61 specifying tagging on the command line.
66 .BR "\-\-input=" <filename>
68 Read input from given file, instead of from stdin. Implies
73 The input must consist of lines of the format:
75 .RI "+<" tag ">|\-<" tag "> [...] [\-\-] <" query ">"
77 Each line is interpreted similarly to
79 command line arguments. The delimiter is one or more spaces ' '. Any
83 be hex-encoded with %NN where NN is the hexadecimal value of the
84 character. To hex-encode a character with a multi-byte UTF-8 encoding,
88 be hex-encoded as %20. Any characters that are not
94 In the future tag:"tag with spaces" style quoting may be supported for
97 for this reason all double quote characters in
104 should be quoted using Xapian boolean term quoting rules: if a term
105 contains whitespace or a close paren or starts with a double quote, it
106 must be enclosed in double quotes (not including any prefix) and
107 double quotes inside the term must be doubled (see below for
110 Leading and trailing space ' ' is ignored. Empty lines and lines
111 beginning with '#' are ignored.
115 The following shows a valid input to batch tagging. Note that only the
116 isolated '*' acts as a wildcard. Also note the two different quotings
123 +foo::bar%25 -- (One and Two) or (One and tag:winner)
124 +found::it -- tag:foo::bar%
125 # ignore this line and the next
127 +space%20in%20tags -- Two
128 # add tag '(tags)', among other stunts.
129 +crazy{ +(tags) +&are +#possible\ -- tag:"space in tags"
130 +match*crazy -- tag:crazy{
131 +some_tag -- id:"this is ""nauty)"""
137 \fBnotmuch\fR(1), \fBnotmuch-config\fR(1), \fBnotmuch-count\fR(1),
138 \fBnotmuch-dump\fR(1), \fBnotmuch-hooks\fR(5),
139 \fBnotmuch-insert\fR(1), \fBnotmuch-new\fR(1),
140 \fBnotmuch-reply\fR(1), \fBnotmuch-restore\fR(1),
141 \fBnotmuch-search\fR(1), \fBnotmuch-search-terms\fR(7),
142 \fBnotmuch-show\fR(1),