--- /dev/null
+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 arlo.cworth.org (Postfix) with ESMTP id 640EE6DE178F\r
+ for <notmuch@notmuchmail.org>; Sun, 14 Feb 2016 10:40:27 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at cworth.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.247\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.247 tagged_above=-999 required=5 tests=[AWL=0.323,\r
+ DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
+ FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7,\r
+ RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001]\r
+ autolearn=disabled\r
+Received: from arlo.cworth.org ([127.0.0.1])\r
+ by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id IEdtKJPVBOAp for <notmuch@notmuchmail.org>;\r
+ Sun, 14 Feb 2016 10:40:25 -0800 (PST)\r
+Received: from mail-wm0-f68.google.com (mail-wm0-f68.google.com\r
+ [74.125.82.68]) by arlo.cworth.org (Postfix) with ESMTPS id DD59F6DE17BD for\r
+ <notmuch@notmuchmail.org>; Sun, 14 Feb 2016 10:40:22 -0800 (PST)\r
+Received: by mail-wm0-f68.google.com with SMTP id c200so12198520wme.0\r
+ for <notmuch@notmuchmail.org>; Sun, 14 Feb 2016 10:40:22 -0800 (PST)\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:in-reply-to:references;\r
+ bh=I2z6cGyLkuJQKLZmtPDG96dFYAkL+7Q/mjRueLiQRJU=;\r
+ b=XMJmzJVG5xwaUiBM7WzcsJ/ytNNjVkOOYAQBrxi9Ni7kx8vQVsdLCdHao3Q9HDNFek\r
+ RQzU8bQmPm/v1qT9FfymGkM7u19a5l8oAKWagwNINwi5YVHn3Ua+N775eXb8EBfnQxrm\r
+ FiQF7RJPseLvwF2XKlogsh+nsn+zCLv6gvYcVEArSpvezz3PfWHqYwwk2a7nIg4xiBiF\r
+ U+TKt/EMc7GXf1lBLRWlen/w4l3acG+pfYGLlx1JXdVokdc5sq8f6zBNgLgiCoLUVZTr\r
+ +2AoCTUUStjRcWMcYX4JyqRfIbPLaZhpCk4R0shoZfdJyUvsPeD9vhruEfu+0WE6qEVF\r
+ ZscQ==\r
+X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
+ d=1e100.net; s=20130820;\r
+ h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\r
+ :references;\r
+ bh=I2z6cGyLkuJQKLZmtPDG96dFYAkL+7Q/mjRueLiQRJU=;\r
+ b=CaOWukB+HZVkkFnfdmSRz87VknqPoB1D8lwvLQcGZBhHiRE4klXokiAELfB7Jm3i+T\r
+ nqTxWUTDDkksGkA3XTUSNpGMHJ4HVQlz31ydGBLH3uwuXkkKHNt3FyD4P0EiTwqH5ZU3\r
+ T2a5TUTfw/YbtXCFxEI45YPqyjuBiV6D5KK1HBdyzLB91sHx4I87L3McH9wLZko78KMa\r
+ drxsnd/ZwZdAyzQMuvqg4hSElMOfOjHJzB9N1bAN8o/u4GDdRsvrBXIo5cRBAs+wmRk9\r
+ si7yXy7zCdHKcConsxhHjeZmYmVCJD8xx4E4PDJpvW7YlGfQVpgqDw+N9fDge6ZRH+QG\r
+ LUFQ==\r
+X-Gm-Message-State:\r
+ AG10YOQvwDmu3GSMQ1vue2Nwoqb5Zp/0xJM2cBC7JdLcfR5dxg4GEPAKRZsPG49xq0YqTA==\r
+X-Received: by 10.28.126.65 with SMTP id z62mr9078028wmc.3.1455475221538;\r
+ Sun, 14 Feb 2016 10:40:21 -0800 (PST)\r
+Received: from localhost (5751dfa2.skybroadband.com. [87.81.223.162])\r
+ by smtp.gmail.com with ESMTPSA id a128sm12052441wmh.6.2016.02.14.10.40.20\r
+ (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\r
+ Sun, 14 Feb 2016 10:40:21 -0800 (PST)\r
+From: Mark Walters <markwalters1009@gmail.com>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH v5 5/7] emacs/show: Make the insertion of part headers\r
+ overridable.\r
+Date: Sun, 14 Feb 2016 18:39:57 +0000\r
+Message-Id: <1455475199-32622-6-git-send-email-markwalters1009@gmail.com>\r
+X-Mailer: git-send-email 2.1.4\r
+In-Reply-To: <1455475199-32622-1-git-send-email-markwalters1009@gmail.com>\r
+References: <1455475199-32622-1-git-send-email-markwalters1009@gmail.com>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.20\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <https://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: <https://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Sun, 14 Feb 2016 18:40:27 -0000\r
+\r
+From: David Edmondson <dme@dme.org>\r
+\r
+This allows callers of notmuch-show-insert-bodypart to use a `let'\r
+binding to override the default function for specifying when part\r
+headers should be inserted.\r
+---\r
+ emacs/notmuch-show.el | 13 +++++++++++--\r
+ 1 file changed, 11 insertions(+), 2 deletions(-)\r
+\r
+diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
+index f0bbff0..5654d11 100644\r
+--- a/emacs/notmuch-show.el\r
++++ b/emacs/notmuch-show.el\r
+@@ -943,8 +943,15 @@ will return nil if the CID is unknown or cannot be retrieved."\r
+ "text/x-diff")\r
+ content-type)))\r
+ \r
++;; The following variable can be overridden by let bindings.\r
++(defvar notmuch-show-insert-header-p-function 'notmuch-show-insert-header-p\r
++ "Specify which function decides which part headers get inserted.\r
++\r
++The function should take two parameters, PART and HIDE, and\r
++should return non-NIL if a header button should be inserted for\r
++this part.")\r
++\r
+ (defun notmuch-show-insert-header-p (part hide)\r
+- "Return non-NIL if a header button should be inserted for this part."\r
+ ;; Show all part buttons except for the first part if it is text/plain.\r
+ (let ((mime-type (notmuch-show-mime-type part)))\r
+ (not (and (string= mime-type "text/plain")\r
+@@ -964,7 +971,9 @@ is t, hide the part initially and show the button."\r
+ (> notmuch-show-max-text-part-size 0)\r
+ (> (length (plist-get part :content)) notmuch-show-max-text-part-size)))\r
+ (beg (point))\r
+- (button (when (notmuch-show-insert-header-p part hide)\r
++ ;; This default header-p function omits the part button for\r
++ ;; the first (or only) part if this is text/plain.\r
++ (button (when (funcall notmuch-show-insert-header-p-function part hide)\r
+ (notmuch-show-insert-part-header nth mime-type content-type (plist-get part :filename))))\r
+ ;; Hide the part initially if HIDE is t, or if it is too long\r
+ ;; and we have a button to allow toggling.\r
+-- \r
+2.1.4\r
+\r