Re: [PATCH] emacs: Fix applying stickiness to the :notmuch-part property
authorMark Walters <markwalters1009@gmail.com>
Mon, 3 Jun 2013 16:33:35 +0000 (17:33 +0100)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:55:23 +0000 (09:55 -0800)
ca/6a1567263f664d126bd88783a04a565cf15c93 [new file with mode: 0644]

diff --git a/ca/6a1567263f664d126bd88783a04a565cf15c93 b/ca/6a1567263f664d126bd88783a04a565cf15c93
new file mode 100644 (file)
index 0000000..7c4c744
--- /dev/null
@@ -0,0 +1,121 @@
+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 186A6431FAF\r
+       for <notmuch@notmuchmail.org>; Mon,  3 Jun 2013 09:33:52 -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 B0ZT4bGwbOVW for <notmuch@notmuchmail.org>;\r
+       Mon,  3 Jun 2013 09:33:44 -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 2B916431FAE\r
+       for <notmuch@notmuchmail.org>; Mon,  3 Jun 2013 09:33:44 -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 1UjXhR-0004dl-9d; Mon, 03 Jun 2013 17:33:42 +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 1UjXhR-0001CV-1y; Mon, 03 Jun 2013 17:33:37 +0100\r
+From: Mark Walters <markwalters1009@gmail.com>\r
+To: Austin Clements <amdragon@MIT.EDU>, notmuch@notmuchmail.org\r
+Subject: Re: [PATCH] emacs: Fix applying stickiness to the :notmuch-part\r
+       property\r
+In-Reply-To: <1370272679-20175-1-git-send-email-amdragon@mit.edu>\r
+References: <1370272679-20175-1-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, 03 Jun 2013 17:33:35 +0100\r
+Message-ID: <878v2rf928.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: fa082a8cc85353dffe10fe9d19b6a5ba (of first 20000 bytes)\r
+X-SpamAssassin-Score: -0.0\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.0 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.0 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, 03 Jun 2013 16:33:52 -0000\r
+\r
+\r
+LGTM +1. This fixes the test failures (and errors in the emacs display) I was seeing on one of my systems.\r
+\r
+Best wishes\r
+\r
+Mark\r
+\r
+\r
+\r
+Austin Clements <amdragon@MIT.EDU> writes:\r
+\r
+> Previously, we simply called pushnew to add :notmuch-part to the\r
+> front-sticky and rear-nonsticky text property lists.  This works if\r
+> these are nil or lists, but they can also have the value t, meaning\r
+> that all properties are front-sticky/rear-nonsticky.  In this case,\r
+> pushnew will signal an error because t is not a list.  We never set\r
+> these properties to t ourselves, but since we apply these property\r
+> changes over arbitrary renderer output, we have to deal with this\r
+> possibility.\r
+> ---\r
+>  emacs/notmuch-show.el |   13 ++++++++++---\r
+>  1 file changed, 10 insertions(+), 3 deletions(-)\r
+>\r
+> diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
+> index 5771950..83bb9ad 100644\r
+> --- a/emacs/notmuch-show.el\r
+> +++ b/emacs/notmuch-show.el\r
+> @@ -846,11 +846,18 @@ If HIDE is non-nil then initially hide this part."\r
+>      (notmuch-map-text-property beg (point) :notmuch-part\r
+>                             (lambda (v) (or v part)))\r
+>      ;; Make :notmuch-part front sticky and rear non-sticky so it stays\r
+> -    ;; applied to the beginning of each line when we indent the message.\r
+> +    ;; applied to the beginning of each line when we indent the\r
+> +    ;; message.  Since we're operating on arbitrary renderer output,\r
+> +    ;; watch out for sticky specs of t, which means all properties are\r
+> +    ;; front-sticky/rear-nonsticky.\r
+>      (notmuch-map-text-property beg (point) 'front-sticky\r
+> -                           (lambda (v) (pushnew :notmuch-part v)))\r
+> +                           (lambda (v) (if (listp v)\r
+> +                                           (pushnew :notmuch-part v)\r
+> +                                         v)))\r
+>      (notmuch-map-text-property beg (point) 'rear-nonsticky\r
+> -                           (lambda (v) (pushnew :notmuch-part v)))))\r
+> +                           (lambda (v) (if (listp v)\r
+> +                                           (pushnew :notmuch-part v)\r
+> +                                         v)))))\r
+>  \r
+>  (defun notmuch-show-insert-body (msg body depth)\r
+>    "Insert the body BODY at depth DEPTH in the current thread."\r
+> -- \r
+> 1.7.10.4\r