[PATCH] configure: add --without-api-docs option
[notmuch-archives.git] / 47 / 3638e759ad28f8ea96201f7173532e54bd5d22
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 637C9431FBD\r
6         for <notmuch@notmuchmail.org>; Mon, 26 Mar 2012 03:37:29 -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 aI0TTzHDlbuS for <notmuch@notmuchmail.org>;\r
16         Mon, 26 Mar 2012 03:37:27 -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 A2C53431FAE\r
21         for <notmuch@notmuchmail.org>; Mon, 26 Mar 2012 03:37:27 -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 1SC7Ij-00085s-NM; Mon, 26 Mar 2012 07:37:26 -0300\r
27 Received: from bremner by zancas.localnet with local (Exim 4.77)\r
28         (envelope-from <bremner@unb.ca>)\r
29         id 1SC7Ie-0005BK-DO; Mon, 26 Mar 2012 07:37:20 -0300\r
30 From: David Bremner <david@tethera.net>\r
31 To: notmuch@notmuchmail.org\r
32 Subject: [Stefano Zacchiroli] Bug#628018: [PATCH] notmuch-mutt utility for\r
33         notmuch/contrib/\r
34 In-Reply-To: <87haxbr6tv.fsf@zancas.localnet>\r
35 User-Agent: Notmuch/0.12 (http://notmuchmail.org) Emacs/23.3.1\r
36         (x86_64-pc-linux-gnu)\r
37 Date: Mon, 26 Mar 2012 07:37:20 -0300\r
38 Message-ID: <87ehsfr6lb.fsf@zancas.localnet>\r
39 MIME-Version: 1.0\r
40 Content-Type: message/rfc822\r
41 Content-Disposition: inline\r
42 Content-Transfer-Encoding: 8bit\r
43 X-Spam_bar: -\r
44 X-BeenThere: notmuch@notmuchmail.org\r
45 X-Mailman-Version: 2.1.13\r
46 Precedence: list\r
47 List-Id: "Use and development of the notmuch mail system."\r
48         <notmuch.notmuchmail.org>\r
49 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
50         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
51 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
52 List-Post: <mailto:notmuch@notmuchmail.org>\r
53 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
54 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
55         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
56 X-List-Received-Date: Mon, 26 Mar 2012 10:37:29 -0000\r
57 \r
58 Return-path: <bounces+20120326-bremner=debian.org@packages.qa.debian.org>\r
59 Envelope-to: david@tethera.net\r
60 Delivery-date: Mon, 26 Mar 2012 06:39:14 -0300\r
61 Received: from yantan.tethera.net ([67.202.105.224])\r
62         by tesseract.cs.unb.ca with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)\r
63         (Exim 4.72)\r
64         (envelope-from <bounces+20120326-bremner=debian.org@packages.qa.debian.org>)\r
65         id 1SC6OO-00083z-Gx\r
66         for david@tethera.net; Mon, 26 Mar 2012 06:39:14 -0300\r
67 Received: from quantz.debian.org ([206.12.19.122])\r
68         by yantan.tethera.net with esmtp (Exim 4.72)\r
69         (envelope-from <bounces+20120326-bremner=debian.org@packages.qa.debian.org>)\r
70         id 1SC6OL-00028f-Rv\r
71         for david@tethera.net; Mon, 26 Mar 2012 06:39:10 -0300\r
72 Received: from qa by quantz.debian.org with local (Exim 4.72)\r
73         (envelope-from <bounces+20120326-bremner=debian.org@packages.qa.debian.org>)\r
74         id 1SC6OK-0007gg-HH\r
75         for david@tethera.net; Mon, 26 Mar 2012 09:39:08 +0000\r
76 Received: from busoni.debian.org ([140.211.15.34])      from C=NA,ST=NA,\r
77  L=Ankh Morpork,O=Debian SMTP,OU=Debian SMTP CA,CN=busoni.debian.org,\r
78  EMAIL=hostmaster@busoni.debian.org (verified)  by quantz.debian.org with\r
79  esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)        (Exim 4.72)     (envelope-from\r
80  <debbugs@busoni.debian.org>)   id 1SC6OK-0007g8-4K     for\r
81  notmuch@packages.qa.debian.org; Mon, 26 Mar 2012 09:39:08 +0000\r
82 Received: from debbugs by busoni.debian.org with local (Exim 4.72)\r
83  (envelope-from <debbugs@busoni.debian.org>)    id 1SC6OJ-0003wK-8d; Mon,\r
84  26 Mar 2012 09:39:07 +0000\r
85 X-Loop: owner@bugs.debian.org\r
86 Subject: Bug#628018: [PATCH] notmuch-mutt utility for notmuch/contrib/\r
87 Reply-To: Stefano Zacchiroli <zack@debian.org>, 628018@bugs.debian.org\r
88 Resent-From: Stefano Zacchiroli <zack@debian.org>\r
89 Resent-To: debian-bugs-dist@lists.debian.org\r
90 Resent-CC: Carl Worth <cworth@debian.org>\r
91 X-Loop: owner@bugs.debian.org\r
92 Resent-Date: Mon, 26 Mar 2012 09:39:05 +0000\r
93 Resent-Message-ID: <handler.628018.B628018.133275457414603@bugs.debian.org>\r
94 X-Debian-PR-Message: followup 628018\r
95 X-Debian-PR-Package: notmuch\r
96 X-Debian-PR-Keywords: patch\r
97 X-Debian-PR-Source: notmuch\r
98 Received: via spool by 628018-submit@bugs.debian.org\r
99  id=B628018.133275457414603          (code B ref 628018); Mon,\r
100  26 Mar 2012 09:39:05 +0000\r
101 Received: (at 628018) by bugs.debian.org; 26 Mar 2012 09:36:14 +0000\r
102 X-Spam-Checker-Version: SpamAssassin 3.3.1-bugs.debian.org_2005_01_02\r
103         (2010-03-16) on busoni.debian.org\r
104 X-Spam-Level: \r
105 X-Spam-Status: No, score=-8.4 required=4.0\r
106  tests=BAYES_00,FOURLA,FROMDEVELOPER,\r
107         IMPRONONCABLE_2,MONEY,MURPHY_DRUGS_REL8,PGPSIGNATURE,STOCKLIKE autolearn=ham\r
108         version=3.3.1-bugs.debian.org_2005_01_02\r
109 X-Spam-Bayes: score:0.0000 Tokens: new, 19; hammy, 151; neutral, 575;\r
110  spammy,        0. spammytokens: hammytokens:0.000-+--H*c:pgp-sha256,\r
111  0.000-+--manpage,      0.000-+--H*u:1.5.21, 0.000-+--H*UA:1.5.21,\r
112  0.000-+--H*u:2010-09-15\r
113 Received: from upsilon.hackadomia.org ([91.121.245.170])        by\r
114  busoni.debian.org with esmtp (Exim 4.72)       (envelope-from <zack@upsilon.cc>)\r
115  id 1SC6LU-0003mg-9Y    for 628018@bugs.debian.org; Mon, 26 Mar 2012 09:36:14\r
116  +0000\r
117 Received: from usha.takhisis.invalid (zack.inria.fr [128.93.60.82])     by\r
118  upsilon.hackadomia.org (Postfix) with ESMTPSA id C4CD81012D    for\r
119  <628018@bugs.debian.org>; Mon, 26 Mar 2012 11:36:06 +0200 (CEST)\r
120 Received: by usha.takhisis.invalid (Postfix, from userid 1000)  id\r
121  AC24F6811BA; Mon, 26 Mar 2012 11:36:06 +0200 (CEST)\r
122 Date: Mon, 26 Mar 2012 11:36:06 +0200\r
123 From: Stefano Zacchiroli <zack@debian.org>\r
124 To: 628018@bugs.debian.org\r
125 Message-ID: <20120326093606.GA3086@upsilon.cc>\r
126 MIME-Version: 1.0\r
127 Content-Type: multipart/signed; micalg=pgp-sha256;\r
128  protocol="application/pgp-signature";\r
129  boundary="R3G7APHDIzY6R/pk"\r
130 Content-Disposition: inline\r
131 User-Agent: Mutt/1.5.21 (2010-09-15)\r
132 Delivered-To: notmuch@packages.qa.debian.org\r
133 Precedence: list\r
134 X-Loop: notmuch@packages.qa.debian.org\r
135 X-Debian: PTS\r
136 X-Debian-Package: notmuch\r
137 X-PTS-Package: notmuch\r
138 X-PTS-Keyword: bts\r
139 List-Unsubscribe: <mailto:pts@qa.debian.org?body=unsubscribe%20notmuch>\r
140 Resent-Sender: Debian QA <qa@quantz.debian.org>\r
141 X-Spam-Score: 0.0\r
142 X-Spam_bar: /\r
143 \r
144 \r
145 --R3G7APHDIzY6R/pk\r
146 Content-Type: multipart/mixed; boundary="82I3+IH0IqGh5yIs"\r
147 Content-Disposition: inline\r
148 \r
149 \r
150 --82I3+IH0IqGh5yIs\r
151 Content-Type: text/plain; charset=iso-8859-1\r
152 Content-Disposition: inline\r
153 Content-Transfer-Encoding: quoted-printable\r
154 \r
155 Here is an updated patch set that ships the notmuch-mutt utility and\r
156 updated the Debian packaging for it. It is now better integrated with\r
157 notmuch: it has been renamed to "notmuch-mutt" (to match the naming\r
158 convention of other notmuch interfaces) and stores all its data under\r
159 ~/.cache/notmuch/mutt/ to avoid polluting user $HOME with other\r
160 directories. I've also fixed the Debian packaging to generate the\r
161 manpage during build.\r
162 \r
163 The first patch in the set adds notmuch-mutt to contrib/, the second\r
164 updates debian/ to build a new "notmuch-mutt" binary package.\r
165 \r
166 The full story is available at http://bugs.debian.org/628018\r
167 \r
168 David: I'm still unable to get through the moderation queue of the\r
169 notmuch mailing list. Would you be so kind to forward this mail there,\r
170 for patch review?\r
171 \r
172 TIA,\r
173 Cheers.\r
174 --=20\r
175 Stefano Zacchiroli     zack@{upsilon.cc,pps.jussieu.fr,debian.org} . o .\r
176 Ma=EEtre de conf=E9rences   ......   http://upsilon.cc/zack   ......   . . o\r
177 Debian Project Leader    .......   @zack on identi.ca   .......    o o o\r
178 =AB the first rule of tautology club is the first rule of tautology club =BB\r
179 \r
180 --82I3+IH0IqGh5yIs\r
181 Content-Type: text/x-diff; charset=iso-8859-1\r
182 Content-Disposition: attachment; filename="0001-contrib-new-mutt-notmuch-utility-for-Mutt-integratio.patch"\r
183 Content-Transfer-Encoding: quoted-printable\r
184 \r
185 =46rom cbb43be7d163e7662c0aa4fcb69f173074bb947d Mon Sep 17 00:00:00 2001\r
186 =46rom: Stefano Zacchiroli <zack@upsilon.cc>\r
187 Date: Mon, 26 Mar 2012 10:45:58 +0200\r
188 Subject: [PATCH 1/2] contrib: new mutt-notmuch utility for Mutt integration\r
189 \r
190 ---\r
191  contrib/notmuch-mutt/.gitignore      |    2 +\r
192  contrib/notmuch-mutt/Makefile        |   12 ++\r
193  contrib/notmuch-mutt/README          |   59 +++++++++\r
194  contrib/notmuch-mutt/notmuch-mutt    |  234 ++++++++++++++++++++++++++++++=\r
195 ++++\r
196  contrib/notmuch-mutt/notmuch-mutt.rc |    9 ++\r
197  5 files changed, 316 insertions(+), 0 deletions(-)\r
198  create mode 100644 contrib/notmuch-mutt/.gitignore\r
199  create mode 100644 contrib/notmuch-mutt/Makefile\r
200  create mode 100644 contrib/notmuch-mutt/README\r
201  create mode 100755 contrib/notmuch-mutt/notmuch-mutt\r
202  create mode 100644 contrib/notmuch-mutt/notmuch-mutt.rc\r
203 \r
204 diff --git a/contrib/notmuch-mutt/.gitignore b/contrib/notmuch-mutt/.gitign=\r
205 ore\r
206 new file mode 100644\r
207 index 0000000..682a577\r
208 --- /dev/null\r
209 +++ b/contrib/notmuch-mutt/.gitignore\r
210 @@ -0,0 +1,2 @@\r
211 +notmuch-mutt.1\r
212 +README.html\r
213 diff --git a/contrib/notmuch-mutt/Makefile b/contrib/notmuch-mutt/Makefile\r
214 new file mode 100644\r
215 index 0000000..87f9031\r
216 --- /dev/null\r
217 +++ b/contrib/notmuch-mutt/Makefile\r
218 @@ -0,0 +1,12 @@\r
219 +NAME =3D notmuch-mutt\r
220 +\r
221 +all: $(NAME) $(NAME).1\r
222 +\r
223 +$(NAME).1: $(NAME)\r
224 +       pod2man $< > $@\r
225 +\r
226 +README.html: README\r
227 +       markdown $< > $@\r
228 +\r
229 +clean:\r
230 +       rm -f notmuch-mutt.1 README.html\r
231 diff --git a/contrib/notmuch-mutt/README b/contrib/notmuch-mutt/README\r
232 new file mode 100644\r
233 index 0000000..382ac91\r
234 --- /dev/null\r
235 +++ b/contrib/notmuch-mutt/README\r
236 @@ -0,0 +1,59 @@\r
237 +notmuch-mutt: Notmuch (of a) helper for Mutt\r
238 +=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
239 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D\r
240 +\r
241 +notmuch-mutt provide integration among the [Mutt] [1] mail user agent and =\r
242 the\r
243 +[Notmuch] [2] mail indexer.\r
244 +\r
245 +notmuch-mutt offer two main integration features. The first one is the abi=\r
246 lity\r
247 +of stating a **search query interactively** and then jump to a fresh Maild=\r
248 ir\r
249 +containing its search results only. The second one is the ability to\r
250 +**reconstruct threads on the fly** starting from the currently highlighted\r
251 +mail, which comes handy when a thread has been split across different mail=\r
252 dirs,\r
253 +archived, or the like.\r
254 +\r
255 +notmuch-mutt enables to trigger mail searches via a Mutt macro (usually F8=\r
256 ) and\r
257 +reconstruct threads via another (usually F9). Check the manpage for the 2-=\r
258 liner\r
259 +configuration snippet for your Mutt configuration files (~/.muttrc,\r
260 +/etc/Muttrc, or a /etc/Muttrc.d snippet).\r
261 +\r
262 +A [blog style introduction] [3] to notmuch-mutt is available and includes =\r
263 some\r
264 +more rationale for its existence.\r
265 +\r
266 +Arguably, some of the logics of notmuch-mutt could disappear by adding sup=\r
267 port\r
268 +for a --output=3Dsymlinks flag to notmuch.\r
269 +\r
270 +\r
271 +[1]: http://www.mutt.org/\r
272 +[2]: http://notmuchmail.org/\r
273 +[3]: http://upsilon.cc/~zack/blog/posts/2011/01/how_to_use_Notmuch_with_Mu=\r
274 tt/\r
275 +\r
276 +\r
277 +Requirements\r
278 +------------\r
279 +\r
280 +To *run* notmuch-mutt you will need Perl with the following libraries:\r
281 +\r
282 +- Mail::Box <http://search.cpan.org/~markov/Mail-Box/>\r
283 +  (Debian package: libmail-box-perl)\r
284 +- Mail::Internet <http://search.cpan.org/~markov/MailTools/>\r
285 +  (Debian package: libmailtools-perl)\r
286 +- String::ShellQuote <http://search.cpan.org/~rosch/String-ShellQuote/Shel=\r
287 lQuote.pm>\r
288 +  (Debian package: libstring-shellquote-perl)\r
289 +- Term::ReadLine <http://search.cpan.org/~hayashi/Term-ReadLine-Gnu/>\r
290 +  (Debian package: libterm-readline-gnu-perl)\r
291 +\r
292 +To *build* notmuch-mutt documentation you will need:\r
293 +\r
294 +- pod2man (coming with Perl) to generate the manpage\r
295 +- markdown to generate README.html out of this file\r
296 +\r
297 +\r
298 +License\r
299 +-------\r
300 +\r
301 +notmuch-mutt is copyright (C) 2011-2012 Stefano Zacchiroli <zack@upsilon.c=\r
302 c>.\r
303 +\r
304 +notmuch-mutt is released under the terms of the GNU General Public License\r
305 +(GPL), version 3 or above. A copy of the license is available online at\r
306 +<http://www.gnu.org/licenses/>.\r
307 +\r
308 diff --git a/contrib/notmuch-mutt/notmuch-mutt b/contrib/notmuch-mutt/notmu=\r
309 ch-mutt\r
310 new file mode 100755\r
311 index 0000000..29674ec\r
312 --- /dev/null\r
313 +++ b/contrib/notmuch-mutt/notmuch-mutt\r
314 @@ -0,0 +1,234 @@\r
315 +#!/usr/bin/perl -w\r
316 +#\r
317 +# notmuch-mutt - notmuch (of a) helper for Mutt\r
318 +#\r
319 +# Copyright: =A9 2011-2012 Stefano Zacchiroli <zack@upsilon.cc>=20\r
320 +# License: GNU General Public License (GPL), version 3 or above\r
321 +#\r
322 +# See the bottom of this file for more documentation.\r
323 +# A manpage can be obtained by running "pod2man notmuch-mutt > notmuch-mut=\r
324 t.1"\r
325 +\r
326 +use strict;\r
327 +use warnings;\r
328 +\r
329 +use File::Path;\r
330 +use Getopt::Long qw(:config no_getopt_compat);\r
331 +use Mail::Internet;\r
332 +use Mail::Box::Maildir;\r
333 +use Pod::Usage;\r
334 +use String::ShellQuote;\r
335 +use Term::ReadLine;\r
336 +\r
337 +\r
338 +my $cache_dir =3D "$ENV{HOME}/.cache/notmuch/mutt";\r
339 +\r
340 +\r
341 +# create an empty maildir (if missing) or empty an existing maildir"\r
342 +sub empty_maildir($) {\r
343 +    my ($maildir) =3D (@_);\r
344 +    rmtree($maildir) if (-d $maildir);\r
345 +    my $folder =3D new Mail::Box::Maildir(folder =3D> $maildir,\r
346 +                                       create =3D> 1);\r
347 +    $folder->close();\r
348 +}\r
349 +\r
350 +# search($maildir, $query)\r
351 +# search mails according to $query with notmuch; store results in $maildir\r
352 +sub search($$) {\r
353 +    my ($maildir, $query) =3D @_;\r
354 +    $query =3D shell_quote($query);\r
355 +\r
356 +    empty_maildir($maildir);\r
357 +    system("notmuch search --output=3Dfiles $query"\r
358 +          . " | sed -e 's: :\\\\ :g'"\r
359 +          . " | xargs --no-run-if-empty ln -s -t $maildir/cur/");\r
360 +}\r
361 +\r
362 +sub prompt($$) {\r
363 +    my ($text, $default) =3D @_;\r
364 +    my $query =3D "";\r
365 +    my $term =3D Term::ReadLine->new( "notmuch-mutt" );\r
366 +    my $histfile =3D "$cache_dir/history";\r
367 +\r
368 +    $term->ornaments( 0 );\r
369 +    $term->unbind_key( ord( "\t" ) );\r
370 +    $term->MinLine( 3 );\r
371 +    $histfile =3D $ENV{MUTT_NOTMUCH_HISTFILE} if $ENV{MUTT_NOTMUCH_HISTFIL=\r
372 E};\r
373 +    $term->ReadHistory($histfile) if (-r $histfile);\r
374 +    while (1) {\r
375 +       chomp($query =3D $term->readline($text, $default));\r
376 +       if ($query eq "?") {\r
377 +           system("man", "notmuch");\r
378 +       } else {\r
379 +           $term->WriteHistory($histfile);\r
380 +           return $query;\r
381 +       }\r
382 +    }\r
383 +}\r
384 +\r
385 +sub get_message_id() {\r
386 +    my $mail =3D Mail::Internet->new(\*STDIN);\r
387 +    $mail->head->get("message-id") =3D~ /^<(.*)>$/;    # get message-id\r
388 +    return $1;\r
389 +}\r
390 +\r
391 +sub search_action($$@) {\r
392 +    my ($interactive, $results_dir, @params) =3D @_;\r
393 +\r
394 +    if (! $interactive) {\r
395 +       search($results_dir, join(' ', @params));\r
396 +    } else {\r
397 +       my $query =3D prompt("search ('?' for man): ", join(' ', @params));\r
398 +       if ($query ne "") {\r
399 +           search($results_dir,$query);\r
400 +       }\r
401 +    }\r
402 +}\r
403 +\r
404 +sub thread_action(@) {\r
405 +    my ($results_dir, @params) =3D @_;\r
406 +    my $mid =3D get_message_id();\r
407 +    my $tid =3D `notmuch search --output=3Dthreads id:$mid`;# get thread id\r
408 +    chomp($tid);\r
409 +\r
410 +    search($results_dir, $tid);\r
411 +}\r
412 +\r
413 +sub tag_action(@) {\r
414 +    my $mid =3D get_message_id();\r
415 +\r
416 +    system("notmuch tag "\r
417 +          . shell_quote(join(' ', @_))\r
418 +          . " id:$mid");\r
419 +}\r
420 +\r
421 +sub die_usage() {\r
422 +    my %podflags =3D ( "verbose" =3D> 1,\r
423 +                   "exitval" =3D> 2 );\r
424 +    pod2usage(%podflags);\r
425 +}\r
426 +\r
427 +sub main() {\r
428 +    mkpath($cache_dir) unless (-d $cache_dir);\r
429 +\r
430 +    my $results_dir =3D "$cache_dir/results";\r
431 +    my $interactive =3D 0;\r
432 +    my $help_needed =3D 0;\r
433 +\r
434 +    my $getopt =3D GetOptions(\r
435 +       "h|help" =3D> \$help_needed,\r
436 +       "o|output-dir=3Ds" =3D> \$results_dir,\r
437 +       "p|prompt" =3D> \$interactive);\r
438 +    if (! $getopt || $#ARGV < 0) { die_usage() };\r
439 +    my ($action, @params) =3D ($ARGV[0], @ARGV[1..$#ARGV]);\r
440 +\r
441 +    foreach my $param (@params) {\r
442 +      $param =3D~ s/folder:=3D/folder:/g;\r
443 +    }\r
444 +\r
445 +    if ($help_needed) {\r
446 +       die_usage();\r
447 +    } elsif ($action eq "search" && $#ARGV =3D=3D 0 && ! $interactive) {\r
448 +       print STDERR "Error: no search term provided\n\n";\r
449 +       die_usage();\r
450 +    } elsif ($action eq "search") {\r
451 +       search_action($interactive, $results_dir, @params);\r
452 +    } elsif ($action eq "thread") {\r
453 +       thread_action($results_dir, @params);\r
454 +    } elsif ($action eq "tag") {\r
455 +       tag_action(@params);\r
456 +    } else {\r
457 +       die_usage();\r
458 +    }\r
459 +}\r
460 +\r
461 +main();\r
462 +\r
463 +__END__\r
464 +\r
465 +=3Dhead1 NAME\r
466 +\r
467 +notmuch-mutt - notmuch (of a) helper for Mutt\r
468 +\r
469 +=3Dhead1 SYNOPSIS\r
470 +\r
471 +=3Dover\r
472 +\r
473 +=3Ditem B<notmuch-mutt> [I<OPTION>]... search [I<SEARCH-TERM>]...\r
474 +\r
475 +=3Ditem B<notmuch-mutt> [I<OPTION>]... thread < I<MAIL>\r
476 +\r
477 +=3Ditem B<notmuch-mutt> [I<OPTION>]... tag [I<TAGS>]... < I<MAIL>\r
478 +\r
479 +=3Dback\r
480 +\r
481 +=3Dhead1 DESCRIPTION\r
482 +\r
483 +notmuch-mutt is a frontend to the notmuch mail indexer capable of populati=\r
484 ng\r
485 +maildir with search results.\r
486 +\r
487 +=3Dhead1 OPTIONS\r
488 +\r
489 +=3Dover 4\r
490 +\r
491 +=3Ditem -o DIR\r
492 +\r
493 +=3Ditem --output-dir DIR\r
494 +\r
495 +Store search results as (symlink) messages under maildir DIR. Beware: DIR =\r
496 will\r
497 +be overwritten. (Default: F<~/.cache/notmuch/mutt/results/>)\r
498 +\r
499 +=3Ditem -p\r
500 +\r
501 +=3Ditem --prompt\r
502 +\r
503 +Instead of using command line search terms, prompt the user for them (only=\r
504  for\r
505 +"search").\r
506 +\r
507 +=3Ditem -h\r
508 +\r
509 +=3Ditem --help\r
510 +\r
511 +Show usage information and exit.\r
512 +\r
513 +=3Dback\r
514 +\r
515 +=3Dhead1 INTEGRATION WITH MUTT\r
516 +\r
517 +notmuch-mutt can be used to integrate notmuch with the Mutt mail user agent\r
518 +(unsurprisingly, given the name). To that end, you should define macros li=\r
519 ke\r
520 +the following in your Mutt configuration (usually one of: F<~/.muttrc>,\r
521 +F</etc/Muttrc>, or a configuration snippet under F</etc/Muttrc.d/>):\r
522 +\r
523 +    macro index <F8> \\r
524 +          "<enter-command>unset wait_key<enter><shell-escape>notmuch-mutt =\r
525 --prompt search<enter><change-folder-readonly>~/.cache/notmuch/mutt/results=\r
526 <enter>" \\r
527 +          "notmuch: search mail"\r
528 +    macro index <F9> \\r
529 +          "<enter-command>unset wait_key<enter><pipe-message>notmuch-mutt =\r
530 thread<enter><change-folder-readonly>~/.cache/notmuch/mutt/results<enter><e=\r
531 nter-command>set wait_key<enter>" \\r
532 +          "notmuch: reconstruct thread"\r
533 +    macro index <F6> \\r
534 +          "<enter-command>unset wait_key<enter><pipe-message>notmuch-mutt =\r
535 tag -inbox<enter>" \\r
536 +          "notmuch: remove message from inbox"\r
537 +\r
538 +The first macro (activated by <F8>) prompts the user for notmuch search te=\r
539 rms\r
540 +and then jump to a temporary maildir showing search results. The second ma=\r
541 cro\r
542 +(activated by <F9>) reconstructs the thread corresponding to the current m=\r
543 ail\r
544 +and show it as search results. The third macro (activated by <F6>) removes=\r
545  the\r
546 +tag C<inbox> from the current message; by changing C<-inbox> this macro ma=\r
547 y be\r
548 +customised to add or remove tags appropriate to the users notmuch work-flo=\r
549 w.\r
550 +\r
551 +To keep notmuch index current you should then periodically run C<notmuch\r
552 +new>. Depending on your local mail setup, you might want to do that via cr=\r
553 on,\r
554 +as a hook triggered by mail retrieval, etc.\r
555 +\r
556 +=3Dhead1 SEE ALSO\r
557 +\r
558 +mutt(1), notmuch(1)\r
559 +\r
560 +=3Dhead1 AUTHOR\r
561 +\r
562 +Copyright: (C) 2011-2012 Stefano Zacchiroli <zack@upsilon.cc>\r
563 +\r
564 +License: GNU General Public License (GPL), version 3 or higher\r
565 +\r
566 +=3Dcut\r
567 diff --git a/contrib/notmuch-mutt/notmuch-mutt.rc b/contrib/notmuch-mutt/no=\r
568 tmuch-mutt.rc\r
569 new file mode 100644\r
570 index 0000000..269f03f\r
571 --- /dev/null\r
572 +++ b/contrib/notmuch-mutt/notmuch-mutt.rc\r
573 @@ -0,0 +1,9 @@\r
574 +macro index <F8> \\r
575 +      "<enter-command>unset wait_key<enter><shell-escape>notmuch-mutt --pr=\r
576 ompt search<enter><change-folder-readonly>~/.cache/notmuch/mutt/results<ent=\r
577 er>" \\r
578 +      "notmuch: search mail"\r
579 +macro index <F9> \\r
580 +      "<enter-command>unset wait_key<enter><pipe-message>notmuch-mutt thre=\r
581 ad<enter><change-folder-readonly>~/.cache/notmuch/mutt/results<enter><enter=\r
582 -command>set wait_key<enter>" \\r
583 +      "notmuch: reconstruct thread"\r
584 +macro index <F6> \\r
585 +      "<enter-command>unset wait_key<enter><pipe-message>notmuch-mutt tag =\r
586 -inbox<enter>" \\r
587 +      "notmuch: remove message from inbox"\r
588 --=20\r
589 1.7.9.1\r
590 \r
591 \r
592 --82I3+IH0IqGh5yIs\r
593 Content-Type: text/x-diff; charset=us-ascii\r
594 Content-Disposition: attachment; filename="0002-debian-packaging-new-binary-package-notmuch-mutt.patch"\r
595 Content-Transfer-Encoding: quoted-printable\r
596 \r
597 =46rom c342af0fa2b9d936753f57cd8fa232ca246079d1 Mon Sep 17 00:00:00 2001\r
598 =46rom: Stefano Zacchiroli <zack@upsilon.cc>\r
599 Date: Mon, 26 Mar 2012 10:51:44 +0200\r
600 Subject: [PATCH 2/2] debian packaging: new binary package notmuch-mutt\r
601 \r
602 ---\r
603  debian/changelog             |    6 ++++++\r
604  debian/control               |   16 ++++++++++++++++\r
605  debian/notmuch-mutt.docs     |    1 +\r
606  debian/notmuch-mutt.install  |    2 ++\r
607  debian/notmuch-mutt.manpages |    1 +\r
608  debian/rules                 |    2 ++\r
609  6 files changed, 28 insertions(+), 0 deletions(-)\r
610  create mode 100644 debian/notmuch-mutt.docs\r
611  create mode 100644 debian/notmuch-mutt.install\r
612  create mode 100644 debian/notmuch-mutt.manpages\r
613 \r
614 diff --git a/debian/changelog b/debian/changelog\r
615 index d0eec37..bd70d08 100644\r
616 --- a/debian/changelog\r
617 +++ b/debian/changelog\r
618 @@ -1,3 +1,9 @@\r
619 +notmuch (0.12-2) UNRELEASED; urgency=3Dlow\r
620 +\r
621 +  * new binary package "notmuch-mutt" for Mutt integration\r
622 +\r
623 + -- Stefano Zacchiroli <zack@debian.org>  Mon, 26 Mar 2012 10:47:29 +0200\r
624 +\r
625  notmuch (0.12-1) unstable; urgency=3Dlow\r
626 =20\r
627    * New upstream release\r
628 diff --git a/debian/control b/debian/control\r
629 index ed27c58..ada9d3d 100644\r
630 --- a/debian/control\r
631 +++ b/debian/control\r
632 @@ -105,3 +105,19 @@ Description: thread-based email index, search and tagg=\r
633 ing (vim interface)\r
634   This package provides a vim based mail user agent based on\r
635   notmuch.\r
636 =20\r
637 +Package: notmuch-mutt\r
638 +Architecture: all\r
639 +Depends: notmuch, libmail-box-perl, libmailtools-perl,\r
640 + libstring-shellquote-perl, libterm-readline-gnu-perl,\r
641 + ${misc:Depends}\r
642 +Recommends: mutt\r
643 +Enhances: notmuch, mutt\r
644 +Description: thread-based email index, search and tagging (Mutt interface)\r
645 + notmuch-mutt provides integration among the Mutt mail user agent and\r
646 + the Notmuch mail indexer.\r
647 + .\r
648 + notmuch-mutt offer two main integration features. The first one is\r
649 + the ability of stating a search query interactively and then jump to\r
650 + a fresh Maildir containing its search results only. The second one is\r
651 + the ability to reconstruct threads on the fly starting from the\r
652 + current highlighted mail.\r
653 diff --git a/debian/notmuch-mutt.docs b/debian/notmuch-mutt.docs\r
654 new file mode 100644\r
655 index 0000000..f3d25cd\r
656 --- /dev/null\r
657 +++ b/debian/notmuch-mutt.docs\r
658 @@ -0,0 +1 @@\r
659 +contrib/notmuch-mutt/README\r
660 diff --git a/debian/notmuch-mutt.install b/debian/notmuch-mutt.install\r
661 new file mode 100644\r
662 index 0000000..9141c26\r
663 --- /dev/null\r
664 +++ b/debian/notmuch-mutt.install\r
665 @@ -0,0 +1,2 @@\r
666 +contrib/notmuch-mutt/notmuch-mutt      usr/bin\r
667 +contrib/notmuch-mutt/notmuch-mutt.rc   etc/Muttrc.d\r
668 diff --git a/debian/notmuch-mutt.manpages b/debian/notmuch-mutt.manpages\r
669 new file mode 100644\r
670 index 0000000..3f6b8ab\r
671 --- /dev/null\r
672 +++ b/debian/notmuch-mutt.manpages\r
673 @@ -0,0 +1 @@\r
674 +contrib/notmuch-mutt/notmuch-mutt.1\r
675 diff --git a/debian/rules b/debian/rules\r
676 index 956f3f2..603b3ab 100755\r
677 --- a/debian/rules\r
678 +++ b/debian/rules\r
679 @@ -9,10 +9,12 @@ override_dh_auto_configure:\r
680  override_dh_auto_build:\r
681         dh_auto_build\r
682         dh_auto_build --sourcedirectory bindings/python\r
683 +       $(MAKE) -C contrib/notmuch-mutt\r
684 =20\r
685  override_dh_auto_clean:\r
686         dh_auto_clean\r
687         dh_auto_clean --sourcedirectory bindings/python\r
688 +       $(MAKE) -C contrib/notmuch-mutt clean\r
689 =20\r
690  override_dh_auto_install:\r
691         dh_auto_install\r
692 --=20\r
693 1.7.9.1\r
694 \r
695 \r
696 --82I3+IH0IqGh5yIs--\r
697 \r
698 --R3G7APHDIzY6R/pk\r
699 Content-Type: application/pgp-signature; name="signature.asc"\r
700 Content-Description: Digital signature\r
701 \r
702 -----BEGIN PGP SIGNATURE-----\r
703 Version: GnuPG v1.4.12 (GNU/Linux)\r
704 \r
705 iQIVAwUBT3A4gJwxUDxthmOWAQhoFxAAjELiHQHDPMQA3EDK02/IuJFuSFQm2wtm\r
706 FO0IHaI/fDUlZrXOUEeo8wAwih9MI0ILTgwuWFVq6YmHUqvye7clFoFc9uRUg4kZ\r
707 ic62tbtRx23vPljBj8tI1F2/tlLZclL1rUt4pKoLPezul7XiIw56v1I4MQNrr1HM\r
708 RhWpzp1mQ0499osM1cRqlkFoOPT5sGrC/t8h6Dy+HiWkFvuwvuaV7jvbkwNKHKAF\r
709 +f/vzkHecNb3imRsl6odXNrQf6+CEAUI+t/gzgEJ8yHdEGegEkeCei21KosvtRSo\r
710 pDlfc5VcUUtHIUfrqFDV69lqfq1OkeQ9Oe7P6UNlT/Lubd74ebqzTg5yvmK6WjCh\r
711 lU3GY7aK4Gbxr1pAxUPVFAQf4WVuNEXjbFB1RgyCdMTIcNj9H9HsbunezjWEw1EL\r
712 Qcr1hhYVY0rQAtpq9Ndd1V1CmqGhsvYoAJpM53Z+H9WAXEW1ngUhoy0RKGNBS004\r
713 h6LtrB1LdLr/ta4kNPEcD8tlMQmr1f2ZeKpYv/DJvHyG9uplzcLpqcVCdMc2DQlA\r
714 EyUC8wfCPY+2kpVxdJzI66Q7MHr0NUFDAJqIh4mgzWjKKKlDhSYmJKi+PezqJAad\r
715 tAbyV18j8VpFy0d2DLs3Plryibu/ANco2h/QUCoEHdz0emRETomssEEcD4ORjYwD\r
716 z95twQ09fJ8=\r
717 =A/JP\r
718 -----END PGP SIGNATURE-----\r
719 \r
720 --R3G7APHDIzY6R/pk--\r
721 \r
722 \r
723 \r