aboutsummaryrefslogtreecommitdiffhomepage
path: root/notmuch.c
diff options
context:
space:
mode:
authorGravatar Carl Worth <cworth@cworth.org>2011-05-17 15:34:57 -0700
committerGravatar Carl Worth <cworth@cworth.org>2011-05-17 15:58:57 -0700
commit362ab047c264ae67ec3de041aec637979077db21 (patch)
treeb1a14c2f8a8434500b6d67c999570107c266a905 /notmuch.c
parentc51d5b3cdb5ca0816816e88ca6f7136a24e74eee (diff)
notmuch show: Properly nest MIME parts within mulipart parts
Previously, notmuch show flattened all output, losing information about the nesting of the MIME hierarchy. Now, the output is properly nested, (both in the --format=text and --format=json output), so that clients can analyze the original MIME structure. Internally, this required splitting the final closing delimiter out of the various show_part functions and putting it into a new show_part_end function instead. Also, the show_part function now accepts a new "first" argument that is set not only for the first MIME part of a message, but also for each first MIME part within a series of multipart parts. This "first" argument controls the omission of a preceding comma when printing a part (for json). Many thanks to David Edmondson <dme@dme.org> for originally identifying the lack of nesting in the json output and submitting an early implementation of this feature. Thanks as well to Jameson Graef Rollins <jrollins@finestructure.net> for carefully shepherding David's patches through a remarkably long review process, patiently explaining them, and providing a cleaned up series that led to this final implementation. Jameson also provided the new emacs code here.
Diffstat (limited to 'notmuch.c')
-rw-r--r--notmuch.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/notmuch.c b/notmuch.c
index 40da62b6..098f7335 100644
--- a/notmuch.c
+++ b/notmuch.c
@@ -238,15 +238,17 @@ command_t commands[] = {
"\t\teasily-parsed markers. Each marker consists of a Control-L\n"
"\t\tcharacter (ASCII decimal 12), the name of the marker, and\n"
"\t\tthen either an opening or closing brace, '{' or '}' to\n"
- "\t\teither open or close the component.\n"
+ "\t\teither open or close the component. For a multipart MIME\n"
+ "\t\tmessage, these parts will be nested.\n"
"\n"
"\t\tjson\n"
"\n"
"\t\tThe output is formatted with Javascript Object Notation\n"
"\t\t(JSON). This format is more robust than the text format\n"
- "\t\tfor automated processing. JSON output always includes all\n"
- "\t\tmessages in a matching thread; in effect '--format=json'\n"
- "\t\timplies '--entire-thread'\n"
+ "\t\tfor automated processing. The nested structure of multipart\n"
+ "\t\tMIME messages is reflected in nested JSON output. JSON\n"
+ "\t\toutput always includes all messages in a matching thread;\n"
+ "\t\tin effect '--format=json' implies '--entire-thread'\n"
"\n"
"\t\tmbox\n"
"\n"