Commit graph

213 commits

Author SHA1 Message Date
Daniel Kahn Gillmor
9829533e92 index: avoid indexing legacy-display parts
When we notice a legacy-display part during indexing, it makes more
sense to avoid indexing it as part of the message body.

Given that the protected subject will already be indexed, there is no
need to index this part at all, so we skip over it.

If this happens during indexing, we set a property on the message:
index.repaired=skip-protected-headers-legacy-display

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
2019-09-01 08:45:30 -03:00
Daniel Kahn Gillmor
1b29822cf5 repair: set up codebase for repair functionality
This adds no functionality directly, but is a useful starting point
for adding new repair functionality.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
2019-09-01 08:20:25 -03:00
David Bremner
a6a8df7e03 build: drop variable HAVE_EMACS. use WITH_EMACS instead
The extra flexibility of having both HAVE_EMACS (for yes, there is an
emacs we can use) and WITH_EMACS (the user wants emacs support) lead
to confusion and bugs. We now just force WITH_EMACS to 0 if no
suitable emacs is detected.
2019-06-12 19:58:30 -03:00
David Bremner
3ec47e1165 doc: Don't install emacs docs when they are not built
In 40b025 we stopped building the notmuch-emacs documentation if
HAVE_EMACS=0 (i.e. no emacs was detected by configure). Unfortunately
we continued to try to install the (non-existent) documentation, which
causes build/install failures.

As a bonus, we also avoid installing the documentation if the user
configures --without-emacs.

Thanks to Ralph Seichter for reporting the problem, and testing
previous versions of this fix.
2019-06-10 21:48:03 -03:00
David Bremner
71bf459596 doc: don't build notmuch-emacs.info for configure --without-emacs
Since the docstrings are not built in the case of --without-emacs,
even if emacs is detected, don't let sphinx build the emacs docs. This
avoids a large number of error messages due to missing includes. It's
actually a bit surprising sphinx doesn't generate an error for the
missing include files.
2019-06-10 21:46:55 -03:00
David Bremner
6edc073e44 doc: use separate doctrees for distinct builders
It seems our previous attempt with order-only targets was not
sufficient to avoid problems with sphinx-builds doctree cache [0].
Looking around at other people's approaches [1], using separate
doctrees was suggested. I guess there might be a slight loss of
efficiency, but it seems more robust.

[0]: build failures were first noticed in Debian experimental, but I was able to duplicate it in
     my usual build environment about 1 in 8 builds.

[1]: in particular
     9e3fc1657d
2019-06-03 07:35:30 -03:00
David Bremner
9dedb23b47 doc: document user header indexing.
It's a bit odd that the primary documentation is in notmuch-config,
but it is consistent with the "query:" prefix.
2019-05-25 07:21:21 -03:00
David Bremner
40b025c5f1 doc: exclude notmuch-emacs.rst if emacs is not present.
This will still generate a warning about an excluded document in the
toctree, but it cuts down on the noise quite a lot.
2019-04-24 06:53:13 -03:00
David Bremner
4f0fe36c47 doc: use stamp file for html docs
These are less time consuming than the texi docs to rebuild (because
the texi rebuild triggers info rebuild), but still take noticable time.
2019-04-24 06:53:13 -03:00
David Bremner
f0399db513 doc: use stamp file to control rebuilding texi
Apparently the sphinx-doc texinfo builder is not smart enough to only
rebuild those files where the source has changed.
2019-04-24 06:53:07 -03:00
David Bremner
319dd95ebb lib: add 'body:' field, stop indexing headers twice.
The new `body:` field (in Xapian terms) or prefix (in slightly
sloppier notmuch) terms allows matching terms that occur only in the
body.

Unprefixed query terms should continue to match anywhere (header or
body) in the message.

This follows a suggestion of Olly Betts to use the facility (since
Xapian 1.0.4) to add the same field with multiple prefixes. The double
indexing of previous versions is thus replaced with a query time
expension of unprefixed query terms to the various prefixed
equivalent.

Reindexing will be needed for 'body:' searches to work correctly;
otherwise they will also match messages where the term occur in
headers (demonstrated by the new tests in T530-upgrade.sh)
2019-04-17 08:48:16 -03:00
Michal Sojka
1e69bb6f46 doc: document notmuch new --verbose 2019-03-31 11:59:46 -03:00
Daniel Kahn Gillmor
cbeb0da595 doc: Clean up warnings when building notmuch-emacs docs
Without this change, we see this during the build:

    sphinx-build -b html -d doc/_build/doctrees -q ./doc doc/_build/html
    …/doc/notmuch-emacs.rst:67: WARNING: Unexpected indentation.
    …/doc/notmuch-emacs.rst:165: WARNING: Unexpected indentation.
    …/doc/notmuch-emacs.rst:306: WARNING: Unexpected indentation.

This source change doesn't seem to have any effect on the generated
HTML, at least.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
2019-03-27 17:45:27 -03:00
David Bremner
0557c5a033 doc/build: use $(MAKE) instead of make
This should silence some warnings about the jobserver, but also make
it easier to build the docs where GNU make is called something other
than make.

Based on a patch from aidecoe.
2019-03-19 20:54:15 -03:00
David Bremner
71eaa19350 Merge branch 'release'
Changes from 0.28.3
2019-03-06 08:53:26 -04:00
David Bremner
dcf7fca2d9 doc: sequentialize calls to sphinx-build
In certain conditions the parallel calls to sphinx-build could
collide, yielding a crash like

Exception occurred:
  File "/usr/lib/python3/dist-packages/sphinx/environment.py", line 1261, in get_doctree
    doctree = pickle.load(f)
EOFError: Ran out of input
2019-03-05 21:46:41 -04:00
Matt Armstrong
adde6dfaef Emacs: bind "g" to 'notuch-refresh-this-buffer
Using "g" for refresh operations is a pretty common Emacs convention,
codified by `special-mode' in simple.el.
2019-02-21 07:16:53 -04:00
David Bremner
87eb477ba5 notmuch 0.28.1 release
-----BEGIN PGP SIGNATURE-----
 
 iQGzBAABCAAdFiEE3VS2dnyDRXKVCQCp8gKXHaSnniwFAlxUOSIACgkQ8gKXHaSn
 nizwvAv8DPoLLssPfwY1AJtc7+JQzAl5scpkjJbGYlzXWTkhD14Efnb0FzMFulRG
 fG4gpsqFA9iNJGT2uTKtYRvKayoMNQMk2eSk8IKyINIVO/jclNbsaSFhL7vqyzsm
 8l+A1UBQ2BsmUsv58ImoS/F65iF2ZBXu5OEEzqxzL+m+WBh9rNyuBaN4Arr64eVy
 f0V/CWYr9VmauuWg0UW3lZ2kwT2+eJDdw7/UwkdeaesuqypPrb+PyRbSDozr4yEj
 n+l0LsbP2iN2i8b0MBNS1vf9fSkUxhBmLzSoqJWbsEZFKwXLFTp5+TLyVxYDzKO5
 D5ug22DG4VFUOmvBaKkMdnavr8z0QZrfL1/z6998Ux+iYG/YrITsrAv02+BxXr5a
 MPmmhW+9x5AZBSP/qasvNCu/Zhczcu/DZ0oUe5qLXTY0yPsOWZRv/+iAWTxXbk+Q
 iS5wbmeZsF/WSH1l3vtK9PnD1wePqITQPK22bKCjSXhPxWOO6AxNcfpy3/lsZ2j2
 9NPLfpFl
 =G2Qd
 -----END PGP SIGNATURE-----

Merge tag '0.28.1'

notmuch 0.28.1 release
2019-02-01 08:35:20 -04:00
David Bremner
32fb3c420a bump copyright year 2019-02-01 08:08:13 -04:00
Peter Wang
6784d5bc60 doc: fix references to search.exclude_tags
The documentation incorrectly referred to a configuration item
"search.tag_exclude" in some places, instead of "search.exclude_tags".
2019-01-27 08:18:38 -04:00
David Bremner
e52535029b doc: make man pages depend on emacs docstrings
This is nonsensical on the face of it, but is needed (for now) because
the notmuch-emacs page is unconditionally included in index.rst.
2018-12-20 17:30:11 +09:00
David Bremner
fcf68eec31 doc/emacs: document notmuch-cycle-notmuch-buffers
For some reason I couldn't find this when I searched, so add it to the
manual.
2018-12-08 09:07:09 -04:00
David Bremner
3324544d42 doc/emacs: document notmuch-poll*
The current "documentation" for these variables consists of only the
variable names.
2018-12-08 09:05:25 -04:00
David Bremner
fd5f666476 doc/emacs: document notmuch-tagging-keys
Calling these "Global keys" is arguably a bit of a stretch, but they
do work in all notmuch modes except notmuch-hello.
2018-12-08 09:02:42 -04:00
David Bremner
1f6778d349 doc/emacs: document notmuch-message-headers*
More precisely, copy the docstrings into notmuch-emacs documentation pages.
2018-12-08 09:00:50 -04:00
David Bremner
241373cd3f doc/emacs: add documentation for stashing 'c X' bindings
This is the first of a series of changes requiring the extracted docstrings.
2018-12-08 08:56:17 -04:00
David Bremner
0601d2337e doc/emacs: require extracted docstrings for sphinx or info manual
We need to use the stamp file here in order not to depend on the order
the submakefiles are included.
2018-12-08 08:53:09 -04:00
Maxime Coste
baa4185c30 cli: notmuch show support for --include-html with --format=text 2018-11-24 09:12:30 -04:00
Maxime Coste
37e5bc00ae cli: notmuch show support for --body=false with --format=text 2018-11-24 09:11:42 -04:00
Daniel Kahn Gillmor
fd3c93650d doc: clean up manpages
Many of the manpages didn't treat literal text as literal text.  I've
tried to normalize some of the restructured text to make it a bit more
regular.

several of the synopsis lines are still untouched by this cleanup, but
i'm not sure what the right way to represent those is in .rst,
actually.

In particular find that if i rebuild the manpages, sometimes i end up
with some of the synopsis lines showing – (U+2013 EN DASH) where they
should have -- (2 × U+002D HYPHEN-MINUS) in the generated nroff
output, though i have not tracked down the source of this error yet.
2018-06-24 21:59:37 -03:00
David Bremner
b50fb1b642 docs: add initial documentation for notmuch-tag-jump
This is mainly to improve discoverability. It seems that doing
variable cross-references is not easy without using some sphinx
extension/customization.
2018-05-26 08:31:03 -07:00
David Bremner
7a58c1c44b doc: initial documentation for notmuch-tree mode 2018-05-26 08:29:35 -07:00
David Bremner
eb6fb36d63 doc: initial documentation for notmuch-show-mode
This is pretty minimal, but will hopefully inspire others to
contribute more complete documentation. If nothing else, it points out
'?'.
2018-05-26 08:28:18 -07:00
David Bremner
7a6d4a0852 doc: install build and install info pages
All of the man pages are installed as info pages, plus
the (unfinished) notmuch-emacs manual
2018-05-26 08:26:13 -07:00
Daniel Kahn Gillmor
aa605f7e8a cli/show: enable --decrypt=stash
Add fancy new feature, which makes "notmuch show" capable of actually
indexing messages that it just decrypted.

This enables a workflow where messages can come in in the background
and be indexed using "--decrypt=auto".  But when showing an encrypted
message for the first time, it gets automatically indexed.

This is something of a departure for "notmuch show" -- in particular,
because it requires read/write access to the database.  However, this
might be a common use case -- people get mail delivered and indexed in
the background, but only want access to their secret key to happen
when they're directly interacting with notmuch itself.

In such a scenario, they couldn't search newly-delivered, encrypted
messages, but they could search for them once they've read them.

Documentation of this new feature also uses a table form, similar to
that found in the description of index.decrypt in notmuch-config(1).

A notmuch UI that wants to facilitate this workflow while also
offering an interactive search interface might instead make use of
these additional commands while the user is at the console:

Count received encrypted messages (if > 0, there are some things we
haven't yet tried to index, and therefore can't yet search):

     notmuch count tag:encrypted and \
         not property:index.decryption=success and \
         not property:index.decryption=failure

Reindex those messages:

     notmuch reindex --try-decrypt=true tag:encrypted and \
         not property:index.decryption=success and \
         not property:index.decryption=failure
2018-05-26 07:43:30 -07:00
David Bremner
8a1eeecdfe doc: document notmuch new --full-scan 2018-05-22 09:31:33 -07:00
David Bremner
a07b28a488 doc: fix notmuch-search example
For some reason the searched tag did not match the displayed results.
2018-05-09 10:31:57 -04:00
David Bremner
f2e6f76a04 doc: document thread subqueries
Mention both performance and quoting issues.
2018-05-07 08:42:53 -03:00
David Bremner
20ba0b7dfa doc: add a section on quoting to notmuch-search-terms(7)
I think we've diverged enough from the Xapian query parser
that we can't rely on that syntax description [1]. As far as I can
tell, [1] also only discusses quotes in the context of phrases.

[1]: https://xapian.org/docs/queryparser.html
2018-04-24 23:08:10 -03:00
Daniel Kahn Gillmor
f6430bc06d doc: Examples of notmuch-reindex use and crypto policy
Currently, notmuch has the levers needed to set coherent crypto policy
around how cleartext is indexed, which also has an impact on how
messages are rendered.  But we don't have a lot of documentation about
how to do sensible things.  This is an initial attempt to address
that.

The first example shows a way to selectively index specific messages.

The next two examples are about aligning the existing database with
crypto indexing policy

The default crypto policy is to not index cleartext, and to only
decrypt messages on display when explicitly requested.

The other sensible crypto policy is to index cleartext while stashing
session keys. messages indexed in this way will be searchable, and
will be decrypted on display automatically unless the user explicitly
asks for it to *not* be decrypted.

The policy for indexing *new* messages is stored in the database as
the config variable index.decrypt.

But setting policy for new messages doesn't retroactively affect
already indexed messages.

This patch attempts to document ways that someone can efficiently
align their pre-existing database with their new policy.

I'm not sure this is the right place to document these examples, but i
do want them to be user-facing and relatively easy to find.  I'm happy
to entertain suggestions for where else we should put them.
2018-03-24 20:08:27 -03:00
Daniel Kahn Gillmor
b6e3efde05 cli/insert: add --world-readable flag
In some cases (e.g. when building a publicly-visible e-mail archive)
it doesn't make any sense to restrict visibility of the message to the
current user account.

This adds a --world-readable boolean option for "notmuch insert", so
that those who want to archive their mail publicly can feed their
archiver with:

    notmuch insert --world-readable

Other local delivery agents (postfix's local, and dovecot's lda) all
default to delivery in mode 0600 rather than relying on the user's
umask, so this fix doesn't change the default.

Also, this does not override the user's umask.  if the umask is
already set tight, it will not become looser as the result of passing
--world-readable.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
2018-03-24 20:08:11 -03:00
Matthew Lear
0cbe982bfd Clarify the syntax required when searching using timestamps.
Need to be clearer about specifying time ranges using timestamps.
Legacy syntax which predates the date prefix is still supported, but
timestamps used in conjunction with the date prefix require additional
syntax.
2018-03-24 20:07:20 -03:00
Antoine Amarilli
cf8c689eab doc: create manpage folders with right permissions
Avoids the issue where umask can make man pages unreadable after
installation. Relevant email on the mailing-list:
<87h8rt30sy.fsf@fifthhorseman.net>
2018-01-31 21:22:04 -04:00
Daniel Kahn Gillmor
54982e520c fix typos 2018-01-04 20:35:58 -04:00
David Bremner
c8fc3d1428 notmuch 0.26~rc1 release
-----BEGIN PGP SIGNATURE-----
 
 iQGzBAABCAAdFiEE3VS2dnyDRXKVCQCp8gKXHaSnniwFAlpK4EkACgkQ8gKXHaSn
 niygiQv/TxmOsXmlxOqBI3pWqhvRjiqE7XlF7ueCBADOxET6cQRfj6CG31vbjAUd
 xNH4SLZR7pKE7K3Dx7jNfqSESgM48Ianlau8ofC2eNpSXegRqX3vTE+9IM64xYpo
 BrdrHJlwOmM2JN/X02mTQFexNgoXZG88Y7WXQOo3ktLxBOna3I1+dS/cEMuHKkGC
 zs80sjqJKixBigI3u9Sg1TMEg/gKj0K3jTRiNtsrR2k3W0ktPmYjMf6l5CKleKx1
 8HGT2VWUip4V3Ih18addQdyxfKPAtvb74SFMu/W6qegTvctr8UIsQhpCzlnzq+37
 UnaTLlmVCWNqMzxt3TUDRq6w4R5MW8wG4iBRuQOYiuzq7vCVV9etRFlWY1KzFbp2
 frtFvq48PyfTupC1B/B6/402V6mooUJXfmu9FP0WxAYawuCsaVVGFXjOwkCeXf6d
 JHuN1Gog4DYPq6y0gakUgFG8sWGouvJVncLHHn26nyDNXnRl5NTGIUrRfce8nXBH
 GV5fHOJ4
 =0A1D
 -----END PGP SIGNATURE-----

Merge tag '0.26_rc1'

notmuch 0.26~rc1 release
2018-01-01 21:50:24 -04:00
David Bremner
b75797150b doc: add 2018 to copyright year 2018-01-01 21:17:05 -04:00
David Bremner
d0dffdae31 doc/{reply, show}: match indentation
This is essentially a conflict resolution Jani's normalization and
Daniel's doc changes, but it's easier to do as a second commit.
2017-12-31 09:34:28 -04:00
David Bremner
99407db25c Merge branch 'release'
Conflicts:
        doc/man1/notmuch-reply.rst
	doc/man1/notmuch-show.rst

Conflicts taken from release (dkg's doc changes)
2017-12-31 09:26:13 -04:00
Jani Nikula
e5e252de55 doc: unify definition list usage across man pages
Make all parameter descriptions etc. use reStructuredText definition
lists with uniform style and indentation. Remove redundant indentation
from around the lists. Remove blank lines between term lines and
definition blocks. Use four spaces for indentation.

This is almost completely whitespace and paragraph reflow changes.
2017-12-31 09:06:11 -04:00
Daniel Kahn Gillmor
af8255fb71 cli/reply: make --decrypt take a keyword
This brings the --decrypt argument to "notmuch reply" into line with
the other --decrypt arguments (in "show", "new", "insert", and
"reindex").  This patch is really just about bringing consistency to
the user interface.

We also use the recommended form in the emacs MUA when replying, and
update test T350 to match.
2017-12-29 16:45:55 -04:00