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

> 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

  reply	other threads:[~2021-02-27  0:18 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
2021-02-27  0:18   ` Jonas Bernoulli [this message]
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=87im6euzwh.fsf@bernoul.li \
    --to=jonas@bernoul.li \
    --cc=notmuch@notmuchmail.org \
    --cc=tomi.ollila@iki.fi \
    /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).