From: Mark Walters <markwalters1009@gmail.com>
To: notmuch@notmuchmail.org
Subject: [RFC PATCH v3 01/11] cli: add --headers_only option to notmuch-show.c
Date: Mon, 13 Feb 2012 01:20:05 +0000 [thread overview]
Message-ID: <1329096015-8078-2-git-send-email-markwalters1009@gmail.com> (raw)
In-Reply-To: <1329072579-27340-1-git-send-email-markwalters1009@gmail.com>
This option just outputs the headers of a message
(i.e. it omits the bodies).
This is used by notmuch-pick.el (although not needed) because it gives a
speed-up of at least a factor of a two; moreover it reduces the memory
usage in emacs hugely.
---
notmuch-client.h | 1 +
notmuch-show.c | 6 +++++-
2 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/notmuch-client.h b/notmuch-client.h
index 60828aa..0da2d8d 100644
--- a/notmuch-client.h
+++ b/notmuch-client.h
@@ -101,6 +101,7 @@ typedef struct notmuch_show_params {
notmuch_bool_t entire_thread;
notmuch_bool_t raw;
int part;
+ int headers_only;
#ifdef GMIME_ATLEAST_26
GMimeCryptoContext* cryptoctx;
#else
diff --git a/notmuch-show.c b/notmuch-show.c
index d930f94..9d73685 100644
--- a/notmuch-show.c
+++ b/notmuch-show.c
@@ -841,7 +841,7 @@ show_message (void *ctx,
fputs (format->body_start, stdout);
}
- if (format->part_content)
+ if (format->part_content && !params->headers_only)
show_message_body (message, format, params);
if (params->part <= 0) {
@@ -1034,6 +1034,7 @@ notmuch_show_command (void *ctx, unused (int argc), unused (char *argv[]))
notmuch_show_params_t params = { .part = -1 };
int format_sel = NOTMUCH_FORMAT_NOT_SPECIFIED;
notmuch_bool_t verify = FALSE;
+ notmuch_bool_t headers_only = FALSE;
notmuch_opt_desc_t options[] = {
{ NOTMUCH_OPT_KEYWORD, &format_sel, "format", 'f',
@@ -1046,6 +1047,7 @@ notmuch_show_command (void *ctx, unused (int argc), unused (char *argv[]))
{ NOTMUCH_OPT_BOOLEAN, ¶ms.entire_thread, "entire-thread", 't', 0 },
{ NOTMUCH_OPT_BOOLEAN, ¶ms.decrypt, "decrypt", 'd', 0 },
{ NOTMUCH_OPT_BOOLEAN, &verify, "verify", 'v', 0 },
+ { NOTMUCH_OPT_BOOLEAN, &headers_only, "headers-only", 'h', 0 },
{ 0, 0, 0, 0, 0 }
};
@@ -1055,6 +1057,8 @@ notmuch_show_command (void *ctx, unused (int argc), unused (char *argv[]))
return 1;
}
+ params.headers_only = headers_only;
+
if (format_sel == NOTMUCH_FORMAT_NOT_SPECIFIED) {
/* if part was requested and format was not specified, use format=raw */
if (params.part >= 0)
--
1.7.2.3
next prev parent reply other threads:[~2012-02-13 1:19 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-12 18:49 [RFC PATCH v2 0/3] notmuch-pick: an emacs threaded message view with split-pane Mark Walters
2012-02-12 18:49 ` [RFC PATCH v2 1/3] cli: notmuch-show changes to support pick Mark Walters
2012-02-12 21:08 ` Daniel Schoepe
2012-02-12 22:08 ` Mark Walters
2012-02-12 18:49 ` [RFC PATCH v2 2/3] emacs: changes to other files to support notmuch-pick Mark Walters
2012-02-12 22:27 ` Mark Walters
2012-02-12 18:49 ` [RFC PATCH v2 3/3] emacs: add notmuch-pick itself Mark Walters
2012-02-12 20:39 ` [RFC PATCH v2 0/3] notmuch-pick: an emacs threaded message view with split-pane Jameson Graef Rollins
2012-02-12 21:51 ` Mark Walters
2012-02-13 1:20 ` [RFC PATCH v3 00/11] " Mark Walters
2012-02-14 12:28 ` Mark Walters
2012-02-14 15:21 ` Austin Clements
2012-02-15 9:27 ` Mark Walters
2012-02-13 1:20 ` Mark Walters [this message]
2012-02-13 1:20 ` [RFC PATCH v3 02/11] cli: add sort options to notmuch-show.c Mark Walters
2012-02-13 1:20 ` [RFC PATCH v3 03/11] cli: add --thread= option to notmuch-show Mark Walters
2012-02-13 1:20 ` [RFC PATCH v3 04/11] emacs: add entry to notmuch-pick from notmuch-hello.el Mark Walters
2012-02-13 1:20 ` [RFC PATCH v3 05/11] emacs: add defcustom group for notmuch-pick Mark Walters
2012-02-13 1:20 ` [RFC PATCH v3 06/11] emacs: add extra parameters option to notmuch-query-get-threads Mark Walters
2012-02-13 1:20 ` [RFC PATCH v3 07/11] emacs: add entry to notmuch-pick from notmuch.el Mark Walters
2012-02-13 1:20 ` [RFC PATCH v3 08/11] emacs: add the entry to notmuch-pick to notmuch-show.el Mark Walters
2012-02-13 1:20 ` [RFC PATCH v3 09/11] emacs: make notmuch-show return its buffer Mark Walters
2012-02-13 1:20 ` [RFC PATCH v3 10/11] emacs: notmuch-show.el just show the actual matching messages Mark Walters
2012-02-13 1:20 ` [RFC PATCH v3 11/11] emacs: add notmuch-pick itself Mark Walters
2012-02-13 9:05 ` [RFC PATCH v2 0/3] notmuch-pick: an emacs threaded message view with split-pane Aneesh Kumar K.V
2012-02-13 18:16 ` Mark Walters
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://notmuchmail.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1329096015-8078-2-git-send-email-markwalters1009@gmail.com \
--to=markwalters1009@gmail.com \
--cc=notmuch@notmuchmail.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://yhetil.org/notmuch.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).