[PATCH 0/4] Add a --include-text-content option to notmuch-show.c

Subject: [PATCH 0/4] Add a --include-text-content option to notmuch-show.c

Date: Sun, 22 Jul 2012 15:37:55 +0100

To: notmuch@notmuchmail.org

Cc:

From: Mark Walters


Currently notmuch show includes text/* parts (except text/html) in the
JSON and text outputs. This patch adds a new option
--include-text-content=true|false which allows the caller to disable
this behaviour.

This is similar to the --headers-only option proposed in
id:"1341041595-5858-1-git-send-email-markwalters1009@gmail.com". The
key difference is that this version does not change the JSON output
schema: the schema says that "A leaf part's body content is optional,
but may be included if it can be correctly encoded as a string."

This means that the emacs show mode works correctly if switched to
specifying --include-text-content=false (it fetches each part
individually). Indeed, it may be desirable to make that the default
(as suggested by Jamie in
id:"877gu7gzy9.fsf@servo.finestructure.net"). However, this may make
show significantly slower so we do not change the default here.

There have been other suggestions of allowing the user to specify
exactly which parts/headers etc notmuch should return and even of
unifying show and search. That is obviously a much bigger change than
this (and this would not make that any more difficult).

Finally, the advantage of this change is that it can substantially
speed up some uses (when the caller only wants the headers): see
id:"87r4sei8yu.fsf@qmul.ac.uk" for some examples with a factor of 8
speed up.

Best wishes

Mark



Mark Walters (4):
  cli: show: add --include-text-content=true|false option
  cli: show: implement --include-text-content for --format=text
  test: add some tests for --include-text-content option
  man: update man page for --include-text-option

 man/man1/notmuch-show.1 |   12 ++++++++++
 notmuch-client.h        |    3 +-
 notmuch-reply.c         |    2 +-
 notmuch-show.c          |   57 ++++++++++++++++++++++++++++-------------------
 test/json               |    9 +++++++
 5 files changed, 58 insertions(+), 25 deletions(-)

-- 
1.7.9.1


Thread: