aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Bernoulli <jonas@bernoul.li>2021-02-16 01:01:38 +0100
committerDavid Bremner <david@tethera.net>2021-07-25 15:15:33 -0300
commitb649b0c871e7fbfcd15a24d51b071bad2680e5d2 (patch)
tree5802ae03c07e35036c28ba1879cfce99647dd880
parentbed62eb8bee4aeca1fabfa5e302b515849f50b31 (diff)
emacs: notmuch-tree: mark the initial message at point as read
When moving between message in a tree or show buffer, the message at point is marked as read. Likewise when creating such a buffer, then the message that is initially at point is supposed to be marked as read as well. The latter worked for `notmuch-show' but not for `notmuch-tree'. Press "RET" or "M-RET" in a search buffer to observe these behaviors. In both cases the marking is supposed to be done by the function `notmuch-show-command-hook'. In the case of `notmuch-show' that function is added directly to `post-command-hook'. `notmuch-tree' instead adds the function `notmuch-tree-command-hook' to `post-command-hook' and that calls `notmuch-show-command-hook', in the respective show buffer, but of course only if that exists. Because the tree buffer is created asynchronously, the show buffer doesn't exist yet by the time the `post-command-hook' is run, so we have to explicitly run `notmuch-tree-command-hook' once the show buffer exists. The show buffer is created when `notmuch-tree-goto-and-insert-msg' calls `notmuch-tree-show-message-in'. `notmuch-tree-process-filter' is what finally brings us here.
-rw-r--r--emacs/notmuch-tree.el3
1 files changed, 2 insertions, 1 deletions
diff --git a/emacs/notmuch-tree.el b/emacs/notmuch-tree.el
index eb7ea941..ef1ca4c5 100644
--- a/emacs/notmuch-tree.el
+++ b/emacs/notmuch-tree.el
@@ -954,7 +954,8 @@ unchanged ADDRESS if parsing fails."
(goto-char (point-max))
(forward-line -1)
(when notmuch-tree-open-target
- (notmuch-tree-show-message-in)))))
+ (notmuch-tree-show-message-in)
+ (notmuch-tree-command-hook)))))
(defun notmuch-tree-insert-tree (tree depth tree-status first last)
"Insert the message tree TREE at depth DEPTH in the current thread.