Re: [PATCH 0/4] Allow specifying alternate names for addresses in other_email
[notmuch-archives.git] / d1 / e080b5e90880bdaab808effa55118441281af8
1 Return-Path: <amthrax@drake.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 18A65431FBC\r
6         for <notmuch@notmuchmail.org>; Tue, 21 Feb 2012 07:42:42 -0800 (PST)\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 JrPl6EDDIGcu for <notmuch@notmuchmail.org>;\r
16         Tue, 21 Feb 2012 07:42:41 -0800 (PST)\r
17 Received: from dmz-mailsec-scanner-1.mit.edu (DMZ-MAILSEC-SCANNER-1.MIT.EDU\r
18         [18.9.25.12])\r
19         by olra.theworths.org (Postfix) with ESMTP id 79261431FB6\r
20         for <notmuch@notmuchmail.org>; Tue, 21 Feb 2012 07:42:40 -0800 (PST)\r
21 X-AuditID: 1209190c-b7fad6d000000920-ec-4f43bb6fc7ce\r
22 Received: from mailhub-auth-4.mit.edu ( [18.7.62.39])\r
23         by dmz-mailsec-scanner-1.mit.edu (Symantec Messaging Gateway) with SMTP\r
24         id 4F.52.02336.F6BB34F4; Tue, 21 Feb 2012 10:42:40 -0500 (EST)\r
25 Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103])\r
26         by mailhub-auth-4.mit.edu (8.13.8/8.9.2) with ESMTP id q1LFgd3b015611; \r
27         Tue, 21 Feb 2012 10:42:39 -0500\r
28 Received: from drake.mit.edu\r
29         (209-6-116-242.c3-0.arl-ubr1.sbo-arl.ma.cable.rcn.com\r
30         [209.6.116.242]) (authenticated bits=0)\r
31         (User authenticated as amdragon@ATHENA.MIT.EDU)\r
32         by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id q1LFgbrM025724\r
33         (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);\r
34         Tue, 21 Feb 2012 10:42:38 -0500 (EST)\r
35 Received: from amthrax by drake.mit.edu with local (Exim 4.77)\r
36         (envelope-from <amthrax@drake.mit.edu>)\r
37         id 1RzrrQ-0005Ox-V5; Tue, 21 Feb 2012 10:42:37 -0500\r
38 From: Austin Clements <amdragon@MIT.EDU>\r
39 To: notmuch@notmuchmail.org\r
40 Subject: [PATCH v3 2/3] emacs: Reverse the meaning of\r
41         notmuch-show-refresh-view's argument\r
42 Date: Tue, 21 Feb 2012 10:42:32 -0500\r
43 Message-Id: <1329838953-20666-3-git-send-email-amdragon@mit.edu>\r
44 X-Mailer: git-send-email 1.7.7.3\r
45 In-Reply-To: <1329838953-20666-1-git-send-email-amdragon@mit.edu>\r
46 References: <1329632533-16152-1-git-send-email-amdragon@mit.edu>\r
47         <1329838953-20666-1-git-send-email-amdragon@mit.edu>\r
48 X-Brightmail-Tracker:\r
49  H4sIAAAAAAAAA+NgFjrJIsWRmVeSWpSXmKPExsUixG6nrluw29nfYO82RovrN2cyW7xZOY/V\r
50         gcnj8NeFLB7PVt1iDmCK4rJJSc3JLEst0rdL4Mq4+OIuS8Ei+Ypll5YwNzBel+xi5OSQEDCR\r
51         uP2unxHCFpO4cG89G4gtJLCPUaJ/FX8XIxeQvYFR4szv9YwQzn0micZvk9khnPmMEm+PTGMH\r
52         aWET0JDYtn852CgRAWmJnXdns4LYzAJWEoevbgKzhQWiJJrOPAKrZxFQlTix+TgziM0r4CDR\r
53         9/oY1BkKEudWnwOr4RRwlFi+7jczxEnlEi0zJjNOYORfwMiwilE2JbdKNzcxM6c4NVm3ODkx\r
54         Ly+1SNdQLzezRC81pXQTIyiUOCV5djC+Oah0iFGAg1GJh/fkZmd/IdbEsuLK3EOMkhxMSqK8\r
55         W3YBhfiS8lMqMxKLM+KLSnNSiw8xSnAwK4nwLl4AlONNSaysSi3Kh0lJc7AoifOqaL3zExJI\r
56         TyxJzU5NLUgtgsnKcHAoSfAeAxkqWJSanlqRlplTgpBm4uAEGc4DMhykhre4IDG3ODMdIn+K\r
57         UZfj44EnFxiFWPLy81KlxHmvgRQJgBRllObBzYGlgFeM4kBvCUP8wANMH3CTXgEtYQJa0vLf\r
58         EWRJSSJCSqqBUeOJx7WLAmUB4fvmtbc5/8wvXh2+b9vUVWEfft14t9bb5HS+DMOj+/57tqT5\r
59         zHeaVB2z5pSF4qsbvDn1WxN29LwRX2keLD7nybxN774pzlzsu+rRll1c89vf5S2ZePd2yssK\r
60         UalvIV9469bYmjt83WrEtdEjQaThc9yezescJ7M+3b8lLZzl2holluKMREMt5qLiRAC3oooO\r
61         3AIAAA==\r
62 Cc: tomi.ollila@iki.fi\r
63 X-BeenThere: notmuch@notmuchmail.org\r
64 X-Mailman-Version: 2.1.13\r
65 Precedence: list\r
66 List-Id: "Use and development of the notmuch mail system."\r
67         <notmuch.notmuchmail.org>\r
68 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
69         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
70 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
71 List-Post: <mailto:notmuch@notmuchmail.org>\r
72 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
73 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
74         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
75 X-List-Received-Date: Tue, 21 Feb 2012 15:42:42 -0000\r
76 \r
77 Consensus seems to be that people prefer that refreshing show buffers\r
78 retains state by default, rather than resetting it by default.  This\r
79 turns out to be the case in the code, as well.  In fact, there's even\r
80 a test for this that's been marked broken for several months, which\r
81 this patch finally gets to mark as fixed.\r
82 ---\r
83  emacs/notmuch-crypto.el |    4 ++--\r
84  emacs/notmuch-show.el   |   18 +++++++++---------\r
85  test/emacs              |    1 -\r
86  3 files changed, 11 insertions(+), 12 deletions(-)\r
87 \r
88 diff --git a/emacs/notmuch-crypto.el b/emacs/notmuch-crypto.el\r
89 index 972f26e..94da325 100644\r
90 --- a/emacs/notmuch-crypto.el\r
91 +++ b/emacs/notmuch-crypto.el\r
92 @@ -120,7 +120,7 @@ mode."\r
93       :notmuch-from from)\r
94      (insert "\n")))\r
95  \r
96 -(declare-function notmuch-show-refresh-view "notmuch-show" (&optional retain-state))\r
97 +(declare-function notmuch-show-refresh-view "notmuch-show" (&optional reset-state))\r
98  \r
99  (defun notmuch-crypto-sigstatus-good-callback (button)\r
100    (let* ((sigstatus (button-get button :notmuch-sigstatus))\r
101 @@ -145,7 +145,7 @@ mode."\r
102         (insert "\n")\r
103         (call-process "gpg" nil t t "--list-keys" keyid))\r
104        (recenter -1))\r
105 -    (notmuch-show-refresh-view)))\r
106 +    (notmuch-show-refresh-view t)))\r
107  \r
108  (defun notmuch-crypto-insert-encstatus-button (encstatus)\r
109    (let* ((status (plist-get encstatus :status))\r
110 diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
111 index f759351..ac9bdbc 100644\r
112 --- a/emacs/notmuch-show.el\r
113 +++ b/emacs/notmuch-show.el\r
114 @@ -957,7 +957,7 @@ current buffer, if possible."\r
115    (message (if notmuch-show-process-crypto\r
116                "Processing cryptographic MIME parts."\r
117              "Not processing cryptographic MIME parts."))\r
118 -  (notmuch-show-refresh-view t))\r
119 +  (notmuch-show-refresh-view))\r
120  \r
121  (defun notmuch-show-toggle-elide-non-matching ()\r
122    "Toggle the display of non-matching messages."\r
123 @@ -966,7 +966,7 @@ current buffer, if possible."\r
124    (message (if notmuch-show-elide-non-matching-messages\r
125                "Showing matching messages only."\r
126              "Showing all messages."))\r
127 -  (notmuch-show-refresh-view t))\r
128 +  (notmuch-show-refresh-view))\r
129  \r
130  (defun notmuch-show-toggle-thread-indentation ()\r
131    "Toggle the indentation of threads."\r
132 @@ -975,7 +975,7 @@ current buffer, if possible."\r
133    (message (if notmuch-show-indent-content\r
134                "Content is indented."\r
135              "Content is not indented."))\r
136 -  (notmuch-show-refresh-view t))\r
137 +  (notmuch-show-refresh-view))\r
138  \r
139  (defun notmuch-show-insert-tree (tree depth)\r
140    "Insert the message tree TREE at depth DEPTH in the current thread."\r
141 @@ -1117,17 +1117,17 @@ This includes:\r
142        (message "Previously current message not found."))\r
143      (notmuch-show-message-adjust)))\r
144  \r
145 -(defun notmuch-show-refresh-view (&optional retain-state)\r
146 +(defun notmuch-show-refresh-view (&optional reset-state)\r
147    "Refresh the current view.\r
148  \r
149  Refreshes the current view, observing changes in display\r
150 -preferences. If RETAIN-STATE is non-nil then the state of the\r
151 -buffer is stored and re-applied after the refresh."\r
152 +preferences. If invoked with a prefix argument (or RESET-STATE is\r
153 +non-nil) then the state of the buffer (open/closed messages) is\r
154 +reset based on the original query."\r
155    (interactive "P")\r
156    (let ((inhibit-read-only t)\r
157 -       state)\r
158 -    (if retain-state\r
159 -       (setq state (notmuch-show-capture-state)))\r
160 +       (state (unless reset-state\r
161 +                (notmuch-show-capture-state))))\r
162      (erase-buffer)\r
163      (notmuch-show-build-buffer)\r
164      (if state\r
165 diff --git a/test/emacs b/test/emacs\r
166 index b74cfa9..2dffee8 100755\r
167 --- a/test/emacs\r
168 +++ b/test/emacs\r
169 @@ -456,7 +456,6 @@ test_emacs '(notmuch-show "id:f35dbb950911171438k5df6eb56k77b6c0944e2e79ae@mail.\r
170  test_expect_equal_file OUTPUT EXPECTED\r
171  \r
172  test_begin_subtest "Refresh modified show buffer"\r
173 -test_subtest_known_broken\r
174  test_emacs '(notmuch-show "id:f35dbb950911171438k5df6eb56k77b6c0944e2e79ae@mail.gmail.com")\r
175             (notmuch-show-toggle-message)\r
176             (notmuch-show-next-message)\r
177 -- \r
178 1.7.7.3\r
179 \r