--- /dev/null
+Return-Path: <zack@upsilon.cc>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by olra.theworths.org (Postfix) with ESMTP id AB88F431FAF\r
+ for <notmuch@notmuchmail.org>; Mon, 26 Mar 2012 11:52:52 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
+ autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+ by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id IJ-uS03iezqv for <notmuch@notmuchmail.org>;\r
+ Mon, 26 Mar 2012 11:52:51 -0700 (PDT)\r
+Received: from upsilon.hackadomia.org (upsilon.hackadomia.org\r
+ [91.121.245.170]) by olra.theworths.org (Postfix) with ESMTP id 2BB4E431FAE\r
+ for <notmuch@notmuchmail.org>; Mon, 26 Mar 2012 11:52:51 -0700 (PDT)\r
+Received: from usha.takhisis.invalid (zack.inria.fr [128.93.60.82])\r
+ by upsilon.hackadomia.org (Postfix) with ESMTPSA id 2DEA310131\r
+ for <notmuch@notmuchmail.org>; Mon, 26 Mar 2012 20:52:49 +0200 (CEST)\r
+Received: by usha.takhisis.invalid (Postfix, from userid 1000)\r
+ id 079FE681CAD; Mon, 26 Mar 2012 20:52:49 +0200 (CEST)\r
+Date: Mon, 26 Mar 2012 20:52:49 +0200\r
+From: Stefano Zacchiroli <zack@upsilon.cc>\r
+To: notmuch@notmuchmail.org\r
+Subject: Re: Bug#628018: [PATCH] notmuch-mutt utility for notmuch/contrib/\r
+Message-ID: <20120326185249.GA2534@upsilon.cc>\r
+Mail-Followup-To: notmuch@notmuchmail.org, Stefano Zacchiroli\r
+ <zack@upsilon.cc>\r
+References: <87ehsfr6lb.fsf@zancas.localnet>\r
+ <m2aa33o81v.fsf@guru.guru-group.fi>\r
+ <87d37zl7qe.fsf@servo.finestructure.net>\r
+ <20120326152902.GA11610@upsilon.cc>\r
+MIME-Version: 1.0\r
+Content-Type: multipart/signed; micalg=pgp-sha256;\r
+ protocol="application/pgp-signature"; boundary="gatW/ieO32f1wygP"\r
+Content-Disposition: inline\r
+In-Reply-To: <20120326152902.GA11610@upsilon.cc>\r
+User-Agent: Mutt/1.5.21 (2010-09-15)\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Mon, 26 Mar 2012 18:52:52 -0000\r
+\r
+\r
+--gatW/ieO32f1wygP\r
+Content-Type: multipart/mixed; boundary="LZvS9be/3tNcYl/X"\r
+Content-Disposition: inline\r
+\r
+\r
+--LZvS9be/3tNcYl/X\r
+Content-Type: text/plain; charset=iso-8859-1\r
+Content-Disposition: inline\r
+Content-Transfer-Encoding: quoted-printable\r
+\r
+On Mon, Mar 26, 2012 at 05:29:02PM +0200, Stefano Zacchiroli wrote:\r
+> But while it's trivial to make notmuch-mutt itself support\r
+> $XDG_CACHE_HOME, it is less so for the Mutt configuration snippet\r
+> (i.e. the notmuch-mutt.rc file which is part of my submission). AFAICT\r
+> the <change-folder-readonly> function does not support variable\r
+> expansions, not to mention default values while doing so.\r
+\r
+=2E.. but Mutt configuration has backtick expansions! So never mind the\r
+above.\r
+\r
+The attached patch should be all that's needed to proper $XDG_CACHE_HOME\r
+support, according to XDG basedir spec.\r
+\r
+If you folks now consider the contrib submission good enough for\r
+inclusion, feel free to just "git am" the 3 patches. If you want me to\r
+implement other changes --- including bureaucratic stuff like merging\r
+patches together --- just let me know!\r
+\r
+Cheers.\r
+--=20\r
+Stefano Zacchiroli zack@{upsilon.cc,pps.jussieu.fr,debian.org} . o .\r
+Ma=EEtre de conf=E9rences ...... http://upsilon.cc/zack ...... . . o\r
+Debian Project Leader ....... @zack on identi.ca ....... o o o\r
+=AB the first rule of tautology club is the first rule of tautology club =BB\r
+\r
+--LZvS9be/3tNcYl/X\r
+Content-Type: text/x-diff; charset=us-ascii\r
+Content-Disposition: attachment; filename="0003-notmuch-mutt-XDG_CACHE_HOME-support-as-per-XDG-based.patch"\r
+Content-Transfer-Encoding: quoted-printable\r
+\r
+=46rom f68f36448f5bc63211c12b9e53e9db603ed76178 Mon Sep 17 00:00:00 2001\r
+=46rom: Stefano Zacchiroli <zack@upsilon.cc>\r
+Date: Mon, 26 Mar 2012 20:47:34 +0200\r
+Subject: [PATCH] notmuch-mutt: $XDG_CACHE_HOME support as per XDG basedir\r
+ spec\r
+\r
+---\r
+ contrib/notmuch-mutt/notmuch-mutt | 4 +++-\r
+ contrib/notmuch-mutt/notmuch-mutt.rc | 4 ++--\r
+ 2 files changed, 5 insertions(+), 3 deletions(-)\r
+ mode change 100755 =3D> 100644 contrib/notmuch-mutt/notmuch-mutt\r
+\r
+diff --git a/contrib/notmuch-mutt/notmuch-mutt b/contrib/notmuch-mutt/notmu=\r
+ch-mutt\r
+old mode 100755\r
+new mode 100644\r
+index 29674ec..9cd01ec\r
+--- a/contrib/notmuch-mutt/notmuch-mutt\r
++++ b/contrib/notmuch-mutt/notmuch-mutt\r
+@@ -20,7 +20,9 @@ use String::ShellQuote;\r
+ use Term::ReadLine;\r
+=20\r
+=20\r
+-my $cache_dir =3D "$ENV{HOME}/.cache/notmuch/mutt";\r
++my $xdg_cache_dir =3D "$ENV{HOME}/.cache";\r
++$xdg_cache_dir =3D $ENV{XDG_CACHE_HOME} if $ENV{XDG_CACHE_HOME};\r
++my $cache_dir =3D "$xdg_cache_dir/notmuch/mutt";\r
+=20\r
+=20\r
+ # create an empty maildir (if missing) or empty an existing maildir"\r
+diff --git a/contrib/notmuch-mutt/notmuch-mutt.rc b/contrib/notmuch-mutt/no=\r
+tmuch-mutt.rc\r
+index 269f03f..c0ff000 100644\r
+--- a/contrib/notmuch-mutt/notmuch-mutt.rc\r
++++ b/contrib/notmuch-mutt/notmuch-mutt.rc\r
+@@ -1,8 +1,8 @@\r
+ macro index <F8> \\r
+- "<enter-command>unset wait_key<enter><shell-escape>notmuch-mutt --pr=\r
+ompt search<enter><change-folder-readonly>~/.cache/notmuch/mutt/results<ent=\r
+er>" \\r
++ "<enter-command>unset wait_key<enter><shell-escape>notmuch-mutt --pr=\r
+ompt search<enter><change-folder-readonly>`echo ${XDG_CACHE_HOME:-$HOME/.ca=\r
+che}/notmuch/mutt/results`<enter>" \\r
+ "notmuch: search mail"\r
+ macro index <F9> \\r
+- "<enter-command>unset wait_key<enter><pipe-message>notmuch-mutt thre=\r
+ad<enter><change-folder-readonly>~/.cache/notmuch/mutt/results<enter><enter=\r
+-command>set wait_key<enter>" \\r
++ "<enter-command>unset wait_key<enter><pipe-message>notmuch-mutt thre=\r
+ad<enter><change-folder-readonly>`echo ${XDG_CACHE_HOME:-$HOME/.cache}/notm=\r
+uch/mutt/results`<enter><enter-command>set wait_key<enter>" \\r
+ "notmuch: reconstruct thread"\r
+ macro index <F6> \\r
+ "<enter-command>unset wait_key<enter><pipe-message>notmuch-mutt tag =\r
+-inbox<enter>" \\r
+--=20\r
+1.7.9.1\r
+\r
+\r
+--LZvS9be/3tNcYl/X--\r
+\r
+--gatW/ieO32f1wygP\r
+Content-Type: application/pgp-signature; name="signature.asc"\r
+Content-Description: Digital signature\r
+\r
+-----BEGIN PGP SIGNATURE-----\r
+Version: GnuPG v1.4.12 (GNU/Linux)\r
+\r
+iQIVAwUBT3C7AJwxUDxthmOWAQjA7A/9Ebr60Dg4h6uCDYPd+cRwlQT9EwBZfxb0\r
+fe3oNwH61paegJ8tiPANqYnExJhxwKkcmqEIhpddvkjLRsvs0upsnrjLfJ6vho3e\r
+E7GFAycAeZR2pcT2SUG/2dzlo9izQMzoMOWRZD5RPVC/k4G0ZoDI4BPs4x0usgtN\r
+rS/8n4tIYGHkH1+BPsyN6R3UDBDAngB5G2xcfBH/WCjV+IomcytYypofIyeTUaR9\r
+VT/eYMYvCU7oLrIQK8qe/tPgag2sw3MrOb/KzXcQGjl2rQ+Q+6JRqJJac7xq01Y+\r
+3SCjA2I30vlcrcese8A4rL+UgRIIhESCfjSg4i6eTqvEtw8V8Twf/bEJOHqiRAu1\r
+8s9mQ3fhOmD679Wg76fi7tA5vFjgotg/3kAVA6TRSLNZfSyHFLaSu8rplrlD6mJ0\r
+LjGM+G7Dg/cZYjSzSrzs9UYKsbLS/yOlyy8ygrKlfQtVSxn6t4L7fShuP5bAuqpv\r
+nwuykfLTqzhq3AAZCXsrmnDHgYwvL1e3s7G0ZKU9adEFv9tJ0++iO8JiTpZ6eoaW\r
+XA+WFr5KE1mFCBjSMLT1Z6Bl/645vIjFDfJ2xZvX7P11wlnmWVKwm9r4NHvglFhB\r
+pdvfKzvW3Z9FAIYtMY/2ISMorNaFbwkvdFxW9ndQPrkjUm03Wq/Fk5hGmyq9iLx3\r
+HaqPbFmMzKQ=\r
+=8C2l\r
+-----END PGP SIGNATURE-----\r
+\r
+--gatW/ieO32f1wygP--\r