|
Austin Clements |
|
|
Based on the thread at id:"[hidden email]" it seems
like people want show refresh to retain message state by default (I certainly do), rather than reset it by default. As a nice bonus, this fixes a broken test. _______________________________________________ notmuch mailing list [hidden email] http://notmuchmail.org/mailman/listinfo/notmuch |
|
Austin Clements |
|
|
The names of the arguments to notmuch-show-refresh-view had gotten out
of sync between the declare-function and the real thing. --- emacs/notmuch-crypto.el | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/emacs/notmuch-crypto.el b/emacs/notmuch-crypto.el index c7ef1eb..972f26e 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 crypto-switch)) +(declare-function notmuch-show-refresh-view "notmuch-show" (&optional retain-state)) (defun notmuch-crypto-sigstatus-good-callback (button) (let* ((sigstatus (button-get button :notmuch-sigstatus)) -- 1.7.7.3 _______________________________________________ notmuch mailing list [hidden email] http://notmuchmail.org/mailman/listinfo/notmuch |
|
Austin Clements |
|
|
In reply to this post by Austin Clements
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:[hidden email]") (notmuch-show-toggle-message) (notmuch-show-next-message) -- 1.7.7.3 _______________________________________________ notmuch mailing list [hidden email] http://notmuchmail.org/mailman/listinfo/notmuch |
|
Austin Clements |
|
|
In reply to this post by Austin Clements
---
NEWS | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/NEWS b/NEWS index e9abb86..75fa2f4 100644 --- a/NEWS +++ b/NEWS @@ -63,6 +63,11 @@ More flexible and consistent tagging operations (notmuch-show-tag-message "-unread") +Refreshing the show view ('=' by default) no longer opens or closes messages + + To get the old behavior of putting messages back in their initial + opened/closed state, use a prefix argument, e.g., C-u =. + Library changes --------------- -- 1.7.7.3 _______________________________________________ notmuch mailing list [hidden email] http://notmuchmail.org/mailman/listinfo/notmuch |
|
Tomi Ollila-2 |
|
|
In reply to this post by Austin Clements
On Sun, 19 Feb 2012 01:22:10 -0500, Austin Clements <[hidden email]> wrote:
> Based on the thread at id:"[hidden email]" it seems > like people want show refresh to retain message state by default (I > certainly do), rather than reset it by default. As a nice bonus, this > fixes a broken test. Hmm Every '=' keypress in a thread removes 'unread' tag from next unread message :o That is probably desirable feature when refreshing view without retaining state. Also, probably notmuch-show-refresh-view should be fixed not to mark next message unread when retaining state ? Tomi _______________________________________________ notmuch mailing list [hidden email] http://notmuchmail.org/mailman/listinfo/notmuch |
|
Dmitry Kurochkin |
|
|
In reply to this post by Austin Clements
On Sun, 19 Feb 2012 01:22:10 -0500, Austin Clements <[hidden email]> wrote:
> Based on the thread at id:"[hidden email]" it seems > like people want show refresh to retain message state by default (I > certainly do), rather than reset it by default. As a nice bonus, this > fixes a broken test. > All three patches look good to me. Regards, Dmitry > _______________________________________________ > notmuch mailing list > [hidden email] > http://notmuchmail.org/mailman/listinfo/notmuch _______________________________________________ notmuch mailing list [hidden email] http://notmuchmail.org/mailman/listinfo/notmuch |
|
Austin Clements |
|
|
In reply to this post by Tomi Ollila-2
Quoth Tomi Ollila on Feb 19 at 11:43 am:
> On Sun, 19 Feb 2012 01:22:10 -0500, Austin Clements <[hidden email]> wrote: > > Based on the thread at id:"[hidden email]" it seems > > like people want show refresh to retain message state by default (I > > certainly do), rather than reset it by default. As a nice bonus, this > > fixes a broken test. > > Hmm > > Every '=' keypress in a thread removes 'unread' tag from next unread > message :o Oh dear. It's slightly subtler than that, though. Refreshing will remove the unread tag from the first message matching the query. (I suspect you had tag:unread in your query?) This is particularly confusing for state-retaining refresh because that message might not even be open. > That is probably desirable feature when refreshing view without > retaining state. Also, probably notmuch-show-refresh-view should > be fixed not to mark next message unread when retaining state ? I would argue that refresh should never have side-effects, so neither case should mark anything read. I'll send a v2. _______________________________________________ notmuch mailing list [hidden email] http://notmuchmail.org/mailman/listinfo/notmuch |
|
Dmitry Kurochkin |
|
|
On Sun, 19 Feb 2012 12:25:41 -0500, Austin Clements <[hidden email]> wrote:
> Quoth Tomi Ollila on Feb 19 at 11:43 am: > > On Sun, 19 Feb 2012 01:22:10 -0500, Austin Clements <[hidden email]> wrote: > > > Based on the thread at id:"[hidden email]" it seems > > > like people want show refresh to retain message state by default (I > > > certainly do), rather than reset it by default. As a nice bonus, this > > > fixes a broken test. > > > > Hmm > > > > Every '=' keypress in a thread removes 'unread' tag from next unread > > message :o > > Oh dear. It's slightly subtler than that, though. Refreshing will > remove the unread tag from the first message matching the query. (I > suspect you had tag:unread in your query?) This is particularly > confusing for state-retaining refresh because that message might not > even be open. > > > That is probably desirable feature when refreshing view without > > retaining state. Also, probably notmuch-show-refresh-view should > > be fixed not to mark next message unread when retaining state ? > > I would argue that refresh should never have side-effects, so neither > case should mark anything read. I'll send a v2. I agree. But this looks like a separate issue, no? So why v2 instead of a separate patch/series? Regards, Dmitry > _______________________________________________ > notmuch mailing list > [hidden email] > http://notmuchmail.org/mailman/listinfo/notmuch _______________________________________________ notmuch mailing list [hidden email] http://notmuchmail.org/mailman/listinfo/notmuch |
|
Austin Clements |
|
|
In reply to this post by Austin Clements
v2 adds patch 2, which should address Tomi's bug where refreshing
would mark unexpected messages read. The other three patches have not changed. _______________________________________________ notmuch mailing list [hidden email] http://notmuchmail.org/mailman/listinfo/notmuch |
|
Austin Clements |
|
|
The names of the arguments to notmuch-show-refresh-view had gotten out
of sync between the declare-function and the real thing. --- emacs/notmuch-crypto.el | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/emacs/notmuch-crypto.el b/emacs/notmuch-crypto.el index c7ef1eb..972f26e 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 crypto-switch)) +(declare-function notmuch-show-refresh-view "notmuch-show" (&optional retain-state)) (defun notmuch-crypto-sigstatus-good-callback (button) (let* ((sigstatus (button-get button :notmuch-sigstatus)) -- 1.7.7.3 _______________________________________________ notmuch mailing list [hidden email] http://notmuchmail.org/mailman/listinfo/notmuch |
|
Austin Clements |
|
|
In reply to this post by Austin Clements
If we retain state while refreshing a show buffer, it should not mark
any messages read since it's not a navigation operation (it especially shouldn't mark the first message matching the query read, which is what it did previously). If the user or caller requests that refresh reset the state of the buffer, then we consider that a navigation operation, so we do mark the message under point after the refresh read. This is implemented by moving responsibility for read-marking out of notmuch-show-worker and into its caller. --- emacs/notmuch-show.el | 14 +++++++++----- 1 files changed, 9 insertions(+), 5 deletions(-) diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el index aa9ccee..d036c54 100644 --- a/emacs/notmuch-show.el +++ b/emacs/notmuch-show.el @@ -1047,7 +1047,10 @@ function is used." (setq notmuch-show-thread-id thread-id notmuch-show-parent-buffer parent-buffer notmuch-show-query-context query-context) - (notmuch-show-worker))) + (notmuch-show-worker) + + ;; Mark the first open message read + (notmuch-show-mark-read))) (defun notmuch-show-worker () (let ((inhibit-read-only t)) @@ -1081,9 +1084,7 @@ function is used." (notmuch-show-next-open-message)) ;; Set the header line to the subject of the first open message. - (setq header-line-format (notmuch-show-strip-re (notmuch-show-get-pretty-subject))) - - (notmuch-show-mark-read))) + (setq header-line-format (notmuch-show-strip-re (notmuch-show-get-pretty-subject))))) (defun notmuch-show-capture-state () "Capture the state of the current buffer. @@ -1132,7 +1133,10 @@ buffer is stored and re-applied after the refresh." (erase-buffer) (notmuch-show-worker) (if state - (notmuch-show-apply-state state)))) + (notmuch-show-apply-state state) + ;; Refreshing with state reset navigates to the first open + ;; message, so mark read like any other navigation operation. + (notmuch-show-mark-read)))) (defvar notmuch-show-stash-map (let ((map (make-sparse-keymap))) -- 1.7.7.3 _______________________________________________ notmuch mailing list [hidden email] http://notmuchmail.org/mailman/listinfo/notmuch |
|
Austin Clements |
|
|
In reply to this post by Austin Clements
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:[hidden email]") (notmuch-show-toggle-message) (notmuch-show-next-message) -- 1.7.7.3 _______________________________________________ notmuch mailing list [hidden email] http://notmuchmail.org/mailman/listinfo/notmuch |
|
Austin Clements |
|
|
In reply to this post by Austin Clements
---
NEWS | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/NEWS b/NEWS index e9abb86..75fa2f4 100644 --- a/NEWS +++ b/NEWS @@ -63,6 +63,11 @@ More flexible and consistent tagging operations (notmuch-show-tag-message "-unread") +Refreshing the show view ('=' by default) no longer opens or closes messages + + To get the old behavior of putting messages back in their initial + opened/closed state, use a prefix argument, e.g., C-u =. + Library changes --------------- -- 1.7.7.3 _______________________________________________ notmuch mailing list [hidden email] http://notmuchmail.org/mailman/listinfo/notmuch |
|
Austin Clements |
|
|
In reply to this post by Dmitry Kurochkin
Quoth Dmitry Kurochkin on Feb 19 at 9:29 pm:
> On Sun, 19 Feb 2012 12:25:41 -0500, Austin Clements <[hidden email]> wrote: > > Quoth Tomi Ollila on Feb 19 at 11:43 am: > > > On Sun, 19 Feb 2012 01:22:10 -0500, Austin Clements <[hidden email]> wrote: > > > > Based on the thread at id:"[hidden email]" it seems > > > > like people want show refresh to retain message state by default (I > > > > certainly do), rather than reset it by default. As a nice bonus, this > > > > fixes a broken test. > > > > > > Hmm > > > > > > Every '=' keypress in a thread removes 'unread' tag from next unread > > > message :o > > > > Oh dear. It's slightly subtler than that, though. Refreshing will > > remove the unread tag from the first message matching the query. (I > > suspect you had tag:unread in your query?) This is particularly > > confusing for state-retaining refresh because that message might not > > even be open. > > > > > That is probably desirable feature when refreshing view without > > > retaining state. Also, probably notmuch-show-refresh-view should > > > be fixed not to mark next message unread when retaining state ? > > > > I would argue that refresh should never have side-effects, so neither > > case should mark anything read. I'll send a v2. > > I agree. But this looks like a separate issue, no? So why v2 instead > of a separate patch/series? I wanted to slip it in before inverting the default behavior of refresh. _______________________________________________ notmuch mailing list [hidden email] http://notmuchmail.org/mailman/listinfo/notmuch |
|
Austin Clements |
|
|
In reply to this post by Austin Clements
Quoth myself on Feb 19 at 1:02 pm:
> v2 adds patch 2, which should address Tomi's bug where refreshing > would mark unexpected messages read. The other three patches have not > changed. Sorry for the spam. Tomi's bug was subtler than I thought, so v2 didn't actually fix it. Please ignore v2. _______________________________________________ notmuch mailing list [hidden email] http://notmuchmail.org/mailman/listinfo/notmuch |
|
David Bremner-2 |
|
|
In reply to this post by Austin Clements
On Sun, 19 Feb 2012 13:02:40 -0500, Austin Clements <[hidden email]> wrote:
> The names of the arguments to notmuch-show-refresh-view had gotten out > of sync between the declare-function and the real thing. pushed _______________________________________________ notmuch mailing list [hidden email] http://notmuchmail.org/mailman/listinfo/notmuch |
|
Austin Clements |
|
|
In reply to this post by Austin Clements
Third time's the charm. This fixes show refresh to not mark anything
read when keeping state while refreshing and makes it the default. _______________________________________________ notmuch mailing list [hidden email] http://notmuchmail.org/mailman/listinfo/notmuch |
|
Austin Clements |
|
|
If we retain state while refreshing a show buffer, it should not mark
any messages read since it's not a navigation operation (it especially shouldn't mark the first message matching the query read, which is what it did previously). If the user or caller requests that refresh reset the state of the buffer, then we consider that a navigation operation, so we do mark the message under point after the refresh read. This is implemented by moving responsibility for initial positioning and read-marking out of notmuch-show-worker and into its caller. Since notmuch-show-worker is now exclusively about building the show buffer, we rename it to notmuch-show-build-buffer. --- emacs/notmuch-show.el | 26 +++++++++++++++----------- 1 files changed, 15 insertions(+), 11 deletions(-) diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el index aa9ccee..f759351 100644 --- a/emacs/notmuch-show.el +++ b/emacs/notmuch-show.el @@ -1047,9 +1047,14 @@ function is used." (setq notmuch-show-thread-id thread-id notmuch-show-parent-buffer parent-buffer notmuch-show-query-context query-context) - (notmuch-show-worker))) + (notmuch-show-build-buffer) -(defun notmuch-show-worker () + ;; Move to the first open message and mark it read + (if (notmuch-show-message-visible-p) + (notmuch-show-mark-read) + (notmuch-show-next-open-message)))) + +(defun notmuch-show-build-buffer () (let ((inhibit-read-only t)) (notmuch-show-mode) @@ -1076,14 +1081,8 @@ function is used." (run-hooks 'notmuch-show-hook)) - ;; Move straight to the first open message - (unless (notmuch-show-message-visible-p) - (notmuch-show-next-open-message)) - ;; Set the header line to the subject of the first open message. - (setq header-line-format (notmuch-show-strip-re (notmuch-show-get-pretty-subject))) - - (notmuch-show-mark-read))) + (setq header-line-format (notmuch-show-strip-re (notmuch-show-get-pretty-subject))))) (defun notmuch-show-capture-state () "Capture the state of the current buffer. @@ -1130,9 +1129,14 @@ buffer is stored and re-applied after the refresh." (if retain-state (setq state (notmuch-show-capture-state))) (erase-buffer) - (notmuch-show-worker) + (notmuch-show-build-buffer) (if state - (notmuch-show-apply-state state)))) + (notmuch-show-apply-state state) + ;; We're resetting state, so navigate to the first open message + ;; and mark it read, just like opening a new show buffer. + (if (notmuch-show-message-visible-p) + (notmuch-show-mark-read) + (notmuch-show-next-open-message))))) (defvar notmuch-show-stash-map (let ((map (make-sparse-keymap))) -- 1.7.7.3 _______________________________________________ notmuch mailing list [hidden email] http://notmuchmail.org/mailman/listinfo/notmuch |
|
Austin Clements |
|
|
In reply to this post by Austin Clements
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:[hidden email]") (notmuch-show-toggle-message) (notmuch-show-next-message) -- 1.7.7.3 _______________________________________________ notmuch mailing list [hidden email] http://notmuchmail.org/mailman/listinfo/notmuch |
|
Austin Clements |
|
|
In reply to this post by Austin Clements
---
NEWS | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/NEWS b/NEWS index e9abb86..75fa2f4 100644 --- a/NEWS +++ b/NEWS @@ -63,6 +63,11 @@ More flexible and consistent tagging operations (notmuch-show-tag-message "-unread") +Refreshing the show view ('=' by default) no longer opens or closes messages + + To get the old behavior of putting messages back in their initial + opened/closed state, use a prefix argument, e.g., C-u =. + Library changes --------------- -- 1.7.7.3 _______________________________________________ notmuch mailing list [hidden email] http://notmuchmail.org/mailman/listinfo/notmuch |
| Powered by Nabble | See how NAML generates this page |