--- /dev/null
+Return-Path: <sebastien.binet@cern.ch>\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 CD733431FBC\r
+ for <notmuch@notmuchmail.org>; Mon, 9 Jul 2012 01:31:24 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -5\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-5 tagged_above=-999 required=5\r
+ tests=[RCVD_IN_DNSWL_HI=-5] 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 Y4yLn3wUnud5 for <notmuch@notmuchmail.org>;\r
+ Mon, 9 Jul 2012 01:31:24 -0700 (PDT)\r
+X-Greylist: delayed 322 seconds by postgrey-1.32 at olra;\r
+ Mon, 09 Jul 2012 01:31:24 PDT\r
+Received: from CERNMX30.cern.ch (cernmx30.cern.ch [137.138.144.177])\r
+ (using TLSv1 with cipher AES128-SHA (128/128 bits))\r
+ (No client certificate requested)\r
+ by olra.theworths.org (Postfix) with ESMTPS id 09BFE431FAE\r
+ for <notmuch@notmuchmail.org>; Mon, 9 Jul 2012 01:31:23 -0700 (PDT)\r
+Received: from CERNFE22.cern.ch (137.138.144.151) by cernmxgwlb2.cern.ch\r
+ (137.138.144.177) with Microsoft SMTP Server (TLS) id 14.2.283.3;\r
+ Mon, 9 Jul 2012 10:25:58 +0200\r
+Received: from localhost (134.158.88.68) by smtp.cern.ch (137.138.144.172)\r
+ with Microsoft SMTP Server (TLS) id 14.2.298.4; Mon, 9 Jul 2012 10:25:58\r
+ +0200\r
+From: Sebastien Binet <binet@cern.ch>\r
+To: Notmuch developer list <notmuch@notmuchmail.org>\r
+CC: \r
+Subject: query on a subset of messages ?\r
+User-Agent: Notmuch/0.13.2+60~g7ecf77d (http://notmuchmail.org) Emacs/24.1.1\r
+ (x86_64-unknown-linux-gnu)\r
+Date: Mon, 9 Jul 2012 10:25:48 +0200\r
+Message-ID: <871ukl5oj7.fsf@cern.ch>\r
+MIME-Version: 1.0\r
+Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1;\r
+ protocol="application/pgp-signature"\r
+X-Originating-IP: [134.158.88.68]\r
+Keywords: CERN SpamKiller Note: -50\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: Mon, 09 Jul 2012 08:31:25 -0000\r
+\r
+--=-=-=\r
+Content-Type: text/plain\r
+\r
+\r
+hi there,\r
+\r
+I was trying to reduce the I/O stress during my usual email\r
+fetching+tagging by writing a little program using the go bindings to\r
+notmuch.\r
+\r
+ie:\r
+db, status := notmuch.OpenDatabase(db_path,\r
+ notmuch.DATABASE_MODE_READ_WRITE)\r
+query := db.CreateQuery("(tag:new AND tag:inbox)")\r
+msgs := query.SearchMessages()\r
+for _,msg := range msgs {\r
+ tag_msg(msg, tagqueries)\r
+}\r
+\r
+\r
+where tagqueries is a subquery of the form:\r
+[\r
+ {\r
+ "Cmd": "+to-me",\r
+ "Query": "(to:sebastien.binet@cern.ch and not tag:to-me)"\r
+ },\r
+ {\r
+ "Cmd": "+sci-notmuch",\r
+ "Query": "from:notmuch@notmuchmail.org or to:notmuch@notmuchmail.org or subject:notmuch"\r
+ }\r
+]\r
+\r
+\r
+the idea being that I only need to crawl through the db only once and\r
+then iteratively apply tags on those messages (instead of repeatedly\r
+running "notmuch tag ..." for each and every of those many\r
+'tag-queries')\r
+\r
+I couldn't find any C-API to do such a thing using the notmuch library.\r
+did I overlook something ?\r
+\r
+Is it something useful to add ?\r
+\r
+-s\r
+\r
+--=-=-=\r
+Content-Type: application/pgp-signature\r
+\r
+-----BEGIN PGP SIGNATURE-----\r
+Version: GnuPG v2.0.19 (GNU/Linux)\r
+\r
+iEYEARECAAYFAk/6lZUACgkQPj4AVbsZCCZzDACg2EcoBgFsmozMYmYI/Vj+on6h\r
+mFYAn19k1GKmhbmAo5MYmthYSf2At5zs\r
+=d2QK\r
+-----END PGP SIGNATURE-----\r
+--=-=-=--\r