[PATCH 3/3] cli: allow show to omit message bodies.
authorMark Walters <markwalters1009@gmail.com>
Sat, 7 Jul 2012 15:12:58 +0000 (16:12 +0100)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:48:03 +0000 (09:48 -0800)
c2/7b9129aa54fa82a948d42352607f68c671c0d8 [new file with mode: 0644]

diff --git a/c2/7b9129aa54fa82a948d42352607f68c671c0d8 b/c2/7b9129aa54fa82a948d42352607f68c671c0d8
new file mode 100644 (file)
index 0000000..db2c848
--- /dev/null
@@ -0,0 +1,114 @@
+Return-Path: <markwalters1009@gmail.com>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 05214431FC2\r
+       for <notmuch@notmuchmail.org>; Sat,  7 Jul 2012 08:13:21 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0.201\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0.201 tagged_above=-999 required=5\r
+       tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
+       FREEMAIL_ENVFROM_END_DIGIT=1, FREEMAIL_FROM=0.001,\r
+       RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id kKIhKt77QpiM for <notmuch@notmuchmail.org>;\r
+       Sat,  7 Jul 2012 08:13:19 -0700 (PDT)\r
+Received: from mail-wg0-f41.google.com (mail-wg0-f41.google.com\r
+ [74.125.82.41])       (using TLSv1 with cipher RC4-SHA (128/128 bits))        (No client\r
+ certificate requested)        by olra.theworths.org (Postfix) with ESMTPS id\r
+ 2AE51431FBF   for <notmuch@notmuchmail.org>; Sat,  7 Jul 2012 08:13:17 -0700\r
+ (PDT)\r
+Received: by wgbds1 with SMTP id ds1so1436036wgb.2\r
+       for <notmuch@notmuchmail.org>; Sat, 07 Jul 2012 08:13:16 -0700 (PDT)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
+       h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references;\r
+       bh=dqlwoEg5uylO8LYitNQ1pmVQwAnDLMQorwFCT+f7XL0=;\r
+       b=q5P9WesEbIdk3fxp/cbijcUYBmwQUnHZurNAQ/OD82ESyU3k1QllJj0xdFKxpJ82BR\r
+       7Ilkf5DNZH0L80sMabaHbwUBh0t10SDf+S/POW5RP28EuQGH0AuFqGwWHZD4Q47lshph\r
+       36H1b6zedAfiV/xkIknH/6+xVMCrTC+5ZbgVnA/1v0eDyTBS+65/TSoqZn50uCa4RSpG\r
+       traY2OHv5myb3dGX5TEak8A1bBJnx2WI6URO/Yp2ZrWlEOTZeca2XEQuOrTjF2bldpRH\r
+       YZuT+cJuEfLhEC3T5gSB1eFCCCbOZrpHkWuPFtS4QTks2m+8TKXFq7MtFJ0t094ah3H+\r
+       vHAA==\r
+Received: by 10.217.3.209 with SMTP id r59mr11762719wes.108.1341673995951;\r
+       Sat, 07 Jul 2012 08:13:15 -0700 (PDT)\r
+Received: from localhost (94-192-233-223.zone6.bethere.co.uk.\r
+ [94.192.233.223])     by mx.google.com with ESMTPS id\r
+ df4sm12175280wib.4.2012.07.07.08.13.14        (version=TLSv1/SSLv3 cipher=OTHER);\r
+       Sat, 07 Jul 2012 08:13:15 -0700 (PDT)\r
+From: Mark Walters <markwalters1009@gmail.com>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH 3/3] cli: allow show to omit message bodies.\r
+Date: Sat,  7 Jul 2012 16:12:58 +0100\r
+Message-Id: <1341673978-6094-4-git-send-email-markwalters1009@gmail.com>\r
+X-Mailer: git-send-email 1.7.9.1\r
+In-Reply-To: <1341673978-6094-1-git-send-email-markwalters1009@gmail.com>\r
+References: <1341673978-6094-1-git-send-email-markwalters1009@gmail.com>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Sat, 07 Jul 2012 15:13:21 -0000\r
+\r
+The new keyword parsing makes this a trivial addition. It replaces\r
+the previously proposed "--headers-only" functionality.\r
+---\r
+ notmuch-client.h |    4 +++-\r
+ notmuch-show.c   |    4 +++-\r
+ 2 files changed, 6 insertions(+), 2 deletions(-)\r
+\r
+diff --git a/notmuch-client.h b/notmuch-client.h\r
+index c241a7d..8e2d9da 100644\r
+--- a/notmuch-client.h\r
++++ b/notmuch-client.h\r
+@@ -78,12 +78,14 @@ typedef enum {\r
+     NOTMUCH_SHOW_OUTPUT_HDR_REPLY_TO = 0x20,\r
+     NOTMUCH_SHOW_OUTPUT_HDR_IN_REPLY_TO = 0x40,\r
+     NOTMUCH_SHOW_OUTPUT_HDR_REFERENCES = 0x80,\r
++    NOTMUCH_SHOW_OUTPUT_BODY = 0x100,\r
+     NOTMUCH_SHOW_OUTPUT_DEFAULT =\r
+           NOTMUCH_SHOW_OUTPUT_HDR_SUBJECT |\r
+           NOTMUCH_SHOW_OUTPUT_HDR_FROM |\r
+           NOTMUCH_SHOW_OUTPUT_HDR_TO |\r
+           NOTMUCH_SHOW_OUTPUT_HDR_CC |\r
+-          NOTMUCH_SHOW_OUTPUT_HDR_DATE\r
++          NOTMUCH_SHOW_OUTPUT_HDR_DATE |\r
++          NOTMUCH_SHOW_OUTPUT_BODY\r
+ } notmuch_show_output_t;\r
+ \r
+ typedef struct notmuch_show_format {\r
+diff --git a/notmuch-show.c b/notmuch-show.c\r
+index 242e8e0..5c3d5c3 100644\r
+--- a/notmuch-show.c\r
++++ b/notmuch-show.c\r
+@@ -586,7 +586,8 @@ format_part_json (const void *ctx, mime_node_t *node, notmuch_bool_t first, notm\r
+       format_headers_json (ctx, GMIME_MESSAGE (node->part), output);\r
+ \r
+       printf (", \"body\": [");\r
+-      format_part_json (ctx, mime_node_child (node, 0), first, output);\r
++      if (output & NOTMUCH_SHOW_OUTPUT_BODY)\r
++          format_part_json (ctx, mime_node_child (node, 0), first, output);\r
+ \r
+       printf ("]}");\r
+       return;\r
+@@ -1044,6 +1045,7 @@ notmuch_show_command (void *ctx, unused (int argc), unused (char *argv[]))\r
+                                 { "reply-to", NOTMUCH_SHOW_OUTPUT_HDR_REPLY_TO },\r
+                                 { "in-reply-to", NOTMUCH_SHOW_OUTPUT_HDR_IN_REPLY_TO },\r
+                                 { "references", NOTMUCH_SHOW_OUTPUT_HDR_REFERENCES },\r
++                                { "body", NOTMUCH_SHOW_OUTPUT_BODY },\r
+                                 { 0, 0 } } },\r
+       { NOTMUCH_OPT_KEYWORD, &exclude, "exclude", 'x',\r
+         (notmuch_keyword_t []){ { "true", EXCLUDE_TRUE },\r
+-- \r
+1.7.9.1\r
+\r