]> git.notmuchmail.org Git - notmuch/blob - man/man1/notmuch-tag.1
0052ca2195e1e9cb38ce74d8733864f6e2dc999a
[notmuch] / man / man1 / notmuch-tag.1
1 .TH NOTMUCH-TAG 1 2013-02-17 "Notmuch 0.15.2"
2 .SH NAME
3 notmuch-tag \- add/remove tags for all messages matching the search terms
4
5 .SH SYNOPSIS
6 .B notmuch tag
7 .RI "+<" tag ">|\-<" tag "> [...] [\-\-] <" search-term "> [...]"
8
9 .B notmuch tag
10 .RI "--batch"
11 .RI "[ --input=<" filename "> ]"
12
13
14 .SH DESCRIPTION
15
16 Add/remove tags for all messages matching the search terms.
17
18 See \fBnotmuch-search-terms\fR(7)
19 for details of the supported syntax for
20 .RI < search-term >.
21
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.
25
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.
31
32 .B "notmuch tag"
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
36 details.
37
38 Supported options for
39 .B tag
40 include
41 .RS 4
42 .TP 4
43 .BR \-\-batch
44
45 Read batch tagging operations from a file (stdin by default). This is more
46 efficient than repeated
47 .B notmuch tag
48 invocations. See
49 .B TAG FILE FORMAT
50 below for the input format. This option is not compatible with
51 specifying tagging on the command line.
52 .RE
53
54 .RS 4
55 .TP 4
56 .BR "\-\-input=" <filename>
57
58 Read input from given file, instead of from stdin. Implies
59 .BR --batch .
60
61 .SH TAG FILE FORMAT
62
63 The input must consist of lines of the format:
64
65 .RI "+<" tag ">|\-<" tag "> [...] [\-\-] <" query ">"
66
67 Each line is interpreted similarly to
68 .B notmuch tag
69 command line arguments. The delimiter is one or more spaces ' '. Any
70 characters in
71 .RI < tag >
72 .B may
73 be hex-encoded with %NN where NN is the hexadecimal value of the
74 character. To hex-encode a character with a multi-byte UTF-8 encoding,
75 hex-encode each byte.
76 Any spaces in <tag>
77 .B must
78 be hex-encoded as %20. Any characters that are not
79 part of
80 .RI  < tag >
81 .B must not
82 be hex-encoded.
83
84 In the future tag:"tag with spaces" style quoting may be supported for
85 .RI < tag >
86 as well;
87 for this reason all double quote characters in
88 .RI < tag >
89 .B should
90 be hex-encoded.
91
92 The
93 .RI < query >
94 should be quoted using Xapian boolean term quoting rules: if a term
95 contains whitespace or a close paren or starts with a double quote, it
96 must be enclosed in double quotes (not including any prefix) and
97 double quotes inside the term must be doubled (see below for
98 examples).
99
100 Leading and trailing space ' ' is ignored. Empty lines and lines
101 beginning with '#' are ignored.
102
103 .SS EXAMPLE
104
105 The following shows a valid input to batch tagging. Note that only the
106 isolated '*' acts as a wildcard. Also note the two different quotings
107 of the tag
108 .B space in tags
109 .
110 .RS
111 .nf
112 +winner *
113 +foo::bar%25 -- (One and Two) or (One and tag:winner)
114 +found::it -- tag:foo::bar%
115 # ignore this line and the next
116
117 +space%20in%20tags -- Two
118 # add tag '(tags)', among other stunts.
119 +crazy{ +(tags) +&are +#possible\ -- tag:"space in tags"
120 +match*crazy -- tag:crazy{
121 +some_tag -- id:"this is ""nauty)"""
122 .fi
123 .RE
124
125 .SH SEE ALSO
126
127 \fBnotmuch\fR(1), \fBnotmuch-config\fR(1), \fBnotmuch-count\fR(1),
128 \fBnotmuch-dump\fR(1), \fBnotmuch-hooks\fR(5), \fBnotmuch-new\fR(1),
129 \fBnotmuch-reply\fR(1), \fBnotmuch-restore\fR(1),
130 \fBnotmuch-search\fR(1), \fBnotmuch-search-terms\fR(7),
131 \fBnotmuch-show\fR(1),