[PATCH 2/3] emacs: Reverse the meaning of notmuch-show-refresh-view's argument
authorAustin Clements <amdragon@MIT.EDU>
Sun, 19 Feb 2012 06:22:12 +0000 (01:22 +1900)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:44:40 +0000 (09:44 -0800)
af/7fb04bed21859bd1f55b7e3e59ea0c8edcf9e1 [new file with mode: 0644]

diff --git a/af/7fb04bed21859bd1f55b7e3e59ea0c8edcf9e1 b/af/7fb04bed21859bd1f55b7e3e59ea0c8edcf9e1
new file mode 100644 (file)
index 0000000..7bc2e94
--- /dev/null
@@ -0,0 +1,176 @@
+Return-Path: <amthrax@drake.mit.edu>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 3C514431FC3\r
+       for <notmuch@notmuchmail.org>; Sat, 18 Feb 2012 22:22:22 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.7\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
+       tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id GB+So3luLN7f for <notmuch@notmuchmail.org>;\r
+       Sat, 18 Feb 2012 22:22:21 -0800 (PST)\r
+Received: from dmz-mailsec-scanner-4.mit.edu (DMZ-MAILSEC-SCANNER-4.MIT.EDU\r
+       [18.9.25.15])\r
+       by olra.theworths.org (Postfix) with ESMTP id 11E68431FAE\r
+       for <notmuch@notmuchmail.org>; Sat, 18 Feb 2012 22:22:20 -0800 (PST)\r
+X-AuditID: 1209190f-b7f8a6d000000914-bd-4f40951cab93\r
+Received: from mailhub-auth-1.mit.edu ( [18.9.21.35])\r
+       by dmz-mailsec-scanner-4.mit.edu (Symantec Messaging Gateway) with SMTP\r
+       id 11.16.02324.C15904F4; Sun, 19 Feb 2012 01:22:20 -0500 (EST)\r
+Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103])\r
+       by mailhub-auth-1.mit.edu (8.13.8/8.9.2) with ESMTP id q1J6MJjt012992; \r
+       Sun, 19 Feb 2012 01:22:19 -0500\r
+Received: from drake.mit.edu\r
+       (209-6-116-242.c3-0.arl-ubr1.sbo-arl.ma.cable.rcn.com\r
+       [209.6.116.242]) (authenticated bits=0)\r
+       (User authenticated as amdragon@ATHENA.MIT.EDU)\r
+       by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id q1J6MIEm020705\r
+       (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);\r
+       Sun, 19 Feb 2012 01:22:19 -0500 (EST)\r
+Received: from amthrax by drake.mit.edu with local (Exim 4.77)\r
+       (envelope-from <amthrax@drake.mit.edu>)\r
+       id 1Rz0A6-0004EZ-HR; Sun, 19 Feb 2012 01:22:18 -0500\r
+From: Austin Clements <amdragon@MIT.EDU>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH 2/3] emacs: Reverse the meaning of notmuch-show-refresh-view's\r
+       argument\r
+Date: Sun, 19 Feb 2012 01:22:12 -0500\r
+Message-Id: <1329632533-16152-3-git-send-email-amdragon@mit.edu>\r
+X-Mailer: git-send-email 1.7.7.3\r
+In-Reply-To: <1329632533-16152-1-git-send-email-amdragon@mit.edu>\r
+References: <1329632533-16152-1-git-send-email-amdragon@mit.edu>\r
+X-Brightmail-Tracker:\r
+ H4sIAAAAAAAAA+NgFtrLIsWRmVeSWpSXmKPExsUixCmqrCsz1cHf4O5rVYvrN2cyOzB6PFt1\r
+       izmAMYrLJiU1J7MstUjfLoErY+4F74I58hX3Fs9nbmC8KNnFyMkhIWAicW/vPSYIW0ziwr31\r
+       bF2MXBxCAvsYJS417GaFcDYwSuya388C4dxnkvgwaTaUM59R4uDE2ywg/WwCGhLb9i9nBLFF\r
+       BKQldt6dDdTOwcEsoCbxp0sFJCwsEC6x8fkJsHUsAqoS9/qPs4CU8Ao4SFy9ZwVxhYLEudXn\r
+       2EFsTgFHiStth5lBbCGgkt8Xt7FOYORfwMiwilE2JbdKNzcxM6c4NVm3ODkxLy+1SNdELzez\r
+       RC81pXQTIzhkJPl3MH47qHSIUYCDUYmHV6rMwV+INbGsuDL3EKMkB5OSKO+hyUAhvqT8lMqM\r
+       xOKM+KLSnNTiQ4wSHMxKIrylN+39hXhTEiurUovyYVLSHCxK4rxqWu/8hATSE0tSs1NTC1KL\r
+       YLIyHBxKErzlU4CGChalpqdWpGXmlCCkmTg4QYbzAA23BKnhLS5IzC3OTIfIn2LU5fh44MkF\r
+       RiGWvPy8VClx3hyQIgGQoozSPLg5sFh/xSgO9JYwbxRIFQ8wTcBNegW0hAloCa+QHciSkkSE\r
+       lFQDYw0Pz905k+2TC+XNEot8DcUEvOu6LaZ4Wmtd1PZotfaQ3Zku0P5j2syQaywvLuyYcnxK\r
+       lkSK2dazj3Wr5hfWvNrDt+qI051u10c7m96Hbpj6fdkO3flSXSZcoS0My851+Tk7NH6cfrX6\r
+       JU9i1vKYsjx5k91ql8KEMm7w1ytI7P/bM1P5Qf5kJZbijERDLeai4kQAgNu5RtACAAA=\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Sun, 19 Feb 2012 06:22:22 -0000\r
+\r
+Consensus seems to be that people prefer that refreshing show buffers\r
+retains state by default, rather than resetting it by default.  This\r
+turns out to be the case in the code, as well.  In fact, there's even\r
+a test for this that's been marked broken for several months, which\r
+this patch finally gets to mark as fixed.\r
+---\r
+ emacs/notmuch-crypto.el |    4 ++--\r
+ emacs/notmuch-show.el   |   18 +++++++++---------\r
+ test/emacs              |    1 -\r
+ 3 files changed, 11 insertions(+), 12 deletions(-)\r
+\r
+diff --git a/emacs/notmuch-crypto.el b/emacs/notmuch-crypto.el\r
+index 972f26e..94da325 100644\r
+--- a/emacs/notmuch-crypto.el\r
++++ b/emacs/notmuch-crypto.el\r
+@@ -120,7 +120,7 @@ mode."\r
+      :notmuch-from from)\r
+     (insert "\n")))\r
+ \r
+-(declare-function notmuch-show-refresh-view "notmuch-show" (&optional retain-state))\r
++(declare-function notmuch-show-refresh-view "notmuch-show" (&optional reset-state))\r
+ \r
+ (defun notmuch-crypto-sigstatus-good-callback (button)\r
+   (let* ((sigstatus (button-get button :notmuch-sigstatus))\r
+@@ -145,7 +145,7 @@ mode."\r
+       (insert "\n")\r
+       (call-process "gpg" nil t t "--list-keys" keyid))\r
+       (recenter -1))\r
+-    (notmuch-show-refresh-view)))\r
++    (notmuch-show-refresh-view t)))\r
+ \r
+ (defun notmuch-crypto-insert-encstatus-button (encstatus)\r
+   (let* ((status (plist-get encstatus :status))\r
+diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
+index aa9ccee..da1289a 100644\r
+--- a/emacs/notmuch-show.el\r
++++ b/emacs/notmuch-show.el\r
+@@ -957,7 +957,7 @@ current buffer, if possible."\r
+   (message (if notmuch-show-process-crypto\r
+              "Processing cryptographic MIME parts."\r
+            "Not processing cryptographic MIME parts."))\r
+-  (notmuch-show-refresh-view t))\r
++  (notmuch-show-refresh-view))\r
+ \r
+ (defun notmuch-show-toggle-elide-non-matching ()\r
+   "Toggle the display of non-matching messages."\r
+@@ -966,7 +966,7 @@ current buffer, if possible."\r
+   (message (if notmuch-show-elide-non-matching-messages\r
+              "Showing matching messages only."\r
+            "Showing all messages."))\r
+-  (notmuch-show-refresh-view t))\r
++  (notmuch-show-refresh-view))\r
+ \r
+ (defun notmuch-show-toggle-thread-indentation ()\r
+   "Toggle the indentation of threads."\r
+@@ -975,7 +975,7 @@ current buffer, if possible."\r
+   (message (if notmuch-show-indent-content\r
+              "Content is indented."\r
+            "Content is not indented."))\r
+-  (notmuch-show-refresh-view t))\r
++  (notmuch-show-refresh-view))\r
+ \r
+ (defun notmuch-show-insert-tree (tree depth)\r
+   "Insert the message tree TREE at depth DEPTH in the current thread."\r
+@@ -1118,17 +1118,17 @@ This includes:\r
+       (message "Previously current message not found."))\r
+     (notmuch-show-message-adjust)))\r
+ \r
+-(defun notmuch-show-refresh-view (&optional retain-state)\r
++(defun notmuch-show-refresh-view (&optional reset-state)\r
+   "Refresh the current view.\r
+ \r
+ Refreshes the current view, observing changes in display\r
+-preferences. If RETAIN-STATE is non-nil then the state of the\r
+-buffer is stored and re-applied after the refresh."\r
++preferences. If invoked with a prefix argument (or RESET-STATE is\r
++non-nil) then the state of the buffer (open/closed messages) is\r
++reset based on the original query."\r
+   (interactive "P")\r
+   (let ((inhibit-read-only t)\r
+-      state)\r
+-    (if retain-state\r
+-      (setq state (notmuch-show-capture-state)))\r
++      (state (unless reset-state\r
++               (notmuch-show-capture-state))))\r
+     (erase-buffer)\r
+     (notmuch-show-worker)\r
+     (if state\r
+diff --git a/test/emacs b/test/emacs\r
+index b74cfa9..2dffee8 100755\r
+--- a/test/emacs\r
++++ b/test/emacs\r
+@@ -456,7 +456,6 @@ test_emacs '(notmuch-show "id:f35dbb950911171438k5df6eb56k77b6c0944e2e79ae@mail.\r
+ test_expect_equal_file OUTPUT EXPECTED\r
+ \r
+ test_begin_subtest "Refresh modified show buffer"\r
+-test_subtest_known_broken\r
+ test_emacs '(notmuch-show "id:f35dbb950911171438k5df6eb56k77b6c0944e2e79ae@mail.gmail.com")\r
+           (notmuch-show-toggle-message)\r
+           (notmuch-show-next-message)\r
+-- \r
+1.7.7.3\r
+\r