X-Git-Url: https://git.madduck.net/etc/mutt.git/blobdiff_plain/57c899814e74bdf9adec4c7d8211fc25d6b39697..78ae86a908265776c91728333e451be278a8a0e7:/.mutt/reuse-message diff --git a/.mutt/reuse-message b/.mutt/reuse-message index c833bd3..6353558 100755 --- a/.mutt/reuse-message +++ b/.mutt/reuse-message @@ -2,10 +2,11 @@ set -eu eval mailfile="\${$#}" +editor= for i in "$@"; do # strip last argument from editor, yuk case "$i" in - ($mailfile) break;; + ("$mailfile") break;; (*) editor="${editor:+$editor }$i";; esac done @@ -22,6 +23,8 @@ cat "$tmpfile" > "$mailfile" if [ -n "$editor" ]; then eval exec "$editor" "$mailfile" + +# the last three replicate mutt's default (cf. manual) elif [ -n "$VISUAL" ]; then eval exec "$VISUAL" "$mailfile" elif [ -n "$EDITOR" ]; then