debian: fix typo in postinst (Debian bug 740325), clean up empty directory

Try to remove the directory /0755 ; if that fails assume it has
something in it to preserve.
Merge tag 'debian/0.17-5'

uploaded to unstable
NEWS: note closing of bug id:87wqhcxb5j.fsf@maritornes.cs.unb.ca

This is also/originally Debian bug 737496, so close that too.
debian: note closing of debian bug 739556

This one doesn't seem NEWS-worthy.
NEWS: note closing of id:87ty19pi85.fsf@zancas.localnet

Also close the original debian bug.
emacs: Simplify and fix `notmuch-mua-prompt-for-sender'

`notmuch-mua-prompt-for-sender' is over-engineered and often wrong.
It attempts to detect when all identities have the same name and
specialize the prompt to just the email address part.  However, to do
this it uses `mail-extract-address-components', which is meant for
displaying email addresses, not general-purpose parsing, and hence
performs many canonicalizations that can interfere with this use.  For
example, configuring notmuch-identities to ("Austin
<austin@example.com>"), will cause `notmuch-mua-prompt-for-sender' to
lose the name part entirely and return " <austin@example.com>".

This patch rewrites `notmuch-mua-prompt-for-sender' to simply prompt
for a full identity when notmuch-identities is configured, or to
prompt for a sender address when it isn't.

The original code also did several strange things, like using `eval'
and specifying that this function was interactive.  As a side-effect,
this patch fixes these problems.  And it adds a docstring.
emacs: use the originating buffer's working directory for pipe

Currently notmuch-show-pipe-message runs the command in the working
directory of the *notmuch-pipe* buffer if it exists, and the current
buffer's working directory (which is inherited to the new
*notmuch-pipe* buffer) otherwise. This is all very surprising to the
user, and it's difficult to know or change where the command will be
run.

Always use the current show buffer's working directory for piping. The
user can check that with M-x pwd and change it with M-x cd. This is
consistent with notmuch-show-pipe-part.
cli: export function for illegal tag checking

This lets us check for forbidden tags consistently across the cli. No
functional changes.
cli: make sure notmuch new and insert don't add invalid tags

Check new.tags configuration values before doing anything, and bail
out on invalid values.
test: add tests for invalid new.tags

Similar tests for both notmuch new and insert.
cli: add missing \n in error message

The error messages returned by illegal_tag() don't contain newlines.
test: Print the number of the test along with its name

Previously, we stripped the "Tnnn-" part from the test name when
printing its description at the beginning of each test.  However, this
makes it difficult to find the source script for a test (e.g., when a
test fails).  Put this prefix back.
debian: add dependency on bash-completion

At some point we decided to only install bash completion for notmuch
if the bash-completion file was present. Add the corresponding debian
build dependency.
test: don't use $(dir) in recipes.

According the semantics of make, the expansion of $(dir) in recipes
uses dynamic scope, i.e. the value at the time the recipe is run. This
means if test/Makefile.local is not the last sub-makefile included,
all heck breaks loose.
test: NOTMUCH_SKIP_TESTS accepts test names with or without Tddd- prefix

The test names assigned to NOTMUCH_SKIP_TESTS variable can now be given
with or without the Tddd- prefix for tester convenience:

The test name without Tddd -prefix stays constant even when test filenames
are renumbered.

The test name with Tddd -prefix is printed out when tests run.
support for generating decreasing dates in bash 4.0 and 4.1

The printf builtin "%(fmt)T" specifier (which allows time values
to use strftime-like formatting) is introduced in bash 4.2.

Trying to execute this in pre-4.2 bash will fail -- and if this
happens execute the fallback piece of perl code to do the same thing.
cli: sanitize tabs and newlines to spaces in notmuch search

Sanitize tabs and newlines to spaces rather than question marks in
--output=summary --format=text output.

This will also hide any difference in unfolding a header that has been
folded with a tab. Our own header parser replaces tabs with spaces,
while gmime would retain the tab.
cli: refactor reply from guessing

The guess_from_received_header() function had grown quite big. Chop it
up into smaller functions.

No functional changes.
util: make sanitize string available in string util for reuse

No functional changes.
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.