Discussion:
[VM] Make vm-save-and-expunge-folder use a trash can?
Daniel Barrett
2014-06-01 16:38:03 UTC
Permalink
Hi - I just joined the viewmail-info list today. Been using VM for
maybe 20 years...?

Anyway, I have a question. The most common mistake I make with VM is
hitting "S" (vm-save-and-expunge-folder) too soon, deleting a message
that I didn't mean to delete. Is there some way to make
vm-save-and-expunge-folder move messages into a "trash" folder, rather
than permanently deleting them, so I can undo my mistake the next time
it happens?

It would be fine if this worked only for the inbox folder. (My other
folders I can presumably retrieve from backups. Inbox changes too
frequently for that.)

Thanks very much.

--
Dan Barrett
***@blazemonger.com
Rene
2014-06-06 08:58:28 UTC
Permalink
Post by Daniel Barrett
Anyway, I have a question. The most common mistake I make with VM is
hitting "S" (vm-save-and-expunge-folder) too soon, deleting a message
that I didn't mean to delete. Is there some way to make
vm-save-and-expunge-folder move messages into a "trash" folder, rather
than permanently deleting them, so I can undo my mistake the next time
it happens?
It would be fine if this worked only for the inbox folder. (My other
folders I can presumably retrieve from backups. Inbox changes too
frequently for that.)
In such a case I on my vmCrashBoxes.
Uday Reddy
2014-06-06 09:39:42 UTC
Permalink
Rebind the delete key (`d') to the `vm-save-message-to-trash' function
defined here:

http://comments.gmane.org/gmane.emacs.viewmail/106

Cheers,
Uday
Post by Daniel Barrett
Hi - I just joined the viewmail-info list today. Been using VM for
maybe 20 years...?
Anyway, I have a question. The most common mistake I make with VM is
hitting "S" (vm-save-and-expunge-folder) too soon, deleting a message
that I didn't mean to delete. Is there some way to make
vm-save-and-expunge-folder move messages into a "trash" folder, rather
than permanently deleting them, so I can undo my mistake the next time
it happens?
It would be fine if this worked only for the inbox folder. (My other
folders I can presumably retrieve from backups. Inbox changes too
frequently for that.)
Thanks very much.
--
Dan Barrett
Daniel Barrett
2014-06-11 14:03:53 UTC
Permalink
Thank you very much for this suggestion.

This solution is almost (but not quite) complete because you can't
delete anything in the trash folder. :-) Each time you press "D" in
the trash, another copy of the message gets appended. How do you
obtain the path to the current folder, so I can add if/then/else logic
to the function, e.g.,

if not viewing the trash folder
then
bind "D" to vm-save-message-to-trash
else
let "D" remain as an ordinary delete operation
end if

Thanks!
Dan
Post by Uday Reddy
Rebind the delete key (`d') to the `vm-save-message-to-trash' function
http://comments.gmane.org/gmane.emacs.viewmail/106
Cheers,
Uday
Post by Daniel Barrett
Hi - I just joined the viewmail-info list today. Been using VM for
maybe 20 years...?
Anyway, I have a question. The most common mistake I make with VM is
hitting "S" (vm-save-and-expunge-folder) too soon, deleting a message
that I didn't mean to delete. Is there some way to make
vm-save-and-expunge-folder move messages into a "trash" folder, rather
than permanently deleting them, so I can undo my mistake the next time
it happens?
It would be fine if this worked only for the inbox folder. (My other
folders I can presumably retrieve from backups. Inbox changes too
frequently for that.)
Thanks very much.
--
Dan Barrett
Uday Reddy
2014-06-11 14:25:04 UTC
Permalink
Post by Daniel Barrett
Thank you very much for this suggestion.
This solution is almost (but not quite) complete because you can't
delete anything in the trash folder. :-)
Not really. vm-delete-message and all its functionality is still there.
You just lost its key binding. You can find some other key to bind it to,
if it is really necessary.

Cheers,
Uday
Daniel Barrett
2014-06-11 14:42:59 UTC
Permalink
Thanks. Even so, how do you retrieve the folder path to the
currently-viewed folder in VM? I'd still like to set up different
logic for the trash folder, e.g.,

(cond ((eq (<PATH-TO-CURRENT-FOLDER>) (vm-trash-folder)) ...

Thanks,
Dan
Post by Uday Reddy
Post by Daniel Barrett
Thank you very much for this suggestion.
This solution is almost (but not quite) complete because you can't
delete anything in the trash folder. :-)
Not really. vm-delete-message and all its functionality is still there.
You just lost its key binding. You can find some other key to bind it to,
if it is really necessary.
Cheers,
Uday
Loading...