aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2020-05-20 17:13:07 +1200
committerTom Ryder <tom@sanctum.geek.nz>2020-05-20 17:19:55 +1200
commit6124c0b09653babdc038abc9c4623141b51a108f (patch)
treee2b13cb150def85e1e51849303cdc73e66f5b058
parentMerge branch 'release/v9.6.0' into develop (diff)
downloaddotfiles-6124c0b09653babdc038abc9c4623141b51a108f.tar.gz
dotfiles-6124c0b09653babdc038abc9c4623141b51a108f.zip
Separate local muttrc from aliases file
-rw-r--r--Makefile1
-rw-r--r--mutt/muttrc14
2 files changed, 13 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 05c5ff29..71cac213 100644
--- a/Makefile
+++ b/Makefile
@@ -503,6 +503,7 @@ install-mutt: install-gnupg install-mail mutt/filters/markdown-to-html
$(XDG_CONFIG_HOME)/mutt
cp -p -- mutt/muttrc.d/src \
$(XDG_CONFIG_HOME)/mutt/muttrc.d
+ touch -- $(XDG_CONFIG_HOME)/mutt/aliases
cp -p -- mutt/filters/markdown-to-html \
$(HOME)/.local/share/mutt/libexec/filters
diff --git a/mutt/muttrc b/mutt/muttrc
index f20ddcee..7a1e3e31 100644
--- a/mutt/muttrc
+++ b/mutt/muttrc
@@ -21,6 +21,14 @@ set abort_noattach_regexp = "attached is|(find|i've|see) attached"
#
unset abort_unmodified
+# Put the alias file in a nice XDG location, distinct from the muttrc, so that
+# we don't end up losing them each time the dotfiles are reinstalled; muttrd(5)
+# points out that this file needs to be explicitly sourced, too.
+#
+set alias_file \
+ = ~/.config/mutt/aliases
+source $alias_file
+
# Don't send terminal bells on errors, but do send them when new mail arrives,
# because that should light up my tmux window label and/or urxvt window.
#
@@ -213,10 +221,12 @@ macro index,pager \\A \
'Add sender address to abook'
# Shortcut to reload configuration
+set my_muttrc \
+ = ~/.config/mutt/muttrc
macro generic,index,browser,pager \\R '\
<enter-command>unhook *<enter>\
-<enter-command>source $alias_file<enter>\
-<enter-command>echo "Reloaded with $alias_file"<enter>' \
+<enter-command>source $my_muttrc<enter>\
+<enter-command>echo "Reloaded $my_muttrc"<enter>' \
"Clear hooks and reload"
# Shortcut to toggle thread display