[PATCH 7/9] CLI: add properties to dump output
[notmuch-archives.git] / 1a / 540b5c02331e94405826acf2f38978e60b4a0f
1 Return-Path: <bremner@tethera.net>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5         by olra.theworths.org (Postfix) with ESMTP id 2BBE1431FC4\r
6         for <notmuch@notmuchmail.org>; Sun,  5 Jan 2014 03:39:56 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: 0\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
12         autolearn=disabled\r
13 Received: from olra.theworths.org ([127.0.0.1])\r
14         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
15         with ESMTP id lh1Zokgd5tDQ for <notmuch@notmuchmail.org>;\r
16         Sun,  5 Jan 2014 03:39:48 -0800 (PST)\r
17 Received: from yantan.tethera.net (yantan.tethera.net [199.188.72.155])\r
18         (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits))\r
19         (No client certificate requested)\r
20         by olra.theworths.org (Postfix) with ESMTPS id D68EF431FCF\r
21         for <notmuch@notmuchmail.org>; Sun,  5 Jan 2014 03:39:32 -0800 (PST)\r
22 Received: from remotemail by yantan.tethera.net with local (Exim 4.80)\r
23         (envelope-from <bremner@tethera.net>)\r
24         id 1Vzm3I-0001YZ-Ee; Sun, 05 Jan 2014 07:39:32 -0400\r
25 Received: (nullmailer pid 5369 invoked by uid 1000); Sun, 05 Jan 2014\r
26         11:39:21 -0000\r
27 From: David Bremner <david@tethera.net>\r
28 To: notmuch@notmuchmail.org\r
29 Subject: [PATCH 2/3] man: partial conversion to pod.\r
30 Date: Sun,  5 Jan 2014 07:39:09 -0400\r
31 Message-Id: <1388921950-5017-3-git-send-email-david@tethera.net>\r
32 X-Mailer: git-send-email 1.8.5.2\r
33 In-Reply-To: <1388921950-5017-1-git-send-email-david@tethera.net>\r
34 References: <1366852752-3584-1-git-send-email-david@tethera.net>\r
35         <1388921950-5017-1-git-send-email-david@tethera.net>\r
36 MIME-Version: 1.0\r
37 Content-Type: text/plain; charset=UTF-8\r
38 Content-Transfer-Encoding: 8bit\r
39 Cc: David Bremner <bremner@debian.org>\r
40 X-BeenThere: notmuch@notmuchmail.org\r
41 X-Mailman-Version: 2.1.13\r
42 Precedence: list\r
43 List-Id: "Use and development of the notmuch mail system."\r
44         <notmuch.notmuchmail.org>\r
45 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
46         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
47 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
48 List-Post: <mailto:notmuch@notmuchmail.org>\r
49 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
50 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
51         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
52 X-List-Received-Date: Sun, 05 Jan 2014 11:39:56 -0000\r
53 \r
54 From: David Bremner <bremner@debian.org>\r
55 \r
56 This allows generation of man page and info document from the same source.\r
57 It is also a bit more friendly to edit for most people.\r
58 \r
59 The conversion was done as follows:\r
60 \r
61  % groff -e -mandoc -Tascii -rHY=0 $* | rman -f POD | sed  -e '/./,/^$/!d' -e 's/\r
62 \r
63 Some small hand-editing of the .pod may be needed afterwards.\r
64 ---\r
65  INSTALL                         |   6 +\r
66  configure                       |  12 ++\r
67  info/Makefile.local             |  25 +++-\r
68  man/Makefile.local              |  19 ++-\r
69  man/man1/notmuch.1              | 190 ----------------------------\r
70  man/man7/notmuch-search-terms.7 | 269 ----------------------------------------\r
71  pod/notmuch-search-terms.pod    | 235 +++++++++++++++++++++++++++++++++++\r
72  pod/notmuch.pod                 | 155 +++++++++++++++++++++++\r
73  8 files changed, 448 insertions(+), 463 deletions(-)\r
74  delete mode 100644 man/man1/notmuch.1\r
75  delete mode 100644 man/man7/notmuch-search-terms.7\r
76  create mode 100644 pod/notmuch-search-terms.pod\r
77  create mode 100644 pod/notmuch.pod\r
78 \r
79 diff --git a/INSTALL b/INSTALL\r
80 index 451bf05..697b7b2 100644\r
81 --- a/INSTALL\r
82 +++ b/INSTALL\r
83 @@ -60,6 +60,12 @@ Talloc which are each described below:\r
84  \r
85         Talloc is available from http://talloc.samba.org/\r
86  \r
87 +       pod2man\r
88 +       -------\r
89 +\r
90 +       Some of the documentation is built with pod2man. This is part\r
91 +       of the standard Perl distribution since Perl 5.6.0\r
92 +\r
93         texinfo\r
94         -------\r
95  \r
96 diff --git a/configure b/configure\r
97 index e75c1d4..6dadbaa 100755\r
98 --- a/configure\r
99 +++ b/configure\r
100 @@ -389,6 +389,15 @@ else\r
101      have_emacs=0\r
102  fi\r
103  \r
104 +printf "Checking for pod2man... "\r
105 +if pod2man --help > /dev/null 2>&1; then\r
106 +    printf "Yes.\n"\r
107 +    have_pod2man=1\r
108 +else\r
109 +    printf "No (man page install may fail)\n"\r
110 +    have_pod2man=0\r
111 +fi\r
112 +\r
113  printf "Checking for makeinfo... "\r
114  if makeinfo --version > /dev/null 2>&1; then\r
115      printf "Yes.\n"\r
116 @@ -768,6 +777,9 @@ HAVE_MAKEINFO = ${have_makeinfo}\r
117  # Whether there's an install-info binary available\r
118  HAVE_INSTALLINFO = ${have_installinfo}\r
119  \r
120 +# Is pod2man in the path?\r
121 +HAVE_POD2MAN = ${have_pod2man}\r
122 +\r
123  # where to install info files\r
124  \r
125  INFODIR = ${INFODIR}\r
126 diff --git a/info/Makefile.local b/info/Makefile.local\r
127 index 55e9740..cca891a 100644\r
128 --- a/info/Makefile.local\r
129 +++ b/info/Makefile.local\r
130 @@ -2,10 +2,14 @@\r
131  \r
132  dir := info\r
133  \r
134 +man_texi :=  $(dir)/notmuch.texi $(dir)/notmuch-search-terms.texi\r
135 +man_info := $(man_texi:.texi=.info)\r
136 +man_entry := $(man_texi:.texi=.entry)\r
137 +\r
138  texi_sources :=  $(dir)/notmuch-emacs.texi\r
139  emacs_info := $(texi_sources:.texi=.info)\r
140  \r
141 -info := $(emacs_info)\r
142 +info := $(emacs_info) $(man_info)\r
143  \r
144  ifeq ($(HAVE_MAKEINFO),1)\r
145  all: $(info)\r
146 @@ -15,11 +19,23 @@ ifeq ($(HAVE_INSTALLINFO),1)\r
147  install: install-info\r
148  endif\r
149  \r
150 -%.info: %.texi\r
151 +%.entry: ../pod/%.pod\r
152 +       printf "@dircategory Notmuch\n@direntry\n" > $@\r
153 +       printf "* %s: (%s). " $(*F) $(*F) >> $@\r
154 +       podselect -section Name $< | \\r
155 +         perl -n -e  's/notmuch.* - (.*)/\u\L$$1/ && print' >> $@\r
156 +       printf "@end direntry\n" >> $@\r
157 +\r
158 +%.info: %.texi %.entry\r
159         makeinfo --no-split -o $@ $<\r
160  \r
161  $(dir)/notmuch-emacs.info: $(dir)/notmuch-emacs.texi $(dir)/version.texi\r
162  \r
163 +%.texi: ../pod/%.pod\r
164 +       # a nasty hack, but the nicer ways seem to have bugs.\r
165 +       pod2texi  $< | \\r
166 +          sed 's/@node Top/@include $(*F).entry\n@node Top/' > $@\r
167 +\r
168  .PHONY: $(dir)/version.texi\r
169  $(dir)/version.texi: version\r
170         printf "@set VERSION ${VERSION}\n" > $@\r
171 @@ -29,5 +45,8 @@ install-info: ${info}\r
172         mkdir -p "$(DESTDIR)$(INFODIR)"\r
173         install -m0644 $(info) "$(DESTDIR)$(INFODIR)"\r
174         install-info --section=Notmuch --info-dir=${DESTDIR}${INFODIR} $(emacs_info)\r
175 +       for ifile in $(man_info); do \\r
176 +           install-info --info-dir=${DESTDIR}${INFODIR} $${ifile}; \\r
177 +       done\r
178  \r
179 -CLEAN := $(CLEAN) $(info)\r
180 +CLEAN := $(CLEAN) $(info) $(man_entry) $(dir)/version.texi\r
181 diff --git a/man/Makefile.local b/man/Makefile.local\r
182 index 57910b7..91bef04 100644\r
183 --- a/man/Makefile.local\r
184 +++ b/man/Makefile.local\r
185 @@ -23,6 +23,8 @@ MAN1 := \\r
186  MAN5 := $(dir)/man5/notmuch-hooks.5\r
187  MAN7 := $(dir)/man7/notmuch-search-terms.7\r
188  \r
189 +GENERATED_MAN := $(MAIN_PAGE) $(MAN7)\r
190 +\r
191  MAN1_GZ := $(addsuffix .gz,$(MAN1))\r
192  MAN5_GZ := $(addsuffix .gz,$(MAN5))\r
193  MAN7_GZ := $(addsuffix .gz,$(MAN7))\r
194 @@ -34,6 +36,21 @@ COMPRESSED_MAN := $(MAN1_GZ) $(MAN5_GZ) $(MAN7_GZ)\r
195  %.gz: %\r
196         gzip --stdout $^ > $@\r
197  \r
198 +POD2MAN_RECIPE = mkdir -p $(@D) && \\r
199 +                pod2man --section=$(subst .,,$(suffix $@)) \\r
200 +                        --center="Notmuch Documentation" --release=${VERSION} $< > $@\r
201 +\r
202 +$(dir)/man1/%.1: $(dir)/../pod/%.pod\r
203 +       $(POD2MAN_RECIPE)\r
204 +\r
205 +$(dir)/man5/%.5: $(dir)/../pod/%.pod\r
206 +       $(POD2MAN_RECIPE)\r
207 +\r
208 +$(dir)/man7/%.7: $(dir)/../pod/%.pod\r
209 +       $(POD2MAN_RECIPE)\r
210 +\r
211 +CLEAN := $(CLEAN) $(NROFF7)\r
212 +\r
213  .PHONY: install-man update-man-versions\r
214  \r
215  install-man: $(COMPRESSED_MAN)\r
216 @@ -52,4 +69,4 @@ update-man-versions: $(MAN_SOURCE)\r
217                 < $$file.bak > $$file; \\r
218         done\r
219  \r
220 -CLEAN := $(CLEAN) $(COMPRESSED_MAN) $(MAN_BACKUP)\r
221 +CLEAN := $(CLEAN) $(COMPRESSED_MAN) $(MAN_BACKUP) $(GENERATED_MAN)\r
222 diff --git a/man/man1/notmuch.1 b/man/man1/notmuch.1\r
223 deleted file mode 100644\r
224 index 605b514..0000000\r
225 --- a/man/man1/notmuch.1\r
226 +++ /dev/null\r
227 @@ -1,190 +0,0 @@\r
228 -.\" notmuch - Not much of an email program, (just index, search and tagging)\r
229 -.\"\r
230 -.\" Copyright Â© 2009 Carl Worth\r
231 -.\"\r
232 -.\" Notmuch is free software: you can redistribute it and/or modify\r
233 -.\" it under the terms of the GNU General Public License as published by\r
234 -.\" the Free Software Foundation, either version 3 of the License, or\r
235 -.\" (at your option) any later version.\r
236 -.\"\r
237 -.\" Notmuch is distributed in the hope that it will be useful,\r
238 -.\" but WITHOUT ANY WARRANTY; without even the implied warranty of\r
239 -.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
240 -.\" GNU General Public License for more details.\r
241 -.\"\r
242 -.\" You should have received a copy of the GNU General Public License\r
243 -.\" along with this program.  If not, see http://www.gnu.org/licenses/ .\r
244 -.\"\r
245 -.\" Author: Carl Worth <cworth@cworth.org>\r
246 -.TH NOTMUCH 1 2013-12-30 "Notmuch 0.17"\r
247 -.SH NAME\r
248 -notmuch \- thread-based email index, search, and tagging\r
249 -.SH SYNOPSIS\r
250 -.B notmuch\r
251 -.RI "[" option " ...] " command  " [" arg " ...]"\r
252 -.SH DESCRIPTION\r
253 -Notmuch is a command-line based program for indexing, searching,\r
254 -reading, and tagging large collections of email messages.\r
255 -\r
256 -This page describes how to get started using notmuch from the command\r
257 -line, and gives a brief overview of the commands available. For more\r
258 -information on e.g.\r
259 -.B notmuch show\r
260 -consult the \fBnotmuch-show\fR(1) man page, also accessible via\r
261 -.B notmuch help show\r
262 -\r
263 -The quickest way to get started with Notmuch is to simply invoke the\r
264 -.B notmuch\r
265 -command with no arguments, which will interactively guide you through\r
266 -the process of indexing your mail.\r
267 -.SH NOTE\r
268 -While the command-line program\r
269 -.B notmuch\r
270 -provides powerful functionality, it does not provide the most\r
271 -convenient interface for that functionality. More sophisticated\r
272 -interfaces are expected to be built on top of either the command-line\r
273 -interface, or more likely, on top of the notmuch library\r
274 -interface. See http://notmuchmail.org for more about alternate\r
275 -interfaces to notmuch. The emacs-based interface to notmuch (available under\r
276 -.B emacs/\r
277 -in the Notmuch source distribution) is probably the most widely used at\r
278 -this time.\r
279 -\r
280 -.SH OPTIONS\r
281 -\r
282 -Supported global options for\r
283 -.B notmuch\r
284 -include\r
285 -\r
286 -.RS 4\r
287 -.TP 4\r
288 -.B \-\-help\r
289 -\r
290 -Print a synopsis of available commands and exit.\r
291 -.RE\r
292 -\r
293 -.RS 4\r
294 -.TP 4\r
295 -.B \-\-version\r
296 -\r
297 -Print the installed version of notmuch, and exit.\r
298 -.RE\r
299 -\r
300 -.RS 4\r
301 -.TP 4\r
302 -.B \-\-config=FILE\r
303 -\r
304 -Specify the configuration file to use. This overrides any\r
305 -configuration file specified by ${NOTMUCH_CONFIG}.\r
306 -\r
307 -.RE\r
308 -\r
309 -.SH COMMANDS\r
310 -\r
311 -\r
312 -.SS SETUP\r
313 -\r
314 -The\r
315 -.B notmuch setup\r
316 -command is used to configure Notmuch for first use, (or to reconfigure\r
317 -it later).\r
318 -\r
319 -The setup command will prompt for your full name, your primary email\r
320 -address, any alternate email addresses you use, and the directory\r
321 -containing your email archives. Your answers will be written to a\r
322 -configuration file in ${NOTMUCH_CONFIG} (if set) or\r
323 -${HOME}/.notmuch-config . This configuration file will be created with\r
324 -descriptive comments, making it easy to edit by hand later to change the\r
325 -configuration. Or you can run\r
326 -.B "notmuch setup"\r
327 -again to change the configuration.\r
328 -\r
329 -The mail directory you specify can contain any number of\r
330 -sub-directories and should primarily contain only files with individual\r
331 -email messages (eg. maildir or mh archives are perfect). If there are\r
332 -other, non-email files (such as indexes maintained by other email\r
333 -programs) then notmuch will do its best to detect those and ignore\r
334 -them.\r
335 -\r
336 -Mail storage that uses mbox format, (where one mbox file contains many\r
337 -messages), will not work with notmuch. If that's how your mail is\r
338 -currently stored, it is recommended you first convert it to maildir\r
339 -format with a utility such as mb2md before running\r
340 -.B "notmuch setup" .\r
341 -\r
342 -Invoking\r
343 -.B notmuch\r
344 -with no command argument will run\r
345 -.B setup\r
346 -if the setup command has not previously been completed.\r
347 -.RE\r
348 -\r
349 -.SS OTHER COMMANDS\r
350 -\r
351 -Several of the notmuch commands accept search terms with a common\r
352 -syntax. See \fNnotmuch-search-terms\fR(7)\r
353 -for more details on the supported syntax.\r
354 -\r
355 -The\r
356 -.BR search ", " show " and " count\r
357 -commands are used to query the email database.\r
358 -\r
359 -The\r
360 -.B reply\r
361 -command is useful for preparing a template for an email reply.\r
362 -\r
363 -The\r
364 -.B tag\r
365 -command is the only command available for manipulating database\r
366 -contents.\r
367 -\r
368 -\r
369 -The\r
370 -.BR dump " and " restore\r
371 -commands can be used to create a textual dump of email tags for backup\r
372 -purposes, and to restore from that dump.\r
373 -\r
374 -The\r
375 -.B config\r
376 -command can be used to get or set settings int the notmuch\r
377 -configuration file.\r
378 -\r
379 -.SH ENVIRONMENT\r
380 -The following environment variables can be used to control the\r
381 -behavior of notmuch.\r
382 -.TP\r
383 -.B NOTMUCH_CONFIG\r
384 -Specifies the location of the notmuch configuration file. Notmuch will\r
385 -use ${HOME}/.notmuch\-config if this variable is not set.\r
386 -\r
387 -.TP\r
388 -.B NOTMUCH_TALLOC_REPORT\r
389 -Location to write a talloc memory usage report. See\r
390 -.B talloc_enable_leak_report_full\r
391 -in \fBtalloc\fR(3)\r
392 -for more information.\r
393 -\r
394 -.TP\r
395 -.B NOTMUCH_DEBUG_QUERY\r
396 -If set to a non-empty value, the notmuch library will print (to stderr) Xapian\r
397 -queries it constructs.\r
398 -\r
399 -.SH SEE ALSO\r
400 -\r
401 -\fBnotmuch-config\fR(1), \fBnotmuch-count\fR(1),\r
402 -\fBnotmuch-dump\fR(1), \fBnotmuch-hooks\fR(5),\r
403 -\fBnotmuch-insert\fR(1), \fBnotmuch-new\fR(1),\r
404 -\fBnotmuch-reply\fR(1), \fBnotmuch-restore\fR(1),\r
405 -\fBnotmuch-search\fR(1), \fBnotmuch-search-terms\fR(7),\r
406 -\fBnotmuch-show\fR(1), \fBnotmuch-tag\fR(1)\r
407 -\r
408 -\r
409 -The notmuch website:\r
410 -.B http://notmuchmail.org\r
411 -.SH CONTACT\r
412 -Feel free to send questions, comments, or kudos to the notmuch mailing\r
413 -list <notmuch@notmuchmail.org> . Subscription is not required before\r
414 -posting, but is available from the notmuchmail.org website.\r
415 -\r
416 -Real-time interaction with the Notmuch community is available via IRC\r
417 -(server: irc.freenode.net, channel: #notmuch).\r
418 diff --git a/man/man7/notmuch-search-terms.7 b/man/man7/notmuch-search-terms.7\r
419 deleted file mode 100644\r
420 index a768b63..0000000\r
421 --- a/man/man7/notmuch-search-terms.7\r
422 +++ /dev/null\r
423 @@ -1,269 +0,0 @@\r
424 -.TH NOTMUCH-SEARCH-TERMS 7 2013-12-30 "Notmuch 0.17"\r
425 -\r
426 -.SH NAME\r
427 -notmuch-search-terms \- syntax for notmuch queries\r
428 -\r
429 -.SH SYNOPSIS\r
430 -\r
431 -.B notmuch count\r
432 -.RI  [ options... ]\r
433 -.RI  < search-term ">..."\r
434 -\r
435 -.B "notmuch dump"\r
436 -.RI "[ <" filename "> ] [--]"\r
437 -.RI "[ <" search-term ">...]"\r
438 -\r
439 -.B notmuch search\r
440 -.RI  [  options "...] <" search-term ">..."\r
441 -\r
442 -.B notmuch show\r
443 -.RI "[" options "...] <" search-term ">..."\r
444 -\r
445 -.B notmuch tag\r
446 -.RI  "+<" tag> "|\-<" tag "> [...] [\-\-] <" search-term ">..."\r
447 -\r
448 -\r
449 -.SH DESCRIPTION\r
450 -Several notmuch commands accept a common syntax for search terms.\r
451 -\r
452 -The search terms can consist of free-form text (and quoted phrases)\r
453 -which will match all messages that contain all of the given\r
454 -terms/phrases in the body, the subject, or any of the sender or\r
455 -recipient headers.\r
456 -\r
457 -As a special case, a search string consisting of exactly a single\r
458 -asterisk ("*") will match all messages.\r
459 -\r
460 -In addition to free text, the following prefixes can be used to force\r
461 -terms to match against specific portions of an email, (where\r
462 -<brackets> indicate user-supplied values):\r
463 -\r
464 -       from:<name-or-address>\r
465 -\r
466 -       to:<name-or-address>\r
467 -\r
468 -       subject:<word-or-quoted-phrase>\r
469 -\r
470 -       attachment:<word>\r
471 -\r
472 -       tag:<tag> (or is:<tag>)\r
473 -\r
474 -       id:<message-id>\r
475 -\r
476 -       thread:<thread-id>\r
477 -\r
478 -       folder:<directory-path>\r
479 -\r
480 -       date:<since>..<until>\r
481 -\r
482 -The\r
483 -.B from:\r
484 -prefix is used to match the name or address of the sender of an email\r
485 -message.\r
486 -\r
487 -The\r
488 -.B to:\r
489 -prefix is used to match the names or addresses of any recipient of an\r
490 -email message, (whether To, Cc, or Bcc).\r
491 -\r
492 -Any term prefixed with\r
493 -.B subject:\r
494 -will match only text from the subject of an email. Searching for a\r
495 -phrase in the subject is supported by including quotation marks around\r
496 -the phrase, immediately following\r
497 -.BR subject: .\r
498 -\r
499 -The\r
500 -.B attachment:\r
501 -prefix can be used to search for specific filenames (or extensions) of\r
502 -attachments to email messages.\r
503 -\r
504 -For\r
505 -.BR tag: " and " is:\r
506 -valid tag values include\r
507 -.BR inbox " and " unread\r
508 -by default for new messages added by\r
509 -.B notmuch new\r
510 -as well as any other tag values added manually with\r
511 -.BR "notmuch tag" .\r
512 -\r
513 -For\r
514 -.BR id: ,\r
515 -message ID values are the literal contents of the Message\-ID: header\r
516 -of email messages, but without the '<', '>' delimiters.\r
517 -\r
518 -The\r
519 -.B thread:\r
520 -prefix can be used with the thread ID values that are generated\r
521 -internally by notmuch (and do not appear in email messages). These\r
522 -thread ID values can be seen in the first column of output from\r
523 -.B "notmuch search"\r
524 -\r
525 -The\r
526 -.B folder:\r
527 -prefix can be used to search for email message files that are\r
528 -contained within particular directories within the mail store. If the\r
529 -same email message has multiple message files associated with it, it's\r
530 -sufficient for a match that at least one of the files is contained\r
531 -within a matching directory. Only the directory components below the\r
532 -top-level mail database path are available to be searched.\r
533 -\r
534 -The\r
535 -.B date:\r
536 -prefix can be used to restrict the results to only messages within a\r
537 -particular time range (based on the Date: header) with a range syntax\r
538 -of:\r
539 -\r
540 -       date:<since>..<until>\r
541 -\r
542 -See \fBDATE AND TIME SEARCH\fR below for details on the range\r
543 -expression, and supported syntax for <since> and <until> date and time\r
544 -expressions.\r
545 -\r
546 -The time range can also be specified using timestamps with a syntax\r
547 -of:\r
548 -\r
549 -       <initial-timestamp>..<final-timestamp>\r
550 -\r
551 -Each timestamp is a number representing the number of seconds since\r
552 -1970\-01\-01 00:00:00 UTC.\r
553 -\r
554 -In addition to individual terms, multiple terms can be\r
555 -combined with Boolean operators (\r
556 -.BR and ", " or ", " not\r
557 -, etc.). Each term in the query will be implicitly connected by a\r
558 -logical AND if no explicit operator is provided, (except that terms\r
559 -with a common prefix will be implicitly combined with OR until we get\r
560 -Xapian defect #402 fixed).\r
561 -\r
562 -Parentheses can also be used to control the combination of the Boolean\r
563 -operators, but will have to be protected from interpretation by the\r
564 -shell, (such as by putting quotation marks around any parenthesized\r
565 -expression).\r
566 -\r
567 -.SH DATE AND TIME SEARCH\r
568 -\r
569 -notmuch understands a variety of standard and natural ways of\r
570 -expressing dates and times, both in absolute terms ("2012-10-24") and\r
571 -in relative terms ("yesterday"). Any number of relative terms can be\r
572 -combined ("1 hour 25 minutes") and an absolute date/time can be\r
573 -combined with relative terms to further adjust it. A non-exhaustive\r
574 -description of the syntax supported for absolute and relative terms is\r
575 -given below.\r
576 -\r
577 -.RS 4\r
578 -.TP 4\r
579 -.B The range expression\r
580 -\r
581 -date:<since>..<until>\r
582 -\r
583 -The above expression restricts the results to only messages from\r
584 -<since> to <until>, based on the Date: header.\r
585 -\r
586 -<since> and <until> can describe imprecise times, such as "yesterday".\r
587 -In this case, <since> is taken as the earliest time it could describe\r
588 -(the beginning of yesterday) and <until> is taken as the latest time\r
589 -it could describe (the end of yesterday). Similarly,\r
590 -date:january..february matches from the beginning of January to the\r
591 -end of February.\r
592 -\r
593 -Currently, we do not support spaces in range expressions. You can\r
594 -replace the spaces with '_', or (in most cases) '-', or (in some\r
595 -cases) leave the spaces out altogether. Examples in this man page use\r
596 -spaces for clarity.\r
597 -\r
598 -Open-ended ranges are supported (since Xapian 1.2.1), i.e. it's\r
599 -possible to specify date:..<until> or date:<since>.. to not limit the\r
600 -start or end time, respectively. Pre-1.2.1 Xapian does not report an\r
601 -error on open ended ranges, but it does not work as expected either.\r
602 -\r
603 -Entering date:expr without ".." (for example date:yesterday) won't\r
604 -work, as it's not interpreted as a range expression at all. You can\r
605 -achieve the expected result by duplicating the expr both sides of ".."\r
606 -(for example date:yesterday..yesterday).\r
607 -.RE\r
608 -\r
609 -.RS 4\r
610 -.TP 4\r
611 -.B Relative date and time\r
612 -[N|number] (years|months|weeks|days|hours|hrs|minutes|mins|seconds|secs) [...]\r
613 -\r
614 -All refer to past, can be repeated and will be accumulated.\r
615 -\r
616 -Units can be abbreviated to any length, with the otherwise ambiguous\r
617 -single m being m for minutes and M for months.\r
618 -\r
619 -Number can also be written out one, two, ..., ten, dozen,\r
620 -hundred. Additionally, the unit may be preceded by "last" or "this"\r
621 -(e.g., "last week" or "this month").\r
622 -\r
623 -When combined with absolute date and time, the relative date and time\r
624 -specification will be relative from the specified absolute date and\r
625 -time.\r
626 -\r
627 -Examples: 5M2d, two weeks\r
628 -.RE\r
629 -\r
630 -.RS 4\r
631 -.TP 4\r
632 -.B Supported absolute time formats\r
633 -H[H]:MM[:SS] [(am|a.m.|pm|p.m.)]\r
634 -\r
635 -H[H] (am|a.m.|pm|p.m.)\r
636 -\r
637 -HHMMSS\r
638 -\r
639 -now\r
640 -\r
641 -noon\r
642 -\r
643 -midnight\r
644 -\r
645 -Examples: 17:05, 5pm\r
646 -.RE\r
647 -\r
648 -.RS 4\r
649 -.TP 4\r
650 -.B Supported absolute date formats\r
651 -YYYY-MM[-DD]\r
652 -\r
653 -DD-MM[-[YY]YY]\r
654 -\r
655 -MM-YYYY\r
656 -\r
657 -M[M]/D[D][/[YY]YY]\r
658 -\r
659 -M[M]/YYYY\r
660 -\r
661 -D[D].M[M][.[YY]YY]\r
662 -\r
663 -D[D][(st|nd|rd|th)] Mon[thname] [YYYY]\r
664 -\r
665 -Mon[thname] D[D][(st|nd|rd|th)] [YYYY]\r
666 -\r
667 -Wee[kday]\r
668 -\r
669 -Month names can be abbreviated at three or more characters.\r
670 -\r
671 -Weekday names can be abbreviated at three or more characters.\r
672 -\r
673 -Examples: 2012-07-31, 31-07-2012, 7/31/2012, August 3\r
674 -.RE\r
675 -\r
676 -.RS 4\r
677 -.TP 4\r
678 -.B Time zones\r
679 -(+|-)HH:MM\r
680 -\r
681 -(+|-)HH[MM]\r
682 -\r
683 -Some time zone codes, e.g. UTC, EET.\r
684 -.RE\r
685 -\r
686 -.SH SEE ALSO\r
687 -\r
688 -\fBnotmuch\fR(1), \fBnotmuch-config\fR(1), \fBnotmuch-count\fR(1),\r
689 -\fBnotmuch-dump\fR(1), \fBnotmuch-hooks\fR(5),\r
690 -\fBnotmuch-insert\fR(1), \fBnotmuch-new\fR(1),\r
691 -\fBnotmuch-reply\fR(1), \fBnotmuch-restore\fR(1),\r
692 -\fBnotmuch-search\fR(1), \fBnotmuch-show\fR(1), \fBnotmuch-tag\fR(1)\r
693 diff --git a/pod/notmuch-search-terms.pod b/pod/notmuch-search-terms.pod\r
694 new file mode 100644\r
695 index 0000000..47b9c20\r
696 --- /dev/null\r
697 +++ b/pod/notmuch-search-terms.pod\r
698 @@ -0,0 +1,235 @@\r
699 +=head1 Name\r
700 +\r
701 +notmuch-search-terms - syntax for notmuch queries\r
702 +\r
703 +=head1 Synopsis\r
704 +\r
705 +B<notmuch> B<count> [I<options...>] <I<search-term>>...\r
706 +\r
707 +B<notmuch> B<dump> [ <I<filename>> ] [--] [ <I<search-term>>...]\r
708 +\r
709 +B<notmuch> B<search> [I<options>...] <I<search-term>>...\r
710 +\r
711 +B<notmuch> B<show> [I<options>...] <I<search-term>>...\r
712 +\r
713 +B<notmuch> B<tag> +<I<tag>>|-<I<tag>> [...] [--] <I<search-term>>...\r
714 +\r
715 +=head1 Description\r
716 +\r
717 +Several notmuch commands accept a common syntax for search terms.\r
718 +\r
719 +The search terms can consist of free-form text (and quoted phrases)\r
720 +which will match all messages that contain all of the given\r
721 +terms/phrases in the body, the subject, or any of the sender or\r
722 +recipient headers.\r
723 +\r
724 +As a special case, a search string consisting of exactly a single\r
725 +asterisk ("*") will match all messages.\r
726 +\r
727 +In addition to free text, the following prefixes can be used to force\r
728 +terms to match against specific portions of an email, (where <brackets>\r
729 +indicate user-supplied values):\r
730 +\r
731 +from:<name-or-address>\r
732 +\r
733 +to:<name-or-address>\r
734 +\r
735 +subject:<word-or-quoted-phrase>\r
736 +\r
737 +attachment:<word>\r
738 +\r
739 +tag:<tag> (or is:<tag>)\r
740 +\r
741 +id:<message-id>\r
742 +\r
743 +thread:<thread-id>\r
744 +\r
745 +folder:<directory-path>\r
746 +\r
747 +date:<since>..<until>\r
748 +\r
749 +The B<from:> prefix is used to match the name or address of the sender of\r
750 +an email message.\r
751 +\r
752 +The B<to:> prefix is used to match the names or addresses of any recipient\r
753 +of an email message, (whether To, Cc, or Bcc).\r
754 +\r
755 +Any term prefixed with B<subject:> will match only text from the subject\r
756 +of an email. Searching for a phrase in the subject is supported by\r
757 +including quotation marks around the phrase, immediately following\r
758 +B<subject:>.\r
759 +\r
760 +The B<attachment:> prefix can be used to search for specific filenames (or\r
761 +extensions) of attachments to email messages.\r
762 +\r
763 +For B<tag:> and B<is:> valid tag values include B<inbox> and B<unread> by default\r
764 +for new messages added by B<notmuch> B<new> as well as any other tag values\r
765 +added manually with B<notmuch> B<tag>.\r
766 +\r
767 +For B<id:>, message ID values are the literal contents of the Message-ID:\r
768 +header of email messages, but without the `<', `>' delimiters.\r
769 +\r
770 +The B<thread:> prefix can be used with the thread ID values that are\r
771 +generated internally by notmuch (and do not appear in email messages).\r
772 +These thread ID values can be seen in the first column of output from\r
773 +B<notmuch> B<search>\r
774 +\r
775 +The B<folder:> prefix can be used to search for email message files that\r
776 +are contained within particular directories within the mail store. If\r
777 +the same email message has multiple message files associated with it,\r
778 +it's sufficient for a match that at least one of the files is contained\r
779 +within a matching directory. Only the directory components below the\r
780 +top-level mail database path are available to be searched.\r
781 +\r
782 +The B<date:> prefix can be used to restrict the results to only messages\r
783 +within a particular time range (based on the Date: header) with a range\r
784 +syntax of:\r
785 +\r
786 +date:<since>..<until>\r
787 +\r
788 +See B<DATE> B<AND> B<TIME> B<SEARCH> below for details on the range expression, and\r
789 +supported syntax for <since> and <until> date and time expressions.\r
790 +\r
791 +The time range can also be specified using timestamps with a syntax of:\r
792 +\r
793 +<initial-timestamp>..<final-timestamp>\r
794 +\r
795 +Each timestamp is a number representing the number of seconds since\r
796 +1970-01-01 00:00:00 UTC.\r
797 +\r
798 +In addition to individual terms, multiple terms can be combined with\r
799 +Boolean operators ( B<and>, B<or>, B<not> , etc.). Each term in the query will\r
800 +be implicitly connected by a logical AND if no explicit operator is\r
801 +provided, (except that terms with a common prefix will be implicitly\r
802 +combined with OR until we get Xapian defect #402 fixed).\r
803 +\r
804 +Parentheses can also be used to control the combination of the Boolean\r
805 +operators, but will have to be protected from interpretation by the\r
806 +shell, (such as by putting quotation marks around any parenthesized\r
807 +expression).\r
808 +\r
809 +=head1 Date and Time Search\r
810 +\r
811 +notmuch understands a variety of standard and natural ways of\r
812 +expressing dates and times, both in absolute terms ("2012-10-24") and\r
813 +in relative terms ("yesterday"). Any number of relative terms can be\r
814 +combined ("1 hour 25 minutes") and an absolute date/time can be\r
815 +combined with relative terms to further adjust it. A non-exhaustive\r
816 +description of the syntax supported for absolute and relative terms is\r
817 +given below.\r
818 +\r
819 +B<The> B<range> B<expression>\r
820 +\r
821 +date:<since>..<until>\r
822 +\r
823 +The above expression restricts the results to only messages\r
824 +from <since> to <until>, based on the Date: header.\r
825 +\r
826 +<since> and <until> can describe imprecise times, such as\r
827 +"yesterday". In this case, <since> is taken as the earliest\r
828 +time it could describe (the beginning of yesterday) and <until>\r
829 +is taken as the latest time it could describe (the end of\r
830 +yesterday). Similarly, date:january..february matches from the\r
831 +beginning of January to the end of February.\r
832 +\r
833 +Currently, we do not support spaces in range expressions. You\r
834 +can replace the spaces with `_', or (in most cases) `-', or (in\r
835 +some cases) leave the spaces out altogether. Examples in this\r
836 +man page use spaces for clarity.\r
837 +\r
838 +Open-ended ranges are supported (since Xapian 1.2.1), i.e. it's\r
839 +possible to specify date:..<until> or date:<since>.. to not\r
840 +limit the start or end time, respectively. Pre-1.2.1 Xapian\r
841 +does not report an error on open ended ranges, but it does not\r
842 +work as expected either.\r
843 +\r
844 +Entering date:expr without ".." (for example date:yesterday)\r
845 +won't work, as it's not interpreted as a range expression at\r
846 +all. You can achieve the expected result by duplicating the\r
847 +expr both sides of ".." (for example\r
848 +date:yesterday..yesterday).\r
849 +\r
850 +B<Relative> B<date> B<and> B<time>\r
851 +[N|number]\r
852 +(years|months|weeks|days|hours|hrs|minutes|mins|seconds|secs)\r
853 +[...]\r
854 +\r
855 +All refer to past, can be repeated and will be accumulated.\r
856 +\r
857 +Units can be abbreviated to any length, with the otherwise\r
858 +ambiguous single m being m for minutes and M for months.\r
859 +\r
860 +Number can also be written out one, two, ..., ten, dozen,\r
861 +hundred. Additionally, the unit may be preceded by "last" or\r
862 +"this" (e.g., "last week" or "this month").\r
863 +\r
864 +When combined with absolute date and time, the relative date\r
865 +and time specification will be relative from the specified\r
866 +absolute date and time.\r
867 +\r
868 +Examples: 5M2d, two weeks\r
869 +\r
870 +B<Supported> B<absolute> B<time> B<formats>\r
871 +H[H]:MM[:SS] [(am|a.m.|pm|p.m.)]\r
872 +\r
873 +H[H] (am|a.m.|pm|p.m.)\r
874 +\r
875 +=over 5\r
876 +\r
877 +=item HHMMSS\r
878 +\r
879 +=back\r
880 +\r
881 +now\r
882 +\r
883 +noon\r
884 +\r
885 +midnight\r
886 +\r
887 +Examples: 17:05, 5pm\r
888 +\r
889 +B<Supported> B<absolute> B<date> B<formats>\r
890 +YYYY-MM[-DD]\r
891 +\r
892 +=over 5\r
893 +\r
894 +=item DD-MM[-[YY]YY]\r
895 +\r
896 +=item MM-YYYY\r
897 +\r
898 +=item M[M]/D[D][/[YY]YY]\r
899 +\r
900 +=item M[M]/YYYY\r
901 +\r
902 +=item D[D].M[M][.[YY]YY]\r
903 +\r
904 +=back\r
905 +\r
906 +D[D][(st|nd|rd|th)] Mon[thname] [YYYY]\r
907 +\r
908 +Mon[thname] D[D][(st|nd|rd|th)] [YYYY]\r
909 +\r
910 +Wee[kday]\r
911 +\r
912 +Month names can be abbreviated at three or more characters.\r
913 +\r
914 +Weekday names can be abbreviated at three or more characters.\r
915 +\r
916 +Examples: 2012-07-31, 31-07-2012, 7/31/2012, August 3\r
917 +\r
918 +B<Time> B<zones>\r
919 +(+|-)HH:MM\r
920 +\r
921 +=over 5\r
922 +\r
923 +=item (+|-)HH[MM]\r
924 +\r
925 +=back\r
926 +\r
927 +Some time zone codes, e.g. UTC, EET.\r
928 +\r
929 +=head1 See Also\r
930 +\r
931 +L<notmuch(1)>, L<notmuch-config(1)>, L<notmuch-count(1)>, L<notmuch-dump(1)>,\r
932 +L<notmuch-hooks(5)>, L<notmuch-insert(1)>, L<notmuch-new(1)>, L<notmuch-reply(1)>,\r
933 +L<notmuch-restore(1)>, L<notmuch-search(1)>, L<notmuch-show(1)>, L<notmuch-tag(1)>\r
934 diff --git a/pod/notmuch.pod b/pod/notmuch.pod\r
935 new file mode 100644\r
936 index 0000000..5b11967\r
937 --- /dev/null\r
938 +++ b/pod/notmuch.pod\r
939 @@ -0,0 +1,155 @@\r
940 +=head1 Name\r
941 +\r
942 +notmuch - thread-based email index, search, and tagging\r
943 +\r
944 +=head1 Synopsis\r
945 +\r
946 +B<notmuch> [I<option> ...] I<command> [I<arg> ...]\r
947 +\r
948 +=head1 Description\r
949 +\r
950 +Notmuch is a command-line based program for indexing, searching,\r
951 +reading, and tagging large collections of email messages.\r
952 +\r
953 +This page describes how to get started using notmuch from the command\r
954 +line, and gives a brief overview of the commands available. For more\r
955 +information on e.g. B<notmuch> B<show> consult the L<notmuch-show(1)> man page,\r
956 +also accessible via B<notmuch> B<help> B<show>\r
957 +\r
958 +The quickest way to get started with Notmuch is to simply invoke the\r
959 +B<notmuch> command with no arguments, which will interactively guide you\r
960 +through the process of indexing your mail.\r
961 +\r
962 +=head1 Note\r
963 +\r
964 +While the command-line program B<notmuch> provides powerful functionality,\r
965 +it does not provide the most convenient interface for that\r
966 +functionality. More sophisticated interfaces are expected to be built\r
967 +on top of either the command-line interface, or more likely, on top of\r
968 +the notmuch library interface. See http://notmuchmail.org for more\r
969 +about alternate interfaces to notmuch. The emacs-based interface to\r
970 +notmuch (available under B<emacs/> in the Notmuch source distribution) is\r
971 +probably the most widely used at this time.\r
972 +\r
973 +=head1 Options\r
974 +\r
975 +Supported global options for B<notmuch> include\r
976 +\r
977 +=over 5\r
978 +\r
979 +=item B<--help>\r
980 +\r
981 +=back\r
982 +\r
983 +Print a synopsis of available commands and exit.\r
984 +\r
985 +=over 5\r
986 +\r
987 +=item B<--version>\r
988 +\r
989 +=back\r
990 +\r
991 +Print the installed version of notmuch, and exit.\r
992 +\r
993 +=over 5\r
994 +\r
995 +=item B<--config=FILE>\r
996 +\r
997 +=back\r
998 +\r
999 +Specify the configuration file to use. This overrides any\r
1000 +configuration file specified by ${NOTMUCH_CONFIG}.\r
1001 +\r
1002 +=head1 Commands\r
1003 +\r
1004 +B<SETUP>\r
1005 +The B<notmuch> B<setup> command is used to configure Notmuch for first use,\r
1006 +(or to reconfigure it later).\r
1007 +\r
1008 +The setup command will prompt for your full name, your primary email\r
1009 +address, any alternate email addresses you use, and the directory\r
1010 +containing your email archives. Your answers will be written to a\r
1011 +configuration file in ${NOTMUCH_CONFIG} (if set) or ${HOME}/.notmuch-\r
1012 +config . This configuration file will be created with descriptive\r
1013 +comments, making it easy to edit by hand later to change the\r
1014 +configuration. Or you can run B<notmuch> B<setup> again to change the\r
1015 +configuration.\r
1016 +\r
1017 +The mail directory you specify can contain any number of sub-\r
1018 +directories and should primarily contain only files with individual\r
1019 +email messages (eg. maildir or mh archives are perfect). If there are\r
1020 +other, non-email files (such as indexes maintained by other email\r
1021 +programs) then notmuch will do its best to detect those and ignore\r
1022 +them.\r
1023 +\r
1024 +Mail storage that uses mbox format, (where one mbox file contains many\r
1025 +messages), will not work with notmuch. If that's how your mail is\r
1026 +currently stored, it is recommended you first convert it to maildir\r
1027 +format with a utility such as mb2md before running B<notmuch> B<setup> B<.>\r
1028 +\r
1029 +Invoking B<notmuch> with no command argument will run B<setup> if the setup\r
1030 +command has not previously been completed.\r
1031 +\r
1032 +B<OTHER> B<COMMANDS>\r
1033 +Several of the notmuch commands accept search terms with a common\r
1034 +syntax. See L<notmuch-search-terms(7)> for more details on the supported\r
1035 +syntax.\r
1036 +\r
1037 +The B<search>, B<show> and B<count> commands are used to query the email\r
1038 +database.\r
1039 +\r
1040 +The B<reply> command is useful for preparing a template for an email\r
1041 +reply.\r
1042 +\r
1043 +The B<tag> command is the only command available for manipulating database\r
1044 +contents.\r
1045 +\r
1046 +The B<dump> and B<restore> commands can be used to create a textual dump of\r
1047 +email tags for backup purposes, and to restore from that dump.\r
1048 +\r
1049 +The B<config> command can be used to get or set settings int the notmuch\r
1050 +configuration file.\r
1051 +\r
1052 +=head1 Environment\r
1053 +\r
1054 +The following environment variables can be used to control the behavior\r
1055 +of notmuch.\r
1056 +\r
1057 +=over 5\r
1058 +\r
1059 +=item B<NOTMUCH_CONFIG>\r
1060 +\r
1061 +Specifies the location of the notmuch configuration file.\r
1062 +Notmuch will use ${HOME}/.notmuch-config if this variable is not\r
1063 +set.\r
1064 +\r
1065 +=item B<NOTMUCH_TALLOC_REPORT>\r
1066 +\r
1067 +Location to write a talloc memory usage report. See\r
1068 +B<talloc_enable_leak_report_full> in L<talloc(3)> for more\r
1069 +information.\r
1070 +\r
1071 +=item B<NOTMUCH_DEBUG_QUERY>\r
1072 +\r
1073 +If set to a non-empty value, the notmuch library will print (to\r
1074 +stderr) Xapian queries it constructs.\r
1075 +\r
1076 +=back\r
1077 +\r
1078 +=head1 See Also\r
1079 +\r
1080 +L<notmuch-config(1)>, L<notmuch-count(1)>, L<notmuch-dump(1)>, L<notmuch-hooks(5)>,\r
1081 +L<notmuch-insert(1)>, L<notmuch-new(1)>, L<notmuch-reply(1)>, L<notmuch-restore(1)>,\r
1082 +L<notmuch-search(1)>, L<notmuch-search-terms(7)>, L<notmuch-show(1)>,\r
1083 +L<notmuch-tag(1)>\r
1084 +\r
1085 +The notmuch website: B<http://notmuchmail.org>\r
1086 +\r
1087 +=head1 Contact\r
1088 +\r
1089 +Feel free to send questions, comments, or kudos to the notmuch mailing\r
1090 +list <notmuch@notmuchmail.org> . Subscription is not required before\r
1091 +posting, but is available from the notmuchmail.org website.\r
1092 +\r
1093 +Real-time interaction with the Notmuch community is available via IRC\r
1094 +(server: irc.freenode.net, channel: #notmuch).\r
1095 -- \r
1096 1.8.5.2\r
1097 \r