--- /dev/null
+Return-Path: <amdragon@mit.edu>\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 E3267431FBF\r
+ for <notmuch@notmuchmail.org>; Mon, 6 Aug 2012 09:50:32 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.7\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
+ tests=[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 11iDwZCBRRDJ for <notmuch@notmuchmail.org>;\r
+ Mon, 6 Aug 2012 09:50:29 -0700 (PDT)\r
+Received: from dmz-mailsec-scanner-3.mit.edu (DMZ-MAILSEC-SCANNER-3.MIT.EDU\r
+ [18.9.25.14])\r
+ by olra.theworths.org (Postfix) with ESMTP id AF8B1431FAF\r
+ for <notmuch@notmuchmail.org>; Mon, 6 Aug 2012 09:50:28 -0700 (PDT)\r
+X-AuditID: 1209190e-b7fb56d0000008b2-4f-501ff5d21567\r
+Received: from mailhub-auth-1.mit.edu ( [18.9.21.35])\r
+ by dmz-mailsec-scanner-3.mit.edu (Symantec Messaging Gateway) with SMTP\r
+ id B9.26.02226.2D5FF105; Mon, 6 Aug 2012 12:50:27 -0400 (EDT)\r
+Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103])\r
+ by mailhub-auth-1.mit.edu (8.13.8/8.9.2) with ESMTP id q76GoQUv022502; \r
+ Mon, 6 Aug 2012 12:50:26 -0400\r
+Received: from awakening.csail.mit.edu (awakening.csail.mit.edu [18.26.4.91])\r
+ (authenticated bits=0)\r
+ (User authenticated as amdragon@ATHENA.MIT.EDU)\r
+ by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id q76GoPmS018977\r
+ (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);\r
+ Mon, 6 Aug 2012 12:50:25 -0400 (EDT)\r
+Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.77)\r
+ (envelope-from <amdragon@mit.edu>)\r
+ id 1SyQVc-000363-TK; Mon, 06 Aug 2012 12:50:24 -0400\r
+Date: Mon, 6 Aug 2012 12:50:24 -0400\r
+From: Austin Clements <amdragon@MIT.EDU>\r
+To: Peter Wang <novalazy@gmail.com>\r
+Subject: Re: [PATCH 3/4] show: indicate length of omitted body content (text)\r
+Message-ID: <20120806165024.GL22601@mit.edu>\r
+References: <1344151345-25411-1-git-send-email-novalazy@gmail.com>\r
+ <1344151345-25411-3-git-send-email-novalazy@gmail.com>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\r
+Content-Disposition: inline\r
+In-Reply-To: <1344151345-25411-3-git-send-email-novalazy@gmail.com>\r
+User-Agent: Mutt/1.5.21 (2010-09-15)\r
+X-Brightmail-Tracker:\r
+ H4sIAAAAAAAAA+NgFmphleLIzCtJLcpLzFFi42IR4hRV1r38VT7AYMEnJovrN2cyWzxv3cvk\r
+ wOSxc9Zddo9nq24xBzBFcdmkpOZklqUW6dslcGVcu/mFraBDrGL6rkksDYxnBLsYOTkkBEwk\r
+ 3i7sYIOwxSQu3FsPZHNxCAnsY5SYNfMMI4SznlGi++0bqMwJJokFS/qhMksYJbZNmckK0s8i\r
+ oCJx/dQaZhCbTUBDYtv+5YwgtoiAssSfX8/AdjALSEt8+93MBGILC/hKrL97C6yeV0BHYu2E\r
+ yWC2kEC1xOSV89kg4oISJ2c+YYHo1ZK48e8lUC8H2Jzl/zhAwpwCzhLnPi4CWyUKdMKUk9vY\r
+ JjAKzULSPQtJ9yyE7gWMzKsYZVNyq3RzEzNzilOTdYuTE/PyUot0jfVyM0v0UlNKNzGCA1uS\r
+ bwfj14NKhxgFOBiVeHhvGMgHCLEmlhVX5h5ilORgUhLljX0HFOJLyk+pzEgszogvKs1JLT7E\r
+ KMHBrCTCW7MQKMebklhZlVqUD5OS5mBREue9knLTX0ggPbEkNTs1tSC1CCYrw8GhJMF75QtQ\r
+ o2BRanpqRVpmTglCmomDE2Q4D9Dw1yA1vMUFibnFmekQ+VOMilLivKdAEgIgiYzSPLheWOJ5\r
+ xSgO9IowLxswDQnxAJMWXPcroMFMQIO95eVABpckIqSkGhgnNIunLxS+8LJB+4o8p1vVmlDJ\r
+ 6Gzmv38Ovtnreuve/Jv2bUlmDkc2m/h7FHo8dZ3zZpHjErOtx/8x/Dl3QFP15NG+z6dsvsjP\r
+ YHnTvu1/0ObP/QfzdQO+/+yUu6l1JoWp+7b4xv1Or7eWbqs4tIN11tvI+Obehef3Op1//5an\r
+ ebO6anTITwYDJZbijERDLeai4kQAFFLAGBcDAAA=\r
+Cc: notmuch@notmuchmail.org\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: Mon, 06 Aug 2012 16:50:33 -0000\r
+\r
+I'm not sure it's worth updating the text format. There's already\r
+plenty of disparity between the JSON and text formats, we're\r
+considering deprecating the text format, and, from what I understand,\r
+this might actually break consumers of the text format (the vim\r
+frontend?) since the text format isn't particularly extensible.\r
+\r
+Quoth Peter Wang on Aug 05 at 5:22 pm:\r
+> If a leaf part's body content is omitted, return the content length in\r
+> --format=text output, for parity with --format=json output.\r
+> ---\r
+> notmuch-show.c | 23 +++++++++++++++++++----\r
+> 1 files changed, 19 insertions(+), 4 deletions(-)\r
+> \r
+> diff --git a/notmuch-show.c b/notmuch-show.c\r
+> index 5c54257..cde8a1e 100644\r
+> --- a/notmuch-show.c\r
+> +++ b/notmuch-show.c\r
+> @@ -488,9 +488,17 @@ format_part_text (const void *ctx, sprinter_t *sp, mime_node_t *node,\r
+> GMIME_OBJECT (node->envelope_part) : node->part;\r
+> GMimeContentType *content_type = g_mime_object_get_content_type (meta);\r
+> const notmuch_bool_t leaf = GMIME_IS_PART (node->part);\r
+> + notmuch_bool_t leaf_text_part = FALSE;\r
+> const char *part_type;\r
+> int i;\r
+> \r
+> + if (leaf &&\r
+> + g_mime_content_type_is_type (content_type, "text", "*") &&\r
+> + !g_mime_content_type_is_type (content_type, "text", "html"))\r
+> + {\r
+> + leaf_text_part = TRUE;\r
+> + }\r
+> +\r
+> if (node->envelope_file) {\r
+> notmuch_message_t *message = node->envelope_file;\r
+> \r
+> @@ -519,7 +527,16 @@ format_part_text (const void *ctx, sprinter_t *sp, mime_node_t *node,\r
+> printf (", Filename: %s", filename);\r
+> if (cid)\r
+> printf (", Content-id: %s", cid);\r
+> - printf (", Content-type: %s\n", g_mime_content_type_to_string (content_type));\r
+> + printf (", Content-type: %s", g_mime_content_type_to_string (content_type));\r
+> + if (leaf && !leaf_text_part) {\r
+> + GMimeDataWrapper *wrapper = g_mime_part_get_content_object (GMIME_PART (node->part));\r
+> + GMimeStream *stream = g_mime_data_wrapper_get_stream (wrapper);\r
+> + ssize_t length = g_mime_stream_length (stream);\r
+> + if (length >= 0) {\r
+> + printf (", Content-length: %ld", length);\r
+> + }\r
+\r
+Same comment about possibly unref'ing wrapper and/or stream.\r
+\r
+> + }\r
+> + printf ("\n");\r
+> }\r
+> \r
+> if (GMIME_IS_MESSAGE (node->part)) {\r
+> @@ -547,9 +564,7 @@ format_part_text (const void *ctx, sprinter_t *sp, mime_node_t *node,\r
+> }\r
+> \r
+> if (leaf) {\r
+> - if (g_mime_content_type_is_type (content_type, "text", "*") &&\r
+> - !g_mime_content_type_is_type (content_type, "text", "html"))\r
+> - {\r
+> + if (leaf_text_part) {\r
+> GMimeStream *stream_stdout = g_mime_stream_file_new (stdout);\r
+> g_mime_stream_file_set_owner (GMIME_STREAM_FILE (stream_stdout), FALSE);\r
+> show_text_part_content (node->part, stream_stdout, 0);\r