David Bremner [Mon, 28 Nov 2016 03:01:42 +0000 (23:01 -0400)]
cli/insert: return EX_TEMPFAIL for some errors
Attempt to distinguish between errors indicating misconfiguration or
programmer error, which we consider "permanent", in the sense that
automatic retries are unlikely to be useful, and those indicating
transient error conditions. We consider XAPIAN_EXCEPTION transient
because it covers the important special case of locking failure.
David Bremner [Sun, 27 Nov 2016 15:24:58 +0000 (11:24 -0400)]
cli/insert: delay database open until after writing mail file
The idea is to get the mail written to disk, even if we can't open the
database (e.g. because some other process has a write lock, and notmuch
is compiled for non-blocking opens).
Running `gdb command < input` is not as reliable way to give input
to the command (some installations of gdb consume it). Use "set args"
gdb command to have input redirected at gdb 'run' time.
Jani Nikula [Mon, 21 Nov 2016 20:14:33 +0000 (22:14 +0200)]
cli: consider files vanishing during notmuch new non-fatal
If some software other than notmuch new renames or removes files
during the notmuch new scan (specifically after scandir but before
indexing the file), keep going instead of bailing out. Failing to
index the file is just a race condition between notmuch and the other
software; the rename could happen after the notmuch new scan
anyway. It's not fatal, and we'll catch the renamed files on the next
scan.
Add a new exit code for when files vanished, so the caller has a
chance to detect the race and re-run notmuch new to recover.
Reported by Paul Wise <pabs@debian.org> at
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=843127
tests: account for varying-size cryptographic signatures
GnuPG 2.1.16 is now injecting the full issuer fingerprint in its
signatures, which makes them about 32 octets larger when
ascii-armored.
This change in size means that the size of the MIME parts will vary
depending on the version of gpg that the user has installed. at any
rate, the signature part should be non-zero (this is true for
basically any MIME part), so we just test for that instead of an exact
size.
Mark Walters [Tue, 15 Nov 2016 19:48:45 +0000 (19:48 +0000)]
emacs: add compatibility functions for emacs 23
Some of the recent changes to the emacs code have used functions
introduced in emacs 24. The functions used are read-char-choice and
setq-local. This changeset adds a file notmuch-compat.el which
contains compatibility functions so that it should work on emacs
23.
Note, since these functions are taken almost unchanged from the emacs
source they are copyright the Free Software Foundation, and the header
in the file reflects that.
Mark Walters [Sat, 22 Oct 2016 12:10:04 +0000 (13:10 +0100)]
emacs: interesting-buffer bugfixes/updates
The command notmuch-interesting-buffer has got out of date -- it
doesn't mention notmuch-tree, and it still refers to message-mode not
notmuch-message-mode. Update both of these.
This fixes the bug that notmuch-cycle-notmuch-buffers does not include
notmuch-tree or notmuch-message-mode buffers in its cycling.
Keith Amidon [Wed, 19 Oct 2016 10:05:19 +0000 (03:05 -0700)]
Expand docstrings about fcc using notmuch-insert
This commit expands docstrings for notmuch-fcc-dirs and
notmuch-maildir-fcc-with-notmuch-insert to describe how quoted strings
are processed and make the ability to configure sent folders containing
whitespace more discoverable.
Mark Walters [Sat, 15 Oct 2016 09:40:48 +0000 (10:40 +0100)]
emacs: fix notmuch-search-line-faces defcustom
In commit 2a7b11b064233afc4feead876fa396e3c18a6b91 the default value
for notmuch-search-line-faces was changed so that it didn't match the
specification in the corresponding defcustom. This meant that it was
difficult for the user to customize this variable as they got a type
mismatch error.
Note anyone who had already customised this variable would not see
this bug as their customisation would match the defcustom.
David Bremner [Sun, 9 Oct 2016 22:30:44 +0000 (19:30 -0300)]
emacs/show: force notmuch-show-buttonise-links to act on lines
This seems to fix a problem with emacs 25 creating partial buttons by
calling n-s-b-l with a region that does not include the whole button.
I'm not 100% sure it's legit to act outside the region passed by
jit-lock, but goto-address-fontify-region (where I borrowed the code
from) already does this, so this patch to not make things worse.
David Bremner [Wed, 5 Oct 2016 00:35:23 +0000 (21:35 -0300)]
require xapian >= 1.2.6
It seems that no-one tried to compile without Xapian compact support
since March of 2015, since that's when I introduced a syntax error in
that branch of the ifdef.
Given the choice of maintaining this underused branch of code, or
bumping the Xapian dependency to a version from 2011, it seems
reasonable to do the latter.
David Bremner [Sun, 2 Oct 2016 01:11:56 +0000 (22:11 -0300)]
lib: bump minor version to mark added symbols
This should not change the SONAME, and therefore won't change the
dynamic linking behaviour, but it may help some users debug missing
symbols in case their libnotmuch is too old.
all variables must be set before their expansion are attempted. These
2 variables: "platform" and "linker_resolves_library_dependencies" were
not given value in the final 'else' branch when platform check failed
due to unrecognized kernel name (output of `uname`). Now those two are
given reasonable non-empty values.
Mark Walters [Sun, 25 Sep 2016 07:18:10 +0000 (08:18 +0100)]
emacs: tree: make b bounce a message and backspace scroll message pane up
This tweaks the keybindings in tree-mode. It make b do bounce/resend
matching show-mode. Since b was already bound to scroll message pane
back, we now use backspace for that.
This means space/backspace scroll the message pane forwards/backwards,
and page-up/page-down scrolls the tree pane forwards/backwards.
David Bremner [Mon, 26 Sep 2016 10:39:25 +0000 (07:39 -0300)]
debian: update symbols for 0.23
New sub-APIs: config, built_with, message_property. A new exception used
internally. Mark the exception as optional, as it only shows up when
built against Xapian supporting FieldProcessors
Mark Walters [Sun, 18 Sep 2016 10:57:32 +0000 (11:57 +0100)]
emacs: tag deleted face bugfix
Commit d25d33ff cleaned up some of the tag face code. However, for the
face notmuch-tag-deleted it used the test
((class color) (supports :strike-through))
to decide whether to use red strikethrough or inverse-video (emacs in
a terminal typically doesn't support red strikethrough, but in X it does).
However, it seems that test often returns true even though red
strikethrough is not supported. This breaks the tag update code -- the
wrong thing is displayed to the user.
Thus we make the test explicitly more specific, changing the test to
Tomi Ollila [Sat, 24 Sep 2016 12:43:27 +0000 (15:43 +0300)]
test: test-lib.sh: use $BASH instead of ${SHELL-sh} to relaunch
In case of the test script is to be relaunced under valgrind, or --tee
is requested, use the $BASH shell variable to locate the command
interpreter. The $SHELL variable is re-set by non-interactive shells
so in case the shell uses some other shell (e.g. zsh) for interactive
use these bash scripts continue to work.
David Bremner [Fri, 23 Sep 2016 09:33:19 +0000 (06:33 -0300)]
lib: add talloc reference from string map iterator to map
This is needed so that when the map is modified during traversal, and
thus unlinked by the database code, the map is not disposed of until the
iterator is done with it.
Mark Walters [Mon, 19 Sep 2016 09:39:49 +0000 (10:39 +0100)]
emacs: tree: make jump close message pane
j is in the global notmuch keymap bound to notmuch jump. In tree-mode
it makes sense to close the message pane first (otherwise the new
search runs in the small top pane of tree-mode).
David Bremner [Tue, 13 Sep 2016 02:24:43 +0000 (23:24 -0300)]
test/emacs: add broken test for message replying to msg to self
This is a strange corner case where the removing of the user's address
from the To: header does the wrong thing. If we think it is
worth (eventually) fixing, this test can serve as a reminder.
David Bremner [Sat, 17 Sep 2016 13:07:44 +0000 (10:07 -0300)]
NEWS: news for Xapian 1.4 enabled features
In fact some of these features are available in Xapian 1.3.x development
releases, but these are not really widely packaged. In any case, the
experts who are using development releases of Xapian can figure that
out.
Mark Walters [Tue, 13 Sep 2016 01:45:58 +0000 (22:45 -0300)]
emacs: reply: remove wrong sig/enc status buttons
This stops the (usually incorrect) sigstatus and encstatus buttons
appearing when replying in emacs, and updates the test suite to match.
Overriding the status button functions is a little unusual but much
less intrusive than passing an argument all the way down the call
chain. It also makes it clear exactly what it does.
We also hide the application/pgp-encrypted part as it can only contain
"Version: 1". We do this in notmuch show, which means it also happens
when replying.
Jani Nikula [Tue, 13 Sep 2016 17:14:21 +0000 (20:14 +0300)]
cli/reply: pass gmime message to Reply-To: redundancy detection
Use gmime message instead of notmuch message in Reply-To: redundancy
detection. This allows us to easily iterate over all recipient email
addresses accurately, instead of just scanning for strings in the
relevant message headers. This improves the accuracy of the detection
in many ways.
This also makes the notmuch message parameter to get_sender()
unused. This will be cleaned up in a follow-up patch to not make too
many changes here at once.
Jani Nikula [Tue, 13 Sep 2016 17:14:20 +0000 (20:14 +0300)]
cli/reply: do not parse Reply-To: header into internet address list twice
Avoid parsing Reply-To: header into internet address list twice. Move
the parsing outside of reply_to_header_is_redundant(), and pass the
parsed internet address list in as parameter. This also avoids leaking
the memory of one copy of the internet address list.
Jani Nikula [Tue, 13 Sep 2016 17:14:19 +0000 (20:14 +0300)]
cli/reply: return internet address list from get header funcs
Pass in GMimeMessage to simplify To/Cc/Bcc headers. We'll eventually
remove the notmuch message passing altogether, but keep both for now
to not make too big changes at once.
Getting the headers from GMimeMessage using GMime functions fixes the
error on duplicate Cc headers reported by Daniel Kahn Gillmor
<dkg@fifthhorseman.net> in id:87d1ngv95p.fsf@alice.fifthhorseman.net.
Get rid of an intermediate function.
The small annoyance is the ownership differences in the address lists.
Jani Nikula [Tue, 13 Sep 2016 17:14:16 +0000 (20:14 +0300)]
cli/reply: reduce the reply format abstractions
Now that we've made the various reply formats quite similar to each
other, there's no point in keeping the abstractions. They are now
close enough to be put in one function.
For now, a mime node will be uselessly created for the headers-only
case, but this is insignificant, and may change in the future.
Jani Nikula [Tue, 13 Sep 2016 17:14:14 +0000 (20:14 +0300)]
cli/reply: make references header creation easier to follow
Just use strdup when original references is not available, instead of
trying to cram everything into a monster asprintf. There should be no
functional changes.
Jani Nikula [Tue, 13 Sep 2016 17:14:13 +0000 (20:14 +0300)]
cli/reply: reorganize create_reply_message()
Again, in preparation for later unification, reorganize
create_reply_message() to be more similar to the headers-only format
reply code in notmuch_reply_format_headers_only(). Due to "pretty"
header ordering, there should be no change in output. There should be
no functional changes.
Jani Nikula [Tue, 13 Sep 2016 17:14:12 +0000 (20:14 +0300)]
cli/reply: unify reply format functions
Prepare for further future unification by making the code similar. The
only functional change is that errors in mime_node_open() also break
execution in default reply format.
Jani Nikula [Tue, 13 Sep 2016 17:14:10 +0000 (20:14 +0300)]
cli/reply: push notmuch reply format abstraction lower in the stack
There's quite a bit of duplication, and some consequent deviation,
between the various notmuch reply format code paths. Perform the query
and message iteration in common code, and make the format specific
functions operate on single messages.