X-Git-Url: https://git.madduck.net/etc/mutt.git/blobdiff_plain/ff90937db28487ad9228eed5357565d2fcc3986e..3918b3e4e1669a0c29b29506427a6d582a2d4978:/.mutt/reuse-message?ds=inline diff --git a/.mutt/reuse-message b/.mutt/reuse-message index f7397ff..0bdb3f8 100755 --- a/.mutt/reuse-message +++ b/.mutt/reuse-message @@ -6,7 +6,7 @@ editor= for i in "$@"; do # strip last argument from editor, yuk case "$i" in - ($mailfile) break;; + ("$mailfile") break;; (*) editor="${editor:+$editor }$i";; esac done @@ -21,8 +21,12 @@ formail -I Subject: < "$mailfile" | \ sed -e '/^Bcc:/aSubject: ' > "$tmpfile" cat "$tmpfile" > "$mailfile" +cleanup + 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