test: normalize only message filenames in show json

notmuch_json_show_sanitize replaced "filename" field values even in part
structures, where the value is predictable.  Make it only normalize the
filename value if it is an absolute path (begins with slash), which is
true of the Maildir filenames that were intended to be normalized away.
show: indicate charset for all omitted parts

Write a "charset" field for all omitted parts for which it is applicable,
not only text/html parts. Factor out the code to a separate function.
It will be extended with more fields next.
show: indicate length, encoding of omitted body content

If a leaf part's body content is omitted, return the encoded length and
transfer encoding in --format=json output.  This information may be used
by the consumer, e.g. to decide whether to download a large attachment
over a slow link.

Returning the _encoded_ content length is more efficient than returning
the _decoded_ content length.  Returning the transfer encoding allows
the consumer to estimate the decoded content length.
test: conform to content length, encoding fields

Update tests to expect content-length and content-transfer-encoding
fields in show --format=json output, for leaf parts with omitted body
content.
contrib: pick: Do not indent messages in the message pane

Currently pick just uses notmuch-show to display messages in the
message pane: this means that they get indented just as show
would. However, since pick is only displaying one message at a time
there is no need to indent so override the indentation.
sprinter: clarify separator documentation

For text printers, the separator is a syntactic element.
sprinter: add text0 formatter for null character separated text

Same as the text formatter, but with each field separated by a null
character rather than a newline character.
cli: add --format=text0 to notmuch search

Add new format text0, which is otherwise the same as text, but use the
null character as separator instead of the newline character. This is
similar to find(1) -print0 option, and works together with the
xargs(1) -0 option.
test: notmuch search --format=text0
man: document notmuch search --format=text0
python: remove Database.db_p

The function has been marked as deprecated in 0.14 and is now removed.

Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
python: remove functions that have been marked as deprecated in 0.14

Removes Message.{format,print}_messages.

This code adds functionality at the python level that is unlikely to
be useful for anyone. Furthermore the python bindings strive to be a
thin wrapper around libnotmuch. The code has been marked as deprecated
in 0.14 and is now removed.

Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
python: remove now unused import of module sys

Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
News for changes from Austin Clements

I fear I've fallen behind on my NEWS duties.
news: Promote some things to a general section

Date range search may be implemented as a library change, but it's an
important user-facing change that affects all notmuch usage.  Tag name
restrictions aren't as important, but they affect both the CLI
interface and the Emacs interface.
emacs: Eliminate buffer invisibility specs from show and wash

Previously, all visibility in show buffers for headers, message
bodies, and washed text was specified by generating one or more
symbols for each region and creating overlays with their 'invisible
property set to carefully crafted combinations of these symbols.
Visibility was controlled not by modifying the overlays directly, but
by adding and removing the generated symbols from a gigantic buffer
invisibilty spec.

This has myriad negative consequences.  It's slow because Emacs'
display engine has to traverse the buffer invisibility list for every
overlay and, since every overlay has its own symbol, this makes
rendering O(N^2) in the number of overlays.  It composes poorly
because symbol-type 'invisible properties are taken from the highest
priority overlay over a given character (which is often ambiguous!),
rather than being gathered from all overlays over a character.  As a
result, we have to include symbols related to message hiding in the
wash code lest the wash overlays un-hide parts of hidden messages.  It
also requires various workarounds for isearch to properly open
overlays, to set up buffer-invisibility-spec for
remove-from-invisibility-spec to work right, and to explicitly refresh
the display after updating the buffer invisibility spec.

None of this is necessary.

This patch converts show and wash to use simple boolean 'invisible
properties and to not use the buffer invisibility spec.  Rather than
adding and removing generated symbols from the invisibility spec, the
code now directly toggles the 'invisible property of the appropriate
overlay.  This speeds up rendering because the display engine only has
to check the boolean values of the overlays over a character.  It
composes nicely because text will be invisible if *any* overlay over
it has 'invisible t, which means we can overlap invisibility overlays
with abandon.  We no longer need any of the workarounds mentioned
above.  And it fixes a minor bug for free: now, when isearch opens a
washed region, the button text will update to say "Click/Enter to
hide" rather than remaining unchanged.
emacs: show: modify insert-part-header to save the button text

This just make notmuch-show-insert-part-header save the basic button
text for parts as an attribute. This makes it simpler for the button
action (added in a later patch) to reword the label as appropriate (eg
append "(not shown)" or not as appropriate).
emacs: show: add overlays for each part

This makes notmuch-show-insert-bodypart add an overlay for any
non-trivial part with a button header (currently the first text/plain
part does not have a button). At this point the overlay is available
to the button but there is no action using it yet.

In addition the argument HIDE is passed down to
notmuch-show-insert-part-overlays to request that the part be hidden
by default but this is not acted on yet.
emacs: show: add invisibility button action

This adds a button action to show hidden parts. In this version "RET"
toggles the visibility of any part which puts content in the buffer
(as opposed to attachments such as application/pdf).

The button is used to hide parts when appropriate (eg text/html in
multipart/alternative).
emacs: show: set default show-all-multipart/alternatives to nil

Now that the invisibility display of parts is present we no longer
need to force the display of all multipart/alternatives: users can
toggle them for themselves when needed.