From: Mark Walters <markwalters1009@gmail.com>
To: notmuch@notmuchmail.org
Subject: [PATCH] emacs: tree: mark read change
Date: Tue, 9 Jun 2015 10:51:07 +0100 [thread overview]
Message-ID: <1433843467-32398-1-git-send-email-markwalters1009@gmail.com> (raw)
The mark read code for tree mode did not get updated in the recent
changes. This updates it to match. Since the user can customize the
mark read logic we just call the show logic in the message pane.
---
An alternative would be to mark any message explicitly viewed in
tree-mode as read. That would be simpler but I think this is better as
it deals with user customized mark read functions -- for example if
the user has a customized function that only marks a message read if
the whole message is viewed then this version will do the same in tree
mode.
Best wishes
Mark
emacs/notmuch-tree.el | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/emacs/notmuch-tree.el b/emacs/notmuch-tree.el
index 8b6cd51..182235e 100644
--- a/emacs/notmuch-tree.el
+++ b/emacs/notmuch-tree.el
@@ -413,6 +413,13 @@ (defun notmuch-tree-message-window-kill-hook ()
(ignore-errors
(delete-window notmuch-tree-message-window)))))
+(defun notmuch-tree-command-hook ()
+ (when (eq major-mode 'notmuch-tree-mode)
+ ;; We just run the notmuch-show-command-hook on the message pane.
+ (when (buffer-live-p notmuch-tree-message-buffer)
+ (with-current-buffer notmuch-tree-message-buffer
+ (notmuch-show-command-hook)))))
+
(defun notmuch-tree-show-message-in ()
"Show the current message (in split-pane)."
(interactive)
@@ -855,6 +862,7 @@ (defun notmuch-tree-worker (basic-query &optional query-context target open-targ
the same as for the function notmuch-tree."
(interactive)
(notmuch-tree-mode)
+ (add-hook 'post-command-hook #'notmuch-tree-command-hook t t)
(setq notmuch-tree-basic-query basic-query)
(setq notmuch-tree-query-context query-context)
(setq notmuch-tree-target-msg target)
--
2.1.4
next reply other threads:[~2015-06-09 9:51 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-09 9:51 Mark Walters [this message]
2015-06-23 20:31 ` [PATCH] emacs: tree: mark read change David Bremner
2015-06-23 21:14 ` Tomi Ollila
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://notmuchmail.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1433843467-32398-1-git-send-email-markwalters1009@gmail.com \
--to=markwalters1009@gmail.com \
--cc=notmuch@notmuchmail.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://yhetil.org/notmuch.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).