Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 98BD3431FB6 for ; Wed, 30 Nov 2011 08:50:09 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[RCVD_IN_DNSWL_NONE=-0.0001] 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 mkVMSJydYHLJ for ; Wed, 30 Nov 2011 08:50:09 -0800 (PST) Received: from idcmail-mo1so.shaw.ca (idcmail-mo1so.shaw.ca [24.71.223.10]) by olra.theworths.org (Postfix) with ESMTP id EAF77429E21 for ; Wed, 30 Nov 2011 08:50:08 -0800 (PST) Received: from pd2ml3so-ssvc.prod.shaw.ca ([10.0.141.148]) by pd3mo1so-svcs.prod.shaw.ca with ESMTP; 30 Nov 2011 09:40:42 -0700 X-Cloudmark-SP-Filtered: true X-Cloudmark-SP-Result: v=1.1 cv=1h8qd3w5pbyJS47frJc7V6h9QwwiBhgsQMy9mbCO+wA= c=1 sm=1 a=SLheIz2_iEgA:10 a=BLceEmwcHowA:10 a=yQp6g8lIsgqumF79BAsFDg==:17 a=9FJIHUyoQUidNP8FYhIA:9 a=QdprsC6vY5kK0t4dUzIA:7 a=HpAAvcLHHh0Zw7uRqdWCyQ==:117 Received: from unknown (HELO lagos.xvx.ca) ([96.52.216.56]) by pd2ml3so-dmz.prod.shaw.ca with ESMTP; 30 Nov 2011 09:40:42 -0700 Received: by lagos.xvx.ca (Postfix, from userid 1000) id C5B99800300E; Wed, 30 Nov 2011 09:40:41 -0700 (MST) From: Adam Wolfe Gordon To: notmuch@notmuchmail.org, awg@xvx.ca Subject: [RFC PATCH 2/3] reply: New format 'html' that quotes text/html parts Date: Wed, 30 Nov 2011 09:40:40 -0700 Message-Id: <1322671241-23438-3-git-send-email-awg+notmuch@xvx.ca> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1322671241-23438-1-git-send-email-awg+notmuch@xvx.ca> References: <1322671241-23438-1-git-send-email-awg+notmuch@xvx.ca> 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: Wed, 30 Nov 2011 16:50:09 -0000 A new format for notmuch reply that quotes text/html parts as well as text/plain parts. The defaults have not changed, so notmuch reply with no arguments still quotes only plain-text parts. This is useful for people who regularly get HTML-only email. --- notmuch-reply.c | 8 +++++++- notmuch.c | 6 +++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/notmuch-reply.c b/notmuch-reply.c index 7ac879f..d44e179 100644 --- a/notmuch-reply.c +++ b/notmuch-reply.c @@ -46,6 +46,8 @@ static const notmuch_show_format_t format_reply = { "" }; +static notmuch_bool_t allow_html = FALSE; + static void show_reply_headers (GMimeMessage *message) { @@ -104,7 +106,7 @@ reply_part_content (GMimeObject *part) /* Ignore PGP/MIME cruft parts */ } else if (g_mime_content_type_is_type (content_type, "text", "*") && - !g_mime_content_type_is_type (content_type, "text", "html")) + (!g_mime_content_type_is_type (content_type, "text", "html") || allow_html)) { GMimeStream *stream_stdout = NULL, *stream_filter = NULL; GMimeDataWrapper *wrapper; @@ -639,8 +641,12 @@ notmuch_reply_command (void *ctx, int argc, char *argv[]) opt = argv[i] + sizeof ("--format=") - 1; if (strcmp (opt, "default") == 0) { reply_format_func = notmuch_reply_format_default; + allow_html = FALSE; } else if (strcmp (opt, "headers-only") == 0) { reply_format_func = notmuch_reply_format_headers_only; + } else if (strcmp (opt, "html") == 0) { + reply_format_func = notmuch_reply_format_default; + allow_html = TRUE; } else { fprintf (stderr, "Invalid value for --format: %s\n", opt); return 1; diff --git a/notmuch.c b/notmuch.c index d44ce9a..f72e79c 100644 --- a/notmuch.c +++ b/notmuch.c @@ -366,7 +366,7 @@ static command_t commands[] = { "\n" "\tSupported options for reply include:\n" "\n" - "\t--format=(default|headers-only)\n" + "\t--format=(default|headers-only|html)\n" "\n" "\t\tdefault:\n" "\t\t\tIncludes subject and quoted message body.\n" @@ -375,6 +375,10 @@ static command_t commands[] = { "\t\t\tOnly produces In-Reply-To, References, To\n" "\t\t\tCc, and Bcc headers.\n" "\n" + "\t\thtml:\n" + "\t\t\tIncludes subject and quoted message body,\n" + "\t\t\tincluding HTML parts.\n" + "\n" "\tSee \"notmuch help search-terms\" for details of the search\n" "\tterms syntax." }, { "tag", notmuch_tag_command, -- 1.7.5.4