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