Re: [PATCH 1/2] Add Google Inc. to AUTHORS as a contributor.
[notmuch-archives.git] / b8 / f1a7722d5b50cd4b922cbba71129fd46ccb450
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 803EC431FAF\r
6         for <notmuch@notmuchmail.org>; Sun, 19 Feb 2012 10:02:53 -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 GCQyqyL4noA4 for <notmuch@notmuchmail.org>;\r
16         Sun, 19 Feb 2012 10:02:52 -0800 (PST)\r
17 Received: from dmz-mailsec-scanner-7.mit.edu (DMZ-MAILSEC-SCANNER-7.MIT.EDU\r
18         [18.7.68.36])\r
19         by olra.theworths.org (Postfix) with ESMTP id A50DB431FC2\r
20         for <notmuch@notmuchmail.org>; Sun, 19 Feb 2012 10:02:50 -0800 (PST)\r
21 X-AuditID: 12074424-b7fae6d000000906-e6-4f4139493b29\r
22 Received: from mailhub-auth-2.mit.edu ( [18.7.62.36])\r
23         by dmz-mailsec-scanner-7.mit.edu (Symantec Messaging Gateway) with SMTP\r
24         id 6D.F4.02310.949314F4; Sun, 19 Feb 2012 13:02:50 -0500 (EST)\r
25 Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103])\r
26         by mailhub-auth-2.mit.edu (8.13.8/8.9.2) with ESMTP id q1JI2mRr032652; \r
27         Sun, 19 Feb 2012 13:02:48 -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 q1JI2lRh013404\r
33         (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);\r
34         Sun, 19 Feb 2012 13:02:48 -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 1RzB5z-0007Mj-ID; Sun, 19 Feb 2012 13:02:47 -0500\r
38 From: Austin Clements <amdragon@MIT.EDU>\r
39 To: notmuch@notmuchmail.org\r
40 Subject: [PATCH v2 3/4] emacs: Reverse the meaning of\r
41         notmuch-show-refresh-view's argument\r
42 Date: Sun, 19 Feb 2012 13:02:42 -0500\r
43 Message-Id: <1329674563-28223-4-git-send-email-amdragon@mit.edu>\r
44 X-Mailer: git-send-email 1.7.7.3\r
45 In-Reply-To: <1329674563-28223-1-git-send-email-amdragon@mit.edu>\r
46 References: <1329632533-16152-1-git-send-email-amdragon@mit.edu>\r
47         <1329674563-28223-1-git-send-email-amdragon@mit.edu>\r
48 X-Brightmail-Tracker:\r
49  H4sIAAAAAAAAA+NgFjrBIsWRmVeSWpSXmKPExsUixG6noutl6ehvcPo1s8X1mzOZLd6snMfq\r
50         wORx+OtCFo9nq24xBzBFcdmkpOZklqUW6dslcGXsuL2WsWCOfMXep7eYGxgvSnYxcnJICJhI\r
51         dPXvYoGwxSQu3FvP1sXIxSEksI9R4vzKX+wQzgZGiYvL/kFl7jNJ7DjWygrSIiQwn1Hi3KQg\r
52         EJtNQENi2/7ljCC2iIC0xM67s8FqmAWsJA5f3QRmCwtESZyZfRishkVAVeL886PsIDavgIPE\r
53         g99/oc5QkDi3+hxQnIODU8BR4uI/O4hV5RJzP7xlnsDIv4CRYRWjbEpulW5uYmZOcWqybnFy\r
54         Yl5eapGuuV5uZoleakrpJkZwILmo7GBsPqR0iFGAg1GJh1eyzMFfiDWxrLgy9xCjJAeTkigv\r
55         j7mjvxBfUn5KZUZicUZ8UWlOavEhRgkOZiUR3tKb9v5CvCmJlVWpRfkwKWkOFiVxXg2td35C\r
56         AumJJanZqakFqUUwWRkODiUJXmcLoKGCRanpqRVpmTklCGkmDk6Q4TxAw5NAaniLCxJzizPT\r
57         IfKnGHU5Ph54coFRiCUvPy9VSpxXD6RIAKQoozQPbg4sAbxiFAd6S5jXDKSKB5g84Ca9AlrC\r
58         BLSEV8gOZElJIkJKqoFR+1houmHU+0XFeTaPlA4zfiruN9nwO3PFrs5L750lOOIucS1yuqa1\r
59         UvDPLy5pjXXvlnB8n7TRbLqqqsim8yeP2sbfu1OZ23K/fX4Ok5VgyIRvSUcXnBdj3ux+dPWJ\r
60         s2x8X2InbLkVv+CZXp2IpT6PR/mG+JavHqHbVTc+n/hbSmL6jXk8pjxpSizFGYmGWsxFxYkA\r
61         j+ST6NsCAAA=\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: Sun, 19 Feb 2012 18:02:53 -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 d036c54..ef81cc7 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 @@ -1119,17 +1119,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-worker)\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