Re: [PATCH] emacs: wash: make word-wrap bound message width
[notmuch-archives.git] / 66 / ea95e72d74f5af625849388dac6e8370522644
1 Return-Path: <amdragon@mit.edu>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5         by olra.theworths.org (Postfix) with ESMTP id 1A68F431FAF\r
6         for <notmuch@notmuchmail.org>; Mon,  3 Jun 2013 08:18:18 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -0.7\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
12         tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
13 Received: from olra.theworths.org ([127.0.0.1])\r
14         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
15         with ESMTP id cE4rtDC8pHbF for <notmuch@notmuchmail.org>;\r
16         Mon,  3 Jun 2013 08:18:10 -0700 (PDT)\r
17 Received: from dmz-mailsec-scanner-2.mit.edu (dmz-mailsec-scanner-2.mit.edu\r
18         [18.9.25.13])\r
19         by olra.theworths.org (Postfix) with ESMTP id A5B64431FAE\r
20         for <notmuch@notmuchmail.org>; Mon,  3 Jun 2013 08:18:10 -0700 (PDT)\r
21 X-AuditID: 1209190d-b7f966d000000944-16-51acb3b08bdb\r
22 Received: from mailhub-auth-4.mit.edu ( [18.7.62.39])\r
23         by dmz-mailsec-scanner-2.mit.edu (Symantec Messaging Gateway) with SMTP\r
24         id 08.29.02372.0B3BCA15; Mon,  3 Jun 2013 11:18:08 -0400 (EDT)\r
25 Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11])\r
26         by mailhub-auth-4.mit.edu (8.13.8/8.9.2) with ESMTP id r53FI5t5002307; \r
27         Mon, 3 Jun 2013 11:18:05 -0400\r
28 Received: from drake.dyndns.org\r
29         (216-15-114-40.c3-0.arl-ubr1.sbo-arl.ma.cable.rcn.com\r
30         [216.15.114.40]) (authenticated bits=0)\r
31         (User authenticated as amdragon@ATHENA.MIT.EDU)\r
32         by outgoing.mit.edu (8.13.8/8.12.4) with ESMTP id r53FI3sI007310\r
33         (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);\r
34         Mon, 3 Jun 2013 11:18:04 -0400\r
35 Received: from amthrax by drake.dyndns.org with local (Exim 4.77)\r
36         (envelope-from <amdragon@mit.edu>)\r
37         id 1UjWWI-0005H4-5z; Mon, 03 Jun 2013 11:18:02 -0400\r
38 From: Austin Clements <amdragon@MIT.EDU>\r
39 To: notmuch@notmuchmail.org\r
40 Subject: [PATCH] emacs: Fix applying stickiness to the :notmuch-part property\r
41 Date: Mon,  3 Jun 2013 11:17:59 -0400\r
42 Message-Id: <1370272679-20175-1-git-send-email-amdragon@mit.edu>\r
43 X-Mailer: git-send-email 1.7.10.4\r
44 X-Brightmail-Tracker:\r
45  H4sIAAAAAAAAA+NgFtrIIsWRmVeSWpSXmKPExsUixG6nrrth85pAg33zFC1Wz+WxuH5zJrMD\r
46         k8fOWXfZPZ6tusUcwBTFZZOSmpNZllqkb5fAlbHu4Be2ghN8FV+3drM0MM7i7mLk5JAQMJH4\r
47         u7CHDcIWk7hwbz2QzcUhJLCPUaLh2n0WCGcDo8SiBbehnNtMEi97p7FCOHMZJT7Pa2AH6WcT\r
48         0JDYtn85I4gtIiAtsfPubFYQm1nAUeLz/kVgO4QFfCVuHXwIVsMioCqxvmsjWJxXwEHizcln\r
49         UHcoSnQ/m8A2gZF3ASPDKkbZlNwq3dzEzJzi1GTd4uTEvLzUIl0jvdzMEr3UlNJNjKDQ4JTk\r
50         3cH47qDSIUYBDkYlHt4AjzWBQqyJZcWVuYcYJTmYlER5OVcDhfiS8lMqMxKLM+KLSnNSiw8x\r
51         SnAwK4nwftsIlONNSaysSi3Kh0lJc7AoifNeSbnpLySQnliSmp2aWpBaBJOV4eBQkuBdvgmo\r
52         UbAoNT21Ii0zpwQhzcTBCTKcB2j4OpAa3uKCxNzizHSI/ClGXY7v86a8YxRiycvPS5US550P\r
53         UiQAUpRRmgc3BxbTrxjFgd4S5t0OUsUDTAdwk14BLWECWjL59SqQJSWJCCmpBsa5UuGNDR7r\r
54         8xgDWSIuPf77zHrn3Avv8g6+yIvm4vsz7ZWv/RTVFHu/jpAn3EkvN57cEvzY+dtOX/7bWnty\r
55         J7268CxS++qUSxe6ShuPrmNukVo1Vfz2zFu3VhS8/m3Ftz2p2IH51ovTL1JfFPN/0wy888if\r
56         Zf/GKqGHD55cvilUcvbNsXdsYtPklViKMxINtZiLihMB6iGEq8QCAAA=\r
57 X-BeenThere: notmuch@notmuchmail.org\r
58 X-Mailman-Version: 2.1.13\r
59 Precedence: list\r
60 List-Id: "Use and development of the notmuch mail system."\r
61         <notmuch.notmuchmail.org>\r
62 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
63         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
64 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
65 List-Post: <mailto:notmuch@notmuchmail.org>\r
66 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
67 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
68         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
69 X-List-Received-Date: Mon, 03 Jun 2013 15:18:18 -0000\r
70 \r
71 Previously, we simply called pushnew to add :notmuch-part to the\r
72 front-sticky and rear-nonsticky text property lists.  This works if\r
73 these are nil or lists, but they can also have the value t, meaning\r
74 that all properties are front-sticky/rear-nonsticky.  In this case,\r
75 pushnew will signal an error because t is not a list.  We never set\r
76 these properties to t ourselves, but since we apply these property\r
77 changes over arbitrary renderer output, we have to deal with this\r
78 possibility.\r
79 ---\r
80  emacs/notmuch-show.el |   13 ++++++++++---\r
81  1 file changed, 10 insertions(+), 3 deletions(-)\r
82 \r
83 diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
84 index 5771950..83bb9ad 100644\r
85 --- a/emacs/notmuch-show.el\r
86 +++ b/emacs/notmuch-show.el\r
87 @@ -846,11 +846,18 @@ If HIDE is non-nil then initially hide this part."\r
88      (notmuch-map-text-property beg (point) :notmuch-part\r
89                                (lambda (v) (or v part)))\r
90      ;; Make :notmuch-part front sticky and rear non-sticky so it stays\r
91 -    ;; applied to the beginning of each line when we indent the message.\r
92 +    ;; applied to the beginning of each line when we indent the\r
93 +    ;; message.  Since we're operating on arbitrary renderer output,\r
94 +    ;; watch out for sticky specs of t, which means all properties are\r
95 +    ;; front-sticky/rear-nonsticky.\r
96      (notmuch-map-text-property beg (point) 'front-sticky\r
97 -                              (lambda (v) (pushnew :notmuch-part v)))\r
98 +                              (lambda (v) (if (listp v)\r
99 +                                              (pushnew :notmuch-part v)\r
100 +                                            v)))\r
101      (notmuch-map-text-property beg (point) 'rear-nonsticky\r
102 -                              (lambda (v) (pushnew :notmuch-part v)))))\r
103 +                              (lambda (v) (if (listp v)\r
104 +                                              (pushnew :notmuch-part v)\r
105 +                                            v)))))\r
106  \r
107  (defun notmuch-show-insert-body (msg body depth)\r
108    "Insert the body BODY at depth DEPTH in the current thread."\r
109 -- \r
110 1.7.10.4\r
111 \r