man: clarify search --exclude documentation

Highlight "excluded messages" as a term with a meaning that
may not be obvious.

Be explicit about the effects of search --exclude=true and
--exclude=false.
man: clarify search --exclude=flag

Improve the description of the search --exclude=flag option,
using text taken from the commit that introduced the option.
test: add basic test for notmuch setup

And annotate with test_subtest_known_broken. Hooray.
cli: config: fix config file save when the file does not exist

The use of realpath(3) in
commit 58ed67992d0ec1fa505026105218fa449f7980b0
Author: Jani Nikula <jani@nikula.org>
Date:   Sun Apr 7 20:15:03 2013 +0300

    cli: config: do not overwrite symlinks when saving config file

broke config file save when the file does not exist, which results in
'notmuch setup' always failing to create a new config file.

Fix by checking ENOENT from realpath(3).
emacs/notmuch-address.el: add notmuch-address-selection-function

Added a customizable variable notmuch-address-selection-function
and the function with the same name to provide a way for user to
change the function called to do address selection.

By default the functionality is exactly the same as it has been so
far; completing-read is called with the same parameters as before.

Setting equivalent lambda expression in place of using
notmuch-address-selection-function function is done as follows:

(setq notmuch-address-selection-function
   (lambda (prompt collection initial-input)
     (completing-read prompt collection nil nil initial-input)))

For example drop-in replacement with ido-completing-read can be done
easily as an one alternative to the default.
emacs: removed code attempting to support emaces prior to version 23

The support for emacs version 22 has not worked at least since
September 2011 when I attempted to use it. I expanded the support in
id:yf6ippgtbn0.fsf@taco2.nixu.fi but that was not enough and then I
found it easier to switch to emacs 23.
In case one wants to resurrect emacs 22 (or earlier!) support, pick
the changes from the patch email referenced above.
test: add tests for the handling of References and In-Reply-To headers

These tests are known_broken, the following commit fixes them.

amended per

	id:87txmi1zq3.fsf@nikula.org
	id:87vc6yalo7.fsf@zancas.localnet
lib/database.cc: change how the parent of a message is calculated

Presently, the code which finds the parent of a message as it is being
added to the database assumes that the first Message-ID-like substring
of the In-Reply-To header is the parent Message ID.  Some mail clients,
however, put stuff other than the Message-ID of the parent in the
In-Reply-To header, such as the email address of the sender of the
parent.  This can fool notmuch.

The updated algorithm prefers the last Message ID in the References
header.  The References header lists messages oldest-first, so the last
Message ID is the parent (RFC2822, p. 24).  The References header is
also less likely to be in a non-standard
syntax (http://cr.yp.to/immhf/thread.html,
http://www.jwz.org/doc/threading.html).  In case the References header
is not to be found, fall back to the old behavior.

V2 of this patch, incorporating feedback from Jani and (indirectly)
Austin.
lib: add --exclude=all option

Adds a exclude all option to the lib which means that excluded
messages are completely ignored (as if they had actually been
deleted).
cli: add --exclude=all option to notmuch-search.c

Add a --exclude=all option to notmuch search.
test: add tests for search --exclude=all

Test the new search --exclude=all option.
man: document search --exclude=all

Document the new search --exclude=all option.
perf-test: rename memory tests

The common suffix will help running them all automatically.
perf-test: rename time tests to have .sh suffix

This will simplify notmuch time tests
perf-test: run all appropriately named time tests

This avoids hassle with manually adding every test to the master list.
perf-test: add notmuch-memory-test

Somehow this file was not added to the patch set which split the tests
into time and memory tests. Take advantage of the the "new" way of
running tests to avoid listing the explicitly.
emacs: tag: fix compile warning

When compiling notmuch-tag.el there is a compile warning:
notmuch-tag.el:27:1:Warning: cl package required at runtime

Since we have decided to allow runtime use of cl we suppress this
warning by adding a tail comment to the file.
emacs: Proper error string handling in search sentinel

Apparently Emacs provides a function to stringify errors properly.
Use this in the search sentinel where we have to do our own error
messaging, rather than assuming the first error argument will be the
descriptive string.