unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Mark Anderson <ma.skies@gmail.com>
To: Pieter Praet <pieter@praet.org>,
	Robin Green <greenrd@greenrd.org>,
	notmuch@notmuchmail.org
Subject: Re: Race condition for '*' command
Date: Tue, 28 Jun 2011 11:36:10 -0600	[thread overview]
Message-ID: <87tyb9j1th.fsf@gmail.com> (raw)
In-Reply-To: <87fwmuxxgd.fsf@praet.org>

On Tue, 28 Jun 2011 08:49:06 +0200, Pieter Praet <pieter@praet.org> wrote:
> On Sun, 26 Jun 2011 10:00:41 +0100, Robin Green <greenrd@greenrd.org> wrote:
> > On Sat, 25 Jun 2011 16:57:50 -0700, Jameson Graef Rollins <jrollins@finestructure.net> wrote:
> > > On Sat, 25 Jun 2011 23:18:52 +0100, Robin Green <greenrd@greenrd.org> wrote:
> > > > A race condition in the '*' command was noted when it was first
> > > > proposed. It looks to me like it still exists - has anything been done
> > > > about it?
> > > 
> > > Hi, Robin.  Can you explain what you mean by the "'*' command"?
> > 
> > Sorry - forgot to say I'm talking about the notmuch emacs mode. In that
> > mode '*' applies tags to all messages matching the current search query,
> > which means that (here's the race condition) new results that have
> > appeared since the last refresh will also be tagged.
> 
> This issue appears to stem from the fact that `notmuch-search-operate-all'
> runs (apply 'notmuch-tag notmuch-search-query-string action-split), in which
> `notmuch-search-query-string' points to a moving target.
> 
> Could be solved by doing it with `notmuch-search', `mark-whole-buffer'
> and `notmuch-search-{add,remove}-tag-region' instead, but I'm sure
> there's a better way (of which I'm as of yet unaware).

I don't think there's a better way, the results which the user is
viewing is the only visual reference for what the action they intend to
apply will use as the object of said action.  I can imagine some people
wanting to have a way to apply an action to a live query string, but I
distinguish between these people and normal humans reading their email.
I expect that when a normal human is reading their email, they do not
intend to apply actions to messages as yet unseen.

I can see some people using the '*' notmuch emacs command as a very
interactive notmuch-poll.sh script.  But I imagine the principle of
least surprise would be to have '*' only apply to visible messages, and
if the buffer is old, the buffer is the only record of what is being
viewed.

-Mark

> 
> > -- 
> > Robin
> > _______________________________________________
> > notmuch mailing list
> > notmuch@notmuchmail.org
> > http://notmuchmail.org/mailman/listinfo/notmuch
> 
> Peace
> 
> -- 
> Pieter
> _______________________________________________
> notmuch mailing list
> notmuch@notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch

  reply	other threads:[~2011-06-28 17:36 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-25 22:18 Race condition for '*' command Robin Green
2011-06-25 23:57 ` Jameson Graef Rollins
2011-06-26  9:00   ` Robin Green
2011-06-28  6:49     ` Pieter Praet
2011-06-28 17:36       ` Mark Anderson [this message]
2011-06-28 19:48         ` Carl Worth
2011-06-30 16:08           ` [PATCH 1/2] test: add/remove tags from all matching messages with `notmuch-search-operate-all' Pieter Praet
2011-06-30 16:08             ` [PATCH 2/2] [RFC] possible solution for "Race condition for '*' command" Pieter Praet
2011-06-30 19:38               ` Pieter Praet
2011-07-01 14:55                 ` Austin Clements

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=87tyb9j1th.fsf@gmail.com \
    --to=ma.skies@gmail.com \
    --cc=greenrd@greenrd.org \
    --cc=notmuch@notmuchmail.org \
    --cc=pieter@praet.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).