[PATCH] emacs: Fix applying stickiness to the :notmuch-part property
authorAustin Clements <amdragon@MIT.EDU>
Mon, 3 Jun 2013 15:17:59 +0000 (11:17 +2000)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:55:22 +0000 (09:55 -0800)
66/ea95e72d74f5af625849388dac6e8370522644 [new file with mode: 0644]

diff --git a/66/ea95e72d74f5af625849388dac6e8370522644 b/66/ea95e72d74f5af625849388dac6e8370522644
new file mode 100644 (file)
index 0000000..eac6e7b
--- /dev/null
@@ -0,0 +1,111 @@
+Return-Path: <amdragon@mit.edu>\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 1A68F431FAF\r
+       for <notmuch@notmuchmail.org>; Mon,  3 Jun 2013 08:18:18 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.7\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
+       tests=[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 cE4rtDC8pHbF for <notmuch@notmuchmail.org>;\r
+       Mon,  3 Jun 2013 08:18:10 -0700 (PDT)\r
+Received: from dmz-mailsec-scanner-2.mit.edu (dmz-mailsec-scanner-2.mit.edu\r
+       [18.9.25.13])\r
+       by olra.theworths.org (Postfix) with ESMTP id A5B64431FAE\r
+       for <notmuch@notmuchmail.org>; Mon,  3 Jun 2013 08:18:10 -0700 (PDT)\r
+X-AuditID: 1209190d-b7f966d000000944-16-51acb3b08bdb\r
+Received: from mailhub-auth-4.mit.edu ( [18.7.62.39])\r
+       by dmz-mailsec-scanner-2.mit.edu (Symantec Messaging Gateway) with SMTP\r
+       id 08.29.02372.0B3BCA15; Mon,  3 Jun 2013 11:18:08 -0400 (EDT)\r
+Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11])\r
+       by mailhub-auth-4.mit.edu (8.13.8/8.9.2) with ESMTP id r53FI5t5002307; \r
+       Mon, 3 Jun 2013 11:18:05 -0400\r
+Received: from drake.dyndns.org\r
+       (216-15-114-40.c3-0.arl-ubr1.sbo-arl.ma.cable.rcn.com\r
+       [216.15.114.40]) (authenticated bits=0)\r
+       (User authenticated as amdragon@ATHENA.MIT.EDU)\r
+       by outgoing.mit.edu (8.13.8/8.12.4) with ESMTP id r53FI3sI007310\r
+       (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);\r
+       Mon, 3 Jun 2013 11:18:04 -0400\r
+Received: from amthrax by drake.dyndns.org with local (Exim 4.77)\r
+       (envelope-from <amdragon@mit.edu>)\r
+       id 1UjWWI-0005H4-5z; Mon, 03 Jun 2013 11:18:02 -0400\r
+From: Austin Clements <amdragon@MIT.EDU>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH] emacs: Fix applying stickiness to the :notmuch-part property\r
+Date: Mon,  3 Jun 2013 11:17:59 -0400\r
+Message-Id: <1370272679-20175-1-git-send-email-amdragon@mit.edu>\r
+X-Mailer: git-send-email 1.7.10.4\r
+X-Brightmail-Tracker:\r
+ H4sIAAAAAAAAA+NgFtrIIsWRmVeSWpSXmKPExsUixG6nrrth85pAg33zFC1Wz+WxuH5zJrMD\r
+       k8fOWXfZPZ6tusUcwBTFZZOSmpNZllqkb5fAlbHu4Be2ghN8FV+3drM0MM7i7mLk5JAQMJH4\r
+       u7CHDcIWk7hwbz2QzcUhJLCPUaLh2n0WCGcDo8SiBbehnNtMEi97p7FCOHMZJT7Pa2AH6WcT\r
+       0JDYtn85I4gtIiAtsfPubFYQm1nAUeLz/kVgO4QFfCVuHXwIVsMioCqxvmsjWJxXwEHizcln\r
+       UHcoSnQ/m8A2gZF3ASPDKkbZlNwq3dzEzJzi1GTd4uTEvLzUIl0jvdzMEr3UlNJNjKDQ4JTk\r
+       3cH47qDSIUYBDkYlHt4AjzWBQqyJZcWVuYcYJTmYlER5OVcDhfiS8lMqMxKLM+KLSnNSiw8x\r
+       SnAwK4nwftsIlONNSaysSi3Kh0lJc7AoifNeSbnpLySQnliSmp2aWpBaBJOV4eBQkuBdvgmo\r
+       UbAoNT21Ii0zpwQhzcTBCTKcB2j4OpAa3uKCxNzizHSI/ClGXY7v86a8YxRiycvPS5US550P\r
+       UiQAUpRRmgc3BxbTrxjFgd4S5t0OUsUDTAdwk14BLWECWjL59SqQJSWJCCmpBsa5UuGNDR7r\r
+       8xgDWSIuPf77zHrn3Avv8g6+yIvm4vsz7ZWv/RTVFHu/jpAn3EkvN57cEvzY+dtOX/7bWnty\r
+       J7268CxS++qUSxe6ShuPrmNukVo1Vfz2zFu3VhS8/m3Ftz2p2IH51ovTL1JfFPN/0wy888if\r
+       Zf/GKqGHD55cvilUcvbNsXdsYtPklViKMxINtZiLihMB6iGEq8QCAAA=\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 15:18:18 -0000\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
+\r