--- /dev/null
+Return-Path: <m.walters@qmul.ac.uk>\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 D662C431FAF\r
+ for <notmuch@notmuchmail.org>; Mon, 27 May 2013 15:19:27 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -1.098\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-1.098 tagged_above=-999 required=5\r
+ tests=[DKIM_ADSP_CUSTOM_MED=0.001, FREEMAIL_FROM=0.001,\r
+ NML_ADSP_CUSTOM_MED=1.2, RCVD_IN_DNSWL_MED=-2.3] 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 V+kyC8Rn01G9 for <notmuch@notmuchmail.org>;\r
+ Mon, 27 May 2013 15:19:21 -0700 (PDT)\r
+Received: from mail2.qmul.ac.uk (mail2.qmul.ac.uk [138.37.6.6])\r
+ (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\r
+ (No client certificate requested)\r
+ by olra.theworths.org (Postfix) with ESMTPS id AE8F0431FAE\r
+ for <notmuch@notmuchmail.org>; Mon, 27 May 2013 15:19:21 -0700 (PDT)\r
+Received: from smtp.qmul.ac.uk ([138.37.6.40])\r
+ by mail2.qmul.ac.uk with esmtp (Exim 4.71)\r
+ (envelope-from <m.walters@qmul.ac.uk>)\r
+ id 1Uh5lA-0001WV-9R; Mon, 27 May 2013 23:19:20 +0100\r
+Received: from 93-97-24-31.zone5.bethere.co.uk ([93.97.24.31] helo=localhost)\r
+ by smtp.qmul.ac.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.71)\r
+ (envelope-from <m.walters@qmul.ac.uk>)\r
+ id 1Uh5lA-00064Y-0p; Mon, 27 May 2013 23:19:20 +0100\r
+From: Mark Walters <markwalters1009@gmail.com>\r
+To: Austin Clements <amdragon@MIT.EDU>, notmuch@notmuchmail.org\r
+Subject: Re: [PATCH 2/4] emacs: Record part p-list in a text property\r
+In-Reply-To: <1369687594-31774-3-git-send-email-amdragon@mit.edu>\r
+References: <1369687594-31774-1-git-send-email-amdragon@mit.edu>\r
+ <1369687594-31774-3-git-send-email-amdragon@mit.edu>\r
+User-Agent: Notmuch/0.14+255~gff3cc55 (http://notmuchmail.org) Emacs/23.4.1\r
+ (i486-pc-linux-gnu)\r
+Date: Mon, 27 May 2013 23:19:18 +0100\r
+Message-ID: <8738t8jcbd.fsf@qmul.ac.uk>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\r
+X-Sender-Host-Address: 93.97.24.31\r
+X-QM-SPAM-Info: Sender has good ham record. :)\r
+X-QM-Body-MD5: c867794f7311dd3a0754b9814b8e1b0a (of first 20000 bytes)\r
+X-SpamAssassin-Score: -0.1\r
+X-SpamAssassin-SpamBar: /\r
+X-SpamAssassin-Report: The QM spam filters have analysed this message to\r
+ determine if it is\r
+ spam. We require at least 5.0 points to mark a message as spam.\r
+ This message scored -0.1 points.\r
+ Summary of the scoring: \r
+ * 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail\r
+ provider * (markwalters1009[at]gmail.com)\r
+ * -0.1 AWL AWL: From: address is in the auto white-list\r
+X-QM-Scan-Virus: ClamAV says the message is clean\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, 27 May 2013 22:19:28 -0000\r
+\r
+\r
+A couple of small nits:\r
+\r
+Austin Clements <amdragon@MIT.EDU> writes:\r
+\r
+> This is similar to what we already do with the message p-list, though\r
+> we apply the part's text property to the whole part's text, in\r
+> contrast with the message p-list, which is (rather obscurely) only\r
+> applied to the first character.\r
+> ---\r
+> emacs/notmuch-lib.el | 16 ++++++++++++++++\r
+> emacs/notmuch-show.el | 13 ++++++++++++-\r
+> 2 files changed, 28 insertions(+), 1 deletion(-)\r
+>\r
+> diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el\r
+> index 790136e..09ce25e 100644\r
+> --- a/emacs/notmuch-lib.el\r
+> +++ b/emacs/notmuch-lib.el\r
+> @@ -360,6 +360,22 @@ OBJECT."\r
+> below\r
+> string))\r
+> \r
+> +(defun notmuch-put-text-property-if-nil (start end property value\r
+> + &optional object)\r
+> + "Like `put-text-property', but only set the property where it is nil."\r
+> + (while (< start end)\r
+> + (let ((start-nil (text-property-any start end property nil object)))\r
+> + (if (null start-nil)\r
+> + ;; There are no more nil regions; exit the loop\r
+> + (setq start end)\r
+> + ;; Find the end of the nil region\r
+> + (let ((end-nil\r
+> + (or (text-property-not-all start-nil end property nil object)\r
+> + end)))\r
+> + ;; Set the property\r
+> + (put-text-property start-nil end-nil property value object)\r
+> + (setq start end-nil))))))\r
+> +\r
+> (defun notmuch-logged-error (msg &optional extra)\r
+> "Log MSG and EXTRA to *Notmuch errors* and signal MSG.\r
+> \r
+> diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
+> index a080134..acd0b55 100644\r
+> --- a/emacs/notmuch-show.el\r
+> +++ b/emacs/notmuch-show.el\r
+> @@ -900,7 +900,10 @@ If HIDE is non-nil then initially hide this part."\r
+> ;; Ensure that the part ends with a carriage return.\r
+> (unless (bolp)\r
+> (insert "\n"))\r
+> - (notmuch-show-create-part-overlays msg beg (point) hide)))\r
+> + (notmuch-show-create-part-overlays msg beg (point) hide)\r
+> + ;; Record part information. Since we already inserted subparts,\r
+> + ;; don't override exiting :notmuch-part properties.\r
+ ^^^\r
+existing\r
+\r
+> + (notmuch-put-text-property-if-nil beg (point) :notmuch-part part)))\r
+> \r
+> (defun notmuch-show-insert-body (msg body depth)\r
+> "Insert the body BODY at depth DEPTH in the current thread."\r
+> @@ -1404,6 +1407,14 @@ Some useful entries are:\r
+> (notmuch-show-move-to-message-top)\r
+> (get-text-property (point) :notmuch-message-properties)))\r
+> \r
+> +(defun notmuch-show-get-part-properties ()\r
+> + "Return the properties of the part containing point.\r
+> +\r
+> +This is the part property list retrieved from the CLI. Signals\r
+> +an error if there is no part containing point."\r
+\r
+I think something here should say innermost part or something similar.\r
+\r
+Best wishes\r
+\r
+Mark\r
+\r
+\r
+> + (or (get-text-property (point) :notmuch-part)\r
+> + (error "No message part here")))\r
+> +\r
+> (defun notmuch-show-set-prop (prop val &optional props)\r
+> (let ((inhibit-read-only t)\r
+> (props (or props\r
+> -- \r
+> 1.7.10.4\r