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
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]
\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
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
39 Content-Type: multipart/mixed; boundary="=-=-="
\r
41 Cc: Stefano Zacchiroli <zack@debian.org>
\r
42 X-BeenThere: notmuch@notmuchmail.org
\r
43 X-Mailman-Version: 2.1.13
\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
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
65 Content-Type: message/rfc822
\r
66 Content-Disposition: inline
\r
67 Content-Transfer-Encoding: 8bit
\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
75 (envelope-from <bounces+20120325-bremner=debian.org@packages.qa.debian.org>)
\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
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
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
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
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
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
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
149 X-Loop: notmuch@packages.qa.debian.org
\r
151 X-Debian-Package: notmuch
\r
152 X-PTS-Package: notmuch
\r
154 List-Unsubscribe: <mailto:pts@qa.debian.org?body=unsubscribe%20notmuch>
\r
155 Resent-Sender: Debian QA <qa@quantz.debian.org>
\r
161 Content-Type: multipart/mixed; boundary="M9NhX3UHpAaciwkO"
\r
162 Content-Disposition: inline
\r
166 Content-Type: text/plain; charset=iso-8859-1
\r
167 Content-Disposition: inline
\r
168 Content-Transfer-Encoding: quoted-printable
\r
170 [ please Cc:-me on follow-ups, as I'm not subscribed to the
\r
171 notmuch@notmuchmail.org mailing list ]
\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
180 Hi David, thanks for the tip.
\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
189 I welcome your comments on how to adapt the patch to your preferences
\r
190 for contrib/, err, contributions.
\r
192 > On the debian side your patch series could also include the necessary
\r
193 > changes to make a new binary package.
\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
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
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
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
217 contrib/mutt-notmuch/Makefile | 12 ++
\r
218 contrib/mutt-notmuch/README | 58 +++++++++
\r
219 contrib/mutt-notmuch/mutt-notmuch | 234 +++++++++++++++++++++++++++++++=
\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
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
232 +++ b/contrib/mutt-notmuch/Makefile
\r
234 +NAME =3D mutt-notmuch
\r
236 +all: $(NAME) $(NAME).1
\r
238 +$(NAME).1: $(NAME)
\r
241 +README.html: README
\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
250 +++ b/contrib/mutt-notmuch/README
\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
256 +mutt-notmuch provide integration among the [Mutt] [1] mail user agent and =
\r
258 +[Notmuch] [2] mail indexer.
\r
260 +mutt-notmuch offer two basic integration features. The first one is the ab=
\r
262 +of stating a **search query interactively** and then jump to a fresh Maild=
\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
268 +archived, or the like.
\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
274 +A [blog style introduction] [3] to mutt-notmuch is available and includes =
\r
276 +more rationale for its existence.
\r
278 +Arguably, some of the logics of mutt-notmuch could disappear by adding sup=
\r
280 +for a --output=3Dsymlinks flag to notmuch.
\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
292 +To *run* mutt-notmuch you will need Perl with the following libraries:
\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
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
304 +To *build* mutt-notmuch documentation you will need:
\r
306 +- pod2man (coming with Perl) to generate the manpage
\r
307 +- markdown to generate README.html out of this file
\r
313 +mutt-notmuch is copyright (C) 2011-2012 Stefano Zacchiroli <zack@upsilon.c=
\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
320 diff --git a/contrib/mutt-notmuch/mutt-notmuch b/contrib/mutt-notmuch/mutt-=
\r
322 new file mode 100755
\r
323 index 0000000..31cb539
\r
325 +++ b/contrib/mutt-notmuch/mutt-notmuch
\r
327 +#!/usr/bin/perl -w
\r
329 +# mutt-notmuch - notmuch (of a) helper for Mutt
\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
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
342 +use Getopt::Long qw(:config no_getopt_compat);
\r
343 +use Mail::Internet;
\r
344 +use Mail::Box::Maildir;
\r
346 +use String::ShellQuote;
\r
347 +use Term::ReadLine;
\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
356 + $folder->close();
\r
359 +# search($maildir, $query)
\r
360 +# search mails according to $query with notmuch; store results in $maildir
\r
362 + my ($maildir, $query) =3D @_;
\r
363 + $query =3D shell_quote($query);
\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
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
384 + chomp($query =3D $term->readline($text, $default));
\r
385 + if ($query eq "?") {
\r
386 + system("man", "notmuch");
\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
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
403 +sub search_action($$@) {
\r
404 + my ($interactive, $results_dir, @params) =3D @_;
\r
406 + if (! $interactive) {
\r
407 + search($results_dir, join(' ', @params));
\r
409 + my $query =3D prompt("search ('?' for man): ", join(' ', @params));
\r
410 + if ($query ne "") {
\r
411 + search($results_dir,$query);
\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
422 + search($results_dir, $tid);
\r
425 +sub tag_action(@) {
\r
426 + my $mid =3D get_message_id();
\r
428 + system("notmuch tag "
\r
429 + . shell_quote(join(' ', @_))
\r
434 + my %podflags =3D ( "verbose" =3D> 1,
\r
435 + "exitval" =3D> 2 );
\r
436 + pod2usage(%podflags);
\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
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
451 + foreach my $param (@params) {
\r
452 + $param =3D~ s/folder:=3D/folder:/g;
\r
455 + if ($help_needed) {
\r
457 + } elsif ($action eq "search" && $#ARGV =3D=3D 0 && ! $interactive) {
\r
458 + print STDERR "Error: no search term provided\n\n";
\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
477 +mutt-notmuch - notmuch (of a) helper for Mutt
\r
483 +=3Ditem B<mutt-notmuch> [I<OPTION>]... search [I<SEARCH-TERM>]...
\r
485 +=3Ditem B<mutt-notmuch> [I<OPTION>]... thread < I<MAIL>
\r
487 +=3Ditem B<mutt-notmuch> [I<OPTION>]... tag [I<TAGS>]... < I<MAIL>
\r
491 +=3Dhead1 DESCRIPTION
\r
493 +mutt-notmuch is a frontend to the notmuch mail indexer capable of populati=
\r
495 +maildir with search results.
\r
503 +=3Ditem --output-dir DIR
\r
505 +Store search results as (symlink) messages under maildir DIR. Beware: DIR =
\r
507 +be overwritten. (Default: F<~/.cache/mutt_results/>)
\r
513 +Instead of using command line search terms, prompt the user for them (only=
\r
521 +Show usage information and exit.
\r
525 +=3Dhead1 INTEGRATION WITH MUTT
\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
530 +macros in your F<~/.muttrc> (replacing F<~/bin/mutt-notmuch> for the actual
\r
531 +location of mutt-notmuch on your system):
\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
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
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
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
554 +removes the tag C<inbox> from the current message; by changing C<-inbox> t=
\r
556 +macro may be customised to add or remove tags appropriate to the users not=
\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
563 +as a hook triggered by mail retrieval, etc.
\r
567 +mutt(1), notmuch(1)
\r
571 +Copyright: (C) 2011-2012 Stefano Zacchiroli <zack@upsilon.cc>
\r
573 +License: GNU General Public License (GPL), version 3 or higher
\r
576 diff --git a/contrib/mutt-notmuch/mutt-notmuch.1 b/contrib/mutt-notmuch/mut=
\r
578 new file mode 100644
\r
579 index 0000000..fe5e653
\r
581 +++ b/contrib/mutt-notmuch/mutt-notmuch.1
\r
583 +.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.16)
\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
593 +.de Vb \" Begin verbatim text
\r
598 +.de Ve \" End verbatim text
\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
609 +.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
\r
613 +. if (\n(.H=3D4u)&(1m=3D24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo =
\r
615 +. if (\n(.H=3D4u)&(1m=3D20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo =
\r
629 +.\" Escape single quotes in literal strings from groff's Unicode transform.
\r
630 +.ie \n(.g .ds Aq \(aq
\r
633 +.\" If the F register is turned on, we'll generate index entries on stderr=
\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
640 +. tm Index:\\$1\t\\n%\t"\\$2"
\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
661 +. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
\r
667 +. \" simple accents for nroff and troff
\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
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
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
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
705 +. ds d- d\h'-1'\(ga
\r
706 +. ds D- D\h'-1'\(hy
\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
717 +.IX Title "MUTT-NOTMUCH 1"
\r
718 +.TH MUTT-NOTMUCH 1 "2012-03-25" "perl v5.14.2" "User Contributed Perl Docu=
\r
720 +.\" For nroff, turn off justification. Always turn off hyphenation; it ma=
\r
722 +.\" way too many mistakes in technical documents.
\r
726 +mutt\-notmuch \- notmuch (of a) helper for Mutt
\r
728 +.IX Header "SYNOPSIS"
\r
729 +.IP "\fBmutt-notmuch\fR [\fI\s-1OPTION\s0\fR]... search [\fISEARCH-TERM\fR=
\r
731 +.IX Item "mutt-notmuch [OPTION]... search [SEARCH-TERM]..."
\r
733 +.IP "\fBmutt-notmuch\fR [\fI\s-1OPTION\s0\fR]... thread < \fI\s-1MAIL\s0\f=
\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
741 +.IX Header "DESCRIPTION"
\r
742 +mutt-notmuch is a frontend to the notmuch mail indexer capable of populati=
\r
744 +maildir with search results.
\r
746 +.IX Header "OPTIONS"
\r
747 +.IP "\-o \s-1DIR\s0" 4
\r
750 +.IP "\-\-output\-dir \s-1DIR\s0" 4
\r
751 +.IX Item "--output-dir DIR"
\r
753 +Store search results as (symlink) messages under maildir \s-1DIR\s0. Bewar=
\r
755 +be overwritten. (Default: \fI~/.cache/mutt_results/\fR)
\r
759 +.IP "\-\-prompt" 4
\r
760 +.IX Item "--prompt"
\r
762 +Instead of using command line search terms, prompt the user for them (only=
\r
764 +\&\*(L"search\*(R").
\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
777 +macros in your \fI~/.muttrc\fR (replacing \fI~/bin/mutt\-notmuch\fR for th=
\r
779 +location of mutt-notmuch on your system):
\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
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
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
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
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
810 +To keep notmuch index current you should then periodically run \f(CW\*(C`n=
\r
812 +new\*(C'\fR. Depending on your local mail setup, you might want to do that=
\r
814 +as a hook triggered by mail retrieval, etc.
\r
816 +.IX Header "SEE ALSO"
\r
817 +\&\fImutt\fR\|(1), \fInotmuch\fR\|(1)
\r
819 +.IX Header "AUTHOR"
\r
820 +Copyright: (C) 2011\-2012 Stefano Zacchiroli <zack@upsilon.cc>
\r
822 +License: \s-1GNU\s0 General Public License (\s-1GPL\s0), version 3 or high=
\r
828 --M9NhX3UHpAaciwkO--
\r
831 Content-Type: application/pgp-signature; name="signature.asc"
\r
832 Content-Description: Digital signature
\r
834 -----BEGIN PGP SIGNATURE-----
\r
835 Version: GnuPG v1.4.12 (GNU/Linux)
\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
850 -----END PGP SIGNATURE-----
\r
852 --CdrF4e02JqNVZeln--
\r