From: Stefano Zacchiroli <zack@upsilon.cc>
To: notmuch@notmuchmail.org
Subject: Re: Bug#628018: [PATCH] notmuch-mutt utility for notmuch/contrib/
Date: Mon, 26 Mar 2012 20:52:49 +0200 [thread overview]
Message-ID: <20120326185249.GA2534@upsilon.cc> (raw)
In-Reply-To: <20120326152902.GA11610@upsilon.cc>
[-- Attachment #1.1: Type: text/plain, Size: 1163 bytes --]
On Mon, Mar 26, 2012 at 05:29:02PM +0200, Stefano Zacchiroli wrote:
> But while it's trivial to make notmuch-mutt itself support
> $XDG_CACHE_HOME, it is less so for the Mutt configuration snippet
> (i.e. the notmuch-mutt.rc file which is part of my submission). AFAICT
> the <change-folder-readonly> function does not support variable
> expansions, not to mention default values while doing so.
... but Mutt configuration has backtick expansions! So never mind the
above.
The attached patch should be all that's needed to proper $XDG_CACHE_HOME
support, according to XDG basedir spec.
If you folks now consider the contrib submission good enough for
inclusion, feel free to just "git am" the 3 patches. If you want me to
implement other changes --- including bureaucratic stuff like merging
patches together --- just let me know!
Cheers.
--
Stefano Zacchiroli zack@{upsilon.cc,pps.jussieu.fr,debian.org} . o .
Maître de conférences ...... http://upsilon.cc/zack ...... . . o
Debian Project Leader ....... @zack on identi.ca ....... o o o
« the first rule of tautology club is the first rule of tautology club »
[-- Attachment #1.2: 0003-notmuch-mutt-XDG_CACHE_HOME-support-as-per-XDG-based.patch --]
[-- Type: text/x-diff, Size: 2254 bytes --]
From f68f36448f5bc63211c12b9e53e9db603ed76178 Mon Sep 17 00:00:00 2001
From: Stefano Zacchiroli <zack@upsilon.cc>
Date: Mon, 26 Mar 2012 20:47:34 +0200
Subject: [PATCH] notmuch-mutt: $XDG_CACHE_HOME support as per XDG basedir
spec
---
contrib/notmuch-mutt/notmuch-mutt | 4 +++-
contrib/notmuch-mutt/notmuch-mutt.rc | 4 ++--
2 files changed, 5 insertions(+), 3 deletions(-)
mode change 100755 => 100644 contrib/notmuch-mutt/notmuch-mutt
diff --git a/contrib/notmuch-mutt/notmuch-mutt b/contrib/notmuch-mutt/notmuch-mutt
old mode 100755
new mode 100644
index 29674ec..9cd01ec
--- a/contrib/notmuch-mutt/notmuch-mutt
+++ b/contrib/notmuch-mutt/notmuch-mutt
@@ -20,7 +20,9 @@ use String::ShellQuote;
use Term::ReadLine;
-my $cache_dir = "$ENV{HOME}/.cache/notmuch/mutt";
+my $xdg_cache_dir = "$ENV{HOME}/.cache";
+$xdg_cache_dir = $ENV{XDG_CACHE_HOME} if $ENV{XDG_CACHE_HOME};
+my $cache_dir = "$xdg_cache_dir/notmuch/mutt";
# create an empty maildir (if missing) or empty an existing maildir"
diff --git a/contrib/notmuch-mutt/notmuch-mutt.rc b/contrib/notmuch-mutt/notmuch-mutt.rc
index 269f03f..c0ff000 100644
--- a/contrib/notmuch-mutt/notmuch-mutt.rc
+++ b/contrib/notmuch-mutt/notmuch-mutt.rc
@@ -1,8 +1,8 @@
macro index <F8> \
- "<enter-command>unset wait_key<enter><shell-escape>notmuch-mutt --prompt search<enter><change-folder-readonly>~/.cache/notmuch/mutt/results<enter>" \
+ "<enter-command>unset wait_key<enter><shell-escape>notmuch-mutt --prompt search<enter><change-folder-readonly>`echo ${XDG_CACHE_HOME:-$HOME/.cache}/notmuch/mutt/results`<enter>" \
"notmuch: search mail"
macro index <F9> \
- "<enter-command>unset wait_key<enter><pipe-message>notmuch-mutt thread<enter><change-folder-readonly>~/.cache/notmuch/mutt/results<enter><enter-command>set wait_key<enter>" \
+ "<enter-command>unset wait_key<enter><pipe-message>notmuch-mutt thread<enter><change-folder-readonly>`echo ${XDG_CACHE_HOME:-$HOME/.cache}/notmuch/mutt/results`<enter><enter-command>set wait_key<enter>" \
"notmuch: reconstruct thread"
macro index <F6> \
"<enter-command>unset wait_key<enter><pipe-message>notmuch-mutt tag -inbox<enter>" \
--
1.7.9.1
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 828 bytes --]
next prev parent reply other threads:[~2012-03-26 18:52 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-26 10:32 [Stefano Zacchiroli] Bug#628018: [PATCH] mutt-notmuch in notmuch contrib David Bremner
2012-03-26 10:37 ` [Stefano Zacchiroli] Bug#628018: [PATCH] notmuch-mutt utility for notmuch/contrib/ David Bremner
2012-03-26 12:34 ` Tomi Ollila
2012-03-26 15:09 ` Jameson Graef Rollins
2012-03-26 15:29 ` Stefano Zacchiroli
2012-03-26 18:52 ` Stefano Zacchiroli [this message]
2012-03-26 19:03 ` Scott Barker
2012-03-26 21:15 ` Stefano Zacchiroli
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://notmuchmail.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120326185249.GA2534@upsilon.cc \
--to=zack@upsilon.cc \
--cc=notmuch@notmuchmail.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://yhetil.org/notmuch.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).