# 2017-08-03 Regarding mmh [1] [2]: It occasionally happens that I am in my mmh folder "trash", search in my bash history and accidentally execute something like "rmm `pick -from foo`". I often use this command in the "inbox" folder, but sometimes it happens that I have switched to trash, forgot about this new context and attempt to delete stuff from the inbox in a different tmux window in which I had at some past executed "scan" on the inbox. For me this is practically always unintended, as mails are then gone forever. I have created this script to prevent me from accidentally deleting stuff: $ alias rmm rmm=/home/michi/.bin/safe-rmm.sh $ cat /home/michi/.bin/safe-rmm.sh #!/bin/bash -eu CURRENT_FOLDER=$(cat ~/.mmh/context | sed -e 's/Current-Folder: //g') if [[ "$CURRENT_FOLDER" == "trash" || "$CURRENT_FOLDER" == "sent" ]]; then echo "You're in $CURRENT_FOLDER!" >&2 exit 1 fi rmm "$@" [1] https://www.youtube.com/watch?v=8aZlJCgHG0w [2] http://marmaro.de/prog/mmh/