[PATCH v2]: contrib/notmuch-mutt
[notmuch-archives.git] / 9f / dc7cb8f343e4f4aebcf072a4345cc27d1ff964
1 Return-Path: <zack@upsilon.cc>\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 7DBA8431FAF\r
6         for <notmuch@notmuchmail.org>; Thu, 29 Mar 2012 06:36:27 -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 YYnt+7Jfxo0f for <notmuch@notmuchmail.org>;\r
16         Thu, 29 Mar 2012 06:36:25 -0700 (PDT)\r
17 Received: from upsilon.hackadomia.org (upsilon.hackadomia.org\r
18  [91.121.245.170])      by olra.theworths.org (Postfix) with ESMTP id 12D9A431FAE\r
19         for <notmuch@notmuchmail.org>; Thu, 29 Mar 2012 06:36:25 -0700 (PDT)\r
20 Received: from usha.takhisis.invalid (eduroam-0-228.enst.fr [137.194.56.228])\r
21         by upsilon.hackadomia.org (Postfix) with ESMTPSA id 8E87D1015C;\r
22         Thu, 29 Mar 2012 15:36:22 +0200 (CEST)\r
23 Received: by usha.takhisis.invalid (Postfix, from userid 1000)\r
24         id 513FD6808C2; Thu, 29 Mar 2012 15:35:38 +0200 (CEST)\r
25 Date: Thu, 29 Mar 2012 15:35:38 +0200\r
26 From: Stefano Zacchiroli <zack@upsilon.cc>\r
27 To: notmuch@notmuchmail.org\r
28 Subject: [PATCH v2]: contrib/notmuch-mutt\r
29 Message-ID: <20120329133538.GA12117@upsilon.cc>\r
30 References: <87iphszuv1.fsf@zancas.localnet>\r
31 MIME-Version: 1.0\r
32 Content-Type: multipart/signed; micalg=pgp-sha256;\r
33         protocol="application/pgp-signature"; boundary="gj572EiMnwbLXET9"\r
34 Content-Disposition: inline\r
35 In-Reply-To: <87iphszuv1.fsf@zancas.localnet>\r
36 User-Agent: Mutt/1.5.21 (2010-09-15)\r
37 Cc: Ben Boeckel <mathstuf@gmail.com>, 628018-quiet@bugs.debian.org\r
38 X-BeenThere: notmuch@notmuchmail.org\r
39 X-Mailman-Version: 2.1.13\r
40 Precedence: list\r
41 List-Id: "Use and development of the notmuch mail system."\r
42         <notmuch.notmuchmail.org>\r
43 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
44         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
45 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
46 List-Post: <mailto:notmuch@notmuchmail.org>\r
47 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
48 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
49         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
50 X-List-Received-Date: Thu, 29 Mar 2012 13:36:27 -0000\r
51 \r
52 \r
53 --gj572EiMnwbLXET9\r
54 Content-Type: multipart/mixed; boundary="qDbXVdCdHGoSgWSk"\r
55 Content-Disposition: inline\r
56 \r
57 \r
58 --qDbXVdCdHGoSgWSk\r
59 Content-Type: text/plain; charset=iso-8859-1\r
60 Content-Disposition: inline\r
61 Content-Transfer-Encoding: quoted-printable\r
62 \r
63 On Sun, Mar 25, 2012 at 10:13:38AM -0300, David Bremner wrote:\r
64 > In the mean time, we at least have a contrib directory, and I think\r
65 > mutt-notmuch would be welcome there. Could you (or somebody) make a\r
66 > reasonable size patch series that adds it to contrib/mutt-notmuch\r
67 > against current master. The patch series should be sent to the\r
68 > upstream mailing list notmuch@notmuchmail.org for review.\r
69 >=20\r
70 > On the debian side your patch series could also include the necessary\r
71 > changes to make a new binary package.\r
72 >=20\r
73 > Notmuch itself is already GPL3+ so no hassles there (for once).\r
74 \r
75 Here is an updated set of patches, which I consider final for inclusion\r
76 of notmuch-mutt as part of notmuch contrib/.  AFAICT I've implemented\r
77 all changes that have been requested either on this list or in private\r
78 mail to me: renaming, Debian packaging, XDG userdir support, shell\r
79 quoting in all notmuch calls. TTBOMK, no further changes have been\r
80 requested.\r
81 \r
82 Can some kind soul "git am" the attached patches to notmuch Git repo?\r
83 \r
84 If OTOH you have further request for changes, please let me know. I'll\r
85 be happy to act on them.\r
86 \r
87 TIA,\r
88 Cheers.\r
89 --=20\r
90 Stefano Zacchiroli     zack@{upsilon.cc,pps.jussieu.fr,debian.org} . o .\r
91 Ma=EEtre de conf=E9rences   ......   http://upsilon.cc/zack   ......   . . o\r
92 Debian Project Leader    .......   @zack on identi.ca   .......    o o o\r
93 =AB the first rule of tautology club is the first rule of tautology club =BB\r
94 \r
95 --qDbXVdCdHGoSgWSk\r
96 Content-Type: text/x-diff; charset=iso-8859-1\r
97 Content-Disposition: attachment; filename="0001-contrib-new-mutt-notmuch-utility-for-Mutt-integratio.patch"\r
98 Content-Transfer-Encoding: quoted-printable\r
99 \r
100 =46rom 9121254754ad742ec025b77c50d5abe3334ba547 Mon Sep 17 00:00:00 2001\r
101 =46rom: Stefano Zacchiroli <zack@upsilon.cc>\r
102 Date: Mon, 26 Mar 2012 10:45:58 +0200\r
103 Subject: [PATCH 1/2] contrib: new mutt-notmuch utility for Mutt integration\r
104 \r
105 ---\r
106  contrib/notmuch-mutt/.gitignore      |    2 +\r
107  contrib/notmuch-mutt/Makefile        |   12 ++\r
108  contrib/notmuch-mutt/README          |   59 +++++++++\r
109  contrib/notmuch-mutt/notmuch-mutt    |  238 ++++++++++++++++++++++++++++++=\r
110 ++++\r
111  contrib/notmuch-mutt/notmuch-mutt.rc |    9 ++\r
112  5 files changed, 320 insertions(+)\r
113  create mode 100644 contrib/notmuch-mutt/.gitignore\r
114  create mode 100644 contrib/notmuch-mutt/Makefile\r
115  create mode 100644 contrib/notmuch-mutt/README\r
116  create mode 100755 contrib/notmuch-mutt/notmuch-mutt\r
117  create mode 100644 contrib/notmuch-mutt/notmuch-mutt.rc\r
118 \r
119 diff --git a/contrib/notmuch-mutt/.gitignore b/contrib/notmuch-mutt/.gitign=\r
120 ore\r
121 new file mode 100644\r
122 index 0000000..682a577\r
123 --- /dev/null\r
124 +++ b/contrib/notmuch-mutt/.gitignore\r
125 @@ -0,0 +1,2 @@\r
126 +notmuch-mutt.1\r
127 +README.html\r
128 diff --git a/contrib/notmuch-mutt/Makefile b/contrib/notmuch-mutt/Makefile\r
129 new file mode 100644\r
130 index 0000000..87f9031\r
131 --- /dev/null\r
132 +++ b/contrib/notmuch-mutt/Makefile\r
133 @@ -0,0 +1,12 @@\r
134 +NAME =3D notmuch-mutt\r
135 +\r
136 +all: $(NAME) $(NAME).1\r
137 +\r
138 +$(NAME).1: $(NAME)\r
139 +       pod2man $< > $@\r
140 +\r
141 +README.html: README\r
142 +       markdown $< > $@\r
143 +\r
144 +clean:\r
145 +       rm -f notmuch-mutt.1 README.html\r
146 diff --git a/contrib/notmuch-mutt/README b/contrib/notmuch-mutt/README\r
147 new file mode 100644\r
148 index 0000000..382ac91\r
149 --- /dev/null\r
150 +++ b/contrib/notmuch-mutt/README\r
151 @@ -0,0 +1,59 @@\r
152 +notmuch-mutt: Notmuch (of a) helper for Mutt\r
153 +=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
154 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D\r
155 +\r
156 +notmuch-mutt provide integration among the [Mutt] [1] mail user agent and =\r
157 the\r
158 +[Notmuch] [2] mail indexer.\r
159 +\r
160 +notmuch-mutt offer two main integration features. The first one is the abi=\r
161 lity\r
162 +of stating a **search query interactively** and then jump to a fresh Maild=\r
163 ir\r
164 +containing its search results only. The second one is the ability to\r
165 +**reconstruct threads on the fly** starting from the currently highlighted\r
166 +mail, which comes handy when a thread has been split across different mail=\r
167 dirs,\r
168 +archived, or the like.\r
169 +\r
170 +notmuch-mutt enables to trigger mail searches via a Mutt macro (usually F8=\r
171 ) and\r
172 +reconstruct threads via another (usually F9). Check the manpage for the 2-=\r
173 liner\r
174 +configuration snippet for your Mutt configuration files (~/.muttrc,\r
175 +/etc/Muttrc, or a /etc/Muttrc.d snippet).\r
176 +\r
177 +A [blog style introduction] [3] to notmuch-mutt is available and includes =\r
178 some\r
179 +more rationale for its existence.\r
180 +\r
181 +Arguably, some of the logics of notmuch-mutt could disappear by adding sup=\r
182 port\r
183 +for a --output=3Dsymlinks flag to notmuch.\r
184 +\r
185 +\r
186 +[1]: http://www.mutt.org/\r
187 +[2]: http://notmuchmail.org/\r
188 +[3]: http://upsilon.cc/~zack/blog/posts/2011/01/how_to_use_Notmuch_with_Mu=\r
189 tt/\r
190 +\r
191 +\r
192 +Requirements\r
193 +------------\r
194 +\r
195 +To *run* notmuch-mutt you will need Perl with the following libraries:\r
196 +\r
197 +- Mail::Box <http://search.cpan.org/~markov/Mail-Box/>\r
198 +  (Debian package: libmail-box-perl)\r
199 +- Mail::Internet <http://search.cpan.org/~markov/MailTools/>\r
200 +  (Debian package: libmailtools-perl)\r
201 +- String::ShellQuote <http://search.cpan.org/~rosch/String-ShellQuote/Shel=\r
202 lQuote.pm>\r
203 +  (Debian package: libstring-shellquote-perl)\r
204 +- Term::ReadLine <http://search.cpan.org/~hayashi/Term-ReadLine-Gnu/>\r
205 +  (Debian package: libterm-readline-gnu-perl)\r
206 +\r
207 +To *build* notmuch-mutt documentation you will need:\r
208 +\r
209 +- pod2man (coming with Perl) to generate the manpage\r
210 +- markdown to generate README.html out of this file\r
211 +\r
212 +\r
213 +License\r
214 +-------\r
215 +\r
216 +notmuch-mutt is copyright (C) 2011-2012 Stefano Zacchiroli <zack@upsilon.c=\r
217 c>.\r
218 +\r
219 +notmuch-mutt is released under the terms of the GNU General Public License\r
220 +(GPL), version 3 or above. A copy of the license is available online at\r
221 +<http://www.gnu.org/licenses/>.\r
222 +\r
223 diff --git a/contrib/notmuch-mutt/notmuch-mutt b/contrib/notmuch-mutt/notmu=\r
224 ch-mutt\r
225 new file mode 100755\r
226 index 0000000..6b34e94\r
227 --- /dev/null\r
228 +++ b/contrib/notmuch-mutt/notmuch-mutt\r
229 @@ -0,0 +1,238 @@\r
230 +#!/usr/bin/perl -w\r
231 +#\r
232 +# notmuch-mutt - notmuch (of a) helper for Mutt\r
233 +#\r
234 +# Copyright: =A9 2011-2012 Stefano Zacchiroli <zack@upsilon.cc>=20\r
235 +# License: GNU General Public License (GPL), version 3 or above\r
236 +#\r
237 +# See the bottom of this file for more documentation.\r
238 +# A manpage can be obtained by running "pod2man notmuch-mutt > notmuch-mut=\r
239 t.1"\r
240 +\r
241 +use strict;\r
242 +use warnings;\r
243 +\r
244 +use File::Path;\r
245 +use Getopt::Long qw(:config no_getopt_compat);\r
246 +use Mail::Internet;\r
247 +use Mail::Box::Maildir;\r
248 +use Pod::Usage;\r
249 +use String::ShellQuote;\r
250 +use Term::ReadLine;\r
251 +\r
252 +\r
253 +my $xdg_cache_dir =3D "$ENV{HOME}/.cache";\r
254 +$xdg_cache_dir =3D $ENV{XDG_CACHE_HOME} if $ENV{XDG_CACHE_HOME};\r
255 +my $cache_dir =3D "$xdg_cache_dir/notmuch/mutt";\r
256 +\r
257 +\r
258 +# create an empty maildir (if missing) or empty an existing maildir"\r
259 +sub empty_maildir($) {\r
260 +    my ($maildir) =3D (@_);\r
261 +    rmtree($maildir) if (-d $maildir);\r
262 +    my $folder =3D new Mail::Box::Maildir(folder =3D> $maildir,\r
263 +                                       create =3D> 1);\r
264 +    $folder->close();\r
265 +}\r
266 +\r
267 +# search($maildir, $query)\r
268 +# search mails according to $query with notmuch; store results in $maildir\r
269 +sub search($$) {\r
270 +    my ($maildir, $query) =3D @_;\r
271 +    $query =3D shell_quote($query);\r
272 +\r
273 +    empty_maildir($maildir);\r
274 +    system("notmuch search --output=3Dfiles $query"\r
275 +          . " | sed -e 's: :\\\\ :g'"\r
276 +          . " | xargs --no-run-if-empty ln -s -t $maildir/cur/");\r
277 +}\r
278 +\r
279 +sub prompt($$) {\r
280 +    my ($text, $default) =3D @_;\r
281 +    my $query =3D "";\r
282 +    my $term =3D Term::ReadLine->new( "notmuch-mutt" );\r
283 +    my $histfile =3D "$cache_dir/history";\r
284 +\r
285 +    $term->ornaments( 0 );\r
286 +    $term->unbind_key( ord( "\t" ) );\r
287 +    $term->MinLine( 3 );\r
288 +    $histfile =3D $ENV{MUTT_NOTMUCH_HISTFILE} if $ENV{MUTT_NOTMUCH_HISTFIL=\r
289 E};\r
290 +    $term->ReadHistory($histfile) if (-r $histfile);\r
291 +    while (1) {\r
292 +       chomp($query =3D $term->readline($text, $default));\r
293 +       if ($query eq "?") {\r
294 +           system("man", "notmuch");\r
295 +       } else {\r
296 +           $term->WriteHistory($histfile);\r
297 +           return $query;\r
298 +       }\r
299 +    }\r
300 +}\r
301 +\r
302 +sub get_message_id() {\r
303 +    my $mail =3D Mail::Internet->new(\*STDIN);\r
304 +    $mail->head->get("message-id") =3D~ /^<(.*)>$/;    # get message-id\r
305 +    return $1;\r
306 +}\r
307 +\r
308 +sub search_action($$@) {\r
309 +    my ($interactive, $results_dir, @params) =3D @_;\r
310 +\r
311 +    if (! $interactive) {\r
312 +       search($results_dir, join(' ', @params));\r
313 +    } else {\r
314 +       my $query =3D prompt("search ('?' for man): ", join(' ', @params));\r
315 +       if ($query ne "") {\r
316 +           search($results_dir,$query);\r
317 +       }\r
318 +    }\r
319 +}\r
320 +\r
321 +sub thread_action(@) {\r
322 +    my ($results_dir, @params) =3D @_;\r
323 +\r
324 +    my $mid =3D get_message_id();\r
325 +    my $search_cmd =3D 'notmuch search --output=3Dthreads ' . shell_quote(=\r
326 "id:$mid");\r
327 +    my $tid =3D `$search_cmd`; # get thread id\r
328 +    chomp($tid);\r
329 +\r
330 +    search($results_dir, $tid);\r
331 +}\r
332 +\r
333 +sub tag_action(@) {\r
334 +    my $mid =3D get_message_id();\r
335 +\r
336 +    system("notmuch tag "\r
337 +          . shell_quote(join(' ', @_))\r
338 +          . " id:$mid");\r
339 +}\r
340 +\r
341 +sub die_usage() {\r
342 +    my %podflags =3D ( "verbose" =3D> 1,\r
343 +                   "exitval" =3D> 2 );\r
344 +    pod2usage(%podflags);\r
345 +}\r
346 +\r
347 +sub main() {\r
348 +    mkpath($cache_dir) unless (-d $cache_dir);\r
349 +\r
350 +    my $results_dir =3D "$cache_dir/results";\r
351 +    my $interactive =3D 0;\r
352 +    my $help_needed =3D 0;\r
353 +\r
354 +    my $getopt =3D GetOptions(\r
355 +       "h|help" =3D> \$help_needed,\r
356 +       "o|output-dir=3Ds" =3D> \$results_dir,\r
357 +       "p|prompt" =3D> \$interactive);\r
358 +    if (! $getopt || $#ARGV < 0) { die_usage() };\r
359 +    my ($action, @params) =3D ($ARGV[0], @ARGV[1..$#ARGV]);\r
360 +\r
361 +    foreach my $param (@params) {\r
362 +      $param =3D~ s/folder:=3D/folder:/g;\r
363 +    }\r
364 +\r
365 +    if ($help_needed) {\r
366 +       die_usage();\r
367 +    } elsif ($action eq "search" && $#ARGV =3D=3D 0 && ! $interactive) {\r
368 +       print STDERR "Error: no search term provided\n\n";\r
369 +       die_usage();\r
370 +    } elsif ($action eq "search") {\r
371 +       search_action($interactive, $results_dir, @params);\r
372 +    } elsif ($action eq "thread") {\r
373 +       thread_action($results_dir, @params);\r
374 +    } elsif ($action eq "tag") {\r
375 +       tag_action(@params);\r
376 +    } else {\r
377 +       die_usage();\r
378 +    }\r
379 +}\r
380 +\r
381 +main();\r
382 +\r
383 +__END__\r
384 +\r
385 +=3Dhead1 NAME\r
386 +\r
387 +notmuch-mutt - notmuch (of a) helper for Mutt\r
388 +\r
389 +=3Dhead1 SYNOPSIS\r
390 +\r
391 +=3Dover\r
392 +\r
393 +=3Ditem B<notmuch-mutt> [I<OPTION>]... search [I<SEARCH-TERM>]...\r
394 +\r
395 +=3Ditem B<notmuch-mutt> [I<OPTION>]... thread < I<MAIL>\r
396 +\r
397 +=3Ditem B<notmuch-mutt> [I<OPTION>]... tag [I<TAGS>]... < I<MAIL>\r
398 +\r
399 +=3Dback\r
400 +\r
401 +=3Dhead1 DESCRIPTION\r
402 +\r
403 +notmuch-mutt is a frontend to the notmuch mail indexer capable of populati=\r
404 ng\r
405 +maildir with search results.\r
406 +\r
407 +=3Dhead1 OPTIONS\r
408 +\r
409 +=3Dover 4\r
410 +\r
411 +=3Ditem -o DIR\r
412 +\r
413 +=3Ditem --output-dir DIR\r
414 +\r
415 +Store search results as (symlink) messages under maildir DIR. Beware: DIR =\r
416 will\r
417 +be overwritten. (Default: F<~/.cache/notmuch/mutt/results/>)\r
418 +\r
419 +=3Ditem -p\r
420 +\r
421 +=3Ditem --prompt\r
422 +\r
423 +Instead of using command line search terms, prompt the user for them (only=\r
424  for\r
425 +"search").\r
426 +\r
427 +=3Ditem -h\r
428 +\r
429 +=3Ditem --help\r
430 +\r
431 +Show usage information and exit.\r
432 +\r
433 +=3Dback\r
434 +\r
435 +=3Dhead1 INTEGRATION WITH MUTT\r
436 +\r
437 +notmuch-mutt can be used to integrate notmuch with the Mutt mail user agent\r
438 +(unsurprisingly, given the name). To that end, you should define macros li=\r
439 ke\r
440 +the following in your Mutt configuration (usually one of: F<~/.muttrc>,\r
441 +F</etc/Muttrc>, or a configuration snippet under F</etc/Muttrc.d/>):\r
442 +\r
443 +    macro index <F8> \\r
444 +          "<enter-command>unset wait_key<enter><shell-escape>notmuch-mutt =\r
445 --prompt search<enter><change-folder-readonly>~/.cache/notmuch/mutt/results=\r
446 <enter>" \\r
447 +          "notmuch: search mail"\r
448 +    macro index <F9> \\r
449 +          "<enter-command>unset wait_key<enter><pipe-message>notmuch-mutt =\r
450 thread<enter><change-folder-readonly>~/.cache/notmuch/mutt/results<enter><e=\r
451 nter-command>set wait_key<enter>" \\r
452 +          "notmuch: reconstruct thread"\r
453 +    macro index <F6> \\r
454 +          "<enter-command>unset wait_key<enter><pipe-message>notmuch-mutt =\r
455 tag -inbox<enter>" \\r
456 +          "notmuch: remove message from inbox"\r
457 +\r
458 +The first macro (activated by <F8>) prompts the user for notmuch search te=\r
459 rms\r
460 +and then jump to a temporary maildir showing search results. The second ma=\r
461 cro\r
462 +(activated by <F9>) reconstructs the thread corresponding to the current m=\r
463 ail\r
464 +and show it as search results. The third macro (activated by <F6>) removes=\r
465  the\r
466 +tag C<inbox> from the current message; by changing C<-inbox> this macro ma=\r
467 y be\r
468 +customised to add or remove tags appropriate to the users notmuch work-flo=\r
469 w.\r
470 +\r
471 +To keep notmuch index current you should then periodically run C<notmuch\r
472 +new>. Depending on your local mail setup, you might want to do that via cr=\r
473 on,\r
474 +as a hook triggered by mail retrieval, etc.\r
475 +\r
476 +=3Dhead1 SEE ALSO\r
477 +\r
478 +mutt(1), notmuch(1)\r
479 +\r
480 +=3Dhead1 AUTHOR\r
481 +\r
482 +Copyright: (C) 2011-2012 Stefano Zacchiroli <zack@upsilon.cc>\r
483 +\r
484 +License: GNU General Public License (GPL), version 3 or higher\r
485 +\r
486 +=3Dcut\r
487 diff --git a/contrib/notmuch-mutt/notmuch-mutt.rc b/contrib/notmuch-mutt/no=\r
488 tmuch-mutt.rc\r
489 new file mode 100644\r
490 index 0000000..c0ff000\r
491 --- /dev/null\r
492 +++ b/contrib/notmuch-mutt/notmuch-mutt.rc\r
493 @@ -0,0 +1,9 @@\r
494 +macro index <F8> \\r
495 +      "<enter-command>unset wait_key<enter><shell-escape>notmuch-mutt --pr=\r
496 ompt search<enter><change-folder-readonly>`echo ${XDG_CACHE_HOME:-$HOME/.ca=\r
497 che}/notmuch/mutt/results`<enter>" \\r
498 +      "notmuch: search mail"\r
499 +macro index <F9> \\r
500 +      "<enter-command>unset wait_key<enter><pipe-message>notmuch-mutt thre=\r
501 ad<enter><change-folder-readonly>`echo ${XDG_CACHE_HOME:-$HOME/.cache}/notm=\r
502 uch/mutt/results`<enter><enter-command>set wait_key<enter>" \\r
503 +      "notmuch: reconstruct thread"\r
504 +macro index <F6> \\r
505 +      "<enter-command>unset wait_key<enter><pipe-message>notmuch-mutt tag =\r
506 -inbox<enter>" \\r
507 +      "notmuch: remove message from inbox"\r
508 --=20\r
509 1.7.9.5\r
510 \r
511 \r
512 --qDbXVdCdHGoSgWSk\r
513 Content-Type: text/x-diff; charset=us-ascii\r
514 Content-Disposition: attachment; filename="0002-debian-packaging-new-binary-package-notmuch-mutt.patch"\r
515 Content-Transfer-Encoding: quoted-printable\r
516 \r
517 =46rom 856204dea0f5133b2f80da74ad329355d5124b36 Mon Sep 17 00:00:00 2001\r
518 =46rom: Stefano Zacchiroli <zack@upsilon.cc>\r
519 Date: Mon, 26 Mar 2012 10:51:44 +0200\r
520 Subject: [PATCH 2/2] debian packaging: new binary package notmuch-mutt\r
521 \r
522 ---\r
523  debian/changelog             |    6 ++++++\r
524  debian/control               |   16 ++++++++++++++++\r
525  debian/notmuch-mutt.docs     |    1 +\r
526  debian/notmuch-mutt.install  |    2 ++\r
527  debian/notmuch-mutt.manpages |    1 +\r
528  debian/rules                 |    2 ++\r
529  6 files changed, 28 insertions(+)\r
530  create mode 100644 debian/notmuch-mutt.docs\r
531  create mode 100644 debian/notmuch-mutt.install\r
532  create mode 100644 debian/notmuch-mutt.manpages\r
533 \r
534 diff --git a/debian/changelog b/debian/changelog\r
535 index d0eec37..bd70d08 100644\r
536 --- a/debian/changelog\r
537 +++ b/debian/changelog\r
538 @@ -1,3 +1,9 @@\r
539 +notmuch (0.12-2) UNRELEASED; urgency=3Dlow\r
540 +\r
541 +  * new binary package "notmuch-mutt" for Mutt integration\r
542 +\r
543 + -- Stefano Zacchiroli <zack@debian.org>  Mon, 26 Mar 2012 10:47:29 +0200\r
544 +\r
545  notmuch (0.12-1) unstable; urgency=3Dlow\r
546 =20\r
547    * New upstream release\r
548 diff --git a/debian/control b/debian/control\r
549 index ed27c58..ada9d3d 100644\r
550 --- a/debian/control\r
551 +++ b/debian/control\r
552 @@ -105,3 +105,19 @@ Description: thread-based email index, search and tagg=\r
553 ing (vim interface)\r
554   This package provides a vim based mail user agent based on\r
555   notmuch.\r
556 =20\r
557 +Package: notmuch-mutt\r
558 +Architecture: all\r
559 +Depends: notmuch, libmail-box-perl, libmailtools-perl,\r
560 + libstring-shellquote-perl, libterm-readline-gnu-perl,\r
561 + ${misc:Depends}\r
562 +Recommends: mutt\r
563 +Enhances: notmuch, mutt\r
564 +Description: thread-based email index, search and tagging (Mutt interface)\r
565 + notmuch-mutt provides integration among the Mutt mail user agent and\r
566 + the Notmuch mail indexer.\r
567 + .\r
568 + notmuch-mutt offer two main integration features. The first one is\r
569 + the ability of stating a search query interactively and then jump to\r
570 + a fresh Maildir containing its search results only. The second one is\r
571 + the ability to reconstruct threads on the fly starting from the\r
572 + current highlighted mail.\r
573 diff --git a/debian/notmuch-mutt.docs b/debian/notmuch-mutt.docs\r
574 new file mode 100644\r
575 index 0000000..f3d25cd\r
576 --- /dev/null\r
577 +++ b/debian/notmuch-mutt.docs\r
578 @@ -0,0 +1 @@\r
579 +contrib/notmuch-mutt/README\r
580 diff --git a/debian/notmuch-mutt.install b/debian/notmuch-mutt.install\r
581 new file mode 100644\r
582 index 0000000..9141c26\r
583 --- /dev/null\r
584 +++ b/debian/notmuch-mutt.install\r
585 @@ -0,0 +1,2 @@\r
586 +contrib/notmuch-mutt/notmuch-mutt      usr/bin\r
587 +contrib/notmuch-mutt/notmuch-mutt.rc   etc/Muttrc.d\r
588 diff --git a/debian/notmuch-mutt.manpages b/debian/notmuch-mutt.manpages\r
589 new file mode 100644\r
590 index 0000000..3f6b8ab\r
591 --- /dev/null\r
592 +++ b/debian/notmuch-mutt.manpages\r
593 @@ -0,0 +1 @@\r
594 +contrib/notmuch-mutt/notmuch-mutt.1\r
595 diff --git a/debian/rules b/debian/rules\r
596 index 956f3f2..603b3ab 100755\r
597 --- a/debian/rules\r
598 +++ b/debian/rules\r
599 @@ -9,10 +9,12 @@ override_dh_auto_configure:\r
600  override_dh_auto_build:\r
601         dh_auto_build\r
602         dh_auto_build --sourcedirectory bindings/python\r
603 +       $(MAKE) -C contrib/notmuch-mutt\r
604 =20\r
605  override_dh_auto_clean:\r
606         dh_auto_clean\r
607         dh_auto_clean --sourcedirectory bindings/python\r
608 +       $(MAKE) -C contrib/notmuch-mutt clean\r
609 =20\r
610  override_dh_auto_install:\r
611         dh_auto_install\r
612 --=20\r
613 1.7.9.5\r
614 \r
615 \r
616 --qDbXVdCdHGoSgWSk--\r
617 \r
618 --gj572EiMnwbLXET9\r
619 Content-Type: application/pgp-signature; name="signature.asc"\r
620 Content-Description: Digital signature\r
621 \r
622 -----BEGIN PGP SIGNATURE-----\r
623 Version: GnuPG v1.4.12 (GNU/Linux)\r
624 \r
625 iQIVAwUBT3RlKpwxUDxthmOWAQgYGQ//QYJ3OosVKFkiXl+yN++VzDKHcTLkO0KK\r
626 H4AgI/TYAas5todKiEfd8SlvVaZG4+HnsKWRxFKbq+IXcgnpX5O1lYcinR0aC1TC\r
627 aeG2K3Cimo1vfjroUanCKf5Puai6MWA8TJtDNjwSruqxbWVZIEonYQyP6ulwetun\r
628 64PUuUtEj+3OobdpHX2IdSyAwzPKnD7FGggshbQ8Z8tehAN/cPB8NQ/muOI8PNhg\r
629 id3AoJJ9ho22UWp3tSvN6/d+AwqBzDFnlaKdqC6LYG45GBLF9jmN65bcKLQP0kLs\r
630 cr5IgmK8JYWQFDrxU/fiVIM7U2xPXfKqSXemdxSHzaSL1L7G50SXG7p51dWcFxIK\r
631 zTbwp14QRbJHMmh5TtvTsxdQaIJyFyao7XnuzrUi3EML2XZnTtTmFDYW3sGqu93Z\r
632 sWGGFGqbimJCC4PzGGjj9ubnVsaBzMacAWVFE6Xw+KM7EqdzhCKwcpOwYwkQliJi\r
633 9can5PPKmcGug5MaekQJqkCB5AA45xFwX3n/T5aAmyAgxBi7gqYVWUgowZrs65nN\r
634 c88QM8tc7k5R76BhpVo/Qdb+rcQumXmxvjIC0ABlkWkgea3bBvZGxdby6+nN561d\r
635 axtYyc32eHS54JKg9mGi6AARtDb8S+5zrKjDuUJWU476625fT5U45qLxDc6z/u1C\r
636 Hp6tm6G96mc=\r
637 =EGhc\r
638 -----END PGP SIGNATURE-----\r
639 \r
640 --gj572EiMnwbLXET9--\r