Re: [PATCH] emacs: notmuch-tree: mark the initial message at point as read

Subject: Re: [PATCH] emacs: notmuch-tree: mark the initial message at point as read

Date: Sat, 27 Feb 2021 01:18:06 +0100

To: Tomi Ollila, notmuch@notmuchmail.org

Cc:

From: Jonas Bernoulli


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

You're right, that's unnecessary, and it gets worse.

`notmuch-tree-command-hook' is unnecessary too and if it weren't,
then it would fail because its added to the buffer-local value of
`post-command-hook', but that buffer is not the current buffer
when the hook is run.

Using `post-command-hook' in any form for this is questionable in the
first place.  The idiomatic approach would be to use the `point-entered'
text property hook.  Or `notmuch-tree-{previous,next}-message' could
just do the marking explicitly.

It's also not okay that `notmuch-tree-show-message-in' keeps recreating
the window.

`notmuch-show-command-hook' forces redisplay to update values that pass
along, but don't and shouldn't use.  There is more than one function to
mark a message as read and they don't all end up doing the same thing.

What effectively does the marking is

(defun notmuch-tree-show-message-in ()
  ...
  (when notmuch-show-mark-read-tags
    (notmuch-tree-tag-update-display notmuch-show-mark-read-tags))
  ...)

I am going to refactor this mess, but that will take a while.

     Jonas
_______________________________________________
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-leave@notmuchmail.org

Thread: