From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 803EC431FAF for ; Sun, 19 Feb 2012 10:02:53 -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 GCQyqyL4noA4 for ; Sun, 19 Feb 2012 10:02:52 -0800 (PST) Received: from dmz-mailsec-scanner-7.mit.edu (DMZ-MAILSEC-SCANNER-7.MIT.EDU [18.7.68.36]) by olra.theworths.org (Postfix) with ESMTP id A50DB431FC2 for ; Sun, 19 Feb 2012 10:02:50 -0800 (PST) X-AuditID: 12074424-b7fae6d000000906-e6-4f4139493b29 Received: from mailhub-auth-2.mit.edu ( [18.7.62.36]) by dmz-mailsec-scanner-7.mit.edu (Symantec Messaging Gateway) with SMTP id 6D.F4.02310.949314F4; Sun, 19 Feb 2012 13:02:50 -0500 (EST) Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103]) by mailhub-auth-2.mit.edu (8.13.8/8.9.2) with ESMTP id q1JI2mRr032652; Sun, 19 Feb 2012 13:02:48 -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 q1JI2lRh013404 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT); Sun, 19 Feb 2012 13:02:48 -0500 (EST) Received: from amthrax by drake.mit.edu with local (Exim 4.77) (envelope-from ) id 1RzB5z-0007Mj-ID; Sun, 19 Feb 2012 13:02:47 -0500 From: Austin Clements To: notmuch@notmuchmail.org Subject: [PATCH v2 3/4] emacs: Reverse the meaning of notmuch-show-refresh-view's argument Date: Sun, 19 Feb 2012 13:02:42 -0500 Message-Id: <1329674563-28223-4-git-send-email-amdragon@mit.edu> X-Mailer: git-send-email 1.7.7.3 In-Reply-To: <1329674563-28223-1-git-send-email-amdragon@mit.edu> References: <1329632533-16152-1-git-send-email-amdragon@mit.edu> <1329674563-28223-1-git-send-email-amdragon@mit.edu> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrBIsWRmVeSWpSXmKPExsUixG6noutl6ehvcPo1s8X1mzOZLd6snMfq wORx+OtCFo9nq24xBzBFcdmkpOZklqUW6dslcGXsuL2WsWCOfMXep7eYGxgvSnYxcnJICJhI dPXvYoGwxSQu3FvP1sXIxSEksI9R4vzKX+wQzgZGiYvL/kFl7jNJ7DjWygrSIiQwn1Hi3KQg EJtNQENi2/7ljCC2iIC0xM67s8FqmAWsJA5f3QRmCwtESZyZfRishkVAVeL886PsIDavgIPE g99/oc5QkDi3+hxQnIODU8BR4uI/O4hV5RJzP7xlnsDIv4CRYRWjbEpulW5uYmZOcWqybnFy Yl5eapGuuV5uZoleakrpJkZwILmo7GBsPqR0iFGAg1GJh1eyzMFfiDWxrLgy9xCjJAeTkigv j7mjvxBfUn5KZUZicUZ8UWlOavEhRgkOZiUR3tKb9v5CvCmJlVWpRfkwKWkOFiVxXg2td35C AumJJanZqakFqUUwWRkODiUJXmcLoKGCRanpqRVpmTklCGkmDk6Q4TxAw5NAaniLCxJzizPT IfKnGHU5Ph54coFRiCUvPy9VSpxXD6RIAKQoozQPbg4sAbxiFAd6S5jXDKSKB5g84Ca9AlrC BLSEV8gOZElJIkJKqoFR+1houmHU+0XFeTaPlA4zfiruN9nwO3PFrs5L750lOOIucS1yuqa1 UvDPLy5pjXXvlnB8n7TRbLqqqsim8yeP2sbfu1OZ23K/fX4Ok5VgyIRvSUcXnBdj3ux+dPWJ s2x8X2InbLkVv+CZXp2IpT6PR/mG+JavHqHbVTc+n/hbSmL6jXk8pjxpSizFGYmGWsxFxYkA j+ST6NsCAAA= 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: Sun, 19 Feb 2012 18:02:53 -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 d036c54..ef81cc7 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." @@ -1119,17 +1119,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