Re: [PATCH v4 13/16] add indexopts to notmuch python bindings.
[notmuch-archives.git] / af / 7fb04bed21859bd1f55b7e3e59ea0c8edcf9e1
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 3C514431FC3\r
6         for <notmuch@notmuchmail.org>; Sat, 18 Feb 2012 22:22:22 -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 GB+So3luLN7f for <notmuch@notmuchmail.org>;\r
16         Sat, 18 Feb 2012 22:22:21 -0800 (PST)\r
17 Received: from dmz-mailsec-scanner-4.mit.edu (DMZ-MAILSEC-SCANNER-4.MIT.EDU\r
18         [18.9.25.15])\r
19         by olra.theworths.org (Postfix) with ESMTP id 11E68431FAE\r
20         for <notmuch@notmuchmail.org>; Sat, 18 Feb 2012 22:22:20 -0800 (PST)\r
21 X-AuditID: 1209190f-b7f8a6d000000914-bd-4f40951cab93\r
22 Received: from mailhub-auth-1.mit.edu ( [18.9.21.35])\r
23         by dmz-mailsec-scanner-4.mit.edu (Symantec Messaging Gateway) with SMTP\r
24         id 11.16.02324.C15904F4; Sun, 19 Feb 2012 01:22:20 -0500 (EST)\r
25 Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103])\r
26         by mailhub-auth-1.mit.edu (8.13.8/8.9.2) with ESMTP id q1J6MJjt012992; \r
27         Sun, 19 Feb 2012 01:22:19 -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 q1J6MIEm020705\r
33         (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);\r
34         Sun, 19 Feb 2012 01:22:19 -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 1Rz0A6-0004EZ-HR; Sun, 19 Feb 2012 01:22:18 -0500\r
38 From: Austin Clements <amdragon@MIT.EDU>\r
39 To: notmuch@notmuchmail.org\r
40 Subject: [PATCH 2/3] emacs: Reverse the meaning of notmuch-show-refresh-view's\r
41         argument\r
42 Date: Sun, 19 Feb 2012 01:22:12 -0500\r
43 Message-Id: <1329632533-16152-3-git-send-email-amdragon@mit.edu>\r
44 X-Mailer: git-send-email 1.7.7.3\r
45 In-Reply-To: <1329632533-16152-1-git-send-email-amdragon@mit.edu>\r
46 References: <1329632533-16152-1-git-send-email-amdragon@mit.edu>\r
47 X-Brightmail-Tracker:\r
48  H4sIAAAAAAAAA+NgFtrLIsWRmVeSWpSXmKPExsUixCmqrCsz1cHf4O5rVYvrN2cyOzB6PFt1\r
49         izmAMYrLJiU1J7MstUjfLoErY+4F74I58hX3Fs9nbmC8KNnFyMkhIWAicW/vPSYIW0ziwr31\r
50         bF2MXBxCAvsYJS417GaFcDYwSuya388C4dxnkvgwaTaUM59R4uDE2ywg/WwCGhLb9i9nBLFF\r
51         BKQldt6dDdTOwcEsoCbxp0sFJCwsEC6x8fkJsHUsAqoS9/qPs4CU8Ao4SFy9ZwVxhYLEudXn\r
52         2EFsTgFHiStth5lBbCGgkt8Xt7FOYORfwMiwilE2JbdKNzcxM6c4NVm3ODkxLy+1SNdELzez\r
53         RC81pXQTIzhkJPl3MH47qHSIUYCDUYmHV6rMwV+INbGsuDL3EKMkB5OSKO+hyUAhvqT8lMqM\r
54         xOKM+KLSnNTiQ4wSHMxKIrylN+39hXhTEiurUovyYVLSHCxK4rxqWu/8hATSE0tSs1NTC1KL\r
55         YLIyHBxKErzlU4CGChalpqdWpGXmlCCkmTg4QYbzAA23BKnhLS5IzC3OTIfIn2LU5fh44MkF\r
56         RiGWvPy8VClx3hyQIgGQoozSPLg5sFh/xSgO9JYwbxRIFQ8wTcBNegW0hAloCa+QHciSkkSE\r
57         lFQDYw0Pz905k+2TC+XNEot8DcUEvOu6LaZ4Wmtd1PZotfaQ3Zku0P5j2syQaywvLuyYcnxK\r
58         lkSK2dazj3Wr5hfWvNrDt+qI051u10c7m96Hbpj6fdkO3flSXSZcoS0My851+Tk7NH6cfrX6\r
59         JU9i1vKYsjx5k91ql8KEMm7w1ytI7P/bM1P5Qf5kJZbijERDLeai4kQAgNu5RtACAAA=\r
60 X-BeenThere: notmuch@notmuchmail.org\r
61 X-Mailman-Version: 2.1.13\r
62 Precedence: list\r
63 List-Id: "Use and development of the notmuch mail system."\r
64         <notmuch.notmuchmail.org>\r
65 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
66         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
67 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
68 List-Post: <mailto:notmuch@notmuchmail.org>\r
69 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
70 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
71         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
72 X-List-Received-Date: Sun, 19 Feb 2012 06:22:22 -0000\r
73 \r
74 Consensus seems to be that people prefer that refreshing show buffers\r
75 retains state by default, rather than resetting it by default.  This\r
76 turns out to be the case in the code, as well.  In fact, there's even\r
77 a test for this that's been marked broken for several months, which\r
78 this patch finally gets to mark as fixed.\r
79 ---\r
80  emacs/notmuch-crypto.el |    4 ++--\r
81  emacs/notmuch-show.el   |   18 +++++++++---------\r
82  test/emacs              |    1 -\r
83  3 files changed, 11 insertions(+), 12 deletions(-)\r
84 \r
85 diff --git a/emacs/notmuch-crypto.el b/emacs/notmuch-crypto.el\r
86 index 972f26e..94da325 100644\r
87 --- a/emacs/notmuch-crypto.el\r
88 +++ b/emacs/notmuch-crypto.el\r
89 @@ -120,7 +120,7 @@ mode."\r
90       :notmuch-from from)\r
91      (insert "\n")))\r
92  \r
93 -(declare-function notmuch-show-refresh-view "notmuch-show" (&optional retain-state))\r
94 +(declare-function notmuch-show-refresh-view "notmuch-show" (&optional reset-state))\r
95  \r
96  (defun notmuch-crypto-sigstatus-good-callback (button)\r
97    (let* ((sigstatus (button-get button :notmuch-sigstatus))\r
98 @@ -145,7 +145,7 @@ mode."\r
99         (insert "\n")\r
100         (call-process "gpg" nil t t "--list-keys" keyid))\r
101        (recenter -1))\r
102 -    (notmuch-show-refresh-view)))\r
103 +    (notmuch-show-refresh-view t)))\r
104  \r
105  (defun notmuch-crypto-insert-encstatus-button (encstatus)\r
106    (let* ((status (plist-get encstatus :status))\r
107 diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
108 index aa9ccee..da1289a 100644\r
109 --- a/emacs/notmuch-show.el\r
110 +++ b/emacs/notmuch-show.el\r
111 @@ -957,7 +957,7 @@ current buffer, if possible."\r
112    (message (if notmuch-show-process-crypto\r
113                "Processing cryptographic MIME parts."\r
114              "Not processing cryptographic MIME parts."))\r
115 -  (notmuch-show-refresh-view t))\r
116 +  (notmuch-show-refresh-view))\r
117  \r
118  (defun notmuch-show-toggle-elide-non-matching ()\r
119    "Toggle the display of non-matching messages."\r
120 @@ -966,7 +966,7 @@ current buffer, if possible."\r
121    (message (if notmuch-show-elide-non-matching-messages\r
122                "Showing matching messages only."\r
123              "Showing all messages."))\r
124 -  (notmuch-show-refresh-view t))\r
125 +  (notmuch-show-refresh-view))\r
126  \r
127  (defun notmuch-show-toggle-thread-indentation ()\r
128    "Toggle the indentation of threads."\r
129 @@ -975,7 +975,7 @@ current buffer, if possible."\r
130    (message (if notmuch-show-indent-content\r
131                "Content is indented."\r
132              "Content is not indented."))\r
133 -  (notmuch-show-refresh-view t))\r
134 +  (notmuch-show-refresh-view))\r
135  \r
136  (defun notmuch-show-insert-tree (tree depth)\r
137    "Insert the message tree TREE at depth DEPTH in the current thread."\r
138 @@ -1118,17 +1118,17 @@ This includes:\r
139        (message "Previously current message not found."))\r
140      (notmuch-show-message-adjust)))\r
141  \r
142 -(defun notmuch-show-refresh-view (&optional retain-state)\r
143 +(defun notmuch-show-refresh-view (&optional reset-state)\r
144    "Refresh the current view.\r
145  \r
146  Refreshes the current view, observing changes in display\r
147 -preferences. If RETAIN-STATE is non-nil then the state of the\r
148 -buffer is stored and re-applied after the refresh."\r
149 +preferences. If invoked with a prefix argument (or RESET-STATE is\r
150 +non-nil) then the state of the buffer (open/closed messages) is\r
151 +reset based on the original query."\r
152    (interactive "P")\r
153    (let ((inhibit-read-only t)\r
154 -       state)\r
155 -    (if retain-state\r
156 -       (setq state (notmuch-show-capture-state)))\r
157 +       (state (unless reset-state\r
158 +                (notmuch-show-capture-state))))\r
159      (erase-buffer)\r
160      (notmuch-show-worker)\r
161      (if state\r
162 diff --git a/test/emacs b/test/emacs\r
163 index b74cfa9..2dffee8 100755\r
164 --- a/test/emacs\r
165 +++ b/test/emacs\r
166 @@ -456,7 +456,6 @@ test_emacs '(notmuch-show "id:f35dbb950911171438k5df6eb56k77b6c0944e2e79ae@mail.\r
167  test_expect_equal_file OUTPUT EXPECTED\r
168  \r
169  test_begin_subtest "Refresh modified show buffer"\r
170 -test_subtest_known_broken\r
171  test_emacs '(notmuch-show "id:f35dbb950911171438k5df6eb56k77b6c0944e2e79ae@mail.gmail.com")\r
172             (notmuch-show-toggle-message)\r
173             (notmuch-show-next-message)\r
174 -- \r
175 1.7.7.3\r
176 \r