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