[PATCH v2 0/7] Fix emacs tagging race
authormarkwalters1009 <markwalters1009@gmail.com>
Sat, 24 Nov 2012 13:20:49 +0000 (13:20 +0000)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:50:49 +0000 (09:50 -0800)
f6/0f1ee28d43a271b38f7cc5fa8d7dd342db5767 [new file with mode: 0644]

diff --git a/f6/0f1ee28d43a271b38f7cc5fa8d7dd342db5767 b/f6/0f1ee28d43a271b38f7cc5fa8d7dd342db5767
new file mode 100644 (file)
index 0000000..3f2b202
--- /dev/null
@@ -0,0 +1,120 @@
+Return-Path: <markwalters1009@gmail.com>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 906C1431FAF\r
+       for <notmuch@notmuchmail.org>; Sat, 24 Nov 2012 05:21:03 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 2.7\r
+X-Spam-Level: **\r
+X-Spam-Status: No, score=2.7 tagged_above=-999 required=5\r
+       tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
+       FREEMAIL_ENVFROM_END_DIGIT=1, FREEMAIL_FROM=0.001,\r
+       FREEMAIL_REPLY=2.499, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id ggEG39vUGR-b for <notmuch@notmuchmail.org>;\r
+       Sat, 24 Nov 2012 05:21:03 -0800 (PST)\r
+Received: from mail-wi0-f175.google.com (mail-wi0-f175.google.com\r
+       [209.85.212.175]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id E7471431FAE\r
+       for <notmuch@notmuchmail.org>; Sat, 24 Nov 2012 05:21:02 -0800 (PST)\r
+Received: by mail-wi0-f175.google.com with SMTP id hm11so1793227wib.2\r
+       for <notmuch@notmuchmail.org>; Sat, 24 Nov 2012 05:21:00 -0800 (PST)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
+       h=from:to:cc:subject:date:message-id:x-mailer;\r
+       bh=86OJ6ItwwSjti3twsXRw+ydILRsUSjRmZO8Ea29Gl+w=;\r
+       b=hgP+hD5i+Irb6HCRNQzIkytnUg5b8iKPfBarhg0SlLhabWCUyf/28FStnhXyUtsTHH\r
+       +BrgzKtDtZjwWaB7BepkOkpV0tAFq7knYR0KQcih1AcmR/bWwmo9L/IUlYhvWbmUxGp1\r
+       EN4KVI8RIkQeFNQJ9aConIozwraHTMB2MxSCPpvyXsupx/XRE+y8wO+vS2mVGA8nt73M\r
+       QdkbUyGnSlaBc47AQt39bMQJl1OeLM6WT4Q6GkbO28WaBxVyT3RvhG0I0VMdXU1h0mps\r
+       ZLSFpu4xKToRFhSEU8MCElv9WTBISZDakuYAFbXFPqAj6C7XClE9CzGo9FhPdXbIQstQ\r
+       hhTQ==\r
+Received: by 10.180.14.162 with SMTP id q2mr13659794wic.21.1353763260361;\r
+       Sat, 24 Nov 2012 05:21:00 -0800 (PST)\r
+Received: from localhost (93-97-24-31.zone5.bethere.co.uk. [93.97.24.31])\r
+       by mx.google.com with ESMTPS id i2sm12682341wiw.3.2012.11.24.05.20.58\r
+       (version=TLSv1/SSLv3 cipher=OTHER);\r
+       Sat, 24 Nov 2012 05:20:59 -0800 (PST)\r
+From: markwalters1009 <markwalters1009@gmail.com>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH v2 0/7] Fix emacs tagging race\r
+Date: Sat, 24 Nov 2012 13:20:49 +0000\r
+Message-Id: <1353763256-32336-1-git-send-email-markwalters1009@gmail.com>\r
+X-Mailer: git-send-email 1.7.9.1\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Sat, 24 Nov 2012 13:21:03 -0000\r
+\r
+This is version 2 of this series: version 1 is at\r
+id:1352487491-31512-1-git-send-email-markwalters1009@gmail.com but\r
+this is a much more complete version. Version 1 roughly corresponds to\r
+patches 5-7.\r
+\r
+The first two patches allows queries to come from stdin (if the query\r
+string is "-"). This is necessary to avoid ARGMAX limits in some\r
+cases. They are independent of the rest of the series. The main thing\r
+needed for these two (apart from review!) is a manpage but I wasn't\r
+sure whether that should go in notmuch-search-terms or somewhere else.\r
+\r
+Patches 3 and 4 make the emacs interface use this new functionality to\r
+pass the tagging query. These two patches depend on the previous two\r
+but are independent of the later patches. Note that it is possible (if\r
+unlikely) to trigger the ARGMAX problem in current notmuch: highlight\r
+most or all of a large search buffer and then try to tag the region.\r
+\r
+Patches 5-7 actually fix the race. They do this by appending two query\r
+strings to each search: one query string for the matching messages and\r
+one for the non-matching messages. The front-end can then combine\r
+these query strings to make sure it only tags messages that were\r
+present/matched when the search buffer was created.\r
+\r
+The main changes from v1 are to append query-string rather than all\r
+the message-ids (so if we had a better way of constructing the queries\r
+we could switch to that later) and to use Austin's suggestion of\r
+--queries=true to add the queries. I think we do want the choice as\r
+appending the string could easily double the size of the output.\r
+\r
+This version (since rebasing and tidying) is not heavily tested (all\r
+tests pass) but I have been running a similar version for some time\r
+without problems.\r
+\r
+Best wishes\r
+\r
+Mark\r
+\r
+\r
+\r
+\r
+Mark Walters (7):\r
+  cli: allow query to come from stdin\r
+  test: for the new query from stdin functionality\r
+  emacs: notmuch.el split call-process into call-process-region\r
+  emacs: make emacs tagging use the stdin query functionality\r
+  test: test for race when tagging from emacs search\r
+  cli: allow search mode to include msg-ids with JSON output\r
+  emacs: make emacs use message-ids for tagging\r
+\r
+ emacs/notmuch-tag.el |   14 +++++---\r
+ emacs/notmuch.el     |   47 ++++++++++++++++++++----\r
+ notmuch-search.c     |   95 ++++++++++++++++++++++++++++++++++++++++++++++---\r
+ query-string.c       |   41 +++++++++++++++++++++\r
+ test/emacs           |   21 +++++++++++\r
+ test/tagging         |    9 +++++\r
+ 6 files changed, 208 insertions(+), 19 deletions(-)\r
+\r
+-- \r
+1.7.9.1\r
+\r