--- /dev/null
+Return-Path: <dme@dme.org>\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 E34C06DE1765\r
+ for <notmuch@notmuchmail.org>; Tue, 9 Feb 2016 12:34:21 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at cworth.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.091\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.091 tagged_above=-999 required=5\r
+ tests=[AWL=-0.024, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,\r
+ RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01,\r
+ RCVD_IN_MSPIKE_WL=-0.01, SPF_NEUTRAL=0.652, UNPARSEABLE_RELAY=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 h0PXWBRcJT_i for <notmuch@notmuchmail.org>;\r
+ Tue, 9 Feb 2016 12:34:19 -0800 (PST)\r
+Received: from mail-wm0-f65.google.com (mail-wm0-f65.google.com\r
+ [74.125.82.65]) by arlo.cworth.org (Postfix) with ESMTPS id 7D6266DE01D3 for\r
+ <notmuch@notmuchmail.org>; Tue, 9 Feb 2016 12:34:19 -0800 (PST)\r
+Received: by mail-wm0-f65.google.com with SMTP id g62so2573wme.2\r
+ for <notmuch@notmuchmail.org>; Tue, 09 Feb 2016 12:34:19 -0800 (PST)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
+ d=dme-org.20150623.gappssmtp.com; s=20150623;\r
+ h=to:subject:in-reply-to:references:from:date:message-id:mime-version\r
+ :content-type; bh=7X00I8Jju9Q7iaCL8m0I5lcpruVckpPINYXojOe+okg=;\r
+ b=xbwKS4DZ9hwtf9rGnl2IBrWgZ1PhJieLcLt7fZ0b3a4eLS7gUIp2SUlSY26UxB2bmQ\r
+ S3wHh7Caoa5iPN9jYwlNud7WWg/F2KWp+swib6hLCecReiaxe19G7iRO6ZKKO7/LvJ0m\r
+ FLHdwm3SyB+sXV4je2d8WTVdE3IzRn6li7HJuok8iU7YdKXRu3HFNBYumnZG6SJMgoem\r
+ dTP+5vtNE7CRtPzHVz9fJMN3o7UFB43VQ8NPcFVXEC6E0cTbkUnNvzSIpmTk5ZF0Am8w\r
+ nwc9vaGZfz2+vmLa8YLhbbFJvohIyyWO2pUit70lPIcJjn7Wy4orKDwTry8/t+Ot5iS/\r
+ 9Ueg==\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:to:subject:in-reply-to:references:from:date\r
+ :message-id:mime-version:content-type;\r
+ bh=7X00I8Jju9Q7iaCL8m0I5lcpruVckpPINYXojOe+okg=;\r
+ b=eyIzx698p5NMWCUMCC9m1C6yjbCzAWwFiA1iw31S6+ulF4q8ZU6XMz8Civ1RG3NbUF\r
+ LB8NE7aad/aUTNy+jxqUJwnpM8tBzg5jomW3QvTLK3WHTq97vHn3FupmZHh1bCKZndi0\r
+ 2ux2QNZxY9JZv8VAME1r7BcMVV7gFL06GEbQP7t1hLCFD8EVhMsW3X9N+NWbRTKzowvj\r
+ lGxe5KhCKJ17++35xNhpw5XD+VcbtW4VMcR70XMusw01WHdEtzaUlJ8epjIPFlHjFRG7\r
+ rseC36AXoi1h6dUyPE4fOgTB9A10LBT4zhiseAyV1UaXYKN/Ge7y2gfY+Fl9llTXyJRA\r
+ T75w==\r
+X-Gm-Message-State:\r
+ AG10YOQMt3j8QHZUIxAX42YUiRNDkkOSe8GybpLzaKiP65Z61LP/tsWvTwTSerauodX5kQ==\r
+X-Received: by 10.28.174.72 with SMTP id x69mr6828563wme.68.1455050058217;\r
+ Tue, 09 Feb 2016 12:34:18 -0800 (PST)\r
+Received: from disaster-area.hh.sledj.net\r
+ ([2a01:348:1a2:1:ea39:35ff:fe2c:a227])\r
+ by smtp.gmail.com with ESMTPSA id w8sm36318414wjx.21.2016.02.09.12.34.16\r
+ (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\r
+ Tue, 09 Feb 2016 12:34:16 -0800 (PST)\r
+Received: from localhost (disaster-area.hh.sledj.net [local])\r
+ by disaster-area.hh.sledj.net (OpenSMTPD) with ESMTPA id 05b79c16;\r
+ Tue, 9 Feb 2016 20:34:16 +0000 (UTC)\r
+To: Mark Walters <markwalters1009@gmail.com>, notmuch@notmuchmail.org\r
+Subject: Re: [PATCH v4 6/7] emacs/mua: Let user specify which parts get a\r
+ header in citations.\r
+In-Reply-To: <1446894276-7814-7-git-send-email-markwalters1009@gmail.com>\r
+References: <1446894276-7814-1-git-send-email-markwalters1009@gmail.com>\r
+ <1446894276-7814-7-git-send-email-markwalters1009@gmail.com>\r
+From: David Edmondson <dme@dme.org>\r
+Date: Tue, 09 Feb 2016 20:34:16 +0000\r
+Message-ID: <m2ziv939o7.fsf@dme.org>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain\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: Tue, 09 Feb 2016 20:34:22 -0000\r
+\r
+On Sat, Nov 07 2015, Mark Walters wrote:\r
+> From: David Edmondson <dme@dme.org>\r
+>\r
+> Add a customizable function specifying which parts get a header when\r
+> replying, and give some sensible possiblities. These are,\r
+>\r
+> 1) all parts except multipart/*. (Subparts of a multipart part do\r
+> receive a header button.)\r
+>\r
+> 2) only included text/* parts.\r
+>\r
+> 3) Exactly as in the show buffer.\r
+>\r
+> 4) None at all. This means the reply contains a mish-mash of all the\r
+> original message's parts.\r
+> ---\r
+> emacs/notmuch-mua.el | 30 ++++++++++++++++++++++++++----\r
+> emacs/notmuch-show.el | 13 +++++++++++++\r
+> 2 files changed, 39 insertions(+), 4 deletions(-)\r
+>\r
+> diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el\r
+> index 2f7abb0..a675f47 100644\r
+> --- a/emacs/notmuch-mua.el\r
+> +++ b/emacs/notmuch-mua.el\r
+> @@ -91,6 +91,23 @@ (defcustom notmuch-mua-cite-function 'message-cite-original\r
+> :link '(custom-manual "(message)Insertion Variables")\r
+> :group 'notmuch-reply)\r
+> \r
+> +(defcustom notmuch-mua-reply-insert-header-p-function\r
+> + 'notmuch-show-reply-insert-header-p-trimmed\r
+> + "Function to decide which parts get a header when replying.\r
+> +\r
+> +This function specifies which parts of a mime message with\r
+> +mutiple parts get a header."\r
+> + :type '(radio (const :tag "All except multipart/* and hidden parts"\r
+> + notmuch-show-reply-insert-header-p-trimmed)\r
+> + (const :tag "Only for included text parts"\r
+> + notmuch-show-reply-insert-header-p-minimal)\r
+> + (const :tag "Exactly as in show view"\r
+> + notmuch-show-insert-header-p)\r
+> + (const :tag "No part headers"\r
+> + notmuch-show-reply-insert-header-p-never)\r
+> + (function :tag "Other"))\r
+> + :group 'notmuch-reply)\r
+> +\r
+\r
+These are all functions - should we be `declare-function'ing them, given\r
+that they come from elsewhere? Presumably the compiler is not clever\r
+enough to complain if we don't.\r
+\r
+> ;;\r
+> \r
+> (defun notmuch-mua-get-switch-function ()\r
+> @@ -221,10 +238,15 @@ (defun notmuch-mua-reply (query-string &optional sender reply-all)\r
+> (insert "Date: " date "\n\n")\r
+> \r
+> (insert (with-temp-buffer\r
+> - ;; Don't attempt to clean up messages, excerpt\r
+> - ;; citations, etc. in the original message before\r
+> - ;; quoting.\r
+> - (let ((notmuch-show-insert-text/plain-hook nil))\r
+> + (let\r
+> + ;; Don't attempt to clean up messages, excerpt\r
+> + ;; citations, etc. in the original message before\r
+> + ;; quoting.\r
+> + ((notmuch-show-insert-text/plain-hook nil)\r
+> + ;; Don't omit long parts.\r
+> + (notmuch-show-max-text-part-size 0)\r
+> + ;; Insert headers for parts as appropriate for replying.\r
+> + (notmuch-show-insert-header-p-function notmuch-mua-reply-insert-header-p-function))\r
+> (notmuch-show-insert-body original (plist-get original :body) 0)\r
+> (buffer-substring-no-properties (point-min) (point-max)))))\r
+> \r
+> diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
+> index f4a65cc..7ff9ed5 100644\r
+> --- a/emacs/notmuch-show.el\r
+> +++ b/emacs/notmuch-show.el\r
+> @@ -959,6 +959,19 @@ (defun notmuch-show-insert-header-p (part hide)\r
+> (not (and (string= mime-type "text/plain")\r
+> (<= (plist-get part :id) 1)))))\r
+> \r
+> +(defun notmuch-show-reply-insert-header-p-never (part hide)\r
+> + nil)\r
+> +\r
+> +(defun notmuch-show-reply-insert-header-p-trimmed (part hide)\r
+> + (let ((mime-type (notmuch-show-mime-type part)))\r
+> + (and (not (notmuch-match-content-type mime-type "multipart/*"))\r
+> + (not hide))))\r
+> +\r
+> +(defun notmuch-show-reply-insert-header-p-minimal (part hide)\r
+> + (let ((mime-type (notmuch-show-mime-type part)))\r
+> + (and (notmuch-match-content-type mime-type "text/*")\r
+> + (not hide))))\r
+> +\r
+> (defun notmuch-show-insert-bodypart (msg part depth &optional hide)\r
+> "Insert the body part PART at depth DEPTH in the current thread.\r
+> \r
+> -- \r
+> 2.1.4\r