Re: [PATCH] doc: Allow rst2man.py as an alternative to rst2man
[notmuch-archives.git] / 28 / 5588715f64c583fb44fa24fc362c8c60164823
1 Return-Path: <sebastien.binet@cern.ch>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5         by olra.theworths.org (Postfix) with ESMTP id 9B2C8431FD7\r
6         for <notmuch@notmuchmail.org>; Mon,  9 Jul 2012 10:06:40 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -5\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-5 tagged_above=-999 required=5\r
12         tests=[RCVD_IN_DNSWL_HI=-5] autolearn=disabled\r
13 Received: from olra.theworths.org ([127.0.0.1])\r
14         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
15         with ESMTP id jJi0iYyGX5Um for <notmuch@notmuchmail.org>;\r
16         Mon,  9 Jul 2012 10:06:40 -0700 (PDT)\r
17 Received: from CERNMX30.cern.ch (cernmx30.cern.ch [137.138.144.177])\r
18         (using TLSv1 with cipher AES128-SHA (128/128 bits))\r
19         (No client certificate requested)\r
20         by olra.theworths.org (Postfix) with ESMTPS id BAC3F431FBF\r
21         for <notmuch@notmuchmail.org>; Mon,  9 Jul 2012 10:06:39 -0700 (PDT)\r
22 Received: from CERNFE22.cern.ch (137.138.144.151) by cernmxgwlb2.cern.ch\r
23         (137.138.144.177) with Microsoft SMTP Server (TLS) id 14.2.283.3;\r
24         Mon, 9 Jul 2012 19:06:37 +0200\r
25 Received: from localhost (134.158.88.68) by smtp.cern.ch (137.138.144.172)\r
26         with Microsoft SMTP Server (TLS) id 14.2.298.4; Mon, 9 Jul 2012 19:06:37\r
27         +0200\r
28 From: Sebastien Binet <binet@cern.ch>\r
29 To: Austin Clements <amdragon@MIT.EDU>\r
30 Subject: Re: query on a subset of messages ?\r
31 In-Reply-To: <20120709163000.GG18195@mit.edu>\r
32 References: <871ukl5oj7.fsf@cern.ch> <20120709163000.GG18195@mit.edu>\r
33 User-Agent: Notmuch/0.13.2+60~g7ecf77d (http://notmuchmail.org) Emacs/24.1.1\r
34         (x86_64-unknown-linux-gnu)\r
35 Date: Mon, 9 Jul 2012 19:06:37 +0200\r
36 Message-ID: <87obno3luq.fsf@cern.ch>\r
37 MIME-Version: 1.0\r
38 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1;\r
39         protocol="application/pgp-signature"\r
40 X-Originating-IP: [134.158.88.68]\r
41 Keywords: CERN SpamKiller Note: -50\r
42 Cc: Notmuch developer list <notmuch@notmuchmail.org>\r
43 X-BeenThere: notmuch@notmuchmail.org\r
44 X-Mailman-Version: 2.1.13\r
45 Precedence: list\r
46 List-Id: "Use and development of the notmuch mail system."\r
47         <notmuch.notmuchmail.org>\r
48 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
49         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
50 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
51 List-Post: <mailto:notmuch@notmuchmail.org>\r
52 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
53 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
54         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
55 X-List-Received-Date: Mon, 09 Jul 2012 17:06:40 -0000\r
56 \r
57 --=-=-=\r
58 Content-Type: text/plain\r
59 Content-Transfer-Encoding: quoted-printable\r
60 \r
61 Austin Clements <amdragon@MIT.EDU> writes:\r
62 \r
63 > Quoth Sebastien Binet on Jul 09 at 10:25 am:\r
64 >>=20\r
65 >> hi there,\r
66 >>=20\r
67 >> I was trying to reduce the I/O stress during my usual email\r
68 >> fetching+tagging by writing a little program using the go bindings to\r
69 >> notmuch.\r
70 >>=20\r
71 >> ie:\r
72 >> db, status :=3D notmuch.OpenDatabase(db_path,\r
73 >>              notmuch.DATABASE_MODE_READ_WRITE)\r
74 >> query :=3D db.CreateQuery("(tag:new AND tag:inbox)")\r
75 >> msgs :=3D query.SearchMessages()\r
76 >> for _,msg :=3D range msgs {\r
77 >>   tag_msg(msg, tagqueries)\r
78 >> }\r
79 >>=20\r
80 >>=20\r
81 >> where tagqueries is a subquery of the form:\r
82 >> [\r
83 >>     {\r
84 >>         "Cmd": "+to-me",\r
85 >>         "Query": "(to:sebastien.binet@cern.ch and not tag:to-me)"\r
86 >>     },\r
87 >>     {\r
88 >>         "Cmd": "+sci-notmuch",\r
89 >>         "Query": "from:notmuch@notmuchmail.org or to:notmuch@notmuchmail=\r
90 .org or subject:notmuch"\r
91 >>     }\r
92 >> ]\r
93 >>=20\r
94 >>=20\r
95 >> the idea being that I only need to crawl through the db only once and\r
96 >> then iteratively apply tags on those messages (instead of repeatedly\r
97 >> running "notmuch tag ..." for each and every of those many\r
98 >> 'tag-queries')\r
99 >>=20\r
100 >> I couldn't find any C-API to do such a thing using the notmuch library.\r
101 >> did I overlook something ?\r
102 >>=20\r
103 >> Is it something useful to add ?\r
104 >>=20\r
105 >> -s\r
106 >\r
107 > Have you tried a more direct translation of the multiple notmuch tag\r
108 > commands into Go, where you don't worry about subsetting the queries?\r
109 > Unless you're tagging a huge number of messages, the cost of notmuch\r
110 > tag is almost certainly the fsync that it does when it closes the\r
111 > database (which every call to notmuch tag must do).  However, in Go,\r
112 > you can keep the database open across all of the tagging operations\r
113 > and then close and fsync it just once.\r
114 \r
115 nope, I haven't tried that, but will do.\r
116 \r
117 >\r
118 > Note that there is an important optimization in notmuch tag that you\r
119 > might have to replicate.  It manipulates the original query to exclude\r
120 > messages that already have the desired tags, so that they get skipped\r
121 > very efficiently at the earliest stage possible.\r
122 I already have this in my original shell script.\r
123 (wouldn't be too hard to automatically do, though.)\r
124 \r
125 =2Ds\r
126 \r
127 --=-=-=\r
128 Content-Type: application/pgp-signature\r
129 \r
130 -----BEGIN PGP SIGNATURE-----\r
131 Version: GnuPG v2.0.19 (GNU/Linux)\r
132 \r
133 iEYEARECAAYFAk/7D50ACgkQPj4AVbsZCCbNJQCgt63SDJf50TSrnZ/j6szzYHsu\r
134 76EAoO3+PD1VEncWbu/uMckjhesXTOKu\r
135 =rRi9\r
136 -----END PGP SIGNATURE-----\r
137 --=-=-=--\r