Commit graph

352 commits

Author SHA1 Message Date
Daniel Kahn Gillmor
a1260896f6 cli/show: use decryption policy "auto" by default.
When showing a message, if the user doesn't specify --decrypt= at all,
but a stashed session key is known to notmuch, notmuch should just go
ahead and try to decrypt the message with the session key (without
bothering the user for access to their asymmetric secret key).

The user can disable this at the command line with --decrypt=false if
they really don't want to look at the e-mail that they've asked
notmuch to show them.

and of course, "notmuch show --decrypt" still works for accessing the
user's secret keys if necessary.
2017-12-08 08:08:46 -04:00
Daniel Kahn Gillmor
6802b333eb cli/reply: use decryption policy "auto" by default.
If the user doesn't specify --decrypt= at all, but a stashed session
key is known to notmuch, when replying to an encrypted message,
notmuch should just go ahead and decrypt.

The user can disable this at the command line with --decrypt=false,
though it's not clear why they would ever want to do that.
2017-12-08 08:08:46 -04:00
Daniel Kahn Gillmor
e4890b5bf9 crypto: new decryption policy "auto"
This new automatic decryption policy should make it possible to
decrypt messages that we have stashed session keys for, without
incurring a call to the user's asymmetric keys.
2017-12-08 08:07:53 -04:00
Daniel Kahn Gillmor
d3964e81ac indexing: Change from try_decrypt to decrypt
the command-line interface for indexing (reindex, new, insert) used
--try-decrypt; and the configuration records used index.try_decrypt.
But by comparison with "show" and "reply", there doesn't seem to be
any reason for the "try" prefix.

This changeset adjusts the command-line interface and the
configuration interface.

For the moment, i've left indexopts_{set,get}_try_decrypt alone.  The
subsequent changeset will address those.
2017-12-08 08:05:53 -04:00
Daniel Kahn Gillmor
a990585408 crypto: use stashed session-key properties for decryption, if available
When doing any decryption, if the notmuch database knows of any
session keys associated with the message in question, try them before
defaulting to using default symmetric crypto.

This changeset does the primary work in _notmuch_crypto_decrypt, which
grows some new parameters to handle it.

The primary advantage this patch offers is a significant speedup when
rendering large encrypted threads ("notmuch show") if session keys
happen to be cached.

Additionally, it permits message composition without access to
asymmetric secret keys ("notmuch reply"); and it permits recovering a
cleartext index when reindexing after a "notmuch restore" for those
messages that already have a session key stored.

Note that we may try multiple decryptions here (e.g. if there are
multiple session keys in the database), but we will ignore and throw
away all the GMime errors except for those that come from last
decryption attempt.  Since we don't necessarily know at the time of
the decryption that this *is* the last decryption attempt, we'll ask
for the errors each time anyway.

This does nothing if no session keys are stashed in the database,
which is fine.  Actually stashing session keys in the database will
come as a subsequent patch.
2017-12-04 21:48:31 -04:00
Jani Nikula
733ccfabca cli: allow empty strings for notmuch insert --folder argument
Now that it's easy to add argument specific modifiers in opt
descriptions, add a new .allow_empty field to allow empty strings for
individual string arguments while retaining strict checks
elsewhere. Use this for notmuch insert --folder, where the empty
string means top level folder.
2017-11-08 09:46:44 -05:00
Daniel Kahn Gillmor
8116891744 cli/reindex: add --try-decrypt=(true|false)
Enable override of the index.try_decrypt setting on a per-run basis
when invoking "notmuch reindex".  This allows the possibility of (for
example) an emacs keybinding that adds the cleartext of the currently
shown decrypted message to the index, making it searchable in the
future.

It also enables one-time indexing of all messages matching some query,
like so:

    notmuch reindex tag:encrypted and\
       not property:index.decryption=success and\
       from:alice@example.org

We also update the documentation and tab completion, and add a few
more tests.
2017-10-21 19:58:52 -03:00
Daniel Kahn Gillmor
c5356b9ed5 cli/insert: add --try-decrypt=(true|false)
Enable override of the index.try_decrypt setting on a per-message
basis when invoking "notmuch insert".

We also update the documentation and tab completion, and add more tests.
2017-10-21 19:58:43 -03:00
Daniel Kahn Gillmor
35456d4b0c cli/new: add --try-decrypt=(true|false)
Enable override of the index.try_decrypt setting during "notmuch new"
on a per-invocation basis.

We update the documentation and tab completion, and also add a test.
2017-10-21 19:58:32 -03:00
Daniel Kahn Gillmor
d0da7a0a1c config: define new option index.try_decrypt
By default, notmuch won't try to decrypt on indexing.  With this
patch, we make it possible to indicate a per-database preference using
the config variable "index.try_decrypt", which by default will be
false.

At indexing time, the database needs some way to know its internal
defaults for how to index encrypted parts.  It shouldn't be contingent
on an external config file (since that can't be retrieved from the
database object itself), so we store it in the database.

This behaves similarly to the query.* configurations, which are also
stored in the database itself, so we're not introducing any new
dependencies by requiring that it be stored in the database.
2017-10-21 19:54:33 -03:00
Daniel Kahn Gillmor
886c0b1666 config: test whether an item is stored in the database by name
QUERY_STRING was only used in two places, both to test whether a
variable should be stored in (or retrieved from) the database.

Since other configuration variables might be stored in the database in
the future, consolidate that test into a single function.

We also document that these configuration options should not be placed
in the config file.
2017-10-21 19:54:24 -03:00
Daniel Kahn Gillmor
4dfcc8c9b2 crypto: index encrypted parts when indexopts try_decrypt is set.
If we see index options that ask us to decrypt when indexing a
message, and we encounter an encrypted part, we'll try to descend into
it.

If we can decrypt, we add the property index.decryption=success.

If we can't decrypt (or recognize the encrypted type of mail), we add
the property index.decryption=failure.

Note that a single message may have both values of the
"index.decryption" property: "success" and "failure".  For example,
consider a message that includes multiple layers of encryption.  If we
manage to decrypt the outer layer ("index.decryption=success"), but
fail on the inner layer ("index.decryption=failure").

Because of the property name, this will be automatically cleared (and
possibly re-set) during re-indexing.  This means it will subsequently
correspond to the actual semantics of the stored index.
2017-10-21 19:53:19 -03:00
Daniel Kahn Gillmor
0bb05ff693 reindex: drop all properties named with prefix "index."
This allows us to create new properties that will be automatically set
during indexing, and cleared during re-indexing, just by choice of
property name.
2017-10-21 19:53:08 -03:00
Daniel Kahn Gillmor
6575b7eb31 doc: add notmuch-properties(7)
We will want a user-facing place to record details about the use of
notmuch properties shortly.  This establishes a new manual page for
that purpose.
2017-10-21 19:52:55 -03:00
Daniel Kahn Gillmor
6499fce391 doc: make SEE ALSO references one-per-line
This will make future diffs cleaner, make it easier to keep them
alphabetical, and make it easier to scan and search the documentation
sources.
2017-10-18 22:36:39 -03:00
Daniel Kahn Gillmor
5fb0f5f113 doc: fix documentation typos and copy/paste-os 2017-10-18 22:36:09 -03:00
Jakub Wilk
073188e690 doc: fix typos 2017-09-28 09:00:20 -03:00
Vladimir Panteleev
938ec0f80c doc: Disable SmartyPants in generated manual pages
By default, Sphinx tries to pre-process text through SmartyPants,
which attempts to convert ASCII quotes and dashes to Unicode
characters. Unfortunately, this mangles technical text such as command
lines. For instance, this excerpt from notmuch-tag.rst:

  **notmuch** **tag** **--batch** [--input=<*filename*>]

got turned into:

  notmuch tag –batch [–input=<filename>]

That's an en-dash and an em-dash respectively.

Not only are these characters visually confusing and could easily be
mistaken for a single dash, copying and pasting such command lines
into a terminal is doomed to result in incomprehensible error
messages.

* doc/conf.py: Disable SmartyPants.
2017-08-20 08:32:29 -03:00
Vladimir Panteleev
ca4688e103 Use rooted paths in .gitignore files
A leading / in paths in a .gitignore file matches the beginning of the
path, meaning that for patterns without slashes, git will match files
only in the current directory as opposed to in any subdirectory.

Prefix relevant paths with / in .gitignore files, to prevent
accidentally ignoring files in subdirectories and possibly slightly
improve the performance of "git status".
2017-08-18 19:42:35 -03:00
Daniel Kahn Gillmor
e5beec39d6 add "notmuch reindex" subcommand
This new subcommand takes a set of search terms, and re-indexes the
list of matching messages.
2017-08-01 21:17:47 -04:00
David Bremner
ed4a9082c0 cli/search: print total number of files matched in summary output.
The structured output formats already have all of the filenames. This
is an easy bit of UI change to make the multiple files visible.
2017-08-01 21:17:47 -04:00
Daniel Kahn Gillmor
87bdfbc91f Fix orthography 2017-07-18 06:50:44 -03:00
Daniel Kahn Gillmor
e142de643d config: deprecate/drop crypto.gpg_path under gmime 2.6/3.0
gmime 3.0 no longer offers a means to set the path for gpg.

Users can set $PATH anyway if they want to pick a
differently-installed gpg (e.g. /usr/local/bin/gpg), so this isn't
much of a reduction in functionality.

The one main difference is for people who have tried to use "gpg2" to
make use of gpg 2.1, but that isn't usefully co-installable anyway.
2017-07-14 21:23:52 -03:00
David Bremner
a32dd81a55 cli: add space separator for keyword, string, and int arguments
Defer the complication of optional boolean arguments for later (never?).
2017-07-12 17:46:29 -03:00
David Bremner
d47e184118 cli/dump: bump dump format version to 3
No changes to the format of the body, but the header format was
fixed, and version 2 headers probably shouldn't be relied on.
2017-04-01 09:10:15 -03:00
Jani Nikula
02421015fd man: document external subcommand handling in notmuch(1)
The documentation for this was overlooked when adding the subcommand
handling. This seems like the proper place for it.
2017-03-07 09:05:50 -04:00
David Bremner
55524bb063 lib: regexp matching in 'subject' and 'from'
the idea is that you can run

% notmuch search subject:/<your-favourite-regexp>/
% notmuch search from:/<your-favourite-regexp>/

or

% notmuch search subject:"your usual phrase search"
% notmuch search from:"usual phrase search"

This feature is only available with recent Xapian, specifically
support for field processors is needed.

It should work with bindings, since it extends the query parser.

This is easy to extend for other value slots, but currently the only
value slots are date, message_id, from, subject, and last_mod. Date is
already searchable;  message_id is left for a followup commit.

This was originally written by Austin Clements, and ported to Xapian
field processors (from Austin's custom query parser) by yours truly.
2017-03-03 17:46:48 -04:00
David Bremner
b15b96f846 Merge branch 'release'
These are the (tentative) changes for 0.23.5
2017-01-08 08:42:26 -04:00
David Bremner
44520bb6ad docs: add 2017 to copyright years 2017-01-08 08:35:17 -04:00
David Bremner
5de84d0752 Merge branch 'release'
Add back in no-display parameter by hand.
2016-12-15 21:57:10 +09:00
David Bremner
3d312e2577 cli/insert: document the use of EX_TEMPFAIL 2016-12-15 20:21:02 +09:00
Tomi Ollila
ef763a9e8b doc: whitespace cleanup
In most part, our .rst documents are indented with 8 spaces instead
of tabs. Bring the rest of the lines to the same format.
Also, on one (supposedly empty) line, trailing spaces were removed.
2016-11-28 21:58:17 -04:00
David Bremner
c970de6dc5 Merge branch 'release'
Add Jani's fix for notmuch-new
2016-11-26 08:43:31 -04:00
Jani Nikula
a5df39c276 notmuch-emacs-mua: add --hello parameter
If the --hello parameter is given, display the notmuch hello buffer
instead of the message composition buffer if no message composition
parameters are given.

Signed-off-by: Jani Nikula <jani@nikula.org>
2016-11-26 08:15:11 -04:00
Jani Nikula
caa9dcb707 man: advertize notmuch-emacs-mua as notmuch emacs-mua subcommand
With subcommand handling for external commands we can now hide the
implementation detail of emacs-mua being a separate notmuch-emacs-mua
script.
2016-11-26 08:09:58 -04:00
David Bremner
0ca7900727 cli/new: document new exit code
It seems important to give the numeric return code for people writing
scripts. Hopefully deviations from this convention are rare.
2016-11-25 22:44:05 -04:00
Jani Nikula
ae97630dbf build: only install known man pages
Install man pages based on $(MAN_GZIP_FILES), which directly
corresponds to the man page source rst files. This way we can filter
the man pages to be installed as needed.
2016-11-17 08:42:23 -04:00
Jani Nikula
76ab6e9962 build: generate man page list from source files, not conf.py
Use $(wildcard ...) to generate the list of man pages based on the rst
source files present in the man page directories, instead of reading
conf.py. This has three main benefits:

1) This makes the man page build slightly less complicated and easier
   to understand. At least there are fewer moving parts.

2) This makes the build fail if we add a man page rst file, but fail
   to add it to conf.py.

3) We can use Sphinx constructs in conf.py that are not available when
   importing the file into a normal python program such as
   mkdocdeps.py.
2016-11-17 08:41:24 -04:00
Jani Nikula
a7a683b120 build: do not touch roff files after sphinx-build
If Sphinx fails to create any of the roff files, having touch create
them hides the errors until someone realizes, possibly much later,
that the resulting files are empty. (Note that gzip doesn't fail on
empty input files.) Sphinx will change the timestamps of any files it
has written anyway.
2016-11-17 08:40:07 -04:00
Jani Nikula
b3eec6f948 doc: fix references in notmuch-emacs.rst
Fix make sphinx-texinfo warnings:

WARNING: undefined label: notmuch-jump (if the link has no caption the
label must precede a section header)

WARNING: undefined label: notmuch-saved-searches (if the link has no
caption the label must precede a section header)
2016-11-17 08:39:04 -04:00
Jani Nikula
c22d5d6770 doc/conf.py: include command name in texinfo document title
Seems to make more sense than to have the same title for everything.
2016-11-17 08:38:20 -04:00
Jani Nikula
0097e7f5d6 doc/conf.py: reindent, whitespace clean man page, texinfo lists
No functional changes.
2016-11-17 08:37:40 -04:00
Jani Nikula
497294b1fb doc/conf.py: abstract notmuch authors
Don't repeat the same stuff so much. We probably don't want to track
individual authors for man/texinfo pages anyway.

No user visible changes.
2016-11-17 08:37:07 -04:00
Jani Nikula
d0862c32d0 doc/conf.py: generate texinfo_documents list from man_pages list
No need to repeat mostly the same information twice in conf.py. We
probably want to have a corresponding texinfo document for all the man
pages. Python list comprehension to the rescue. (The reverse is not
true; we have a texinfo document for notmuch-emacs we don't want as a
man page.)

There should be no user visible changes.
2016-11-17 08:35:00 -04:00
Jani Nikula
fe5f761a80 doc/conf.py: add notmuch-emacs-mua to texinfo documents
This was overlooked when adding the man page.
2016-11-17 08:34:44 -04:00
Jani Nikula
cbeb0685c7 notmuch-emacs-mua: add support for mailto: URL handling
Add support for composing an email in the Notmuch Emacs UI using a
mailto: URL. The mailto: URL mode is mutually exclusive with
specifying other message modifying parameters and positional
arguments.
2016-11-02 07:40:33 -03:00
Daniel Kahn Gillmor
693ca8d8a8 add property: query prefix to search for specific properties
We want to be able to query the properties directly, like:

   notmuch count property:foo=bar

which should return a count of messages where the property with key
"foo" has value equal to "bar".
2016-09-21 18:14:25 -03:00
David Bremner
651da30c09 cli: optionally restore message properties from dump file
This somewhat mimics the config line parsing, except there can be
arbitrarily many key value pairs, so one more level of looping is
required.
2016-09-21 18:14:25 -03:00
David Bremner
b7345d277e CLI: add properties to dump output
Part of providing extensibility via properties is to make sure that user
data is not lost. Thus we need to be able to dump and restore
properties.
2016-09-21 18:14:25 -03:00
Daniel Kahn Gillmor
89c8d27948 clean up spelling 2016-09-12 08:16:35 -03:00
David Bremner
3ba1b938b5 doc: update cross references for notmuch.1
In particular add notmuch-compact(1) (Debian bug #825884)
2016-08-23 20:53:52 -03:00
Tomi Ollila
6a49e8a51e doc/notmuch-emacs.rst: update notmuch-hello buffer help text
To look the same as commit b8a136187a changed it in emacs MUA code.
2016-06-11 13:02:35 -03:00
Daniel Kahn Gillmor
d080b4100a doc: clean up boolean vs. probabilistic prefixes
sphinx-build emits a minor warning:

[...]doc/man7/notmuch-search-terms.rst:223: WARNING: Block quote ends without a blank line; unexpected unindent.

And the tabular representation of boolean or probabilistic prefixes
currently renders like this when i view it in man:

       ┌───────────────────────────┬────────────────────────────┐
       │Boolean                    │ Probabilistic              │
       └───────────────────────────┴────────────────────────────┘

       │          tag: id:         │           from: to:        │
       │                           │                            │
       │       thread:     folder: │        subject:    attach‐ │
       │       path:               │        ment: mimetype:     │
       └───────────────────────────┴────────────────────────────┘

This isn't just ugly: it's confusing, because it seems to imply that
some of the prefixes in the left-hand column are somehow related to
specific other prefixes in the right-hand column.

The Definition List representation introduced by this patch should be
simpler for readers to understand, and doesn't have the warning.
2016-06-07 08:00:40 -03:00
David Bremner
d9d2d535b3 doc: document notmuch-dump header line
This was introduced with the libconfig changes, but not documented then.
2016-06-07 07:52:34 -03:00
Daniel Kahn Gillmor
6a833a6e83 Use https instead of http where possible
Many of the external links found in the notmuch source can be resolved
using https instead of http.  This changeset addresses as many as i
could find, without touching the e-mail corpus or expected outputs
found in tests.
2016-06-05 08:32:17 -03:00
Daniel Kahn Gillmor
cfabfc6dab doc: include notmuch-emacs-mua in documentation ToC
Without this patch, i'm seeing sphinx-build emit:

 [...]doc/man1/notmuch-emacs-mua.rst:: WARNING: document isn't included in any toctree
2016-06-05 08:24:25 -03:00
David Bremner
b9bf3f44ea lib: add support for named queries
This relies on the optional presense of xapian field processors, and the
library config API.
2016-05-25 07:40:44 -03:00
David Bremner
2d2a13966c CLI: add notmuch-config support for named queries
Most of the infrastructure here is general, only the validation/dispatch
is hardcoded to a particular prefix.

A notable change in behaviour is that notmuch-config now opens the
database e.g. on every call to list, which fails with an error message
if the database doesn't exit yet.
2016-05-25 07:40:44 -03:00
David Bremner
c6fcc555dd CLI: optionally restore config data.
The default to restore config data seems safest, especially since
currently we have no config data to mess up.
2016-05-25 07:40:44 -03:00
David Bremner
e042a25a3f CLI: add optional config data to dump output.
Note that it changes the default dump output format, but doesn't break
existing notmuch-restore. It might break user scripts though.
2016-05-25 07:07:56 -03:00
David Bremner
792bea5aff lib/cli: add library API / CLI for compile time options
This is intentionally low tech; if we have more than two options it may
make sense to build up what infrastructure is provided.
2016-05-13 07:29:12 -03:00
David Bremner
bbf6069252 lib: optionally support single argument date: queries
This relies on the FieldProcessor API, which is only present in xapian
>= 1.3.
2016-05-08 08:17:07 -03:00
David Bremner
b194340ecc doc: change copyright date
Yes, it is 2016
2016-04-24 17:49:18 -03:00
Michal Sojka
557965b8fa doc/reply: Clarify how reply-to header is handled
Current documentation and comments in the code do not correspond to
the actual code and tests in the test suite ("Un-munging Reply-To" in
T230-reply-to-sender.sh). Fix it.
2016-03-14 20:34:17 -03:00
Jani Nikula
bf719963a7 man: clarify the parameters for lastmod: range query
<since> and <until> for the lastmod: prefix right below the date:
prefix description give the impression one could use last modified
dates to lastmod: which is not at all the case. Use
<initial-revision>..<final-revision> instead.
2015-10-21 09:13:33 -03:00
Tomi Ollila
e56fb9785c doc: update copyright year to contain range 2009-2015
Now it is accurate and provides more information to the
reader of the documents.
2015-10-17 09:06:28 -03:00
Tomi Ollila
7b7dadb93f notmuch-emacs-mua: make --auto-daemon imply --create-frame
Before this change with --auto-daemon but without --create-frame
emacs server was started but no clients stay connected to it
(in both graphical and terminal displays).

Note that this changes how --client --auto-daemon works on
graphical display; New emacs frame is now created for the
message (and message-exit-actions hook appended).
2015-10-01 08:40:32 -03:00
Jani Nikula
b69201da5d notmuch-emacs-mua: do not create a frame by default with --client
Make the default behaviour for --client the same as emacsclient
default: do not create a new frame. Add a new option --create-frame,
passing the same option to emacsclient to create a frame.
2015-09-29 08:25:25 -03:00
Jani Nikula
17fcf24d8b notmuch-emacs-mua: add --auto-daemon option to start Emacs daemon as needed
Automatically starting Emacs in daemon mode if the Emacs server is not
running is a matter of preference better not hard coded in
notmuch-emacs-mua. Add an option to control the behaviour.
2015-09-29 08:25:25 -03:00
Jani Nikula
ac609e5a3b man: clean up notmuch-emacs-mua man page
Move --client description to a more suitable location, stylistic
changes.
2015-09-29 08:25:25 -03:00
Jani Nikula
02e394aed2 cli: do not sort addresses on --output=count or --deduplicate=address
The order of the results with --output=count and --deduplicate=address
are unspecified as they're based on a hash table traversal. This being
the case, optimize the query by explicitly requesting unsorted
results. Clarify the documentation accordingly.
2015-09-26 07:41:05 -03:00
Jani Nikula
71fae18fba man: document notmuch address --deduplicate=address option
Document the deduplication based on case insensitive address.
2015-09-26 07:40:39 -03:00
Jani Nikula
23b8ed610a lib: add support for date:<expr>..! to mean date:<expr>..<expr>
It doesn't seem likely we can support simple date:<expr> expanding to
date:<expr>..<expr> any time soon. (This can be done with a future
version of Xapian, or with a custom query query parser.) In the mean
time, provide shorthand date:<expr>..! to mean the same. This is
useful, as the expansion takes place before interpetation, and we can
use, for example, date:yesterday..! to match from beginning of
yesterday to end of yesterday.

Idea from Mark Walters <markwalters1009@gmail.com>.
2015-09-25 21:55:24 -03:00
Jani Nikula
36b75cd441 man: document notmuch address --deduplicate=(no|mailbox) option
Document the deduplication of results.
2015-09-24 07:34:39 -03:00
Austin Clements
cb08a2ee01 lib: Add "lastmod:" queries for filtering by last modification
The implementation is essentially the same as the date range search
prior to Jani's fancy date parser.
2015-08-14 18:23:49 +02:00
David Bremner
f76d8f82dd cli: add global option "--uuid"
The function notmuch_exit_if_unmatched_db_uuid is split from
notmuch_process_shared_options because it needs an open notmuch
database.

There are two exceptional cases in uuid handling.

1) notmuch config and notmuch setup don't currently open the database,
   so it doesn't make sense to check the UUID.

2) notmuch compact opens the database inside the library, so we either
   need to open the database just to check uuid, or change the API.
2015-08-14 18:23:49 +02:00
David Bremner
5a3b42fb8c cli/count: add --lastmod
In the short term we need a way to get lastmod information e.g. for
the test suite. In the long term we probably want to add lastmod
information to at least the structured output for several other
clients (e.g. show, search).
2015-08-14 18:07:55 +02:00
David Bremner
7e2d0ef105 lib: define NOTMUCH_DEPRECATED macro, document its use.
This has been tested with gcc and clang.
2015-08-04 09:11:17 +02:00
David Bremner
653190bf2a cli: enable notmuch --help command
This functionality seems to have been undocumented, if it ever
existed. Document it now.
2015-07-30 07:45:26 +02:00
David Bremner
83e9df98a0 doc: whitespace cleanup for notmuch.rst
replace leading spaces with tabs
2015-07-30 07:45:26 +02:00
David Bremner
82d8d0b062 replace hardcoded "python" with configured python command
Thanks to FreeBSD port maintainer Mikhail for report and the original
the original patch.

This is the right thing (TM) and also apparently fixes the build on
FreeBSD.
2015-07-10 18:13:28 +02:00
David Bremner
9f57b7e8c5 doc: add minimal note about shared options.
The example is a bit silly, but notmuch subcommand --help is actually
not equivalent to "notmuch --help subcommand".
2015-06-05 18:51:15 +02:00
David Bremner
c883e632bf CLI: make gpg binary used by libgmime configurable.
Previously we set up a way for the top level notmuch command to choose
which gpg binary was invoked by libgmime. In this commit we add the
(mostly boilerplate) code to allow the notmuch-config command to read
and write this path, and use it in the appropriate struct.

Update tests for new default variable
2015-03-11 08:04:00 +01:00
Jani Nikula
a00b4abc27 man: fix notmuch-emacs-mua environment section
It's emacsclient command, not comment. Document default values. While
at it, format the environment section similarly to other man pages.
2015-03-08 08:27:43 +01:00
Jani Nikula
5240c438f5 notmuch-emacs-mua: remove -C to keep short options compatible with mutt
Notmuch uses long options exclusively all around. The short options in
notmuch-emacs-mua are intentionally just a compatible subset of
mutt(1). Keep it this way, if only to make documenting the fact easy!

The Notmuch style --client long option remains, of course.
2015-03-08 08:27:28 +01:00
Jani Nikula
f4a5a534c8 cli: add a tool for starting new message in the emacs ui
Add a tool to start composing an email in the Notmuch Emacs UI with
the specified subject, recipients, and message body.
2015-03-06 08:02:08 +01:00
David Bremner
d7b6e0cae7 doc: update list of prefixes
'attachement' missed a colon, and 'mimetype' was not added to this table
at all.
2015-02-24 08:29:01 +01:00
David Bremner
682a362c85 doc: typo fix for prefix discussion. 2015-02-24 08:29:01 +01:00
David Bremner
4313be0a0c doc: add more information on operators.
More material borrowed from the wiki page on "searching"
2015-02-24 08:29:01 +01:00
David Bremner
7fa58b792c doc: add material on stemming and wildcards
This is lightly massaged from the searching page on the wiki.
2015-02-24 08:29:01 +01:00
Jani Nikula
45038b44b7 doc: document notmuch-restore --input=filename option
Document all options for completeness.
2015-02-23 21:47:55 +01:00
Jani Nikula
1e5b4b72c9 doc: document notmuch-dump --output=filename option
Document all options for completeness.
2015-02-23 21:47:46 +01:00
Jani Nikula
6cc1c8d149 doc: bring notmuch-dump manual page in line with the rest
Fix indentation of options. Move search terms description before
options. Fix synopsis.
2015-02-23 21:47:32 +01:00
David Bremner
625401eb2f doc: remove reference to sender,recipients from notmuch-search.1
Apparently these were missed when notmuch-address was split to it's
own subcommand.
2015-02-22 19:52:42 +01:00
David Bremner
4d5477a3d5 doc: add details about Xapian search syntax
Questions related to the way that probabilistic prefixes and phrases
are handled come up quite often and it is nicer to have the documentation self contained.  Hopefully putting it in subsections prevents it from being overwhelming.
2015-01-25 18:36:47 +01:00
David Bremner
b9e7b8e8f0 doc: gzipped notmuch.3 before trying to install notmuch.3.gz
If HAVE_SPHINX=0 but HAVE_DOXYGEN=1, then the previous version was
trying to install notmuch.3.gz but only got as far as creating
notmuch.3
2015-01-25 15:04:51 +01:00
Todd
8fb1cbc1c2 Update documentation
Adds new entry to the NEWS file, and updates the search terms section
of the man page.  The search terms section needs to be updated again
once the new section in the documentation covering probablistic terms
has been committed.
2015-01-24 16:51:20 +01:00
David Bremner
d241a486fa doc: remove support for rst2man
It was becoming increasingly complicated to support rst2man, and there
were apparently not many people that relied on it.
2015-01-22 08:37:25 +01:00
David Bremner
2bb906a6dd build: eliminate use of python execfile command
As discussed in
id:8cc9dd580ad672527e12f43706f9803b2c8e99d8.1405220724.git.wking@tremily.us,
execfile is unavailable in python3.

The approach of this commit avoids modifying the python module path,
which is arguably preferable since it avoids potentially accidentally
importing a module from the wrong place.
2015-01-03 15:18:54 +01:00
Sergei Shilovsky
7b31f54ed9 Add default configuration values to the man page 2015-01-01 16:48:18 +01:00
Tomi Ollila
32855b91d9 NEWS & doc: typing fixes
Some inconsistent formatting in NEWS for 0.19, 0.18 & 0.17 fixed.

Extra `*` when making bold text in doc/man1/notmuch-search.rst removed.
2014-11-16 09:36:50 +01:00
Michal Sojka
9710f0886a doc: Minor fixes related to notmuch-address
- Add notmuch-address to HTML index
- Remove extra '*'
2014-11-13 21:25:07 +01:00
Tomi Ollila
0d8251dbe2 cli: notmuch address option defaults update
When no --output option were given, change default to display senders
only.

When only --count option is given, display senders (in contrary to not
displaying anything).

Document that --count with --sort=**order** is not supported option
combination.

Clean up some whitespace in the documentation.

One test updated to have --output=count without sender nor recipient
output option.
2014-11-09 10:09:51 +01:00
Tomi Ollila
8e3ee13abc doc: whitespace cleanup
Changed one tab in doc/man1/notmuch-show.rst to 8 spaces.

Removed one leading tab in doc/man5/notmuch-hooks.rst to make
the SYNOPSIS style consistent with other pages.
2014-11-09 10:08:33 +01:00
David Bremner
3d991261a4 doc: add notmuch-address.rst to sphinx config
This is needed so that the rst docs are converted to man and info
pages.
2014-11-05 23:52:17 +01:00
Michal Sojka
a5a6859197 cli: address: Add --output=count
This output prints how many times was each address encountered during
search.
2014-11-05 23:25:05 +01:00
Michal Sojka
4176e527fc cli: address: Do not output duplicate addresses
This filters out duplicate addresses from address command output.

It also also adds tests for the address command.

The code here is an extended version of a patch from Jani Nikula.
2014-11-05 23:23:01 +01:00
Michal Sojka
5c32365d87 cli: search: Convert --output to keyword argument
Now, when address related outputs are in a separate command, it makes
no sense to combine multiple --output options in search command line.
Using switch statement to handle different outputs is more readable
than a series of if statements.
2014-11-05 23:20:17 +01:00
Michal Sojka
5c27136e64 cli: Introduce "notmuch address" command
This moves address-related functionality from search command to the
new address command. The implementation shares almost all code and
some command line options.

Options --offset and --limit were intentionally not included in the
address command, because they refer to messages numbers, which users
do not see in the output. This could confuse users because, for
example, they could see more addresses in the output that what was
specified with --limit. This functionality can be correctly
reimplemented for address subcommand later.

Also useless values of --exclude flag were not included in the address
command.

This was inspired by a patch from Jani Nikula.
2014-11-05 23:19:12 +01:00
Jani Nikula
4366b9b88c cli: add support for notmuch search --duplicate=N with --output=messages
Print the message IDs of all messages matching the search terms that
have at least N files associated with them.
2014-11-02 19:42:12 +01:00
Michal Sojka
3cc8ed5978 cli: search: Add --output={sender,recipients}
The new outputs allow printing senders, recipients or both of matching
messages. To print both, the user can use --output=sender and
--output=recipients simultaneously.

Currently, the same address can appear multiple times in the output.
The next commit will change this. For this reason, tests are
introduced there.

We use mailbox_t rather than InternetAddressMailbox because we will
need to extend it in a following commit.

This code is based on a patch from Jani Nikula.
2014-11-01 08:02:58 +01:00
Jani Nikula
19c09d870f cli/insert: add post-insert hook
The post-new hook might no longer be needed or run very often if
notmuch insert is being used. Therefore a post-insert hook is needed
(arguably pre-insert not so much, so don't add one). Also add the
--no-hooks option to skip hooks.
2014-10-28 19:19:30 +01:00
Jani Nikula
50eedb48ec gitignore: ignore sh.config and doc/config.dox 2014-10-28 12:12:33 +01:00
Jani Nikula
dc20a0eedc cli/insert: require succesful message indexing for success status
Add --keep option to keep any remaining stuff in index or file. We
could distinguish between failures to index and failures to apply tags
or maildir sync, but for simplicity just have one.
2014-10-18 07:54:25 +02:00
David Bremner
b71e3d00de doc: build notmuch-emacs info/html docs, link from index
Although this manual is far from complete, it may be helpful for
someone. In particular building it as part of the standard build
process makes it easier to find problems when editing the
notmuch-emacs-manual.
2014-10-04 20:47:00 +02:00
Austin Clements
76490fba3c doc: Emacs manual improvements and expansions
Fix several typos, improve general wording and flow, and add some
information on notmuch-jump.
2014-10-04 20:32:59 +02:00
Tomi Ollila
ef5e66ae8e doc: 'rm -f' potential doxygen temporary output file
Some (older) Doxygen versions do not create such a temporary file.
2014-09-02 08:43:20 -07:00
David Bremner
5694d72a83 docs: remove spurious man page generated from doxygen
There is a doxygen bug about these odd files,

      https://bugzilla.gnome.org/show_bug.cgi?id=727796

But it isn't clear if / when a fix will be provided, so just delete it
to avoid e.g. confusing man-to-wiki.pl
2014-07-13 08:59:02 -03:00
David Bremner
934e333a08 doc: postprocess notmuch.3
Remove excess italics from doxygen output. It seems to make no
sense (and is certainly ugly) to italicize the first argument to the
.RI macro.
2014-07-09 19:32:44 -03:00
David Bremner
c6cdac8ece doc: quiet doxygen warnings
remove some obsolete tags for XML output (which we don't currently
generate in any case)
2014-07-09 19:32:44 -03:00
David Bremner
1022433551 doc: build and install doxygen api docs
In order to support out of tree builds and avoid hardcoding version
number, generate `doc/config.dox` from configure.
2014-07-09 19:32:15 -03:00
David Bremner
94064a6ba2 Merge branch 'release'
A point release is slowly being built on branch release. Merge those
changes into master.
2014-05-28 09:50:32 -03:00
W. Trevor King
ebf4aaa0f8 doc/conf.py: Remove _static from html_static_path
Avoid:

  $ make HAVE_SPHINX=1 sphinx-html
  python ./doc/mkdocdeps.py ./doc doc/_build doc/docdeps.mk
  sphinx-build -b html -d doc/_build/doctrees -q ./doc doc/_build/html
  Making output directory...
  WARNING: html_static_path entry '/home/wking/src/notmuch/notmuch/doc/_static' does not exist

because we have no static source in doc/_static.
2014-05-28 09:45:45 -03:00
David Bremner
21cb851a22 notmuch 0.18~rc1 release
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQGcBAABCAAGBQJTZXg2AAoJEPIClx2kp54shMEL/jimQji1GYwhBMfQKldBkl52
 FVbxOS4YiOc6zOcz7n8wjkjnHPEvTS/Q6mrZQTjJxtGDYkzaY27JKczXWB/ueqCJ
 /G9kEiXRbkVBLp2AQH7zHnKWRvqAQsaw9o+jyjzmW1UbJXX7dmZNmMQkWyN3bzy6
 taCDiKPxNTlwePRJUbC6O51GC6m7fZOQHSvrmrqFZiNdeT1Gs7g/Adj8Mho6x9A+
 q98Jtftk30Cyx0hXQKNXcJyTukdvVi69HZcmP+Rr9rCRZ4/L7WRbkX+iFQhvOm19
 c6ldgiwBV6+3DW4sNDHcpwZm5ZFh4I+0xUZ/r8V9F8f4yaY0SzMYtvA2xeIqXSG6
 FwkmPSGoW8A8cF8YqKkHOEZrM4ybd2XGvkDkibUncaAeAHQp4DCVG6etLG9kEtzr
 I4yqGhYTIjmjTuLXDOLEZ2mbhgayS5oAEnVqghapTNDYzzOK8h9Gr3Jvq6Kb2ckQ
 /VnEAOOvSv4bomil4NdgXaPrLZrTiq8lS6/pe2DZEg==
 =0A2e
 -----END PGP SIGNATURE-----

Merge tag '0.18_rc1'

notmuch 0.18~rc1 release
2014-05-04 08:32:05 +09:00
David Bremner
2983a85eed doc/doxygen.cfg: bump version to 0.18 2014-05-04 07:38:21 +09:00
Jani Nikula
26b5836be3 doc: add *.pyc to doc/.gitignore 2014-05-03 05:49:34 +09:00
David Bremner
95aa988a06 doc: remove conf.pyc on clean
This build artifict messes up the packaging process for (at least)
Debian if not removed on clean.
2014-04-22 14:24:04 +09:00
Austin Clements
827a69f639 doc: Simplify and clarify notmuch show --format=sexp description
Previously, this was a verbatim copy of the --format=json text.
Change it to instead reference the JSON text and actually describe how
the S-expression format works.
2014-04-21 21:51:54 +09:00
Austin Clements
a39a69ca0f doc: Clarify charset encoding of JSON output 2014-04-21 21:51:35 +09:00
Austin Clements
3cd00fdb8f doc: Fix minor formatting issues in notmuch-show.rst
There were some extra line breaks and missing periods.
2014-04-21 21:51:08 +09:00
Austin Clements
56871c628b doc: Clarify notmuch show --format=raw description
In addition to being generally more precise, this is explicit that
there is no charset conversion.
2014-04-21 21:50:57 +09:00
W. Trevor King
c3d54c4b54 doc/prerst2man.py: Fix 'os.system' -> 'system' typo
Avoid:

  $ make HAVE_SPHINX=0 HAVE_RST2MAN=1 build-man
  python ./doc/prerst2man.py ./doc doc/_build/man
  Traceback (most recent call last):
    File "./doc/prerst2man.py", line 65, in <module>
      os.system('set -x; rst2man {0} {1}/{2}.{3}'
  NameError: name 'os' is not defined
  make: *** [doc/_build/man/man1/notmuch.1] Error 1

by using system directly.  We don't need the 'os.' namespacing,
because the function was imported with:

  from os import makedirs, system
2014-04-21 21:32:03 +09:00
W. Trevor King
334f247d9f doc/prerst2man.py: Use Python-3-compatible octal notation
Python 3 only supports the 0oXXX notation for octal literals [1,2],
which have also been supported in 2.x since 2.6 [2].

[1]: https://docs.python.org/3.0/whatsnew/3.0.html#integers
[2]: http://legacy.python.org/dev/peps/pep-3127/
2014-04-21 21:31:54 +09:00
W. Trevor King
427b3db243 doc/mkdocdeps.py: Use "with" statement for the output file
Before this patch, the open was unnecessarily early and relied on the
process cleanup to close.  Neither one of these was a real problem,
but PEP 343's context managers (which landed in Python 2.5) make
proper cleanup very easy.

[1]: http://legacy.python.org/dev/peps/pep-0343/
2014-04-21 21:31:45 +09:00
W. Trevor King
b10b12da89 doc/mkdocdeps.py: Convert execfile to import
excefile is gone in Python 3 [1].  Instead of exec-ing the
configuration, it's easier to insert the source directory in Python's
path [2], and just import the configuration.  With this change,
mkdocdeps.py is compatible with both Python 2 and 3.

[1]: https://docs.python.org/3.0/whatsnew/3.0.html#builtins
[2]: https://docs.python.org/3/library/sys.html#sys.path
2014-04-21 21:31:36 +09:00
David Bremner
99d351360b doc: make notmuch-new summary line more generic
Since 'notmuch new' now takes multiple options, it's confusing to show
only one of them in the summary.
2014-04-19 14:29:06 +09:00
Austin Clements
59c6103e1c doc: Fix parallel build of roff files
The roff build rule builds all of the roff files in a single command.
Previously, this was expressed as a multi-target rule, but since this
is equivalent to specifying a copy of the rule for each target, make
-jN could start up to N parallel instances of this command.  Fix this
by bottlenecking this rule through a single stamp file.

This also removes the unused man.stamp from CLEAN.
2014-04-19 05:55:30 +09:00
David Bremner
4c62d9366a restore: transparently support gzipped input
We rely completely on zlib to do the right thing in detecting gzipped
input. Since our dump format is chosen to be 7 bit ascii, this should
be fine.
2014-04-12 07:59:44 -03:00
David Bremner
3c13bc0321 dump: support gzipped and atomic output
The main goal is to support gzipped output for future internal
calls (e.g. from notmuch-new) to notmuch_database_dump.

The additional dependency is not very heavy since xapian already pulls
in zlib.

We want the dump to be "atomic", in the sense that after running the
dump file is either present and complete, or not present.  This avoids
certain classes of mishaps involving overwriting a good backup with a
bad or partial one.
2014-04-12 07:59:44 -03:00
Tomi Ollila
703dec7754 doc: added 'Init File' section to notmuch-emacs info source
While adding that fixed (also other) typos noticed by aspell(1) run,
and capitalized Emacs and (most) Notmuch terms to match how emacs
Info documentation seems to look in general.
2014-04-08 07:31:32 -03:00
David Bremner
b6751cf875 doc: move doxgen config from devel/ to doc/
a first step towards actually instally the API docs
2014-04-08 07:30:42 -03:00
David Bremner
57b4ef6f30 doc: fix out-of-tree build
The subtle part is adding .rst and .py files to vpath so they can be
used as dependencies without prefixing with $(srcdir)

We also change the interface to mkbuildeps.py: rather than getting the
containing directory from the conf file path, we go the other way.
2014-03-25 08:32:10 -03:00
David Bremner
4430b14106 doc: cosmetic fix for prerst2man.py
Fix a particular egregious combination of format and string
concatenation.
2014-03-18 07:46:08 -03:00
David Bremner
beef0a8f55 doc: configure detection of sphinx and rst2man
Because sphinx-build does not provide a convenient way of listing
which builders exist, and some people actually have pre 1.0 sphinx, we
try loading a relevant python module.

Currently the assumption is that no python in path -> no sphinx-build
in path.
2014-03-18 07:39:32 -03:00
David Bremner
533639b143 doc: build man pages into hierarchy, fix help test.
It turns out there was a reason the old man pages were stored in a man
compatible hierarchy, namely so that we could run man on them before
installing.

Hardcode doc build location into test suite.  This isn't ideal, but
let's unbreak the test suite for now.
2014-03-18 07:39:12 -03:00
David Bremner
9d9a700f1d doc: build man pages at build time; introduce HAVE_SPHINX, HAVE_RST2MAN
This helps avoid build artifacts (namely, nroff and gzipped-nroff man
pages) owned by root.

The variables allow choosing which generator to use for the man page.
These will be hooked to configure in a following commit.
2014-03-18 07:38:57 -03:00
Jani Nikula
5348d1987c man: try to clarify the folder: and path: vs. --output=files confusion 2014-03-11 19:51:22 -03:00
Jani Nikula
0969c8be09 man: update man pages for folder: and path: search terms
Text from review by Austin Clements <amdragon@MIT.EDU>.
2014-03-11 19:51:22 -03:00
David Bremner
eb61cc7839 doc: automatically read version from file
This avoids having to recreate the update-man-versions rule
2014-03-09 10:41:09 -03:00
David Bremner
6f8daa3989 doc: install sphinx version of man pages
The python script mkdocdeps.py is used to import the list of man pages
from the sphinx configuration to make.

This will delete the (release only) target update-man-versions. This
will be replaced in a followup commit.
2014-03-09 10:41:09 -03:00
David Bremner
df70fc4b4b doc: add target rst2man to build man pages using rst2man
Many people have docutils installed, but not sphinx. Allow these
people to build the man pages.
2014-03-09 10:41:09 -03:00
David Bremner
d736260385 doc: convert sphinx based docs
This is the output from sphinx-quickstart, massaged a bit, along with
our existing man pages converted to rst.

A skeleton notmuch-emacs manual is also included. It is not suitable
for end user use yet.
2014-03-09 10:41:08 -03:00