Re: [feature request] emacs: use `notmuch insert` for FCC
[notmuch-archives.git] / 88 / 1b0df88e072918e08f281e4034dc1140096a3a
1 Return-Path: <patricktotzke@gmail.com>\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 AC568431FAF\r
6         for <notmuch@notmuchmail.org>; Sat, 13 Oct 2012 09:58:58 -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: 1.7\r
10 X-Spam-Level: *\r
11 X-Spam-Status: No, score=1.7 tagged_above=-999 required=5\r
12         tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
13         FREEMAIL_FROM=0.001, FREEMAIL_REPLY=2.499, RCVD_IN_DNSWL_LOW=-0.7]\r
14         autolearn=disabled\r
15 Received: from olra.theworths.org ([127.0.0.1])\r
16         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
17         with ESMTP id ALU8TD6-Lb9y for <notmuch@notmuchmail.org>;\r
18         Sat, 13 Oct 2012 09:58:57 -0700 (PDT)\r
19 Received: from mail-wi0-f179.google.com (mail-wi0-f179.google.com\r
20         [209.85.212.179]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
21         (No client certificate requested)\r
22         by olra.theworths.org (Postfix) with ESMTPS id 120C1431FAE\r
23         for <notmuch@notmuchmail.org>; Sat, 13 Oct 2012 09:58:56 -0700 (PDT)\r
24 Received: by mail-wi0-f179.google.com with SMTP id hq7so474734wib.2\r
25         for <notmuch@notmuchmail.org>; Sat, 13 Oct 2012 09:58:54 -0700 (PDT)\r
26 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
27         h=content-type:mime-version:content-disposition:from:user-agent:to\r
28         :references:in-reply-to:message-id:subject:date;\r
29         bh=8JtzhEy/zL//eJsxSac+ZULSPhwHzhHgqdikRBckbBE=;\r
30         b=zsJbFd9AWA4L5uU2tz9nwCS0RZZ/4kIityrY36ubAPba4TOrryuSwp6vBjkGihThRo\r
31         lPFkLwULUwxm1mNfoSi4MGqeQjytaHkdyCL4l0nm34PbBn0oq1u16e6mdsscw1gXYrBX\r
32         utO96MC2X8sgNxPRnYcoUZDbjYkXngSlAhSAR6RYlgw+K187DCYLf1hiSGmALoOErOQJ\r
33         4JOTfmEGmJ8MMIO93vqsodoO5NGH1BkSqVnGzf8iDH4eqzr7pQ/+0wddbL9RV1YTMWnF\r
34         AsIuG+1OtyPL1arv1xgsQnoFiOSEQ6CEFxJT0HYy+9yG2gCQr8HLRsSMJ5KnwyNAeJwr\r
35         c8tQ==\r
36 Received: by 10.216.227.133 with SMTP id d5mr4665672weq.194.1350147534338;\r
37         Sat, 13 Oct 2012 09:58:54 -0700 (PDT)\r
38 Received: from localhost (cpc6-sgyl27-2-0-cust46.sgyl.cable.virginmedia.com.\r
39         [82.32.140.47])\r
40         by mx.google.com with ESMTPS id dm3sm4558286wib.3.2012.10.13.09.58.52\r
41         (version=TLSv1/SSLv3 cipher=OTHER);\r
42         Sat, 13 Oct 2012 09:58:53 -0700 (PDT)\r
43 Content-Type: multipart/signed; protocol="application/pgp-signature";\r
44         micalg="pgp-sha1"; boundary="===============3247913046672548219=="\r
45 MIME-Version: 1.0\r
46 Content-Disposition: inline\r
47 From: Patrick Totzke <patricktotzke@gmail.com>\r
48 User-Agent: alot/0.3.3+\r
49 To: Suvayu Ali <fatkasuvayu+linux@gmail.com>,  notmuch@notmuchmail.org\r
50 References: <20120924082646.GA10577@kuru.dyndns-at-home.com>\r
51         <20120925104457.12264.30350@megatron>\r
52         <20121008093429.GC4534@kuru.dyndns-at-home.com>\r
53 In-Reply-To: <20121008093429.GC4534@kuru.dyndns-at-home.com>\r
54 Message-ID: <20121013165851.29671.29869@brick.lan>\r
55 Subject: Re: nbook: a notmuch based address book written in python\r
56 Date: Sat, 13 Oct 2012 17:58:51 +0100\r
57 X-BeenThere: notmuch@notmuchmail.org\r
58 X-Mailman-Version: 2.1.13\r
59 Precedence: list\r
60 List-Id: "Use and development of the notmuch mail system."\r
61         <notmuch.notmuchmail.org>\r
62 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
63         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
64 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
65 List-Post: <mailto:notmuch@notmuchmail.org>\r
66 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
67 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
68         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
69 X-List-Received-Date: Sat, 13 Oct 2012 16:58:58 -0000\r
70 \r
71 --===============3247913046672548219==\r
72 Content-Type: text/plain; charset="utf-8"\r
73 MIME-Version: 1.0\r
74 Content-Transfer-Encoding: quoted-printable\r
75 \r
76 Quoting Suvayu Ali (2012-10-08 10:34:29)\r
77 > Hi Patrick,\r
78 > =\r
79 \r
80 > Sorry for the very late reply; I got distracted with some personal\r
81 > matters.\r
82 > =\r
83 \r
84 > On Tue, Sep 25, 2012 at 11:44:57AM +0100, Patrick Totzke wrote:\r
85 > > Hey Suvayu, welcome to notmuch!\r
86 > > =\r
87 \r
88 > > I hope you are aware that there are already a few search based abook to=\r
89 ols\r
90 > > around for notmuch (listed in the wiki, albeit hidden in the emacs docs=\r
91 ):\r
92 > > http://notmuchmail.org/emacstips/#index14h2\r
93 > > I personally use nottoomuch-addresses.sh, which apparently does some ad=\r
94 vanced\r
95 > > caching voodoo for speed.\r
96 > > =\r
97 \r
98 > =\r
99 \r
100 > I wasn't aware of either of them, thanks for pointing them out.  I'll\r
101 > take a look for inspiration and ideas.\r
102 > =\r
103 \r
104 > > But to your tool; practice test:\r
105 > > I wasn't able to use wildcards or simply prefixes of names. This is ess=\r
106 ential\r
107 > > if you want to use it for tabcompleting contacts in a MUA.\r
108 > =\r
109 \r
110 > Since the idea was inspired by the completion on the Gmail web\r
111 > interface, I already do a partial search so wildcards should not be\r
112 > necessary.\r
113 \r
114 Not sure what you mean here: If I compose a mail using gmails web interface\r
115 and type a prefix of someone's name I will get this contect as a suggestion.\r
116 My point was that using your tool, I did not get a contact suggested\r
117 for all prefixes.\r
118 \r
119 > > The time lookups take seems to depend on how many matches there are:\r
120 > > =\r
121 \r
122 > > -------------------------------\r
123 > > time nbook Suvayu\r
124 > > 1 unique email addresses found for `Suvayu'\r
125 > > fatkasuvayu+linux@gmail.com     Suvayu Ali\r
126 > > =\r
127 \r
128 > > nbook Suvayu  0.04s user 0.01s system 95% cpu 0.050 total\r
129 > > -------------------------------\r
130 > > time nbook Justus\r
131 > > ...\r
132 > > =\r
133 \r
134 > > nbook Justus  0.21s user 0.07s system 11% cpu 2.484 total\r
135 > > -------------------------------\r
136 > =\r
137 \r
138 > Yes, I noticed this too when I searched for the more common names.  Not\r
139 > sure how to get around this though.\r
140 \r
141 I think this is a conceptual problem with your algorithm:\r
142 You look up *all* messages and add a name to your result-list\r
143 if it matches. This means you go through some condidate\r
144 as often as you index contains mails from/to him.\r
145 What one really wants is to ask the database to do something like\r
146   "SELECT name,email from RECIPIENTS_OR_SENDER"\r
147 where RECIPIENTS_OR_SENDER is some imaginary list that stores\r
148 a set of contacts.\r
149 \r
150 Bottom line: One would have to change the layout of the underlying\r
151 database (not likely) or do regularly update some cache\r
152 and only work on that. This is what some of the mentioned tools do if i'm n=\r
153 ot mistaken.\r
154 \r
155 > > And If I look for my own name, this takes over a minute,\r
156 > > eventually dying. This could be an issue with libnotmuch though.\r
157 > > Possibly, your algorithm takes very long and then reads from an initial=\r
158 ly\r
159 > > opened Database object again, which was invalidated by concurrent write=\r
160 s of other processes..\r
161 > > =\r
162 \r
163 > > -------------------------------\r
164 > > [~] time nbook Patrick                     =\r
165 \r
166 > > =\r
167 \r
168 > > Error opening /home/pazz/mail/gmail/[Google Mail].All Mail/cur/13306822=\r
169 70_0.12958.megatron,U=3D8766,FMD5=3D66ff6a8bc18a8a3ac4b311daa93d358a:2,S: T=\r
170 oo many open files\r
171 > > Traceback (most recent call last):\r
172 > >   File "/home/pazz/bin/nbook", line 167, in <module>\r
173 > >   File "/home/pazz/bin/nbook", line 71, in __init__\r
174 > >   File "/home/pazz/.local/lib/python2.7/site-packages/notmuch/message.p=\r
175 y", line 233, in get_header\r
176 > > notmuch.errors.NullPointerError\r
177 > > Error in sys.excepthook:\r
178 > > Traceback (most recent call last):\r
179 > >   File "/usr/lib/python2.7/dist-packages/apport_python_hook.py", line 6=\r
180 6, in apport_excepthook\r
181 > > ImportError: No module named fileutils\r
182 > > =\r
183 \r
184 > > Original exception was:\r
185 > > Traceback (most recent call last):\r
186 > >   File "/home/pazz/bin/nbook", line 167, in <module>\r
187 > >   File "/home/pazz/bin/nbook", line 71, in __init__\r
188 > >   File "/home/pazz/.local/lib/python2.7/site-packages/notmuch/message.p=\r
189 y", line 233, in get_header\r
190 > > notmuch.errors.NullPointerError\r
191 > > nbook Patrick  3.20s user 5.47s system 12% cpu 1:11.65 total\r
192 > > ------------------------------------\r
193 > > =\r
194 \r
195 > =\r
196 \r
197 > Yes someone else pointed this out too.  Again I'm not sure how to\r
198 > proceed here.  I had a quick look at this last week and it seemed to me\r
199 > the limitation comes from within the python bindings for notmuch.  Do\r
200 > you have any ideas?\r
201 \r
202 As mentioned before, I think you invalidate the Database object concurrently\r
203 while your long-running algorithm goes through all messages.\r
204 Xapian doesn't handle concurrent access to the index like a normal=E2=84=A2=\r
205  database would.\r
206 This means you are notified by this error that some changes were detected.\r
207 Maybe the error message should be more telling here though. Teythoon?\r
208 \r
209 > > Anyway, have fun hacking notmuch! If you are looking for a related proj=\r
210 ect to bring in your python skills\r
211 > > I could think of one or two :D\r
212 > =\r
213 \r
214 > That would be wonderful.  To give you my background, I'm a graduate\r
215 > student in physics and I have to do a lot of C/C++ and python\r
216 > programming for my research.  Contributing to FOSS projects seems like a\r
217 > wonderful way to learn to collaborate and clean programming (we\r
218 > physicists tend to be sloppy programmers :-p).\r
219 \r
220 https://github.com/teythoon/afew\r
221 https://github.com/pazz/alot\r
222 http://excess.org/urwid/\r
223 \r
224 I'm sure patches will be welcome to any of the above :)\r
225 Best,\r
226 /p\r
227 \r
228 --===============3247913046672548219==\r
229 MIME-Version: 1.0\r
230 Content-Transfer-Encoding: 7bit\r
231 Content-Description: signature\r
232 Content-Type: application/pgp-signature; name="signature.asc"; charset="us-ascii"\r
233 \r
234 -----BEGIN PGP SIGNATURE-----\r
235 Version: GnuPG v1.4.11 (GNU/Linux)\r
236 \r
237 iEYEABECAAYFAlB5ncsACgkQlDQDZ9fWxaofuwCbBIrFTCAEoimDW+oZLkLIOp5+\r
238 hFsAnjPfXjLw2idZX33ykZMrhQ5KXSp/\r
239 =1H/w\r
240 -----END PGP SIGNATURE-----\r
241 \r
242 --===============3247913046672548219==--\r