unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Tomi Ollila <tomi.ollila@iki.fi>
To: Jonas Bernoulli <jonas@bernoul.li>, notmuch@notmuchmail.org
Subject: Re: [PATCH] emacs: notmuch-tree: mark the initial message at point as read
Date: Thu, 25 Feb 2021 22:52:21 +0200	[thread overview]
Message-ID: <m235xjswe2.fsf@guru.guru-group.fi> (raw)
In-Reply-To: <20210216000138.19625-1-jonas@bernoul.li>

On Tue, Feb 16 2021, Jonas Bernoulli wrote:

> 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.

Long message, small change (which is good). I try to understand
whether adding notmuch-tree-command-hook to post-command-hook in
notmuch-tree.el (not in this change) actually have any effect. 

Tomi

> ---
>  emacs/notmuch-tree.el | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/emacs/notmuch-tree.el b/emacs/notmuch-tree.el
> index 13007a13..d9265fd5 100644
> --- a/emacs/notmuch-tree.el
> +++ b/emacs/notmuch-tree.el
> @@ -949,7 +949,8 @@ (defun notmuch-tree-goto-and-insert-msg (msg)
>        (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.
> -- 
> 2.30.1
> _______________________________________________
> notmuch mailing list -- notmuch@notmuchmail.org
> To unsubscribe send an email to notmuch-leave@notmuchmail.org

  reply	other threads:[~2021-02-25 20:52 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-16  0:01 [PATCH] emacs: notmuch-tree: mark the initial message at point as read Jonas Bernoulli
2021-02-25 20:52 ` Tomi Ollila [this message]
2021-02-27  0:18   ` Jonas Bernoulli
2021-02-27  0:28     ` Jonas Bernoulli
2021-06-05 11:23       ` David Bremner
2021-07-19 11:12         ` Jonas Bernoulli
2021-07-19 23:37           ` David Bremner
2021-07-23 14:01             ` Jonas Bernoulli
2021-07-25 18:30 ` David Bremner

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=m235xjswe2.fsf@guru.guru-group.fi \
    --to=tomi.ollila@iki.fi \
    --cc=jonas@bernoul.li \
    --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).