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