aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2020-06-21 00:40:46 +1200
committerTom Ryder <tom@sanctum.geek.nz>2020-06-21 00:40:46 +1200
commitdd5d1b2ee5156dfc01eb2c73265e4be6fc175958 (patch)
tree081b46350312514064f767b47ac8ab8826250639
parentMerge branch 'release/v9.24.0' (diff)
parentBump VERSION (diff)
downloaddotfiles-dd5d1b2ee5156dfc01eb2c73265e4be6fc175958.tar.gz
dotfiles-dd5d1b2ee5156dfc01eb2c73265e4be6fc175958.zip
Merge branch 'release/v9.25.0'v9.25.0
* release/v9.25.0: Add notmuch-mutt macro Adopt pared-down custom mailcap for Mutt
-rw-r--r--Makefile1
-rw-r--r--VERSION4
-rw-r--r--mutt/mailcap11
-rw-r--r--mutt/muttrc42
4 files changed, 49 insertions, 9 deletions
diff --git a/Makefile b/Makefile
index 60f2be62..487b835c 100644
--- a/Makefile
+++ b/Makefile
@@ -483,6 +483,7 @@ install-mutt: install-gnupg install-mail mutt/filters/markdown-to-html
$(XDG_DATA_HOME)/mutt/autocrypt \
$(HOME)/.local/libexec/mutt/filters
cp -p -- mutt/muttrc \
+ mutt/mailcap \
$(XDG_CONFIG_HOME)/mutt
cp -p -- mutt/muttrc.d/src \
$(XDG_CONFIG_HOME)/mutt/muttrc.d
diff --git a/VERSION b/VERSION
index 8aa530ce..437677b7 100644
--- a/VERSION
+++ b/VERSION
@@ -1,2 +1,2 @@
-tejr dotfiles v9.24.0
-Wed, 17 Jun 2020 09:18:47 +0000
+tejr dotfiles v9.25.0
+Sat, 20 Jun 2020 12:40:42 +0000
diff --git a/mutt/mailcap b/mutt/mailcap
new file mode 100644
index 00000000..3ce21d24
--- /dev/null
+++ b/mutt/mailcap
@@ -0,0 +1,11 @@
+# Simple mailcap for a terminal-only Mutt; I generally download everything
+# anyway and deal with it on a shell, or pass it to a GUI machine.
+#
+text/html; lynx -dump -force_html %s; \
+ copiousoutput; \
+ description=HTML; \
+ nametemplate=%s.html
+application/pdf; pdftotext -layout -nopgbrk -q %s -; \
+ copiousoutput; \
+ description=PDF; \
+ nametemplate=%s.pdf
diff --git a/mutt/muttrc b/mutt/muttrc
index 572ea165..8ff08aa5 100644
--- a/mutt/muttrc
+++ b/mutt/muttrc
@@ -1,10 +1,3 @@
-# Prefer the plain text part of multipart emails, followed by any enriched text
-# part (?), followed by the HTML part, followed by any other parts. Decode the
-# text/html part with .mailcap's chosen program (I favour Lynx).
-#
-alternative_order text/plain text/enriched text/html *
-auto_view text/html
-
# If an outgoing message looks like I meant to attach something, and there
# isn't an attachment, prompt me to make sure I haven't forgotten it.
# I normally don't like this sort of nagging, but I'm making an exception in
@@ -69,6 +62,29 @@ set include
#
set index_format = '%4C %Z %{%b %d %Y} %-15.15L (%?l?%4l&%4c?) %?H?[%H] ?%s'
+# Set a custom mailcap, rather than leaning on the system's
+#
+set mailcap_path = \
+ ~/.config/mutt/mailcap
+
+# When displaying messages with multiple alternatives for display, prefer any
+# plain text one, but failing that, fall back to enriched text (hey, it could
+# happen...)
+#
+alternative_order \
+ text/plain \
+ text/enriched \
+ text/html \
+ application/pdf \
+ *
+
+# Decode any text/html and application/pdf parts with .mailcap's specified
+# programs.
+#
+auto_view \
+ text/html \
+ application/pdf
+
# Don't show any nasty little markers at the start of wrapped lines. That's
# the sort of thing Vim cares about, if need be.
#
@@ -232,6 +248,18 @@ macro index,pager \\a \
'<pipe-message>abook --add-email-quiet<enter>' \
'Add sender address to abook'
+# Janky notmuch-mutt search macro, cleaned up a little
+macro index \\l '\
+<enter-command>set my_pipe_decode=$pipe_decode \
+ my_wait_key=$wait_key \
+ nopipe_decode \
+ nowait_key<enter>\
+<shell-escape>notmuch-mutt --prompt search --remove-dups<enter>\
+<change-folder-readonly>~/.cache/notmuch/mutt/results<enter>\
+<enter-command>set pipe_decode=$my_pipe_decode \
+ wait_key=$my_wait_key<enter>' \
+ 'notmuch: search mail'
+
# Shortcut to reload configuration
set my_muttrc \
= ~/.config/mutt/muttrc