[RFC Patch v2 1/2] doc: start of sphinx based docs
authorDavid Bremner <david@tethera.net>
Tue, 28 Jan 2014 16:12:37 +0000 (12:12 +2000)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:59:29 +0000 (09:59 -0800)
27/9b185d808c67ed7cec556ada39023a168c0b7a [new file with mode: 0644]

diff --git a/27/9b185d808c67ed7cec556ada39023a168c0b7a b/27/9b185d808c67ed7cec556ada39023a168c0b7a
new file mode 100644 (file)
index 0000000..e667b3e
--- /dev/null
@@ -0,0 +1,1105 @@
+Return-Path: <bremner@tethera.net>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 3CDB6431FC2\r
+       for <notmuch@notmuchmail.org>; Tue, 28 Jan 2014 08:13:11 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
+       autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id E3+TXQpA2J9q for <notmuch@notmuchmail.org>;\r
+       Tue, 28 Jan 2014 08:13:06 -0800 (PST)\r
+Received: from yantan.tethera.net (yantan.tethera.net [199.188.72.155])\r
+       (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 3E400431FBF\r
+       for <notmuch@notmuchmail.org>; Tue, 28 Jan 2014 08:13:06 -0800 (PST)\r
+Received: from remotemail by yantan.tethera.net with local (Exim 4.80)\r
+       (envelope-from <bremner@tethera.net>)\r
+       id 1W8BHY-000369-Fh; Tue, 28 Jan 2014 12:13:00 -0400\r
+Received: (nullmailer pid 15962 invoked by uid 1000); Tue, 28 Jan 2014\r
+       16:12:53 -0000\r
+From: David Bremner <david@tethera.net>\r
+To: notmuch@notmuchmail.org\r
+Subject: [RFC Patch v2 1/2] doc: start of sphinx based docs\r
+Date: Tue, 28 Jan 2014 12:12:37 -0400\r
+Message-Id: <1390925558-15873-2-git-send-email-david@tethera.net>\r
+X-Mailer: git-send-email 1.8.5.2\r
+In-Reply-To: <1390925558-15873-1-git-send-email-david@tethera.net>\r
+References: <87vbxfkdex.fsf@zancas.localnet>\r
+       <1390925558-15873-1-git-send-email-david@tethera.net>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=UTF-8\r
+Content-Transfer-Encoding: 8bit\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Tue, 28 Jan 2014 16:13:11 -0000\r
+\r
+This is the output from sphinx-quickstart, massaged a bit, along with\r
+a few sample docs converted to rst.\r
+---\r
+ Makefile                     |   2 +-\r
+ doc/Makefile                 |   5 +\r
+ doc/Makefile.local           |  28 +++++\r
+ doc/conf.py                  |  91 +++++++++++++++\r
+ doc/index.rst                |  24 ++++\r
+ doc/notmuch-emacs.rst        | 188 +++++++++++++++++++++++++++++++\r
+ doc/notmuch-search-terms.rst | 255 +++++++++++++++++++++++++++++++++++++++++++\r
+ doc/notmuch-search.rst       | 203 ++++++++++++++++++++++++++++++++++\r
+ doc/notmuch.rst              | 173 +++++++++++++++++++++++++++++\r
+ 9 files changed, 968 insertions(+), 1 deletion(-)\r
+ create mode 100644 doc/Makefile\r
+ create mode 100644 doc/Makefile.local\r
+ create mode 100644 doc/conf.py\r
+ create mode 100644 doc/index.rst\r
+ create mode 100644 doc/notmuch-emacs.rst\r
+ create mode 100644 doc/notmuch-search-terms.rst\r
+ create mode 100644 doc/notmuch-search.rst\r
+ create mode 100644 doc/notmuch.rst\r
+\r
+diff --git a/Makefile b/Makefile\r
+index 0428160..39f0e62 100644\r
+--- a/Makefile\r
++++ b/Makefile\r
+@@ -5,7 +5,7 @@ all:\r
+ # List all subdirectories here. Each contains its own Makefile.local.\r
+ # Use of '=', without '+=', seems to be required for out-of-tree\r
+ # builds to work.\r
+-subdirs = compat completion emacs lib man parse-time-string performance-test util test\r
++subdirs = compat completion doc emacs lib man parse-time-string performance-test util test\r
\r
+ # We make all targets depend on the Makefiles themselves.\r
+ global_deps = Makefile Makefile.config Makefile.local \\r
+diff --git a/doc/Makefile b/doc/Makefile\r
+new file mode 100644\r
+index 0000000..fa25832\r
+--- /dev/null\r
++++ b/doc/Makefile\r
+@@ -0,0 +1,5 @@\r
++all:\r
++      $(MAKE) -C .. all\r
++\r
++.DEFAULT:\r
++      $(MAKE) -C .. $@\r
+diff --git a/doc/Makefile.local b/doc/Makefile.local\r
+new file mode 100644\r
+index 0000000..d2a339b\r
+--- /dev/null\r
++++ b/doc/Makefile.local\r
+@@ -0,0 +1,28 @@\r
++# Makefile for Sphinx documentation\r
++#\r
++\r
++dir := doc\r
++\r
++# You can set these variables from the command line.\r
++SPHINXOPTS    := -q -c $(dir)\r
++SPHINXBUILD   = sphinx-build\r
++BUILDDIR      := $(dir)/_build\r
++\r
++# Internal variables.\r
++ALLSPHINXOPTS   := -d $(BUILDDIR)/doctrees $(SPHINXOPTS) $(dir)\r
++\r
++.PHONY: help clean html man texinfo info\r
++\r
++html:\r
++      $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html\r
++\r
++man:\r
++      $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man\r
++\r
++texinfo:\r
++      $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo\r
++\r
++info: texinfo\r
++      make -C $(BUILDDIR)/texinfo info\r
++\r
++CLEAN := $(CLEAN) $(dir)/_build\r
+diff --git a/doc/conf.py b/doc/conf.py\r
+new file mode 100644\r
+index 0000000..9170920\r
+--- /dev/null\r
++++ b/doc/conf.py\r
+@@ -0,0 +1,91 @@\r
++# -*- coding: utf-8 -*-\r
++\r
++import sys\r
++import os\r
++\r
++# -- General configuration ------------------------------------------------\r
++#\r
++# Add any Sphinx extension module names here, as strings. They can be\r
++# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom\r
++# ones.\r
++extensions = []\r
++\r
++# Add any paths that contain templates here, relative to this directory.\r
++templates_path = ['_templates']\r
++\r
++# The suffix of source filenames.\r
++source_suffix = '.rst'\r
++\r
++# The master toctree document.\r
++master_doc = 'index'\r
++\r
++# General information about the project.\r
++project = u'notmuch'\r
++copyright = u'2014, Carl Worth and many others'\r
++\r
++# The short X.Y version.\r
++version = '0.17'\r
++# The full version, including alpha/beta/rc tags.\r
++release = '0.17'\r
++\r
++# List of patterns, relative to source directory, that match files and\r
++# directories to ignore when looking for source files.\r
++exclude_patterns = ['_build']\r
++\r
++# The name of the Pygments (syntax highlighting) style to use.\r
++pygments_style = 'sphinx'\r
++\r
++# -- Options for HTML output ----------------------------------------------\r
++\r
++# The theme to use for HTML and HTML Help pages.  See the documentation for\r
++# a list of builtin themes.\r
++html_theme = 'default'\r
++\r
++\r
++# Add any paths that contain custom static files (such as style sheets) here,\r
++# relative to this directory. They are copied after the builtin static files,\r
++# so a file named "default.css" will overwrite the builtin "default.css".\r
++html_static_path = ['_static']\r
++\r
++# Output file base name for HTML help builder.\r
++htmlhelp_basename = 'notmuchdoc'\r
++\r
++# -- Options for manual page output ---------------------------------------\r
++\r
++# One entry per manual page. List of tuples\r
++# (source start file, name, description, authors, manual section).\r
++man_pages = [\r
++    ('notmuch', 'notmuch', u'thread-based email index, search, and tagging',\r
++     [u'Carl Worth and many others'], 1),\r
++    ('notmuch-search', 'notmuch-search', u'search the notmuch mail index',\r
++     [u'Carl Worth and many others'], 1),\r
++    ('notmuch-search-terms', 'notmuch-search-terms', u'query format for notmuch',\r
++     [u'Carl Worth and many others'], 7),\r
++\r
++]\r
++\r
++# If true, show URL addresses after external links.\r
++#man_show_urls = False\r
++\r
++# -- Options for Texinfo output -------------------------------------------\r
++\r
++# Grouping the document tree into Texinfo files. List of tuples\r
++# (source start file, target name, title, author,\r
++#  dir menu entry, description, category)\r
++texinfo_documents = [\r
++  ('notmuch', 'notmuch', u'notmuch Documentation',\r
++   u'Carl Worth and many others', 'notmuch', 'thread-based email index, search and tagging',\r
++   'Miscellaneous'),\r
++  ('notmuch-emacs', 'notmuch-emacs', u'notmuch Documentation',\r
++   u'Carl Worth and many others', 'notmuch-emacs', 'emacs based front-end for notmuch',\r
++   'Miscellaneous'),\r
++  ('notmuch-search', 'notmuch-search', u'notmuch Documentation',\r
++   u'Carl Worth and many others', 'notmuch-search', 'search the notmuch mail index.',\r
++   'Miscellaneous'),\r
++  ('notmuch-search-terms', 'notmuch-search-terms', u'notmuch Documentation',\r
++   u'Carl Worth and many others', 'notmuch-search-terms', 'query syntax for notmuch.',\r
++   'Miscellaneous'),\r
++]\r
++\r
++# If true, do not generate a @detailmenu in the "Top" node's menu.\r
++texinfo_no_detailmenu = True\r
+diff --git a/doc/index.rst b/doc/index.rst\r
+new file mode 100644\r
+index 0000000..c05c855\r
+--- /dev/null\r
++++ b/doc/index.rst\r
+@@ -0,0 +1,24 @@\r
++.. notmuch documentation master file, created by\r
++   sphinx-quickstart on Fri Jan 17 22:34:14 2014.\r
++   You can adapt this file completely to your liking, but it should at least\r
++   contain the root `toctree` directive.\r
++\r
++Welcome to notmuch's documentation!\r
++===================================\r
++\r
++Contents:\r
++\r
++.. toctree::\r
++   :maxdepth: 2\r
++\r
++   notmuch\r
++   notmuch-emacs\r
++   notmuch-search\r
++   notmuch-search-terms\r
++\r
++Indices and tables\r
++==================\r
++\r
++* :ref:`genindex`\r
++* :ref:`modindex`\r
++* :ref:`search`\r
+diff --git a/doc/notmuch-emacs.rst b/doc/notmuch-emacs.rst\r
+new file mode 100644\r
+index 0000000..283bf69\r
+--- /dev/null\r
++++ b/doc/notmuch-emacs.rst\r
+@@ -0,0 +1,188 @@\r
++About this Manual\r
++=================\r
++\r
++This manual covers only the emacs interface to notmuch. For information\r
++on the command line interface, see See section “Description” in Notmuch\r
++Manual Pager. To save typing, we will sometimes use *notmuch* in this\r
++manual to refer to the Emacs interface to notmuch. If the distinction\r
++should every be important, we’ll refer to the Emacs inteface as\r
++*notmuch-emacs*.\r
++\r
++Notmuch-emacs is highly customizable via the the Emacs customization\r
++framework (or just by setting the appropriate variables). We try to\r
++point out relevant variables in this manual, but in order to avoid\r
++duplication of information, but you can usually find the most detailed\r
++description in the varables docstring.\r
++\r
++notmuch-hello\r
++=============\r
++\r
++.. index::\r
++   single: notmuch-hello\r
++   single: notmuch\r
++\r
++``notmuch-hello`` is the main entry point for notmuch. You can start it\r
++with ``M-x notmuch`` or ``M-x notmuch-hello``. The startup screen looks\r
++something like the following. There are some hints at the bottom of the\r
++screen. There are three main parts to the notmuch-hello screen,\r
++discussed below. The **bold** text indicates buttons you can click with\r
++a mouse or by positioning the cursor and pressing ``<return>``\r
++\r
++|   Welcome to **notmuch** You have 52 messages.\r
++|\r
++| Saved searches: **[edit]**\r
++|\r
++|       52 **inbox**           52 **unread**\r
++|\r
++| Search: ____________________________________\r
++|\r
++| All tags: **[show]**\r
++|\r
++|      Type a search query and hit RET to view matching threads.\r
++|             Edit saved searches with the ``edit`` button.\r
++| Hit RET or click on a saved search or tag name to view matching threads.\r
++|     ``=`` to refresh this screen. ``s`` to search messages. ``q`` to quit.\r
++|                 **Customize** this page.\r
++\r
++You can change the overall appearence of the notmuch-hello screen by\r
++customizing the variable :index:`notmuch-hello-sections`.\r
++\r
++\r
++\r
++notmuch-hello key bindings\r
++--------------------------\r
++\r
++``<tab>``\r
++    Move to the next widget (button or text entry field)\r
++\r
++``<backtab>``\r
++    Move to the previous widget.\r
++\r
++``<return>``\r
++    Activate the current widget.\r
++\r
++``=``\r
++    Refresh the buffer; mainly update the counts of messages for various\r
++    saved searches.\r
++\r
++``G``\r
++    Import mail, See :ref:`importing`\r
++\r
++``m``\r
++    Compose a message\r
++\r
++``s``\r
++    Search the notmuch database using :ref:`notmuch-search`\r
++\r
++``v``\r
++    Print notmuch version\r
++\r
++``q``\r
++    Quit\r
++\r
++.. _saved-searches:\r
++\r
++Saved Searches\r
++--------------\r
++\r
++Notmuch replaces the static assignment of messages with the more dynamic\r
++notion of searching. Notmuch-hello presents the user with a customizable\r
++set of saved searchs. The initial defaults are ``tag:inbox`` and\r
++``tag:unread``, but you can customize the following variables\r
++\r
++:index:`notmuch-saved-searches`\r
++    A list of cons pairs, the first being the name to display, the\r
++    second being a query string for notmuch. See section “Description”\r
++    in Notmuch Query Syntax.\r
++\r
++:index:`notmuch-saved-searches-sort-function`\r
++    This variable controls how saved searches should be sorted. A value\r
++    of ``nil`` displays the saved searches in the order they are stored\r
++    in ‘notmuch-saved-searches’.\r
++\r
++:index:`notmuch-column-control`\r
++    Controls the number of columns for displaying saved-searches/tags\r
++\r
++Search Box\r
++----------\r
++\r
++The search box lets the user enter an notmuch query. See section\r
++“Description” in Notmuch Query Syntax, for more info on notmuch query\r
++syntax. A history of recent searches is also displayed by default. The\r
++latter is controlled by the variable :index:`notmuch-hello-recent-searches-max`.\r
++\r
++Known Tags\r
++----------\r
++\r
++One special kind of saved search provided by default is for each\r
++individual tag defined in the database. This can be controlled via the\r
++following variables.\r
++\r
++:index:`notmuch-hello-tag-list-make-query`\r
++    Control how to construct a search (“virtual folder”) from a given\r
++    tag.\r
++\r
++:index:`notmuch-hello-hide-tags`\r
++    Which tags not to display at all.\r
++\r
++:index:`notmuch-column-control`\r
++    Controls the number of columns for displaying saved-searches/tags\r
++\r
++.. _notmuch-search:\r
++\r
++notmuch-search\r
++==============\r
++\r
++``notmuch-search-mode`` is used to display the results from executing\r
++a query via ``notmuch-search``. The syntax for these queries is the\r
++the same as :ref:`saved-searches`. For details of this syntax see\r
++info:notmuch-search-terms\r
++\r
++By default the output approximates that of the command line See section\r
++“Description” in notmuch search command.\r
++\r
++The main purpose of the ``notmuch-search-mode`` buffer is to act as a\r
++menu of results that the user can explore further by pressing\r
++``<return>`` on the appropriate line.\r
++\r
++``n,C-n,<down>``\r
++    Move to next line\r
++\r
++``p,C-p,<up>``\r
++    Move to previous line\r
++\r
++``<return>``\r
++    Open thread on current line in :ref:`notmuch-show` mode\r
++\r
++``?``\r
++    Display full set of key bindings\r
++\r
++The presentation of results can be controlled by the following\r
++variables.\r
++\r
++:index:`notmuch-search-result-format`\r
++    Control how each thread of messages is presented in the\r
++    ``notmuch-show-mode`` buffer\r
++\r
++:index:`notmuch-search-oldest-first`\r
++    Display the oldest threads at the top of the buffer\r
++\r
++.. _notmuch-show:\r
++\r
++notmuch-show\r
++============\r
++\r
++notmuch-tree\r
++============\r
++\r
++Configuration\r
++=============\r
++\r
++.. _importing:\r
++\r
++Importing Mail\r
++--------------\r
++\r
++:index:`notmuch-poll`\r
++\r
++:index:`notmuch-poll-script`\r
+diff --git a/doc/notmuch-search-terms.rst b/doc/notmuch-search-terms.rst\r
+new file mode 100644\r
+index 0000000..7885c6a\r
+--- /dev/null\r
++++ b/doc/notmuch-search-terms.rst\r
+@@ -0,0 +1,255 @@\r
++====================\r
++notmuch-search-terms\r
++====================\r
++\r
++********\r
++Synopsis\r
++********\r
++\r
++\r
++\ **notmuch**\  \ **count**\  [\ *options...*\ ] <\ *search-term*\ >...\r
++\r
++\ **notmuch**\  \ **dump**\  [ <\ *filename*\ > ] [--] [ <\ *search-term*\ >...]\r
++\r
++\ **notmuch**\  \ **search**\  [\ *options*\ ...] <\ *search-term*\ >...\r
++\r
++\ **notmuch**\  \ **show**\  [\ *options*\ ...] <\ *search-term*\ >...\r
++\r
++\ **notmuch**\  \ **tag**\  +<\ *tag*\ >|-<\ *tag*\ > [...] [--] <\ *search-term*\ >...\r
++\r
++\r
++***********\r
++Description\r
++***********\r
++\r
++\r
++Several notmuch commands accept a common syntax for search terms.\r
++\r
++The search terms can consist of free-form text (and quoted phrases)\r
++which will match all messages that contain all of the given\r
++terms/phrases in the body, the subject, or any of the sender or\r
++recipient headers.\r
++\r
++As a special case, a search string consisting of exactly a single\r
++asterisk ("\*") will match all messages.\r
++\r
++In addition to free text, the following prefixes can be used to force\r
++terms to match against specific portions of an email, (where <brackets>\r
++indicate user-supplied values):\r
++\r
++from:<name-or-address>\r
++\r
++to:<name-or-address>\r
++\r
++subject:<word-or-quoted-phrase>\r
++\r
++attachment:<word>\r
++\r
++tag:<tag> (or is:<tag>)\r
++\r
++id:<message-id>\r
++\r
++thread:<thread-id>\r
++\r
++folder:<directory-path>\r
++\r
++date:<since>..<until>\r
++\r
++The \ **from:**\  prefix is used to match the name or address of the sender of\r
++an email message.\r
++\r
++The \ **to:**\  prefix is used to match the names or addresses of any recipient\r
++of an email message, (whether To, Cc, or Bcc).\r
++\r
++Any term prefixed with \ **subject:**\  will match only text from the subject\r
++of an email. Searching for a phrase in the subject is supported by\r
++including quotation marks around the phrase, immediately following\r
++\ **subject:**\ .\r
++\r
++The \ **attachment:**\  prefix can be used to search for specific filenames (or\r
++extensions) of attachments to email messages.\r
++\r
++For \ **tag:**\  and \ **is:**\  valid tag values include \ **inbox**\  and \ **unread**\  by default\r
++for new messages added by \ **notmuch**\  \ **new**\  as well as any other tag values\r
++added manually with \ **notmuch**\  \ **tag**\ .\r
++\r
++For \ **id:**\ , message ID values are the literal contents of the Message-ID:\r
++header of email messages, but without the \`<', \`>' delimiters.\r
++\r
++The \ **thread:**\  prefix can be used with the thread ID values that are\r
++generated internally by notmuch (and do not appear in email messages).\r
++These thread ID values can be seen in the first column of output from\r
++\ **notmuch**\  \ **search**\\r
++\r
++The \ **folder:**\  prefix can be used to search for email message files that\r
++are contained within particular directories within the mail store. If\r
++the same email message has multiple message files associated with it,\r
++it's sufficient for a match that at least one of the files is contained\r
++within a matching directory. Only the directory components below the\r
++top-level mail database path are available to be searched.\r
++\r
++The \ **date:**\  prefix can be used to restrict the results to only messages\r
++within a particular time range (based on the Date: header) with a range\r
++syntax of:\r
++\r
++date:<since>..<until>\r
++\r
++See \ **DATE**\  \ **AND**\  \ **TIME**\  \ **SEARCH**\  below for details on the range expression, and\r
++supported syntax for <since> and <until> date and time expressions.\r
++\r
++The time range can also be specified using timestamps with a syntax of:\r
++\r
++<initial-timestamp>..<final-timestamp>\r
++\r
++Each timestamp is a number representing the number of seconds since\r
++1970-01-01 00:00:00 UTC.\r
++\r
++In addition to individual terms, multiple terms can be combined with\r
++Boolean operators ( \ **and**\ , \ **or**\ , \ **not**\  , etc.). Each term in the query will\r
++be implicitly connected by a logical AND if no explicit operator is\r
++provided, (except that terms with a common prefix will be implicitly\r
++combined with OR until we get Xapian defect #402 fixed).\r
++\r
++Parentheses can also be used to control the combination of the Boolean\r
++operators, but will have to be protected from interpretation by the\r
++shell, (such as by putting quotation marks around any parenthesized\r
++expression).\r
++\r
++\r
++********************\r
++Date and Time Search\r
++********************\r
++\r
++\r
++notmuch understands a variety of standard and natural ways of\r
++expressing dates and times, both in absolute terms ("2012-10-24") and\r
++in relative terms ("yesterday"). Any number of relative terms can be\r
++combined ("1 hour 25 minutes") and an absolute date/time can be\r
++combined with relative terms to further adjust it. A non-exhaustive\r
++description of the syntax supported for absolute and relative terms is\r
++given below.\r
++\r
++\ **The**\  \ **range**\  \ **expression**\\r
++\r
++date:<since>..<until>\r
++\r
++The above expression restricts the results to only messages\r
++from <since> to <until>, based on the Date: header.\r
++\r
++<since> and <until> can describe imprecise times, such as\r
++"yesterday". In this case, <since> is taken as the earliest\r
++time it could describe (the beginning of yesterday) and <until>\r
++is taken as the latest time it could describe (the end of\r
++yesterday). Similarly, date:january..february matches from the\r
++beginning of January to the end of February.\r
++\r
++Currently, we do not support spaces in range expressions. You\r
++can replace the spaces with \`_', or (in most cases) \`-', or (in\r
++some cases) leave the spaces out altogether. Examples in this\r
++man page use spaces for clarity.\r
++\r
++Open-ended ranges are supported (since Xapian 1.2.1), i.e. it's\r
++possible to specify date:..<until> or date:<since>.. to not\r
++limit the start or end time, respectively. Pre-1.2.1 Xapian\r
++does not report an error on open ended ranges, but it does not\r
++work as expected either.\r
++\r
++Entering date:expr without ".." (for example date:yesterday)\r
++won't work, as it's not interpreted as a range expression at\r
++all. You can achieve the expected result by duplicating the\r
++expr both sides of ".." (for example\r
++date:yesterday..yesterday).\r
++\r
++\ **Relative**\  \ **date**\  \ **and**\  \ **time**\\r
++[N|number]\r
++(years|months|weeks|days|hours|hrs|minutes|mins|seconds|secs)\r
++[...]\r
++\r
++All refer to past, can be repeated and will be accumulated.\r
++\r
++Units can be abbreviated to any length, with the otherwise\r
++ambiguous single m being m for minutes and M for months.\r
++\r
++Number can also be written out one, two, ..., ten, dozen,\r
++hundred. Additionally, the unit may be preceded by "last" or\r
++"this" (e.g., "last week" or "this month").\r
++\r
++When combined with absolute date and time, the relative date\r
++and time specification will be relative from the specified\r
++absolute date and time.\r
++\r
++Examples: 5M2d, two weeks\r
++\r
++\ **Supported**\  \ **absolute**\  \ **time**\  \ **formats**\\r
++H[H]:MM[:SS] [(am|a.m.|pm|p.m.)]\r
++\r
++H[H] (am|a.m.|pm|p.m.)\r
++\r
++\r
++HHMMSS\r
++\r
++\r
++\r
++now\r
++\r
++noon\r
++\r
++midnight\r
++\r
++Examples: 17:05, 5pm\r
++\r
++\ **Supported**\  \ **absolute**\  \ **date**\  \ **formats**\\r
++YYYY-MM[-DD]\r
++\r
++\r
++DD-MM[-[YY]YY]\r
++\r
++\r
++\r
++MM-YYYY\r
++\r
++\r
++\r
++M[M]/D[D][/[YY]YY]\r
++\r
++\r
++\r
++M[M]/YYYY\r
++\r
++\r
++\r
++D[D].M[M][.[YY]YY]\r
++\r
++\r
++\r
++D[D][(st|nd|rd|th)] Mon[thname] [YYYY]\r
++\r
++Mon[thname] D[D][(st|nd|rd|th)] [YYYY]\r
++\r
++Wee[kday]\r
++\r
++Month names can be abbreviated at three or more characters.\r
++\r
++Weekday names can be abbreviated at three or more characters.\r
++\r
++Examples: 2012-07-31, 31-07-2012, 7/31/2012, August 3\r
++\r
++\ **Time**\  \ **zones**\\r
++(+|-)HH:MM\r
++\r
++\r
++(+|-)HH[MM]\r
++\r
++\r
++\r
++Some time zone codes, e.g. UTC, EET.\r
++\r
++\r
++********\r
++See Also\r
++********\r
++\r
++\r
++notmuch(1), notmuch-config(1), notmuch-count(1), notmuch-dump(1),\r
++notmuch-hooks(5), notmuch-insert(1), notmuch-new(1), notmuch-reply(1),\r
++notmuch-restore(1), notmuch-search(1), notmuch-show(1), notmuch-tag(1)\r
+diff --git a/doc/notmuch-search.rst b/doc/notmuch-search.rst\r
+new file mode 100644\r
+index 0000000..deb7e8b\r
+--- /dev/null\r
++++ b/doc/notmuch-search.rst\r
+@@ -0,0 +1,203 @@\r
++==============\r
++notmuch-search\r
++==============\r
++\r
++\r
++********\r
++Synopsis\r
++********\r
++\r
++\r
++\ **notmuch**\  \ **search**\  [\ *options*\ ...] <\ *search-term*\ >...\r
++\r
++\r
++***********\r
++Description\r
++***********\r
++\r
++\r
++Search for messages matching the given search terms, and display as\r
++results the threads containing the matched messages.\r
++\r
++The output consists of one line per thread, giving a thread ID, the\r
++date of the newest (or oldest, depending on the sort option) matched\r
++message in the thread, the number of matched messages and total\r
++messages in the thread, the names of all participants in the thread,\r
++and the subject of the newest (or oldest) message.\r
++\r
++See notmuch-search-terms(7) for details of the supported syntax for\r
++<search-terms>.\r
++\r
++Supported options for \ **search**\  include\r
++\r
++\r
++  **--format=** ( **json** | **sexp** | **text** |  **text0** )\r
++\r
++\r
++\r
++Presents the results in either JSON, S-Expressions, newline\r
++character separated plain-text (default), or null character\r
++separated plain-text (compatible with xargs(1) -0 option where\r
++available).\r
++\r
++\r
++\ **--format-version=N**\\r
++\r
++\r
++\r
++Use the specified structured output format version. This is\r
++intended for programs that invoke notmuch(1) internally. If\r
++omitted, the latest supported version will be used.\r
++\r
++\r
++\ **--output=(summary|threads|messages|files|tags)**\\r
++\r
++\r
++\r
++\ **summary**\\r
++\r
++Output a summary of each thread with any message matching\r
++the search terms. The summary includes the thread ID, date,\r
++the number of messages in the thread (both the number\r
++matched and the total number), the authors of the thread\r
++and the subject.\r
++\r
++\ **threads**\\r
++\r
++Output the thread IDs of all threads with any message\r
++matching the search terms, either one per line\r
++(--format=text), separated by null characters\r
++(--format=text0), as a JSON array (--format=json), or an S-\r
++Expression list (--format=sexp).\r
++\r
++\ **messages**\\r
++\r
++Output the message IDs of all messages matching the search\r
++terms, either one per line (--format=text), separated by\r
++null characters (--format=text0), as a JSON array\r
++(--format=json), or as an S-Expression list\r
++(--format=sexp).\r
++\r
++\ **files**\\r
++\r
++Output the filenames of all messages matching the search\r
++terms, either one per line (--format=text), separated by\r
++null characters (--format=text0), as a JSON array\r
++(--format=json), or as an S-Expression list\r
++(--format=sexp).\r
++\r
++Note that each message may have multiple filenames\r
++associated with it. All of them are included in the\r
++output, unless limited with the --duplicate=N option.\r
++\r
++\ **tags**\\r
++\r
++Output all tags that appear on any message matching the\r
++search terms, either one per line (--format=text),\r
++separated by null characters (--format=text0), as a JSON\r
++array (--format=json), or as an S-Expression list\r
++(--format=sexp).\r
++\r
++\r
++\ **--sort=** (\ **newest-first** | **oldest-first** )\r
++\r
++\r
++\r
++This option can be used to present results in either\r
++chronological order (\ **oldest-first**\ ) or reverse chronological\r
++order (\ **newest-first**\ ).\r
++\r
++Note: The thread order will be distinct between these two\r
++options (beyond being simply reversed). When sorting by\r
++\ **oldest-first**\  the threads will be sorted by the oldest message\r
++in each thread, but when sorting by \ **newest-first**\  the threads\r
++will be sorted by the newest message in each thread.\r
++\r
++By default, results will be displayed in reverse chronological\r
++order, (that is, the newest results will be displayed first).\r
++\r
++\r
++\ **--offset=[-]N**\\r
++\r
++\r
++\r
++Skip displaying the first N results. With the leading \`-',\r
++start at the Nth result from the end.\r
++\r
++\r
++\ **--limit=N**\\r
++\r
++\r
++\r
++Limit the number of displayed results to N.\r
++\r
++\r
++\ **--exclude=(true|false|all|flag)**\\r
++\r
++\r
++\r
++A message is called "excluded" if it matches at least one tag\r
++in search.tag_exclude that does not appear explicitly in the\r
++search terms. This option specifies whether to omit excluded\r
++messages in the search process.\r
++\r
++The default value, \ **true**\ , prevents excluded messages from\r
++matching the search terms.\r
++\r
++\ **all**\  additionally prevents excluded messages from appearing in\r
++displayed results, in effect behaving as though the excluded\r
++messages do not exist.\r
++\r
++\ **false**\  allows excluded messages to match search terms and appear\r
++in displayed results. Excluded messages are still marked in the\r
++relevant outputs.\r
++\r
++\ **flag**\  only has an effect when \ **--output=summary**\ . The output is\r
++almost identical to \ **false**\ , but the "match count" is the number\r
++of matching non-excluded messages in the thread, rather than\r
++the number of matching messages.\r
++\r
++\r
++\ **--duplicate=N**\\r
++\r
++\r
++\r
++Effective with \ **--output=files**\ , output the Nth filename\r
++associated with each message matching the query (N is 1-based).\r
++If N is greater than the number of files associated with the\r
++message, don't print anything.\r
++\r
++Note that this option is orthogonal with the \ **folder:**\  search\r
++prefix. The prefix matches messages based on filenames. This\r
++option filters filenames of the matching messages.\r
++\r
++\r
++***********\r
++Exit Status\r
++***********\r
++\r
++\r
++This command supports the following special exit status codes\r
++\r
++\r
++\ **20**\\r
++\r
++   The requested format version is too old.\r
++\r
++\r
++\ **21**\\r
++\r
++   The requested format version is too new.\r
++\r
++\r
++\r
++\r
++\r
++********\r
++See Also\r
++********\r
++\r
++\r
++notmuch(1), notmuch-config(1), notmuch-count(1), notmuch-dump(1),\r
++notmuch-hooks(5), notmuch-insert(1), notmuch-new(1), notmuch-reply(1),\r
++notmuch-restore(1), notmuch-search-terms(7), notmuch-show(1), notmuchtag(1)\r
+diff --git a/doc/notmuch.rst b/doc/notmuch.rst\r
+new file mode 100644\r
+index 0000000..9d9a35c\r
+--- /dev/null\r
++++ b/doc/notmuch.rst\r
+@@ -0,0 +1,173 @@\r
++========\r
++notmuch\r
++========\r
++\r
++Synopsis\r
++========\r
++\r
++\r
++\ **notmuch**\  [\ *option*\  ...] \ *command*\  [\ *arg*\  ...]\r
++\r
++\r
++Description\r
++===========\r
++\r
++\r
++Notmuch is a command-line based program for indexing, searching,\r
++reading, and tagging large collections of email messages.\r
++\r
++This page describes how to get started using notmuch from the command\r
++line, and gives a brief overview of the commands available. For more\r
++information on e.g. \ **notmuch**\  \ **show**\  consult the notmuch-show(1) man page,\r
++also accessible via \ **notmuch**\  \ **help**\  \ **show**\\r
++\r
++The quickest way to get started with Notmuch is to simply invoke the\r
++\ **notmuch**\  command with no arguments, which will interactively guide you\r
++through the process of indexing your mail.\r
++\r
++Note\r
++====\r
++\r
++\r
++While the command-line program \ **notmuch**\  provides powerful functionality,\r
++it does not provide the most convenient interface for that\r
++functionality. More sophisticated interfaces are expected to be built\r
++on top of either the command-line interface, or more likely, on top of\r
++the notmuch library interface. See http://notmuchmail.org for more\r
++about alternate interfaces to notmuch. The emacs-based interface to\r
++notmuch (available under \ **emacs/**\  in the Notmuch source distribution) is\r
++probably the most widely used at this time.\r
++\r
++Options\r
++========\r
++\r
++\r
++Supported global options for \ **notmuch**\  include\r
++\r
++\r
++\ **--help**\\r
++\r
++\r
++\r
++Print a synopsis of available commands and exit.\r
++\r
++\r
++\ **--version**\\r
++\r
++\r
++\r
++Print the installed version of notmuch, and exit.\r
++\r
++\r
++\ **--config=FILE**\\r
++\r
++\r
++\r
++Specify the configuration file to use. This overrides any\r
++configuration file specified by ${NOTMUCH_CONFIG}.\r
++\r
++Commands\r
++========\r
++\r
++\r
++\ **SETUP**\\r
++The \ **notmuch**\  \ **setup**\  command is used to configure Notmuch for first use,\r
++(or to reconfigure it later).\r
++\r
++The setup command will prompt for your full name, your primary email\r
++address, any alternate email addresses you use, and the directory\r
++containing your email archives. Your answers will be written to a\r
++configuration file in ${NOTMUCH_CONFIG} (if set) or ${HOME}/.notmuch-\r
++config . This configuration file will be created with descriptive\r
++comments, making it easy to edit by hand later to change the\r
++configuration. Or you can run \ **notmuch**\  \ **setup**\  again to change the\r
++configuration.\r
++\r
++The mail directory you specify can contain any number of sub-\r
++directories and should primarily contain only files with individual\r
++email messages (eg. maildir or mh archives are perfect). If there are\r
++other, non-email files (such as indexes maintained by other email\r
++programs) then notmuch will do its best to detect those and ignore\r
++them.\r
++\r
++Mail storage that uses mbox format, (where one mbox file contains many\r
++messages), will not work with notmuch. If that's how your mail is\r
++currently stored, it is recommended you first convert it to maildir\r
++format with a utility such as mb2md before running \ **notmuch**\  \ **setup**\  \ **.**\\r
++\r
++Invoking \ **notmuch**\  with no command argument will run \ **setup**\  if the setup\r
++command has not previously been completed.\r
++\r
++\ **OTHER**\  \ **COMMANDS**\\r
++Several of the notmuch commands accept search terms with a common\r
++syntax. See notmuch-search-terms(7) for more details on the supported\r
++syntax.\r
++\r
++The \ **search**\ , \ **show**\  and \ **count**\  commands are used to query the email\r
++database.\r
++\r
++The \ **reply**\  command is useful for preparing a template for an email\r
++reply.\r
++\r
++The \ **tag**\  command is the only command available for manipulating database\r
++contents.\r
++\r
++The \ **dump**\  and \ **restore**\  commands can be used to create a textual dump of\r
++email tags for backup purposes, and to restore from that dump.\r
++\r
++The \ **config**\  command can be used to get or set settings int the notmuch\r
++configuration file.\r
++\r
++\r
++Environment\r
++===========\r
++\r
++\r
++The following environment variables can be used to control the behavior\r
++of notmuch.\r
++\r
++\r
++\ **NOTMUCH_CONFIG**\\r
++\r
++ Specifies the location of the notmuch configuration file.\r
++ Notmuch will use ${HOME}/.notmuch-config if this variable is not\r
++ set.\r
++\r
++\r
++\r
++\ **NOTMUCH_TALLOC_REPORT**\\r
++\r
++ Location to write a talloc memory usage report. See\r
++ \ **talloc_enable_leak_report_full**\  in talloc(3) for more\r
++ information.\r
++\r
++\r
++\r
++\ **NOTMUCH_DEBUG_QUERY**\\r
++\r
++ If set to a non-empty value, the notmuch library will print (to\r
++ stderr) Xapian queries it constructs.\r
++\r
++\r
++See Also\r
++========\r
++\r
++\r
++notmuch-config(1), notmuch-count(1), notmuch-dump(1), notmuch-hooks(5),\r
++notmuch-insert(1), notmuch-new(1), notmuch-reply(1), notmuch-restore(1),\r
++notmuch-search(1), notmuch-search-terms(7), notmuch-show(1),\r
++notmuch-tag(1)\r
++\r
++The notmuch website: \ **http://notmuchmail.org**\\r
++\r
++\r
++Contact\r
++========\r
++\r
++\r
++Feel free to send questions, comments, or kudos to the notmuch mailing\r
++list <notmuch@notmuchmail.org> . Subscription is not required before\r
++posting, but is available from the notmuchmail.org website.\r
++\r
++Real-time interaction with the Notmuch community is available via IRC\r
++(server: irc.freenode.net, channel: #notmuch).\r
+-- \r
+1.8.5.2\r
+\r