[PATCH] python: use absolute import for SOVERSION
[notmuch-archives.git] / 04 / 325c05be95ab931f672e0885726fdf6a63f4e0
1 Return-Path: <daniel@schoepe.org>\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 87190429E54\r
6         for <notmuch@notmuchmail.org>; Sat, 21 Jan 2012 16:39:39 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -0.8\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.8 tagged_above=-999 required=5\r
12         tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
13         RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
14 Received: from olra.theworths.org ([127.0.0.1])\r
15         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
16         with ESMTP id lnn9Ki4uFYCD for <notmuch@notmuchmail.org>;\r
17         Sat, 21 Jan 2012 16:39:38 -0800 (PST)\r
18 Received: from mail-ey0-f181.google.com (mail-ey0-f181.google.com\r
19         [209.85.215.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
20         (No client certificate requested)\r
21         by olra.theworths.org (Postfix) with ESMTPS id 986DE429E40\r
22         for <notmuch@notmuchmail.org>; Sat, 21 Jan 2012 16:39:37 -0800 (PST)\r
23 Received: by eaal1 with SMTP id l1so933034eaa.26\r
24         for <notmuch@notmuchmail.org>; Sat, 21 Jan 2012 16:39:35 -0800 (PST)\r
25 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=schoepe.org; s=google;\r
26         h=from:to:subject:in-reply-to:references:user-agent:date:message-id\r
27         :mime-version:content-type:x-gm-message-state;\r
28         bh=WFqcOlzp7R+t7ZE+qSVRyIDyHIgOW/9AcLFHLSv+7o4=;\r
29         b=kRgu2e648by1ahJu4OOcrrJjZRxLTIKVxiSgQuzqyTxwPyho2jSNH9+wKnkL2cQ1x9\r
30         kJhLewDAZVvuK4QDIL0BeBb+g0rd4ESxwevUjWi6AU4RgmBCnofdi31JDStTzPZmFTDR\r
31         g2vqouOO55yuaKhDSy36uc7RG3SfToYFQcnzU=\r
32 Received: by 10.213.34.17 with SMTP id j17mr600473ebd.84.1327192774811;\r
33         Sat, 21 Jan 2012 16:39:34 -0800 (PST)\r
34 Received: from localhost (dslb-188-107-198-094.pools.arcor-ip.net.\r
35         [188.107.198.94])\r
36         by mx.google.com with ESMTPS id t59sm32567809eeh.10.2012.01.21.16.39.31\r
37         (version=TLSv1/SSLv3 cipher=OTHER);\r
38         Sat, 21 Jan 2012 16:39:32 -0800 (PST)\r
39 From: Daniel Schoepe <daniel@schoepe.org>\r
40 To: Dmitry Kurochkin <dmitry.kurochkin@gmail.com>, notmuch@notmuchmail.org\r
41 Subject: Re: [PATCH v6 1/2] emacs: User-defined sections in notmuch-hello\r
42 In-Reply-To: <87aa6vvodi.fsf@gmail.com>\r
43 References: <87ippzysmv.fsf@steelpick.2x.cz>\r
44         <1318253982-23588-1-git-send-email-daniel@schoepe.org>\r
45         <1318253982-23588-2-git-send-email-daniel@schoepe.org>\r
46         <87aa6vvodi.fsf@gmail.com>\r
47 User-Agent: Notmuch/0.11+62~g888dddb (http://notmuchmail.org) Emacs/24.0.92.1\r
48         (x86_64-pc-linux-gnu)\r
49 Date: Sun, 22 Jan 2012 01:39:26 +0100\r
50 Message-ID: <87d3ac8ta9.fsf@schoepe.localhost>\r
51 MIME-Version: 1.0\r
52 Content-Type: multipart/signed; boundary="=-=-=";\r
53         micalg=pgp-sha1; protocol="application/pgp-signature"\r
54 X-Gm-Message-State:\r
55  ALoCoQl9tmpXbO1MF/J5u1hIZsQY42u4KX9g1LZNhhD8l+Q/5kCrL5zaXLkEBPBUqC9PifAcu0Ol\r
56 X-BeenThere: notmuch@notmuchmail.org\r
57 X-Mailman-Version: 2.1.13\r
58 Precedence: list\r
59 List-Id: "Use and development of the notmuch mail system."\r
60         <notmuch.notmuchmail.org>\r
61 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
62         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
63 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
64 List-Post: <mailto:notmuch@notmuchmail.org>\r
65 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
66 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
67         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
68 X-List-Received-Date: Sun, 22 Jan 2012 00:39:39 -0000\r
69 \r
70 --=-=-=\r
71 Content-Type: text/plain\r
72 Content-Transfer-Encoding: quoted-printable\r
73 \r
74 On Wed, 14 Dec 2011 07:11:21 +0400, Dmitry Kurochkin <dmitry.kurochkin@gmai=\r
75 l.com> wrote:\r
76 > Hi Daniel.\r
77 >=20\r
78 > I have finished reviewing this patch at last.  Sorry, it is a bit messy.\r
79 > Overall, I like the patch.  It is a very nice improvement.\r
80 >=20\r
81 > I am sure I have missed some important points, but I guess this is the\r
82 > best I can do right now.  Perhaps I will find more comments for the next\r
83 > version of the patch :)\r
84 >=20\r
85 > As we already discussed on IRC, there are some trailing whitespaces to\r
86 > cleanup.\r
87 >=20\r
88 > Here is the review:\r
89 >=20\r
90 > +(defvar notmuch-custom-section-options\r
91 >=20\r
92 > s/notmuch-custom-section-options/notmuch-hello-custom-section-options/\r
93 > for consistency?\r
94 \r
95 Agreed.\r
96 \r
97 >=20\r
98 > +    (:filter-count (string :tag "Different filter message counts"))\r
99 >=20\r
100 > It was not clear to me what this option is for from the docstring.\r
101 > Perhaps something like: "Count query filter, if different from :filter"?\r
102 \r
103 This option is for displaying a different number of messages next to the\r
104 button, than actually match the query the button links to. I think this is\r
105 something that was requested a while ago in the context of my patch that\r
106 added notmuch-hello-tag-list-make-query.\r
107 \r
108 > +    (:initially-hidden (const :tag "Hide this on startup?" t))\r
109 >=20\r
110 > "This" refers to section, right?  If yes, let's state it explicitly:\r
111 > "Hide this section on startup".  Also, we should probably remove the\r
112 > question mark, or add it to other options for consistency.\r
113 \r
114 Agreed.\r
115 \r
116 > Should the default be to show all sections?\r
117 \r
118 That's the default I'd prefer, since I want to see most of the section\r
119 I define by default. If you have some less bike-shedy arguments for\r
120 changing this, I'm all ears.\r
121 \r
122 >=20\r
123 > +    (:hide-if-empty (const :tag "Hide if empty" t)))\r
124 >=20\r
125 > As I understand, this controls whether the whole sections is visible.\r
126 > It is not clear what "if empty" means.  Does it mean that all queries\r
127 > are empty?  Or all queries are empty and :show-empty-sections is\r
128 > false?  Consider changing to something like: "Hide this section if all\r
129 > queries are empty [and hidden]".\r
130 \r
131 Okay, I'll clarify this in the next version.\r
132 \r
133 > +  `(list :tag ""\r
134 > +      (const :tag "" notmuch-hello-insert-query-list)\r
135 >=20\r
136 > Do we need to explicitly specify empty tags?  Aren't they empty by\r
137 > default?\r
138 \r
139 It displays the symbol after the const if this is missing.\r
140 \r
141 >=20\r
142 > +  :tag "Customized tag-list (see docstring for details)"\r
143 > +  :tag "Customized queries section (see docstring for details)"\r
144 >=20\r
145 > Perhaps it would be more useful to add reference to\r
146 > `notmuch-hello-sections'?  I.e. "see `notmuch-hello-sections' for\r
147 > details.\r
148 \r
149 Since this is mainly displayed in the drop-down menu for the section\r
150 type in the customize page for notmuch-hello-sections (or\r
151 customize-group 'notmuch), references a) don't work there and b)\r
152 usually would point to the same thing as the user is currently editing.\r
153 \r
154 > Please s/Customized tag-list/Customized tag-list section/ everywhere for\r
155 > consistency (or remove section from "Customized queries section").\r
156 \r
157 Done.\r
158 \r
159 >=20\r
160 > +Each entry of this list should be a function of no arguments that\r
161 > +should return if `notmuch-hello-target' is produced as part of its\r
162 > +output and nil otherwise.\r
163 >=20\r
164 > Something is missing between "return if".  IMO it is really hard to\r
165 > understand what the function should actually do and what it should\r
166 > return.  Are this functions expected to add section content to current\r
167 > position?  As I understand, the return value indicates whether cursor\r
168 > should be positioned somewhere inside this section.  It is a minor\r
169 > detail, but it is described in the first (and complex sentence) as if\r
170 > it was the most important part.  Consider moving the return and "no\r
171 > arguments" to the 3rd paragraph which describes details about the\r
172 > functions.  I would also swap 2nd and 3rd paragraph.  Smth like:\r
173 >=20\r
174 >   The list contains functions which are used to construct sections in\r
175 >   notmuch-hello buffer.  When notmuch-hello buffer is constructed,\r
176 >   these functions are run in the order they appear in this list.  Each\r
177 >   function produces a section simply by adding content to the current\r
178 >   buffer.  A section should not end with an empty line, because a\r
179 >   newline will be inserted after each section by `notmuch-hello'.\r
180 >=20\r
181 >   Each function should take no arguments.  If the produced section\r
182 >   includes `notmuch-hello-target' (i.e. cursor should be positioned\r
183 >   inside this section), the function should return [something].\r
184 >   Otherwise, it should return nil.\r
185 >=20\r
186 >   For convenience an element can also be a list of the form (FUNC ARG1\r
187 >   ARG2 .. ARGN) in which case FUNC will be applied to the rest of the\r
188 >   list.\r
189 >=20\r
190 >   [ details about customized tag-list and queries sections ]\r
191 >=20\r
192 > This is just a draft.  Feel free to use it or ignore it.\r
193 \r
194 Thanks, that is quite a bit clearer than what I wrote.\r
195 \r
196 > + For convenience an element can also be\r
197 >=20\r
198 > Remove space the leading space and do `fill-paragraph'.\r
199 >=20\r
200 > +         (function :tag "Custom function"))))\r
201 >=20\r
202 > Perhaps "Custom section" would be more accurate?\r
203 \r
204 Yes, it would.\r
205 \r
206 >=20\r
207 > +  "Button at position of point before rebuilding the notmuch-buffer\r
208 >=20\r
209 > Missing dot at the end.\r
210 >=20\r
211 > s/Button/Button text/?\r
212 >=20\r
213 > +This variable contains the string of the button, if any, the\r
214 >=20\r
215 > s/the string/text/ or label?\r
216 >=20\r
217 > +rebuilt. This is never actually set globally and defined as a\r
218 >=20\r
219 > s/is never actually set/should never be set/?\r
220 \r
221 Sounds good.\r
222 \r
223 >=20\r
224 > +(defvar notmuch-hello-hidden-sections nil\r
225 > +  "List of query section titles whose contents are hidden")\r
226 >=20\r
227 > Is this really for query sections only?\r
228 \r
229 No, good catch.\r
230 \r
231 >=20\r
232 > Does this duplicate :initially-hidden option from\r
233 > notmuch-custom-section-options?\r
234 \r
235 This is actually for keeping track of which sections the user chose to\r
236 hide via the "[hide]"-button. Changing the corresponding field\r
237 :initially-hidden field in notmuch-sections is not possible for\r
238 arbitrary sections, i.e. functions and would alter what the users for\r
239 customize. Also, exiting notmuch and then starting it again would no\r
240 longer do what the user set in his configuration, if he didn't want to\r
241 hide it in the beginning, but then clicked on [hide] later.\r
242 \r
243 >=20\r
244 > How about adding a global alist variable notmuch-hello-state to store\r
245 > the state needed for section functions?  Currently, it would contain\r
246 > two values: :first-run and :target.  This would allow us to add more\r
247 > state variables in the future without polluting the global namespace.\r
248 > Also, it would make clear what variables are section function are\r
249 > supposed to use and perhaps even change (docstring should explain that\r
250 > of course).\r
251 \r
252 Given that all the variables are prefixed with notmuch-hello already, I\r
253 don't think that the polluting the namespace is really a problem. And\r
254 given that section functions would have to access target, I'd rather\r
255 keep it in a separate variable so people who write a new type of section\r
256 don't have to inspect some detail in a variable whose other components\r
257 are internal implementation details (this is the case for first-run and\r
258 hidden-sections). If this actually becomes a problem we can still\r
259 move them there later.\r
260 \r
261 >=20\r
262 > `notmuch-hello-filtered-query':\r
263 >=20\r
264 > +      (and result (concat query " and (" result ")"))))\r
265 >=20\r
266 > How about using the result as query instead of filter?  I.e. returning\r
267 > the result without adding the query to it.  IMO it is simpler and more\r
268 > flexible.  In particular, that would allow the function to return nil\r
269 > in case the query should not be shown.\r
270 \r
271 The entry is already hidden if the function returns nil, because of the\r
272 `and'. I agree that it's simpler though, so I changed it.\r
273 \r
274 >=20\r
275 > Query should be put in ().\r
276 >=20\r
277 > +    (concat query " and (" filter ")"))\r
278 >=20\r
279 > Same here.\r
280 >=20\r
281 > +   (t (concat query))))\r
282 >=20\r
283 > Why do we need concat here?\r
284 \r
285 Fixed.\r
286 \r
287 >=20\r
288 > `notmuch-hello-query-counts':\r
289 >=20\r
290 > +             (notmuch-hello-filtered-query (cdr query-and-count)\r
291 > +                                           (or (plist-get options :filter-count)\r
292 > +                                              (plist-get options :filter)))))))\r
293 >=20\r
294 > and\r
295 >=20\r
296 > +        (list name (notmuch-hello-filtered-query\r
297 > +                    (car query-and-count) (plist-get options :filter))\r
298 > +              message-count))))\r
299 >=20\r
300 > We already handled :filter and :filter-count options in\r
301 > `notmuch-hello-generate-tag-alist'.  We should just use the generated\r
302 > queries passed in query-alist.\r
303 \r
304 Yes, I handled that by moving all the code for that to -query-counts,\r
305 like you suggested in your other mail.\r
306 \r
307 > It seems that `notmuch-hello-query-counts' should handle only\r
308 > :show-empty-searches option.  If that is true, docstring should be\r
309 > updated accordingly.  Also, I think it is better to pass a single\r
310 > :show-empty-searches option as a parameter instead of the whole\r
311 > options plist.\r
312 >=20\r
313 > -       reordered-list)\r
314 > +       searches)\r
315 >=20\r
316 > I am not sure if this is a mistake.  I hope it is not, because it\r
317 > allows us to remove some code :) If this change is correct, please\r
318 > make it a separate patch and remove unused reordered-list variable,\r
319 > notmuch-hello-reflect and notmuch-hello-reflect-generate-row\r
320 > functions.  Otherwise, revert the change.\r
321 \r
322 It was definitely unintended and changes the default behavior, which is\r
323 to have the strings sorted within the columns instead of the rows.\r
324 \r
325 >=20\r
326 > - "Major mode for convenient notmuch navigation. This is your entry porta=\r
327 l into notmuch.\r
328 > +  "Major mode for convenient notmuch navigation. This is your entry port=\r
329 al into notmuch.\r
330 >=20\r
331 > Please revert.\r
332 >=20\r
333 > - (interactive)\r
334 > - (kill-all-local-variables)\r
335 > - (use-local-map notmuch-hello-mode-map)\r
336 > - (setq major-mode 'notmuch-hello-mode\r
337 > -       mode-name "notmuch-hello")\r
338 > - ;;(setq buffer-read-only t)\r
339 > -)\r
340 > -\r
341 > +  (interactive)\r
342 > +  (kill-all-local-variables)\r
343 > +  (use-local-map notmuch-hello-mode-map)\r
344 > +  (setq major-mode 'notmuch-hello-mode\r
345 > +     mode-name "notmuch-hello"))\r
346 > +\r
347 >=20\r
348 > Please revert.  The commented out line may be removed in a separate patch.\r
349 >=20\r
350 > `notmuch-hello-generate-tag-alist':\r
351 >=20\r
352 > +                  (list tag (notmuch-hello-filtered-query tag filter-query)\r
353 >=20\r
354 > It should be (concat "tag:" tag) instead of tag.  Besides we already\r
355 > have it in the query variable, so just use it.\r
356 >=20\r
357 > +                (cons tag (notmuch-hello-filtered-query\r
358 > +                           (concat "tag:" tag) filter-query))))))\r
359 >=20\r
360 > Same as above: use the query variable.\r
361 >=20\r
362 > `notmuch-hello-insert-saved-searches':\r
363 >=20\r
364 > Looks like we do not need both `final-target-pos'.  Can we just return\r
365 > `found-target-pos'?\r
366 >=20\r
367 > `notmuch-hello-insert-search':\r
368 >=20\r
369 > +  (insert "\n"))\r
370 >=20\r
371 > Should this be `widget-insert'?\r
372 >=20\r
373 > Note that there are changes in master that need to be merged into\r
374 > `notmuch-hello-insert-search' during rebase.\r
375 >=20\r
376 > `notmuch-hello-insert-searches':\r
377 >=20\r
378 > if my above comments on `notmuch-hello-query-counts' are correct, the\r
379 > docstring should be fixed because `notmuch-hello-insert-searches' does\r
380 > not handle :filter and :filter-count options.  Would be nice to move\r
381 > this documentation somewhere instead of deleting it.\r
382 \r
383 I moved it to notmuch-hello-insert-tags-section, which actually\r
384 does handle those option and is a high-level function that will\r
385 probably be used a lot more by users.\r
386 \r
387 >=20\r
388 > +       (searches (apply 'notmuch-hello-query-counts query-alist options)))\r
389 >=20\r
390 > Why do we need `apply' here?\r
391 \r
392 Because we want each item in `options' to be passed as an individual\r
393 argument. Note that apply is a bit peculiar about its last argument.\r
394 \r
395 > `notmuch-hello-insert-tags-section':\r
396 >=20\r
397 > +  "Insert a section displaying all tags and message counts for each.\r
398 >=20\r
399 > Perhaps s/and message counts for each/with message counts/?\r
400 >=20\r
401 > `notmuch-hello-insert-inbox':\r
402 >=20\r
403 > Perhaps change docstring to something more consistent with other\r
404 > notmuch-hello-insert-* functions?  E.g.:\r
405 >=20\r
406 >   Insert a section displaying saved search and inbox messages for each\r
407 >   tag.\r
408 \r
409 Changed, thanks.\r
410 \r
411 >=20\r
412 > +                               (notmuch-hello-generate-tag-alist))\r
413 > +                              :filter "tag:inbox"))\r
414 >=20\r
415 > If my above comments are correct, then :filter option should be given\r
416 > to `notmuch-hello-generate-tag-alist' instead of\r
417 > `notmuch-hello-insert-searches'.\r
418 >=20\r
419 > `notmuch-hello-insert-alltags':\r
420 >=20\r
421 > Missing dot at the end of docstring.\r
422 >=20\r
423 > Perhaps s/and associated message counts/with message counts/?\r
424 >=20\r
425 > `notmuch-hello':\r
426 >=20\r
427 > -  ; Jump through a hoop to get this value from the deprecated variable\r
428 > -  ; name (`notmuch-folders') or from the default value.\r
429 > +                                     ; Jump through a hoop to get this value from the deprecated variable\r
430 > +                                     ; name (`notmuch-folders') or from the default value.\r
431 >=20\r
432 > Please revert.\r
433 >=20\r
434 >    (if (not notmuch-saved-searches)\r
435 > -    (setq notmuch-saved-searches (notmuch-saved-searches)))\r
436 > +      (setq notmuch-saved-searches (notmuch-saved-searches)))\r
437 >=20\r
438 > Please revert.\r
439 >=20\r
440 > +    (setq notmuch-hello-first-run nil)))\r
441 >=20\r
442 > Please move this statement to the top level.  There is no need for it\r
443 > to be inside let.\r
444 \r
445 Fixed.\r
446 \r
447 I'll send my current version shortly, which does not yet include\r
448 Michal's performance improvement, because there probably still be a few\r
449 rough edges. The performance improvement could also be put in separate\r
450 patch so I don't have to keep rebasing this uncomfortably big patch for\r
451 much longer.\r
452 \r
453 Thank you for your very detailed review.\r
454 \r
455 Cheers,\r
456 Daniel\r
457 \r
458 --=-=-=\r
459 Content-Type: application/pgp-signature\r
460 \r
461 -----BEGIN PGP SIGNATURE-----\r
462 Version: GnuPG v1.4.11 (GNU/Linux)\r
463 \r
464 iQIcBAEBAgAGBQJPG1q+AAoJEIaTAtce+Z+J6IEP/3Ri3FqBe5x7HAB5gmlPvWdQ\r
465 Kw11Bt9IFbQCmmtvBy8IOgFddWyeu/zaFr/wyHkoqvRpg77t2k5kj9FP2jqTPHQf\r
466 nETumv4KezLOxqcZfnfUgOmcibCGyDgTxLHBlmMXGX0/V/cvCBiBvPwgVzsIQyYC\r
467 X5TJpedvjDzqQc8y8Xit/DJ5JsKQxRIStnRkNRahxp4R/dMcNVai3aGNHw3xnKAv\r
468 IMro9CiTmshi9O2PkXnDpYxNKD5IrjhmTlfffsPNWlPM4d70miUyUTHxhmpre7xn\r
469 sj9OKqmvLkhrdgVsO9CdSyF7YUWWYu2Q3MbI+TcEbgL3lkbY8GLa6y4b5Zm/0QIt\r
470 RQYfkUf7EqR6IMdJ3n/ApEP9/PX6LkutNWh0DtYq3HYjnlBnzEb4V/7bWrnSoj5b\r
471 no7UkenZrYUrTDUBrNkG4kOIyQYTSe5CgR5m4F4N0vHi9r2fNvnBKE8X8D4x5W2Z\r
472 VhpGVzEp36CtAIH7txyiGkYKbgP4tiFybNlrnVU+qCEVHmkvHjW44dLza382E7K7\r
473 GzED/L8YdQTxAZCCkFrvxeS/zbn8JoFAQcuGS1sJ2eQbL1v6L10rkp3w7ciGPSSV\r
474 yU821CrXcb6jA/M6hR9VozkTrh5MhPnWZOclPzDbTTcLcVH+Dn7H3BN6h5PSlUJR\r
475 bqSJmtCLNUDUsBLtFd/d\r
476 =OPgO\r
477 -----END PGP SIGNATURE-----\r
478 --=-=-=--\r