test: conditionally test help system depending on configured support

If neither sphinx nor rst2man is available, the notmuch man pages will
not be available. Take this into account in the help system test.
cli: fix notmuch help additional topics

The help for hooks was missing.
emacs: instruct user to autoload notmuch instead of require'ing it

When (require 'notmuch) is added to ~/.emacs notmuch is loaded to every
instance of emacs although it may not be used in majority of
those instances.

When (autoload 'notmuch "notmuch" ...) is added to ~/.emacs notmuch
is loaded (only) when user invokes the notmuch function.

User may want to add other entrypoints to notmuch by adding more
autoloads -- the autoload instruction given should offer them clue how
to do so.
emacs: add defcustom notmuch-init-file and load it if exists

So that users can easily organize their notmuch-specific configurations
to separate file and they don't have to have notmuch configurations in
*every* emacs installation they launch, especially if those need to
'(require notmuch) to make the configurations possible.
emacs: push mark before signature on reply

We push mark on reply so user can cut the quote. Push the mark before
signature, if any, instead of end of buffer so the signature is
preserved.

This is consistent with message-kill-to-signature.
cli: abstract database dumping from the dump command

No functional changes, except for slight improvement in error
handling.
cli: abstract dump file open from the dump command

Also expose the dump function to the rest of notmuch. No functional
changes, except for slight improvement in error handling.
lib: drop support for single-message mbox files

We've supported mbox files containing a single message for historical
reasons, but the support has been deprecated, with a warning message
while indexing, since Notmuch 0.15. Finally drop the support, and
consider all mbox files non-email.
lib: replace the header parser with gmime

The notmuch library includes a full blown message header parser. Yet
the same message headers are parsed by gmime during indexing. Switch
to gmime parsing completely.

These are the main changes:

* Gmime stops header parsing at the first invalid header, and presumes
  the message body starts from there. The current parser is quite
  liberal in accepting broken headers. The change means we will be
  much pickier about accepting invalid messages.

* The current parser converts tabs used in header folding to
  spaces. Gmime preserve the tabs. Due to a broken python library used
  in mailman, there are plenty of mailing lists that produce headers
  with tabs in header folding, and we'll see plenty of tabs. (This
  change has been mitigated in preparatory patches.)

* For pure header parsing, the current parser is likely faster than
  gmime, which parses the whole message rather than just the
  headers. Since we parse the message and its headers using gmime for
  indexing anyway, this avoids and extra header parsing round when
  adding new messages. In case of duplicate messages, we'll end up
  parsing the full message although just headers would be
  sufficient. All in all this should still speed up 'notmuch new'.

* Calls to notmuch_message_get_header() may be slightly slower than
  previously for headers that are not indexed in the database, due to
  parsing of the whole message. Within the notmuch code base, notmuch
  reply is the only such user.
debian: ignore performance corpus when making source package

Currently "make debian-snapshot" will include the performance corpus
tarball in the source package, which slows things down and wastes disk
space.  tar-ignore is needed twice to keep the default exclude rules
(e.g. to exclude .git)
debian: really delete madduck from uploaders

I'm not sure how it got into debian/changelog without actually
happening, but actually delete martin from debian/control per
request in Debian bug #719100
debian: add build conflicts against ruby1.8

Debian stable has ruby 1.9, so this should be OK. The issue is that
the ruby bindings don't build if "ruby" points to ruby1.8
compat: add canonicalize_file_name

the POSIX 2008 behaviour of realpath is not available everywhere so we
provide a simple wrapper function.  We use (and provide) the gnu
extension canonicalize_file_name to make it cleaner to test for the
feature we need; otherwise we have to rely on realpath segfaulting if
the second argument is null.
doc: move doxgen config from devel/ to doc/

a first step towards actually instally the API docs
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.
release-checks: removed manual page version check

Manual pages are now generated and during the generation the version
string is read from `version` file, so this (currently failing) test
checking manual page versions can be removed.

While at it, changed the case pattern *[^0-9.]*
to its portable alternative *[!0-9.]*
nmbug: Add 'clone' and replace FETCH_HEAD with @{upstream}

With two branches getting fetched (master and config), the branch
referenced by FETCH_HEAD is ambiguous.  For example, I have:

  $ cat FETCH_HEAD
  41d7bfa7184cc93c9dac139d1674e9530799e3b0 \
    not-for-merge   branch 'config' of http://nmbug.tethera.net/git/nmbug-tags
  acd379ccb973c45713eee9db177efc530f921954 \
    not-for-merge   branch 'master' of http://nmbug.tethera.net/git/nmbug-tags

(where I wrapped the line by hand).  This means that FETCH_HEAD
references the config branch:

  $ git rev-parse FETCH_HEAD
  41d7bfa7184cc93c9dac139d1674e9530799e3b0

which breaks all of the FETCH_HEAD logic in nmbug (where FETCH_HEAD is
assumed to point to the master branch).

Instead of relying on FETCH_HEAD, use @{upstream} as the
remote-tracking branch that should be merged/diffed/integrated into
HEAD.  @{upstream} was added in Git v1.7.0 (2010-02-12) [1], so
relying on it should be fairly safe.  One tricky bit is that bare
repositories don't set upstream tracking branches by default:

  $ git clone --bare http://nmbug.tethera.net/git/nmbug-tags.git nmbug-bare
  $ cd nmbug-bare
  $ git remote show origin
  * remote origin
    Fetch URL: http://nmbug.tethera.net/git/nmbug-tags.git
    Push  URL: http://nmbug.tethera.net/git/nmbug-tags.git
    HEAD branch: master
    Local refs configured for 'git push':
      config pushes to config (up to date)
      master pushes to master (up to date)

While in a non-bare clone:

  $ git clone http://nmbug.tethera.net/git/nmbug-tags.git
  $ cd nmbug-tags
  $ git remote show origin
  * remote origin
    Fetch URL: http://nmbug.tethera.net/git/nmbug-tags.git
    Push  URL: http://nmbug.tethera.net/git/nmbug-tags.git
    HEAD branch: master
    Remote branches:
      config tracked
      master tracked
    Local branch configured for 'git pull':
      master merges with remote master
    Local ref configured for 'git push':
      master pushes to master (up to date)

From the clone docs [2]:

  --bare::
        Make a 'bare' Git repository…
        Also the branch heads at the remote are copied directly
        to corresponding local branch heads, without mapping
        them to `refs/remotes/origin/`.  When this option is
        used, neither remote-tracking branches nor the related
        configuration variables are created.

To use @{upstream}, we need to the local vs. remote-tracking
distinction, so this commit adds 'nmbug clone', replacing the
previously suggested --bare clone with a non-bare --no-checkout
--separate-git-dir clone into a temporary work directory.  After
which:

  $ git rev-parse @{upstream}
  acd379ccb973c45713eee9db177efc530f921954

gives us the master-branch commit.  Existing nmbug users will have to
run the configuration tweaks and re-fetch by hand.  If you don't have
any local commits, you could also blow away your NMBGIT repository and
re-clone from scratch:

  $ nmbug clone http://nmbug.tethera.net/git/nmbug-tags.git

Besides removing the ambiguity of FETCH_HEAD, this commit allows users
to configure which upstream branch they want nmbug to track via 'git
config', in case they want to change their upstream repository.

[1]: http://git.kernel.org/cgit/git/git.git/tree/Documentation/RelNotes/1.7.0.txt
[2]: http://git.kernel.org/cgit/git/git.git/tree/Documentation/git-clone.txt
build: write version.stamp file containing $(VERSION) string

This version file will be as prerequisite to the target files
that use the version info for some purpose, like printing
it for the user to examine. The contents of the version.stamp
file is seldom read by the build system itself as the $(VERSION)
variable has the same information.

Thanks to Trevor, David and Mark for their contributions.
emacs: add notmuch-version.el.tmpl and create notmuch-version.el from it

The notmuch cli program and emacs lisp versions may differ (especially
in remote usage). It helps to resolve problems if we can determine
the versions of notmuch cli and notmuch emacs mua separately.

The build process now creates notmuch-version.el from template file
by filling the version info to notmuch-emacs-version variable.
emacs: defun notmuch-hello-versions and bind 'v' in hello mode to it

If notmuch cli & notmuch emacs MUA versions differ, print also the
emacs MUA version string (along with the cli version) to the
minibuffer.