1 Return-Path: <markwalters1009@gmail.com>
\r
2 X-Original-To: notmuch@notmuchmail.org
\r
3 Delivered-To: notmuch@notmuchmail.org
\r
4 Received: from localhost (localhost [127.0.0.1])
\r
5 by olra.theworths.org (Postfix) with ESMTP id C522A429E52
\r
6 for <notmuch@notmuchmail.org>; Sun, 12 Feb 2012 17:19:13 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=0.201 tagged_above=-999 required=5
\r
12 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,
\r
13 FREEMAIL_ENVFROM_END_DIGIT=1, FREEMAIL_FROM=0.001,
\r
14 RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled
\r
15 Received: from olra.theworths.org ([127.0.0.1])
\r
16 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
17 with ESMTP id 2I0I7EV448mz for <notmuch@notmuchmail.org>;
\r
18 Sun, 12 Feb 2012 17:19:13 -0800 (PST)
\r
19 Received: from mail-ww0-f45.google.com (mail-ww0-f45.google.com
\r
20 [74.125.82.45]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client
\r
21 certificate requested) by olra.theworths.org (Postfix) with ESMTPS id
\r
22 24246431FAE for <notmuch@notmuchmail.org>; Sun, 12 Feb 2012 17:19:13 -0800
\r
24 Received: by wgbdt12 with SMTP id dt12so3923384wgb.2
\r
25 for <notmuch@notmuchmail.org>; Sun, 12 Feb 2012 17:19:12 -0800 (PST)
\r
26 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
\r
27 h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references;
\r
28 bh=8BPgVNhJdKBFIvnx334lcsEIbtKP+dGP8/iG78plaM4=;
\r
29 b=ILevKFHij+kPAWLoN96l5OY3V1J6X4nw/oM56m9wKcqCc7fwbeoXOiBhQ3nKjtjLGV
\r
30 uHOdJCAD37iXvBLuBmbzqbPrUNT6xvusU88dE9FaWUV3CPRR9dKv2+XmtYAZxiSNeavg
\r
31 Ie4qGPn/aR6z4tyZE0Oph74/fQqJGK0Lu0y2A=
\r
32 Received: by 10.180.85.105 with SMTP id g9mr15277808wiz.12.1329095951984;
\r
33 Sun, 12 Feb 2012 17:19:11 -0800 (PST)
\r
34 Received: from localhost (94-192-233-223.zone6.bethere.co.uk.
\r
35 [94.192.233.223]) by mx.google.com with ESMTPS id
\r
36 s8sm18408712wiz.8.2012.02.12.17.19.10 (version=TLSv1/SSLv3 cipher=OTHER);
\r
37 Sun, 12 Feb 2012 17:19:11 -0800 (PST)
\r
38 From: Mark Walters <markwalters1009@gmail.com>
\r
39 To: notmuch@notmuchmail.org
\r
40 Subject: [RFC PATCH v3 01/11] cli: add --headers_only option to notmuch-show.c
\r
41 Date: Mon, 13 Feb 2012 01:20:05 +0000
\r
42 Message-Id: <1329096015-8078-2-git-send-email-markwalters1009@gmail.com>
\r
43 X-Mailer: git-send-email 1.7.2.3
\r
44 In-Reply-To: <1329072579-27340-1-git-send-email-markwalters1009@gmail.com>
\r
45 References: <1329072579-27340-1-git-send-email-markwalters1009@gmail.com>
\r
46 X-BeenThere: notmuch@notmuchmail.org
\r
47 X-Mailman-Version: 2.1.13
\r
49 List-Id: "Use and development of the notmuch mail system."
\r
50 <notmuch.notmuchmail.org>
\r
51 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
52 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
53 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
54 List-Post: <mailto:notmuch@notmuchmail.org>
\r
55 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
56 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
57 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
58 X-List-Received-Date: Mon, 13 Feb 2012 01:19:13 -0000
\r
60 This option just outputs the headers of a message
\r
61 (i.e. it omits the bodies).
\r
63 This is used by notmuch-pick.el (although not needed) because it gives a
\r
64 speed-up of at least a factor of a two; moreover it reduces the memory
\r
65 usage in emacs hugely.
\r
67 notmuch-client.h | 1 +
\r
68 notmuch-show.c | 6 +++++-
\r
69 2 files changed, 6 insertions(+), 1 deletions(-)
\r
71 diff --git a/notmuch-client.h b/notmuch-client.h
\r
72 index 60828aa..0da2d8d 100644
\r
73 --- a/notmuch-client.h
\r
74 +++ b/notmuch-client.h
\r
75 @@ -101,6 +101,7 @@ typedef struct notmuch_show_params {
\r
76 notmuch_bool_t entire_thread;
\r
80 #ifdef GMIME_ATLEAST_26
\r
81 GMimeCryptoContext* cryptoctx;
\r
83 diff --git a/notmuch-show.c b/notmuch-show.c
\r
84 index d930f94..9d73685 100644
\r
85 --- a/notmuch-show.c
\r
86 +++ b/notmuch-show.c
\r
87 @@ -841,7 +841,7 @@ show_message (void *ctx,
\r
88 fputs (format->body_start, stdout);
\r
91 - if (format->part_content)
\r
92 + if (format->part_content && !params->headers_only)
\r
93 show_message_body (message, format, params);
\r
95 if (params->part <= 0) {
\r
96 @@ -1034,6 +1034,7 @@ notmuch_show_command (void *ctx, unused (int argc), unused (char *argv[]))
\r
97 notmuch_show_params_t params = { .part = -1 };
\r
98 int format_sel = NOTMUCH_FORMAT_NOT_SPECIFIED;
\r
99 notmuch_bool_t verify = FALSE;
\r
100 + notmuch_bool_t headers_only = FALSE;
\r
102 notmuch_opt_desc_t options[] = {
\r
103 { NOTMUCH_OPT_KEYWORD, &format_sel, "format", 'f',
\r
104 @@ -1046,6 +1047,7 @@ notmuch_show_command (void *ctx, unused (int argc), unused (char *argv[]))
\r
105 { NOTMUCH_OPT_BOOLEAN, ¶ms.entire_thread, "entire-thread", 't', 0 },
\r
106 { NOTMUCH_OPT_BOOLEAN, ¶ms.decrypt, "decrypt", 'd', 0 },
\r
107 { NOTMUCH_OPT_BOOLEAN, &verify, "verify", 'v', 0 },
\r
108 + { NOTMUCH_OPT_BOOLEAN, &headers_only, "headers-only", 'h', 0 },
\r
112 @@ -1055,6 +1057,8 @@ notmuch_show_command (void *ctx, unused (int argc), unused (char *argv[]))
\r
116 + params.headers_only = headers_only;
\r
118 if (format_sel == NOTMUCH_FORMAT_NOT_SPECIFIED) {
\r
119 /* if part was requested and format was not specified, use format=raw */
\r
120 if (params.part >= 0)
\r