unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: markwalters1009 <markwalters1009@gmail.com>
To: notmuch@notmuchmail.org
Subject: [PATCH v2 0/7] Fix emacs tagging race
Date: Sat, 24 Nov 2012 13:20:49 +0000	[thread overview]
Message-ID: <1353763256-32336-1-git-send-email-markwalters1009@gmail.com> (raw)

This is version 2 of this series: version 1 is at
id:1352487491-31512-1-git-send-email-markwalters1009@gmail.com but
this is a much more complete version. Version 1 roughly corresponds to
patches 5-7.

The first two patches allows queries to come from stdin (if the query
string is "-"). This is necessary to avoid ARGMAX limits in some
cases. They are independent of the rest of the series. The main thing
needed for these two (apart from review!) is a manpage but I wasn't
sure whether that should go in notmuch-search-terms or somewhere else.

Patches 3 and 4 make the emacs interface use this new functionality to
pass the tagging query. These two patches depend on the previous two
but are independent of the later patches. Note that it is possible (if
unlikely) to trigger the ARGMAX problem in current notmuch: highlight
most or all of a large search buffer and then try to tag the region.

Patches 5-7 actually fix the race. They do this by appending two query
strings to each search: one query string for the matching messages and
one for the non-matching messages. The front-end can then combine
these query strings to make sure it only tags messages that were
present/matched when the search buffer was created.

The main changes from v1 are to append query-string rather than all
the message-ids (so if we had a better way of constructing the queries
we could switch to that later) and to use Austin's suggestion of
--queries=true to add the queries. I think we do want the choice as
appending the string could easily double the size of the output.

This version (since rebasing and tidying) is not heavily tested (all
tests pass) but I have been running a similar version for some time
without problems.

Best wishes

Mark




Mark Walters (7):
  cli: allow query to come from stdin
  test: for the new query from stdin functionality
  emacs: notmuch.el split call-process into call-process-region
  emacs: make emacs tagging use the stdin query functionality
  test: test for race when tagging from emacs search
  cli: allow search mode to include msg-ids with JSON output
  emacs: make emacs use message-ids for tagging

 emacs/notmuch-tag.el |   14 +++++---
 emacs/notmuch.el     |   47 ++++++++++++++++++++----
 notmuch-search.c     |   95 ++++++++++++++++++++++++++++++++++++++++++++++---
 query-string.c       |   41 +++++++++++++++++++++
 test/emacs           |   21 +++++++++++
 test/tagging         |    9 +++++
 6 files changed, 208 insertions(+), 19 deletions(-)

-- 
1.7.9.1

             reply	other threads:[~2012-11-24 13:21 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-24 13:20 markwalters1009 [this message]
2012-11-24 13:20 ` [PATCH v2 1/7] cli: allow query to come from stdin markwalters1009
2012-11-24 13:24   ` Mark Walters
2012-11-24 17:41   ` Austin Clements
2012-11-26 10:15     ` Mark Walters
2012-11-24 22:34   ` Tomi Ollila
2012-11-24 13:20 ` [PATCH v2 2/7] test: for the new query from stdin functionality markwalters1009
2012-11-24 13:20 ` [PATCH v2 3/7] emacs: notmuch.el split call-process into call-process-region markwalters1009
2012-11-24 13:20 ` [PATCH v2 4/7] emacs: make emacs tagging use the stdin query functionality markwalters1009
2012-11-24 22:09   ` Austin Clements
2012-11-24 13:20 ` [PATCH v2 5/7] test: test for race when tagging from emacs search markwalters1009
2012-11-24 13:20 ` [PATCH v2 6/7] cli: allow search mode to include msg-ids with JSON output markwalters1009
2012-11-24 22:30   ` Tomi Ollila
2012-11-25  0:23   ` Austin Clements
2012-11-24 13:20 ` [PATCH v2 7/7] emacs: make emacs use message-ids for tagging markwalters1009
2012-11-25  0:38   ` 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=1353763256-32336-1-git-send-email-markwalters1009@gmail.com \
    --to=markwalters1009@gmail.com \
    --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).