[PATCH v3 2/3] emacs: Reverse the meaning of notmuch-show-refresh-view's argument
authorAustin Clements <amdragon@MIT.EDU>
Tue, 21 Feb 2012 15:42:32 +0000 (10:42 +1900)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:44:47 +0000 (09:44 -0800)
d1/e080b5e90880bdaab808effa55118441281af8 [new file with mode: 0644]

diff --git a/d1/e080b5e90880bdaab808effa55118441281af8 b/d1/e080b5e90880bdaab808effa55118441281af8
new file mode 100644 (file)
index 0000000..69ce225
--- /dev/null
@@ -0,0 +1,179 @@
+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 18A65431FBC\r
+       for <notmuch@notmuchmail.org>; Tue, 21 Feb 2012 07:42:42 -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 JrPl6EDDIGcu for <notmuch@notmuchmail.org>;\r
+       Tue, 21 Feb 2012 07:42:41 -0800 (PST)\r
+Received: from dmz-mailsec-scanner-1.mit.edu (DMZ-MAILSEC-SCANNER-1.MIT.EDU\r
+       [18.9.25.12])\r
+       by olra.theworths.org (Postfix) with ESMTP id 79261431FB6\r
+       for <notmuch@notmuchmail.org>; Tue, 21 Feb 2012 07:42:40 -0800 (PST)\r
+X-AuditID: 1209190c-b7fad6d000000920-ec-4f43bb6fc7ce\r
+Received: from mailhub-auth-4.mit.edu ( [18.7.62.39])\r
+       by dmz-mailsec-scanner-1.mit.edu (Symantec Messaging Gateway) with SMTP\r
+       id 4F.52.02336.F6BB34F4; Tue, 21 Feb 2012 10:42:40 -0500 (EST)\r
+Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103])\r
+       by mailhub-auth-4.mit.edu (8.13.8/8.9.2) with ESMTP id q1LFgd3b015611; \r
+       Tue, 21 Feb 2012 10:42:39 -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 q1LFgbrM025724\r
+       (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);\r
+       Tue, 21 Feb 2012 10:42:38 -0500 (EST)\r
+Received: from amthrax by drake.mit.edu with local (Exim 4.77)\r
+       (envelope-from <amthrax@drake.mit.edu>)\r
+       id 1RzrrQ-0005Ox-V5; Tue, 21 Feb 2012 10:42:37 -0500\r
+From: Austin Clements <amdragon@MIT.EDU>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH v3 2/3] emacs: Reverse the meaning of\r
+       notmuch-show-refresh-view's argument\r
+Date: Tue, 21 Feb 2012 10:42:32 -0500\r
+Message-Id: <1329838953-20666-3-git-send-email-amdragon@mit.edu>\r
+X-Mailer: git-send-email 1.7.7.3\r
+In-Reply-To: <1329838953-20666-1-git-send-email-amdragon@mit.edu>\r
+References: <1329632533-16152-1-git-send-email-amdragon@mit.edu>\r
+       <1329838953-20666-1-git-send-email-amdragon@mit.edu>\r
+X-Brightmail-Tracker:\r
+ H4sIAAAAAAAAA+NgFjrJIsWRmVeSWpSXmKPExsUixG6nrluw29nfYO82RovrN2cyW7xZOY/V\r
+       gcnj8NeFLB7PVt1iDmCK4rJJSc3JLEst0rdL4Mq4+OIuS8Ei+Ypll5YwNzBel+xi5OSQEDCR\r
+       uP2unxHCFpO4cG89G4gtJLCPUaJ/FX8XIxeQvYFR4szv9YwQzn0micZvk9khnPmMEm+PTGMH\r
+       aWET0JDYtn852CgRAWmJnXdns4LYzAJWEoevbgKzhQWiJJrOPAKrZxFQlTix+TgziM0r4CDR\r
+       9/oY1BkKEudWnwOr4RRwlFi+7jczxEnlEi0zJjNOYORfwMiwilE2JbdKNzcxM6c4NVm3ODkx\r
+       Ly+1SNdQLzezRC81pXQTIyiUOCV5djC+Oah0iFGAg1GJh/fkZmd/IdbEsuLK3EOMkhxMSqK8\r
+       W3YBhfiS8lMqMxKLM+KLSnNSiw8xSnAwK4nwLl4AlONNSaysSi3Kh0lJc7AoifOqaL3zExJI\r
+       TyxJzU5NLUgtgsnKcHAoSfAeAxkqWJSanlqRlplTgpBm4uAEGc4DMhykhre4IDG3ODMdIn+K\r
+       UZfj44EnFxiFWPLy81KlxHmvgRQJgBRllObBzYGlgFeM4kBvCUP8wANMH3CTXgEtYQJa0vLf\r
+       EWRJSSJCSqqBUeOJx7WLAmUB4fvmtbc5/8wvXh2+b9vUVWEfft14t9bb5HS+DMOj+/57tqT5\r
+       zHeaVB2z5pSF4qsbvDn1WxN29LwRX2keLD7nybxN774pzlzsu+rRll1c89vf5S2ZePd2yssK\r
+       UalvIV9469bYmjt83WrEtdEjQaThc9yezescJ7M+3b8lLZzl2holluKMREMt5qLiRAC3oooO\r
+       3AIAAA==\r
+Cc: tomi.ollila@iki.fi\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: Tue, 21 Feb 2012 15:42:42 -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 f759351..ac9bdbc 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
+@@ -1117,17 +1117,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-build-buffer)\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