[PATCH 0/4] Add a --include-text-content option to notmuch-show.c
authorMark Walters <markwalters1009@gmail.com>
Sun, 22 Jul 2012 14:37:55 +0000 (15:37 +0100)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:48:27 +0000 (09:48 -0800)
cb/8f4da9f8373223825183c3ff27008b48dd653b [new file with mode: 0644]

diff --git a/cb/8f4da9f8373223825183c3ff27008b48dd653b b/cb/8f4da9f8373223825183c3ff27008b48dd653b
new file mode 100644 (file)
index 0000000..e1979df
--- /dev/null
@@ -0,0 +1,110 @@
+Return-Path: <markwalters1009@gmail.com>\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 0E1F3431FAF\r
+       for <notmuch@notmuchmail.org>; Sun, 22 Jul 2012 07:38:09 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 2.7\r
+X-Spam-Level: **\r
+X-Spam-Status: No, score=2.7 tagged_above=-999 required=5\r
+       tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
+       FREEMAIL_ENVFROM_END_DIGIT=1, FREEMAIL_FROM=0.001,\r
+       FREEMAIL_REPLY=2.499, 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 ygWqJ6r-+u2f for <notmuch@notmuchmail.org>;\r
+       Sun, 22 Jul 2012 07:38:08 -0700 (PDT)\r
+Received: from mail-we0-f181.google.com (mail-we0-f181.google.com\r
+       [74.125.82.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id EB70A431FAE\r
+       for <notmuch@notmuchmail.org>; Sun, 22 Jul 2012 07:38:07 -0700 (PDT)\r
+Received: by weyt57 with SMTP id t57so4152698wey.26\r
+       for <notmuch@notmuchmail.org>; Sun, 22 Jul 2012 07:38:05 -0700 (PDT)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
+       h=from:to:cc:subject:date:message-id:x-mailer;\r
+       bh=XdFWsu8vQJRkUJQjMQzlut5+mBhlLa5HIatYQmwp1Xw=;\r
+       b=CfDOQktrYsnwgmSBKGzGPxevWPnyMyJbl18z/hP9pH95uDrBezYRET9H7s0+rffOnF\r
+       WumpPooVGVOtCKwOY5cctLxeJSERY100b6CvNPoZfdDTSOqwVbdZPmQGe/FHOFPk3lqA\r
+       Pv0N4zlnHpgfIOTNsFTu8rOUXyP8hkT25LRKA5QPXMNdwSIBQp6R7nqfOJ8m0KPqqG49\r
+       5E+c+LvBsXQryHs7lXiOkdKT97GYHV4skP9ZJwgHCTxSJLOm5LYI6D3dikH2uG4PJmZZ\r
+       t5aYoi2d8IGkUuy55YPJVIxQq2jmuj2ZzPUEyqdmHZnQaOqNBtxeJ64TEZ3y9Yryg2RE\r
+       RSJg==\r
+Received: by 10.180.100.35 with SMTP id ev3mr21651751wib.10.1342967884876;\r
+       Sun, 22 Jul 2012 07:38:04 -0700 (PDT)\r
+Received: from localhost (94-192-233-223.zone6.bethere.co.uk.\r
+ [94.192.233.223])     by mx.google.com with ESMTPS id\r
+ ef5sm16731287wib.3.2012.07.22.07.38.03        (version=TLSv1/SSLv3 cipher=OTHER);\r
+       Sun, 22 Jul 2012 07:38:03 -0700 (PDT)\r
+From: Mark Walters <markwalters1009@gmail.com>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH 0/4] Add a --include-text-content option to notmuch-show.c\r
+Date: Sun, 22 Jul 2012 15:37:55 +0100\r
+Message-Id: <1342967879-20453-1-git-send-email-markwalters1009@gmail.com>\r
+X-Mailer: git-send-email 1.7.9.1\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: Sun, 22 Jul 2012 14:38:09 -0000\r
+\r
+Currently notmuch show includes text/* parts (except text/html) in the\r
+JSON and text outputs. This patch adds a new option\r
+--include-text-content=true|false which allows the caller to disable\r
+this behaviour.\r
+\r
+This is similar to the --headers-only option proposed in\r
+id:"1341041595-5858-1-git-send-email-markwalters1009@gmail.com". The\r
+key difference is that this version does not change the JSON output\r
+schema: the schema says that "A leaf part's body content is optional,\r
+but may be included if it can be correctly encoded as a string."\r
+\r
+This means that the emacs show mode works correctly if switched to\r
+specifying --include-text-content=false (it fetches each part\r
+individually). Indeed, it may be desirable to make that the default\r
+(as suggested by Jamie in\r
+id:"877gu7gzy9.fsf@servo.finestructure.net"). However, this may make\r
+show significantly slower so we do not change the default here.\r
+\r
+There have been other suggestions of allowing the user to specify\r
+exactly which parts/headers etc notmuch should return and even of\r
+unifying show and search. That is obviously a much bigger change than\r
+this (and this would not make that any more difficult).\r
+\r
+Finally, the advantage of this change is that it can substantially\r
+speed up some uses (when the caller only wants the headers): see\r
+id:"87r4sei8yu.fsf@qmul.ac.uk" for some examples with a factor of 8\r
+speed up.\r
+\r
+Best wishes\r
+\r
+Mark\r
+\r
+\r
+\r
+Mark Walters (4):\r
+  cli: show: add --include-text-content=true|false option\r
+  cli: show: implement --include-text-content for --format=text\r
+  test: add some tests for --include-text-content option\r
+  man: update man page for --include-text-option\r
+\r
+ man/man1/notmuch-show.1 |   12 ++++++++++\r
+ notmuch-client.h        |    3 +-\r
+ notmuch-reply.c         |    2 +-\r
+ notmuch-show.c          |   57 ++++++++++++++++++++++++++++-------------------\r
+ test/json               |    9 +++++++\r
+ 5 files changed, 58 insertions(+), 25 deletions(-)\r
+\r
+-- \r
+1.7.9.1\r
+\r