unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Mark Walters <markwalters1009@gmail.com>
To: Vladimir Panteleev <notmuch@thecybershadow.net>, notmuch@notmuchmail.org
Cc: Vladimir Panteleev <git@thecybershadow.net>
Subject: Re: [PATCH v2] emacs: Add notmuch-update-search-tags
Date: Sat, 26 Aug 2017 11:23:35 +0100	[thread overview]
Message-ID: <87a82mzkyg.fsf@qmul.ac.uk> (raw)
In-Reply-To: <20170826015541.25937-1-notmuch@thecybershadow.net>


Hi

On Sat, 26 Aug 2017, Vladimir Panteleev <notmuch@thecybershadow.net> wrote:
> From: Vladimir Panteleev <git@thecybershadow.net>
>
> Implement an option which, when enabled, causes any tag changes done
> from within notmuch-emacs to instantly update matching threads in open
> search buffers.

I like the idea, and provided it only marks the tags as changed in the
normal way, I think we could even default to on.

However, I am concerned that this version does other things as
well. Note these comments are from reading the patch not from testing,
so please point out if I am wrong.

1) Suppose a new message arrives in the thread. Then triggering a tag
change in the show buffer, (eg notmuch automatically removing an unread
tag) pulls that message into original search buffer.

2) If that new message has some tags that aren't in the thread they will
get marked as "added tags"

3) At least in theory I think the thread may no longer exist -- it could
have merged with another thread and taken the other threads id.

I think 3 is probably rare enough not to be real concern (though we
should make sure we don't actually give an error). But 1 and 2 seem
undesirable.

Rather than refreshing the result it might make sense to fetch the tags
for the actual messages in that thread (as it was when the search buffer
was loaded) by using notmuch-search-find-stable-query.

So something like the following,

- in each notmuch-search buffer

- see if thread-id thread is in that buffer (or perhaps even if there is a thread
  which contains message id in that buffer?)

- If yes, fetch a new list of tags for the messages that buffer thinks are
  in that thread (using notmuch-search-find-stable-query).

- Update tags appropriately.

If we do that then I think the only change in these buffers is the tag
updates, and exactly as if you changed those tags in the search buffer
itself, the threads shown etc don't change.

What do you think?

Best wishes

Mark

  reply	other threads:[~2017-08-26 10:23 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-14  5:54 [PATCH 0/2] Update search results when tags change Vladimir Panteleev
2017-08-14  5:54 ` [PATCH 1/2] notmuch-tag.el: Fix minor grammar error Vladimir Panteleev
2017-08-23 11:11   ` David Bremner
2017-08-14  5:54 ` [PATCH 2/2] emacs: Add notmuch-update-search-tags Vladimir Panteleev
2017-08-25 11:12   ` David Bremner
2017-08-26  1:50     ` Vladimir Panteleev
2017-08-26  1:55       ` [PATCH v2] " Vladimir Panteleev
2017-08-26 10:23         ` Mark Walters [this message]
2017-08-26 17:15           ` Vladimir Panteleev
2017-08-27  7:46             ` Mark Walters
2017-08-29  1:18         ` David Bremner
2017-09-04 22:05           ` Vladimir Panteleev
2017-09-06 13:11             ` 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=87a82mzkyg.fsf@qmul.ac.uk \
    --to=markwalters1009@gmail.com \
    --cc=git@thecybershadow.net \
    --cc=notmuch@notmuchmail.org \
    --cc=notmuch@thecybershadow.net \
    /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).