[PATCH] configure: add --without-api-docs option
[notmuch-archives.git] / 07 / 033432c64acc66e8eeb92598cd439ee3d79e8d
1 Return-Path: <bremner@unb.ca>\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 20675431FAF\r
6         for <notmuch@notmuchmail.org>; Mon, 26 Mar 2012 03:32:23 -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: 0\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
12         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 kOKsp0-mdRHT for <notmuch@notmuchmail.org>;\r
16         Mon, 26 Mar 2012 03:32:21 -0700 (PDT)\r
17 Received: from tesseract.cs.unb.ca (tesseract.cs.unb.ca [131.202.240.238])\r
18         (using TLSv1 with cipher AES256-SHA (256/256 bits))\r
19         (No client certificate requested)\r
20         by olra.theworths.org (Postfix) with ESMTPS id C4563431FAE\r
21         for <notmuch@notmuchmail.org>; Mon, 26 Mar 2012 03:32:20 -0700 (PDT)\r
22 Received: from fctnnbsc30w-142166230117.dhcp-dynamic.fibreop.nb.bellaliant.net\r
23         ([142.166.230.117] helo=zancas.localnet)\r
24         by tesseract.cs.unb.ca with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32)\r
25         (Exim 4.72) (envelope-from <bremner@unb.ca>)\r
26         id 1SC7Dm-00085e-7r; Mon, 26 Mar 2012 07:32:19 -0300\r
27 Received: from bremner by zancas.localnet with local (Exim 4.77)\r
28         (envelope-from <bremner@unb.ca>)\r
29         id 1SC7Dg-000586-Qv; Mon, 26 Mar 2012 07:32:12 -0300\r
30 From: David Bremner <bremner@unb.ca>\r
31 To: notmuch@notmuchmail.org\r
32 Subject: [Stefano Zacchiroli] Bug#628018: [PATCH] mutt-notmuch in notmuch\r
33         contrib\r
34 User-Agent: Notmuch/0.12 (http://notmuchmail.org) Emacs/23.3.1\r
35         (x86_64-pc-linux-gnu)\r
36 Date: Mon, 26 Mar 2012 07:32:12 -0300\r
37 Message-ID: <87haxbr6tv.fsf@zancas.localnet>\r
38 MIME-Version: 1.0\r
39 Content-Type: multipart/mixed; boundary="=-=-="\r
40 X-Spam_bar: -\r
41 Cc: Stefano Zacchiroli <zack@debian.org>\r
42 X-BeenThere: notmuch@notmuchmail.org\r
43 X-Mailman-Version: 2.1.13\r
44 Precedence: list\r
45 List-Id: "Use and development of the notmuch mail system."\r
46         <notmuch.notmuchmail.org>\r
47 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
48         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
49 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
50 List-Post: <mailto:notmuch@notmuchmail.org>\r
51 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
52 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
53         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
54 X-List-Received-Date: Mon, 26 Mar 2012 10:32:23 -0000\r
55 \r
56 --=-=-=\r
57 \r
58 \r
59 Hi, this will probably eventually make it to the list, but until then,\r
60 here is a forwarded version. Please keep Stefano in CC, I don't think he's\r
61 subscribed.\r
62 \r
63 \r
64 --=-=-=\r
65 Content-Type: message/rfc822\r
66 Content-Disposition: inline\r
67 Content-Transfer-Encoding: 8bit\r
68 \r
69 Return-path: <bounces+20120325-bremner=debian.org@packages.qa.debian.org>\r
70 Envelope-to: david@tethera.net\r
71 Delivery-date: Sun, 25 Mar 2012 11:29:53 -0300\r
72 Received: from yantan.tethera.net ([67.202.105.224])\r
73         by tesseract.cs.unb.ca with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)\r
74         (Exim 4.72)\r
75         (envelope-from <bounces+20120325-bremner=debian.org@packages.qa.debian.org>)\r
76         id 1SBoS6-0007Ps-Gz\r
77         for david@tethera.net; Sun, 25 Mar 2012 11:29:53 -0300\r
78 Received: from quantz.debian.org ([206.12.19.122])\r
79         by yantan.tethera.net with esmtp (Exim 4.72)\r
80         (envelope-from <bounces+20120325-bremner=debian.org@packages.qa.debian.org>)\r
81         id 1SBoS5-0001U1-C0\r
82         for david@tethera.net; Sun, 25 Mar 2012 11:29:49 -0300\r
83 Received: from qa by quantz.debian.org with local (Exim 4.72)\r
84         (envelope-from <bounces+20120325-bremner=debian.org@packages.qa.debian.org>)\r
85         id 1SBoS4-0005Po-Gi\r
86         for david@tethera.net; Sun, 25 Mar 2012 14:29:48 +0000\r
87 Received: from busoni.debian.org ([140.211.15.34])      from C=NA,ST=NA,\r
88  L=Ankh Morpork,O=Debian SMTP,OU=Debian SMTP CA,CN=busoni.debian.org,\r
89  EMAIL=hostmaster@busoni.debian.org (verified)  by quantz.debian.org with\r
90  esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)        (Exim 4.72)     (envelope-from\r
91  <debbugs@busoni.debian.org>)   id 1SBoS4-0005PY-4y     for\r
92  notmuch@packages.qa.debian.org; Sun, 25 Mar 2012 14:29:48 +0000\r
93 Received: from debbugs by busoni.debian.org with local (Exim 4.72)\r
94  (envelope-from <debbugs@busoni.debian.org>)    id 1SBoS2-0003w7-D7; Sun,\r
95  25 Mar 2012 14:29:47 +0000\r
96 X-Loop: owner@bugs.debian.org\r
97 Subject: Bug#628018: [PATCH] mutt-notmuch in notmuch contrib\r
98 Reply-To: Stefano Zacchiroli <zack@debian.org>, 628018-quiet@bugs.debian.org\r
99 Resent-From: Stefano Zacchiroli <zack@debian.org>\r
100 Resent-To: \r
101 Resent-Date: Sun, 25 Mar 2012 14:29:45 +0000\r
102 Resent-Message-ID: <handler.628018.Q628018.13326841347285@bugs.debian.org>\r
103 X-Loop: owner@bugs.debian.org\r
104 X-Debian-PR-Message: followup 628018\r
105 X-Debian-PR-Package: notmuch\r
106 X-Debian-PR-Keywords: \r
107 X-Debian-PR-Source: notmuch\r
108 Received: via spool by 628018-quiet@bugs.debian.org\r
109  id=Q628018.13326841347285          (code Q ref 628018); Sun,\r
110  25 Mar 2012 14:29:45 +0000\r
111 Received: (at 628018-quiet) by bugs.debian.org; 25 Mar 2012 14:02:14 +0000\r
112 X-Spam-Checker-Version: SpamAssassin 3.3.1-bugs.debian.org_2005_01_02\r
113         (2010-03-16) on busoni.debian.org\r
114 X-Spam-Level: \r
115 X-Spam-Status: No, score=-8.4 required=4.0\r
116  tests=BAYES_00,FOURLA,FROMDEVELOPER,\r
117         IMPRONONCABLE_2,MONEY,MURPHY_DRUGS_REL8,PGPSIGNATURE,STOCKLIKE autolearn=ham\r
118         version=3.3.1-bugs.debian.org_2005_01_02\r
119 X-Spam-Bayes: score:0.0000 Tokens: new, 148; hammy, 151; neutral, 665;\r
120  spammy,        0. spammytokens: hammytokens:0.000-+--H*c:pgp-sha256,\r
121  0.000-+--manpage,      0.000-+--H*u:1.5.21, 0.000-+--H*UA:1.5.21,\r
122  0.000-+--H*u:2010-09-15\r
123 Received: from upsilon.hackadomia.org ([91.121.245.170])        by\r
124  busoni.debian.org with esmtp (Exim 4.72)       (envelope-from <zack@upsilon.cc>)\r
125  id 1SBo15-0001rp-N4    for 628018-quiet@bugs.debian.org; Sun, 25 Mar 2012\r
126  14:02:05 +0000\r
127 Received: from usha.takhisis.invalid\r
128  (did75-22-78-236-196-47.fbx.proxad.net [78.236.196.47])        by\r
129  upsilon.hackadomia.org (Postfix) with ESMTPSA id 41A3A1012D;   Sun,\r
130  25 Mar 2012 16:01:52 +0200 (CEST)\r
131 Received: by usha.takhisis.invalid (Postfix, from userid 1000)  id\r
132  B01B5681E70; Sun, 25 Mar 2012 16:01:51 +0200 (CEST)\r
133 Date: Sun, 25 Mar 2012 16:01:51 +0200\r
134 From: Stefano Zacchiroli <zack@debian.org>\r
135 To: notmuch@notmuchmail.org\r
136 CC: 628018-quiet@bugs.debian.org, David Bremner <bremner@debian.org>,\r
137  Ben Boeckel <mathstuf@gmail.com>\r
138 Message-ID: <20120325140151.GA12546@upsilon.cc>\r
139 References: <87iphszuv1.fsf@zancas.localnet>\r
140 MIME-Version: 1.0\r
141 Content-Type: multipart/signed; micalg=pgp-sha256;\r
142  protocol="application/pgp-signature";\r
143  boundary="CdrF4e02JqNVZeln"\r
144 Content-Disposition: inline\r
145 In-Reply-To: <87iphszuv1.fsf@zancas.localnet>\r
146 User-Agent: Mutt/1.5.21 (2010-09-15)\r
147 Delivered-To: notmuch@packages.qa.debian.org\r
148 Precedence: list\r
149 X-Loop: notmuch@packages.qa.debian.org\r
150 X-Debian: PTS\r
151 X-Debian-Package: notmuch\r
152 X-PTS-Package: notmuch\r
153 X-PTS-Keyword: bts\r
154 List-Unsubscribe: <mailto:pts@qa.debian.org?body=unsubscribe%20notmuch>\r
155 Resent-Sender: Debian QA <qa@quantz.debian.org>\r
156 X-Spam-Score: 0.0\r
157 X-Spam_bar: /\r
158 \r
159 \r
160 --CdrF4e02JqNVZeln\r
161 Content-Type: multipart/mixed; boundary="M9NhX3UHpAaciwkO"\r
162 Content-Disposition: inline\r
163 \r
164 \r
165 --M9NhX3UHpAaciwkO\r
166 Content-Type: text/plain; charset=iso-8859-1\r
167 Content-Disposition: inline\r
168 Content-Transfer-Encoding: quoted-printable\r
169 \r
170 [ please Cc:-me on follow-ups, as I'm not subscribed to the\r
171   notmuch@notmuchmail.org mailing list ]\r
172 \r
173 On Sun, Mar 25, 2012 at 10:13:38AM -0300, David Bremner wrote:\r
174 > In the mean time, we at least have a contrib directory, and I think\r
175 > mutt-notmuch would be welcome there. Could you (or somebody) make a\r
176 > reasonable size patch series that adds it to contrib/mutt-notmuch\r
177 > against current master. The patch series should be sent to the\r
178 > upstream mailing list notmuch@notmuchmail.org for review.\r
179 \r
180 Hi David, thanks for the tip.\r
181 \r
182 Dear notmuch list, please find attached a proposed patch that add a new\r
183 contrib utility called mutt-notmuch for integration with Mutt. Its full\r
184 rationale can be found in the contained README. Background for this\r
185 submission, including previous discussions to ship mutt-notmuch as part\r
186 of notmuch, can be found at\r
187 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=3D628018\r
188 \r
189 I welcome your comments on how to adapt the patch to your preferences\r
190 for contrib/, err, contributions.\r
191 \r
192 > On the debian side your patch series could also include the necessary\r
193 > changes to make a new binary package.\r
194 \r
195 I'll be pleased to do so when/if mutt-notmuch is accepted in contrib/,\r
196 just out of general laziness for potentially useless work :-)\r
197 \r
198 Thanks,\r
199 Cheers.\r
200 --=20\r
201 Stefano Zacchiroli     zack@{upsilon.cc,pps.jussieu.fr,debian.org} . o .\r
202 Ma=EEtre de conf=E9rences   ......   http://upsilon.cc/zack   ......   . . o\r
203 Debian Project Leader    .......   @zack on identi.ca   .......    o o o\r
204 =AB the first rule of tautology club is the first rule of tautology club =BB\r
205 \r
206 --M9NhX3UHpAaciwkO\r
207 Content-Type: text/x-diff; charset=iso-8859-1\r
208 Content-Disposition: attachment; filename="0001-contrib-new-utility-mutt-notmuch-for-Mutt-integratio.patch"\r
209 Content-Transfer-Encoding: quoted-printable\r
210 \r
211 =46rom 8f5be32912920c2c5eca7084885c0e2498540311 Mon Sep 17 00:00:00 2001\r
212 =46rom: Stefano Zacchiroli <zack@upsilon.cc>\r
213 Date: Sun, 25 Mar 2012 15:55:44 +0200\r
214 Subject: [PATCH] contrib: new utility mutt-notmuch for Mutt integration\r
215 \r
216 ---\r
217  contrib/mutt-notmuch/Makefile       |   12 ++\r
218  contrib/mutt-notmuch/README         |   58 +++++++++\r
219  contrib/mutt-notmuch/mutt-notmuch   |  234 +++++++++++++++++++++++++++++++=\r
220 ++++\r
221  contrib/mutt-notmuch/mutt-notmuch.1 |  210 +++++++++++++++++++++++++++++++\r
222  4 files changed, 514 insertions(+), 0 deletions(-)\r
223  create mode 100644 contrib/mutt-notmuch/Makefile\r
224  create mode 100644 contrib/mutt-notmuch/README\r
225  create mode 100755 contrib/mutt-notmuch/mutt-notmuch\r
226  create mode 100644 contrib/mutt-notmuch/mutt-notmuch.1\r
227 \r
228 diff --git a/contrib/mutt-notmuch/Makefile b/contrib/mutt-notmuch/Makefile\r
229 new file mode 100644\r
230 index 0000000..b78953d\r
231 --- /dev/null\r
232 +++ b/contrib/mutt-notmuch/Makefile\r
233 @@ -0,0 +1,12 @@\r
234 +NAME =3D mutt-notmuch\r
235 +\r
236 +all: $(NAME) $(NAME).1\r
237 +\r
238 +$(NAME).1: $(NAME)\r
239 +       pod2man $< > $@\r
240 +\r
241 +README.html: README\r
242 +       markdown $< > $@\r
243 +\r
244 +clean:\r
245 +       rm -f mutt-notmuch.1 README.html\r
246 diff --git a/contrib/mutt-notmuch/README b/contrib/mutt-notmuch/README\r
247 new file mode 100644\r
248 index 0000000..e72aa91\r
249 --- /dev/null\r
250 +++ b/contrib/mutt-notmuch/README\r
251 @@ -0,0 +1,58 @@\r
252 +mutt-notmuch: Notmuch (of a) helper for Mutt\r
253 +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=\r
254 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D\r
255 +\r
256 +mutt-notmuch provide integration among the [Mutt] [1] mail user agent and =\r
257 the\r
258 +[Notmuch] [2] mail indexer.\r
259 +\r
260 +mutt-notmuch offer two basic integration features. The first one is the ab=\r
261 ility\r
262 +of stating a **search query interactively** and then jump to a fresh Maild=\r
263 ir\r
264 +containing its search results only. The second one is the ability to\r
265 +**reconstruct threads on the fly** starting from the currently highlighted\r
266 +mail, which comes handy when a thread has been split across different mail=\r
267 dirs,\r
268 +archived, or the like.\r
269 +\r
270 +mutt-notmuch enables to trigger mail searches via a Mutt macro (F8 being my\r
271 +choice) and reconstruct threads via another (F9). Check the manpage for the\r
272 +2-liner configuration snippet for your ~/.muttrc.\r
273 +\r
274 +A [blog style introduction] [3] to mutt-notmuch is available and includes =\r
275 some\r
276 +more rationale for its existence.\r
277 +\r
278 +Arguably, some of the logics of mutt-notmuch could disappear by adding sup=\r
279 port\r
280 +for a --output=3Dsymlinks flag to notmuch.\r
281 +\r
282 +\r
283 +[1]: http://www.mutt.org/\r
284 +[2]: http://notmuchmail.org/\r
285 +[3]: http://upsilon.cc/~zack/blog/posts/2011/01/how_to_use_Notmuch_with_Mu=\r
286 tt/\r
287 +\r
288 +\r
289 +Requirements\r
290 +------------\r
291 +\r
292 +To *run* mutt-notmuch you will need Perl with the following libraries:\r
293 +\r
294 +- Mail::Box <http://search.cpan.org/~markov/Mail-Box/>\r
295 +  (Debian package: libmail-box-perl)\r
296 +- Mail::Internet <http://search.cpan.org/~markov/MailTools/>\r
297 +  (Debian package: libmailtools-perl)\r
298 +- String::ShellQuote <http://search.cpan.org/~rosch/String-ShellQuote/Shel=\r
299 lQuote.pm>\r
300 +  (Debian package: libstring-shellquote-perl)\r
301 +- Term::ReadLine <http://search.cpan.org/~hayashi/Term-ReadLine-Gnu/>\r
302 +  (Debian package: libterm-readline-gnu-perl)\r
303 +\r
304 +To *build* mutt-notmuch documentation you will need:\r
305 +\r
306 +- pod2man (coming with Perl) to generate the manpage\r
307 +- markdown to generate README.html out of this file\r
308 +\r
309 +\r
310 +License\r
311 +-------\r
312 +\r
313 +mutt-notmuch is copyright (C) 2011-2012 Stefano Zacchiroli <zack@upsilon.c=\r
314 c>.\r
315 +\r
316 +mutt-notmuch is released under the terms of the GNU General Public License\r
317 +(GPL), version 3 or above. A copy of the license is available online at\r
318 +<http://www.gnu.org/licenses/>.\r
319 +\r
320 diff --git a/contrib/mutt-notmuch/mutt-notmuch b/contrib/mutt-notmuch/mutt-=\r
321 notmuch\r
322 new file mode 100755\r
323 index 0000000..31cb539\r
324 --- /dev/null\r
325 +++ b/contrib/mutt-notmuch/mutt-notmuch\r
326 @@ -0,0 +1,234 @@\r
327 +#!/usr/bin/perl -w\r
328 +#\r
329 +# mutt-notmuch - notmuch (of a) helper for Mutt\r
330 +#\r
331 +# Copyright: =A9 2011-2012 Stefano Zacchiroli <zack@upsilon.cc>=20\r
332 +# License: GNU General Public License (GPL), version 3 or above\r
333 +#\r
334 +# See the bottom of this file for more documentation.\r
335 +# A manpage can be obtained by running "pod2man mutt-notmuch > mutt-notmuc=\r
336 h.1"\r
337 +\r
338 +use strict;\r
339 +use warnings;\r
340 +\r
341 +use File::Path;\r
342 +use Getopt::Long qw(:config no_getopt_compat);\r
343 +use Mail::Internet;\r
344 +use Mail::Box::Maildir;\r
345 +use Pod::Usage;\r
346 +use String::ShellQuote;\r
347 +use Term::ReadLine;\r
348 +\r
349 +\r
350 +# create an empty maildir (if missing) or empty an existing maildir"\r
351 +sub empty_maildir($) {\r
352 +    my ($maildir) =3D (@_);\r
353 +    rmtree($maildir) if (-d $maildir);\r
354 +    my $folder =3D new Mail::Box::Maildir(folder =3D> $maildir,\r
355 +                                       create =3D> 1);\r
356 +    $folder->close();\r
357 +}\r
358 +\r
359 +# search($maildir, $query)\r
360 +# search mails according to $query with notmuch; store results in $maildir\r
361 +sub search($$) {\r
362 +    my ($maildir, $query) =3D @_;\r
363 +    $query =3D shell_quote($query);\r
364 +\r
365 +    empty_maildir($maildir);\r
366 +    system("notmuch search --output=3Dfiles $query"\r
367 +          . " | sed -e 's: :\\\\ :g'"\r
368 +          . " | xargs --no-run-if-empty ln -s -t $maildir/cur/");\r
369 +}\r
370 +\r
371 +sub prompt($$) {\r
372 +    my ($text, $default) =3D @_;\r
373 +    my $query =3D "";\r
374 +    my $term =3D Term::ReadLine->new( "mutt-notmuch" );\r
375 +    $term->ornaments( 0 );\r
376 +    $term->unbind_key( ord( "\t" ) );\r
377 +    $term->MinLine( 3 );\r
378 +    if ($ENV{MUTT_NOTMUCH_HISTFILE} && -r "$ENV{MUTT_NOTMUCH_HISTFILE}") {\r
379 +      $term->ReadHistory("$ENV{MUTT_NOTMUCH_HISTFILE}");\r
380 +    } elsif (-r "$ENV{HOME}/.mutt-notmuch.history") {\r
381 +      $term->ReadHistory("$ENV{HOME}/.mutt-notmuch.history");\r
382 +    }\r
383 +    while (1) {\r
384 +       chomp($query =3D $term->readline($text, $default));\r
385 +       if ($query eq "?") {\r
386 +           system("man", "notmuch");\r
387 +       } else {\r
388 +       if (!$ENV{MUTT_NOTMUCH_HISTFILE} ||\r
389 +           !$term->WriteHistory("$ENV{MUTT_NOTMUCH_HISTFILE}")) {\r
390 +         $term->WriteHistory("$ENV{HOME}/.mutt-notmuch.history");\r
391 +       }\r
392 +           return $query;\r
393 +       }\r
394 +    }\r
395 +}\r
396 +\r
397 +sub get_message_id() {\r
398 +    my $mail =3D Mail::Internet->new(\*STDIN);\r
399 +    $mail->head->get("message-id") =3D~ /^<(.*)>$/;    # get message-id\r
400 +    return $1;\r
401 +}\r
402 +\r
403 +sub search_action($$@) {\r
404 +    my ($interactive, $results_dir, @params) =3D @_;\r
405 +\r
406 +    if (! $interactive) {\r
407 +       search($results_dir, join(' ', @params));\r
408 +    } else {\r
409 +       my $query =3D prompt("search ('?' for man): ", join(' ', @params));\r
410 +       if ($query ne "") {\r
411 +           search($results_dir,$query);\r
412 +       }\r
413 +    }\r
414 +}\r
415 +\r
416 +sub thread_action(@) {\r
417 +    my ($results_dir, @params) =3D @_;\r
418 +    my $mid =3D get_message_id();\r
419 +    my $tid =3D `notmuch search --output=3Dthreads id:$mid`;# get thread id\r
420 +    chomp($tid);\r
421 +\r
422 +    search($results_dir, $tid);\r
423 +}\r
424 +\r
425 +sub tag_action(@) {\r
426 +    my $mid =3D get_message_id();\r
427 +\r
428 +    system("notmuch tag "\r
429 +          . shell_quote(join(' ', @_))\r
430 +          . " id:$mid");\r
431 +}\r
432 +\r
433 +sub die_usage() {\r
434 +    my %podflags =3D ( "verbose" =3D> 1,\r
435 +                   "exitval" =3D> 2 );\r
436 +    pod2usage(%podflags);\r
437 +}\r
438 +\r
439 +sub main() {\r
440 +    my $results_dir =3D "$ENV{HOME}/.cache/mutt_results";\r
441 +    my $interactive =3D 0;\r
442 +    my $help_needed =3D 0;\r
443 +\r
444 +    my $getopt =3D GetOptions(\r
445 +       "h|help" =3D> \$help_needed,\r
446 +       "o|output-dir=3Ds" =3D> \$results_dir,\r
447 +       "p|prompt" =3D> \$interactive);\r
448 +    if (! $getopt || $#ARGV < 0) { die_usage() };\r
449 +    my ($action, @params) =3D ($ARGV[0], @ARGV[1..$#ARGV]);\r
450 +\r
451 +    foreach my $param (@params) {\r
452 +      $param =3D~ s/folder:=3D/folder:/g;\r
453 +    }\r
454 +\r
455 +    if ($help_needed) {\r
456 +       die_usage();\r
457 +    } elsif ($action eq "search" && $#ARGV =3D=3D 0 && ! $interactive) {\r
458 +       print STDERR "Error: no search term provided\n\n";\r
459 +       die_usage();\r
460 +    } elsif ($action eq "search") {\r
461 +       search_action($interactive, $results_dir, @params);\r
462 +    } elsif ($action eq "thread") {\r
463 +       thread_action($results_dir, @params);\r
464 +    } elsif ($action eq "tag") {\r
465 +       tag_action(@params);\r
466 +    } else {\r
467 +       die_usage();\r
468 +    }\r
469 +}\r
470 +\r
471 +main();\r
472 +\r
473 +__END__\r
474 +\r
475 +=3Dhead1 NAME\r
476 +\r
477 +mutt-notmuch - notmuch (of a) helper for Mutt\r
478 +\r
479 +=3Dhead1 SYNOPSIS\r
480 +\r
481 +=3Dover\r
482 +\r
483 +=3Ditem B<mutt-notmuch> [I<OPTION>]... search [I<SEARCH-TERM>]...\r
484 +\r
485 +=3Ditem B<mutt-notmuch> [I<OPTION>]... thread < I<MAIL>\r
486 +\r
487 +=3Ditem B<mutt-notmuch> [I<OPTION>]... tag [I<TAGS>]... < I<MAIL>\r
488 +\r
489 +=3Dback\r
490 +\r
491 +=3Dhead1 DESCRIPTION\r
492 +\r
493 +mutt-notmuch is a frontend to the notmuch mail indexer capable of populati=\r
494 ng\r
495 +maildir with search results.\r
496 +\r
497 +=3Dhead1 OPTIONS\r
498 +\r
499 +=3Dover 4\r
500 +\r
501 +=3Ditem -o DIR\r
502 +\r
503 +=3Ditem --output-dir DIR\r
504 +\r
505 +Store search results as (symlink) messages under maildir DIR. Beware: DIR =\r
506 will\r
507 +be overwritten. (Default: F<~/.cache/mutt_results/>)\r
508 +\r
509 +=3Ditem -p\r
510 +\r
511 +=3Ditem --prompt\r
512 +\r
513 +Instead of using command line search terms, prompt the user for them (only=\r
514  for\r
515 +"search").\r
516 +\r
517 +=3Ditem -h\r
518 +\r
519 +=3Ditem --help\r
520 +\r
521 +Show usage information and exit.\r
522 +\r
523 +=3Dback\r
524 +\r
525 +=3Dhead1 INTEGRATION WITH MUTT\r
526 +\r
527 +mutt-notmuch can be used to integrate notmuch with the Mutt mail user agent\r
528 +(unsurprisingly, given the name). To that end, you should define the follo=\r
529 wing\r
530 +macros in your F<~/.muttrc> (replacing F<~/bin/mutt-notmuch> for the actual\r
531 +location of mutt-notmuch on your system):\r
532 +\r
533 +    macro index <F8> \\r
534 +          "<enter-command>unset wait_key<enter><shell-escape>~/bin/mutt-no=\r
535 tmuch --prompt search<enter><change-folder-readonly>~/.cache/mutt_results<e=\r
536 nter>" \\r
537 +          "search mail (using notmuch)"\r
538 +    macro index <F9> \\r
539 +          "<enter-command>unset wait_key<enter><pipe-message>~/bin/mutt-no=\r
540 tmuch thread<enter><change-folder-readonly>~/.cache/mutt_results<enter><ent=\r
541 er-command>set wait_key<enter>" \\r
542 +          "search and reconstruct owning thread (using notmuch)"\r
543 +    macro index <F6> \\r
544 +          "<enter-command>unset wait_key<enter><pipe-message>~/bin/mutt-no=\r
545 tmuch tag -inbox<enter>" \\r
546 +          "remove message from inbox (using notmuch)"\r
547 +\r
548 +The first macro (activated by <F8>) will prompt the user for notmuch search\r
549 +terms and then jump to a temporary maildir showing search results. The sec=\r
550 ond\r
551 +macro (activated by <F9>) will reconstruct the thread corresponding to the\r
552 +current mail and show it as search results. The third macro (activated by =\r
553 <F6>)\r
554 +removes the tag C<inbox> from the current message; by changing C<-inbox> t=\r
555 his\r
556 +macro may be customised to add or remove tags appropriate to the users not=\r
557 much\r
558 +work-flow.\r
559 +\r
560 +To keep notmuch index current you should then periodically run C<notmuch\r
561 +new>. Depending on your local mail setup, you might want to do that via cr=\r
562 on,\r
563 +as a hook triggered by mail retrieval, etc.\r
564 +\r
565 +=3Dhead1 SEE ALSO\r
566 +\r
567 +mutt(1), notmuch(1)\r
568 +\r
569 +=3Dhead1 AUTHOR\r
570 +\r
571 +Copyright: (C) 2011-2012 Stefano Zacchiroli <zack@upsilon.cc>\r
572 +\r
573 +License: GNU General Public License (GPL), version 3 or higher\r
574 +\r
575 +=3Dcut\r
576 diff --git a/contrib/mutt-notmuch/mutt-notmuch.1 b/contrib/mutt-notmuch/mut=\r
577 t-notmuch.1\r
578 new file mode 100644\r
579 index 0000000..fe5e653\r
580 --- /dev/null\r
581 +++ b/contrib/mutt-notmuch/mutt-notmuch.1\r
582 @@ -0,0 +1,210 @@\r
583 +.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.16)\r
584 +.\"\r
585 +.\" Standard preamble:\r
586 +.\" =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=\r
587 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=\r
588 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D\r
589 +.de Sp \" Vertical space (when we can't use .PP)\r
590 +.if t .sp .5v\r
591 +.if n .sp\r
592 +..\r
593 +.de Vb \" Begin verbatim text\r
594 +.ft CW\r
595 +.nf\r
596 +.ne \\$1\r
597 +..\r
598 +.de Ve \" End verbatim text\r
599 +.ft R\r
600 +.fi\r
601 +..\r
602 +.\" Set up some character translations and predefined strings.  \*(-- will\r
603 +.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left\r
604 +.\" double quote, and \*(R" will give a right double quote.  \*(C+ will\r
605 +.\" give a nicer C++.  Capital omega is used to do unbreakable dashes and\r
606 +.\" therefore won't be available.  \*(C` and \*(C' expand to `' in nroff,\r
607 +.\" nothing in troff, for use with C<>.\r
608 +.tr \(*W-\r
609 +.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'\r
610 +.ie n \{\\r
611 +.    ds -- \(*W-\r
612 +.    ds PI pi\r
613 +.    if (\n(.H=3D4u)&(1m=3D24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo =\r
614 10 pitch\r
615 +.    if (\n(.H=3D4u)&(1m=3D20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\"  diablo =\r
616 12 pitch\r
617 +.    ds L" ""\r
618 +.    ds R" ""\r
619 +.    ds C` ""\r
620 +.    ds C' ""\r
621 +'br\}\r
622 +.el\{\\r
623 +.    ds -- \|\(em\|\r
624 +.    ds PI \(*p\r
625 +.    ds L" ``\r
626 +.    ds R" ''\r
627 +'br\}\r
628 +.\"\r
629 +.\" Escape single quotes in literal strings from groff's Unicode transform.\r
630 +.ie \n(.g .ds Aq \(aq\r
631 +.el       .ds Aq '\r
632 +.\"\r
633 +.\" If the F register is turned on, we'll generate index entries on stderr=\r
634  for\r
635 +.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index\r
636 +.\" entries marked with X<> in POD.  Of course, you'll have to process the\r
637 +.\" output yourself in some meaningful fashion.\r
638 +.ie \nF \{\\r
639 +.    de IX\r
640 +.    tm Index:\\$1\t\\n%\t"\\$2"\r
641 +..\r
642 +.    nr % 0\r
643 +.    rr F\r
644 +.\}\r
645 +.el \{\\r
646 +.    de IX\r
647 +..\r
648 +.\}\r
649 +.\"\r
650 +.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).\r
651 +.\" Fear.  Run.  Save yourself.  No user-serviceable parts.\r
652 +.    \" fudge factors for nroff and troff\r
653 +.if n \{\\r
654 +.    ds #H 0\r
655 +.    ds #V .8m\r
656 +.    ds #F .3m\r
657 +.    ds #[ \f1\r
658 +.    ds #] \fP\r
659 +.\}\r
660 +.if t \{\\r
661 +.    ds #H ((1u-(\\\\n(.fu%2u))*.13m)\r
662 +.    ds #V .6m\r
663 +.    ds #F 0\r
664 +.    ds #[ \&\r
665 +.    ds #] \&\r
666 +.\}\r
667 +.    \" simple accents for nroff and troff\r
668 +.if n \{\\r
669 +.    ds ' \&\r
670 +.    ds ` \&\r
671 +.    ds ^ \&\r
672 +.    ds , \&\r
673 +.    ds ~ ~\r
674 +.    ds /\r
675 +.\}\r
676 +.if t \{\\r
677 +.    ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"\r
678 +.    ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'\r
679 +.    ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'\r
680 +.    ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'\r
681 +.    ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'\r
682 +.    ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'\r
683 +.\}\r
684 +.    \" troff and (daisy-wheel) nroff accents\r
685 +.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h=\r
686 '|\\n:u'\v'\*(#V'\r
687 +.ds 8 \h'\*(#H'\(*b\h'-\*(#H'\r
688 +.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\=\r
689 \n:u'\*(#]\r
690 +.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'\r
691 +.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'\r
692 +.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]\r
693 +.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]\r
694 +.ds ae a\h'-(\w'a'u*4/10)'e\r
695 +.ds Ae A\h'-(\w'A'u*4/10)'E\r
696 +.    \" corrections for vroff\r
697 +.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'\r
698 +.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'\r
699 +.    \" for low resolution devices (crt and lpr)\r
700 +.if \n(.H>23 .if \n(.V>19 \\r
701 +\{\\r
702 +.    ds : e\r
703 +.    ds 8 ss\r
704 +.    ds o a\r
705 +.    ds d- d\h'-1'\(ga\r
706 +.    ds D- D\h'-1'\(hy\r
707 +.    ds th \o'bp'\r
708 +.    ds Th \o'LP'\r
709 +.    ds ae ae\r
710 +.    ds Ae AE\r
711 +.\}\r
712 +.rm #[ #] #H #V #F C\r
713 +.\" =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=\r
714 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=\r
715 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D\r
716 +.\"\r
717 +.IX Title "MUTT-NOTMUCH 1"\r
718 +.TH MUTT-NOTMUCH 1 "2012-03-25" "perl v5.14.2" "User Contributed Perl Docu=\r
719 mentation"\r
720 +.\" For nroff, turn off justification.  Always turn off hyphenation; it ma=\r
721 kes\r
722 +.\" way too many mistakes in technical documents.\r
723 +.if n .ad l\r
724 +.nh\r
725 +.SH "NAME"\r
726 +mutt\-notmuch \- notmuch (of a) helper for Mutt\r
727 +.SH "SYNOPSIS"\r
728 +.IX Header "SYNOPSIS"\r
729 +.IP "\fBmutt-notmuch\fR [\fI\s-1OPTION\s0\fR]... search [\fISEARCH-TERM\fR=\r
730 ]..." 4\r
731 +.IX Item "mutt-notmuch [OPTION]... search [SEARCH-TERM]..."\r
732 +.PD 0\r
733 +.IP "\fBmutt-notmuch\fR [\fI\s-1OPTION\s0\fR]... thread < \fI\s-1MAIL\s0\f=\r
734 R" 4\r
735 +.IX Item "mutt-notmuch [OPTION]... thread < MAIL"\r
736 +.IP "\fBmutt-notmuch\fR [\fI\s-1OPTION\s0\fR]... tag [\fI\s-1TAGS\s0\fR]..=\r
737 =2E < \fI\s-1MAIL\s0\fR" 4\r
738 +.IX Item "mutt-notmuch [OPTION]... tag [TAGS]... < MAIL"\r
739 +.PD\r
740 +.SH "DESCRIPTION"\r
741 +.IX Header "DESCRIPTION"\r
742 +mutt-notmuch is a frontend to the notmuch mail indexer capable of populati=\r
743 ng\r
744 +maildir with search results.\r
745 +.SH "OPTIONS"\r
746 +.IX Header "OPTIONS"\r
747 +.IP "\-o \s-1DIR\s0" 4\r
748 +.IX Item "-o DIR"\r
749 +.PD 0\r
750 +.IP "\-\-output\-dir \s-1DIR\s0" 4\r
751 +.IX Item "--output-dir DIR"\r
752 +.PD\r
753 +Store search results as (symlink) messages under maildir \s-1DIR\s0. Bewar=\r
754 e: \s-1DIR\s0 will\r
755 +be overwritten. (Default: \fI~/.cache/mutt_results/\fR)\r
756 +.IP "\-p" 4\r
757 +.IX Item "-p"\r
758 +.PD 0\r
759 +.IP "\-\-prompt" 4\r
760 +.IX Item "--prompt"\r
761 +.PD\r
762 +Instead of using command line search terms, prompt the user for them (only=\r
763  for\r
764 +\&\*(L"search\*(R").\r
765 +.IP "\-h" 4\r
766 +.IX Item "-h"\r
767 +.PD 0\r
768 +.IP "\-\-help" 4\r
769 +.IX Item "--help"\r
770 +.PD\r
771 +Show usage information and exit.\r
772 +.SH "INTEGRATION WITH MUTT"\r
773 +.IX Header "INTEGRATION WITH MUTT"\r
774 +mutt-notmuch can be used to integrate notmuch with the Mutt mail user agent\r
775 +(unsurprisingly, given the name). To that end, you should define the follo=\r
776 wing\r
777 +macros in your \fI~/.muttrc\fR (replacing \fI~/bin/mutt\-notmuch\fR for th=\r
778 e actual\r
779 +location of mutt-notmuch on your system):\r
780 +.PP\r
781 +.Vb 9\r
782 +\&    macro index <F8> \e\r
783 +\&          "<enter\-command>unset wait_key<enter><shell\-escape>~/bin/mut=\r
784 t\-notmuch \-\-prompt search<enter><change\-folder\-readonly>~/.cache/mutt_=\r
785 results<enter>" \e\r
786 +\&          "search mail (using notmuch)"\r
787 +\&    macro index <F9> \e\r
788 +\&          "<enter\-command>unset wait_key<enter><pipe\-message>~/bin/mut=\r
789 t\-notmuch thread<enter><change\-folder\-readonly>~/.cache/mutt_results<ent=\r
790 er><enter\-command>set wait_key<enter>" \e\r
791 +\&          "search and reconstruct owning thread (using notmuch)"\r
792 +\&    macro index <F6> \e\r
793 +\&          "<enter\-command>unset wait_key<enter><pipe\-message>~/bin/mut=\r
794 t\-notmuch tag \-inbox<enter>" \e\r
795 +\&          "remove message from inbox (using notmuch)"\r
796 +.Ve\r
797 +.PP\r
798 +The first macro (activated by <F8>) will prompt the user for notmuch search\r
799 +terms and then jump to a temporary maildir showing search results. The sec=\r
800 ond\r
801 +macro (activated by <F9>) will reconstruct the thread corresponding to the\r
802 +current mail and show it as search results. The third macro (activated by =\r
803 <F6>)\r
804 +removes the tag \f(CW\*(C`inbox\*(C'\fR from the current message; by chang=\r
805 ing \f(CW\*(C`\-inbox\*(C'\fR this\r
806 +macro may be customised to add or remove tags appropriate to the users not=\r
807 much\r
808 +work-flow.\r
809 +.PP\r
810 +To keep notmuch index current you should then periodically run \f(CW\*(C`n=\r
811 otmuch\r
812 +new\*(C'\fR. Depending on your local mail setup, you might want to do that=\r
813  via cron,\r
814 +as a hook triggered by mail retrieval, etc.\r
815 +.SH "SEE ALSO"\r
816 +.IX Header "SEE ALSO"\r
817 +\&\fImutt\fR\|(1), \fInotmuch\fR\|(1)\r
818 +.SH "AUTHOR"\r
819 +.IX Header "AUTHOR"\r
820 +Copyright: (C) 2011\-2012 Stefano Zacchiroli <zack@upsilon.cc>\r
821 +.PP\r
822 +License: \s-1GNU\s0 General Public License (\s-1GPL\s0), version 3 or high=\r
823 er\r
824 --=20\r
825 1.7.9.1\r
826 \r
827 \r
828 --M9NhX3UHpAaciwkO--\r
829 \r
830 --CdrF4e02JqNVZeln\r
831 Content-Type: application/pgp-signature; name="signature.asc"\r
832 Content-Description: Digital signature\r
833 \r
834 -----BEGIN PGP SIGNATURE-----\r
835 Version: GnuPG v1.4.12 (GNU/Linux)\r
836 \r
837 iQIVAwUBT28lTJwxUDxthmOWAQi4HBAAhTUufin73Rp4vQKKJWQPorfz/ytWL4kd\r
838 rM2i+gsL+onUGjpiLWhqAl/50qtiJzYoq4OyauRaqc3lHedlv63I+9l5RZwdaosP\r
839 dYClOnqyJizyfEuFqEXIU+39lmY92HhQuaFV+s2hHJjpVdk14+majInT5VDHykw0\r
840 gP9YiqEbiki22mLX8nNrSEqQ6nNjgj9602airLn5HCWHUA3VfsB6fOMbzAswFjch\r
841 FmuVfs5w8JtCvYvzThMTXjg2cfi1EHuWqElu+F61O8zZBb8fMHPTj+0VHwLyeWx6\r
842 iynn/wT7bm+t0unUuxfA89VjrACxuznCPJfRYDBi+GVu100jO+fG0JHmnYFvnVXb\r
843 pIHFG1DW/L8QuwkFUbA+dX5B/TrF0F71fFVUvur65qO2aSSZexsIPXIwhec4Xg2l\r
844 Bqt2qNzN47p4y/cbacBn452bxr8NcMBgDyEnFcd0U99Xhgl8G7G20IFeasJEqbZn\r
845 GiHm4gICNs4Rgho3D/vVI7tmi/XU8K/bZ9D2hQBB4AN8N7+WElzSQCX1koa3EWuc\r
846 JHuEfeJbEwdrDa5QYg/+3ZyE0T9KXEElPTV94dKAm/wZ9RCzysH3X2aL+9bXaSzs\r
847 Hh3iJsZjwn9PtJn7ofoKVRYW3DOTdNnkzjlJHEvSy9NsEOYmnNGKcD0d/8M0OdEk\r
848 R9alqj5Lw5o=\r
849 =y9sK\r
850 -----END PGP SIGNATURE-----\r
851 \r
852 --CdrF4e02JqNVZeln--\r
853 \r
854 \r
855 \r
856 \r
857 --=-=-=--\r