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 E1158431FAE
\r
6 for <notmuch@notmuchmail.org>; Mon, 27 May 2013 13:46:54 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\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 JT9R7QFML7HS for <notmuch@notmuchmail.org>;
\r
16 Mon, 27 May 2013 13:46:47 -0700 (PDT)
\r
17 Received: from dmz-mailsec-scanner-7.mit.edu (DMZ-MAILSEC-SCANNER-7.MIT.EDU
\r
19 by olra.theworths.org (Postfix) with ESMTP id 48791431FAF
\r
20 for <notmuch@notmuchmail.org>; Mon, 27 May 2013 13:46:47 -0700 (PDT)
\r
21 X-AuditID: 12074424-b7f8c6d0000028c4-1a-51a3c634b37f
\r
22 Received: from mailhub-auth-3.mit.edu ( [18.9.21.43])
\r
23 by dmz-mailsec-scanner-7.mit.edu (Symantec Messaging Gateway) with SMTP
\r
24 id 19.E5.10436.436C3A15; Mon, 27 May 2013 16:46:45 -0400 (EDT)
\r
25 Received: from outgoing.mit.edu (OUTGOING-AUTH-1.MIT.EDU [18.9.28.11])
\r
26 by mailhub-auth-3.mit.edu (8.13.8/8.9.2) with ESMTP id r4RKkhsn032253;
\r
27 Mon, 27 May 2013 16:46:43 -0400
\r
28 Received: from drake.dyndns.org (c-76-21-105-205.hsd1.ca.comcast.net
\r
29 [76.21.105.205]) (authenticated bits=0)
\r
30 (User authenticated as amdragon@ATHENA.MIT.EDU)
\r
31 by outgoing.mit.edu (8.13.8/8.12.4) with ESMTP id r4RKkewD026417
\r
32 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);
\r
33 Mon, 27 May 2013 16:46:42 -0400
\r
34 Received: from amthrax by drake.dyndns.org with local (Exim 4.77)
\r
35 (envelope-from <amdragon@mit.edu>)
\r
36 id 1Uh4JT-0008NB-Mz; Mon, 27 May 2013 16:46:39 -0400
\r
37 From: Austin Clements <amdragon@MIT.EDU>
\r
38 To: notmuch@notmuchmail.org
\r
39 Subject: [PATCH 1/4] emacs: Retain text properties when toggling buttons
\r
40 Date: Mon, 27 May 2013 16:46:31 -0400
\r
41 Message-Id: <1369687594-31774-2-git-send-email-amdragon@mit.edu>
\r
42 X-Mailer: git-send-email 1.7.10.4
\r
43 In-Reply-To: <1369687594-31774-1-git-send-email-amdragon@mit.edu>
\r
44 References: <1369687594-31774-1-git-send-email-amdragon@mit.edu>
\r
45 X-Brightmail-Tracker:
\r
46 H4sIAAAAAAAAA+NgFtrDIsWRmVeSWpSXmKPExsUixCmqrWt6bHGgwaS3zBar5/JYXL85k9mB
\r
47 yWPnrLvsHs9W3WIOYIrisklJzcksSy3St0vgyth4UKWgm6/iSut7tgbGHdxdjJwcEgImEsu3
\r
48 rGKHsMUkLtxbz9bFyMUhJLCPUeLzl+msEM5GIGfhPXYI5zSTxNH3k6CcuYwSW1fMZgHpZxPQ
\r
49 kNi2fzkjiC0iIC2x8+5sVhCbWcBR4vP+RWwgtrCAh8ScjxuZQGwWAVWJzolHwGxeAQeJ/mdr
\r
50 GCHuUJTofjYBrJ4TqPfKrt9gc4SAala/7mCawMi/gJFhFaNsSm6Vbm5iZk5xarJucXJiXl5q
\r
51 ka65Xm5miV5qSukmRlAgsbuo7GBsPqR0iFGAg1GJh9cic3GgEGtiWXFl7iFGSQ4mJVFe9iNA
\r
52 Ib6k/JTKjMTijPii0pzU4kOMEhzMSiK821cA5XhTEiurUovyYVLSHCxK4rzXU276CwmkJ5ak
\r
53 ZqemFqQWwWRlODiUJHjlQIYKFqWmp1akZeaUIKSZODhBhvMADc8AqeEtLkjMLc5Mh8ifYlSU
\r
54 EuctB0kIgCQySvPgemGR/opRHOgVYV4nkCoeYJKA634FNJgJaLA4M9jgkkSElFQD4/wrudu9
\r
55 lm7Sd1H8kB/tyGbz8+ikP9qJKa6HLrqtCymvtNAXnK97SNF/4SHtXw5Xl68s6V/Jy+X0xL9L
\r
56 vqfzH7v44brPti84vnJJm70+KBz9K9phtyeHWnbR9JML8mbPrN2UdUZw09PXzk6eKnaLFizd
\r
57 tDXS8WxBW1f3WpEVlas42LdX26xqV2Ipzkg01GIuKk4EAOcRN8TPAgAA
\r
58 X-BeenThere: notmuch@notmuchmail.org
\r
59 X-Mailman-Version: 2.1.13
\r
61 List-Id: "Use and development of the notmuch mail system."
\r
62 <notmuch.notmuchmail.org>
\r
63 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
64 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
65 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
66 List-Post: <mailto:notmuch@notmuchmail.org>
\r
67 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
68 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
69 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
70 X-List-Received-Date: Mon, 27 May 2013 20:46:55 -0000
\r
72 Previously, we lost any text properties applied to part buttons or
\r
73 wash buttons when they were toggled because `insert' directly copies
\r
74 the text properties of the string being inserted. Fix this by
\r
75 capturing the properties applied to the button beforehand and
\r
76 re-applying them after inserting the new text.
\r
78 emacs/notmuch-show.el | 2 ++
\r
79 emacs/notmuch-wash.el | 2 ++
\r
80 2 files changed, 4 insertions(+)
\r
82 diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
\r
83 index b0a8d8a..a080134 100644
\r
84 --- a/emacs/notmuch-show.el
\r
85 +++ b/emacs/notmuch-show.el
\r
86 @@ -559,10 +559,12 @@ message at DEPTH in the current thread."
\r
87 (new-start (button-start button))
\r
88 (button-label (button-get button :base-label))
\r
90 + (properties (text-properties-at (point)))
\r
91 (inhibit-read-only t))
\r
92 (overlay-put overlay 'invisible (not show))
\r
93 (goto-char new-start)
\r
94 (insert "[ " button-label (if show " ]" " (hidden) ]"))
\r
95 + (set-text-properties new-start (point) properties)
\r
96 (let ((old-end (button-end button)))
\r
97 (move-overlay button new-start (point))
\r
98 (delete-region (point) old-end))
\r
99 diff --git a/emacs/notmuch-wash.el b/emacs/notmuch-wash.el
\r
100 index 8a68819..8fe91e1 100644
\r
101 --- a/emacs/notmuch-wash.el
\r
102 +++ b/emacs/notmuch-wash.el
\r
103 @@ -104,9 +104,11 @@ lower).")
\r
104 (overlay (button-get cite-button 'overlay))
\r
105 (button-label (notmuch-wash-button-label overlay))
\r
106 (old-point (point))
\r
107 + (properties (text-properties-at (point)))
\r
108 (inhibit-read-only t))
\r
109 (goto-char new-start)
\r
110 (insert button-label)
\r
111 + (set-text-properties new-start (point) properties)
\r
112 (let ((old-end (button-end cite-button)))
\r
113 (move-overlay cite-button new-start (point))
\r
114 (delete-region (point) old-end))
\r