On Tue, Aug 24, 2010 at 01:19:34PM +0100, seanh wrote: > On Mon, Aug 23, 2010 at 09:12:17AM +0200, Baptiste Grenier wrote: > > I am using this to copy deleted message to a trash: > > > > folder-hook . 'macro index d "<save-message>+Trash<enter>"' > > folder-hook =Trash 'macro index d <delete-message>' > > > > It's working quite good except that this does not handle message > > deleted using the delete-pattern (D). > > Great idea! Thanks for that. The trash patch is not applied on some of > the systems I use, this is a great universal alternative. > > To make it perfect, you would need to set some $Trash variable > (different account hooks might set it differently, e.g. lavabit uses > =Trash but gmail uses something like =[Gmail]/Bin) and reference that > variable in the folder-hook.
Also, this macro applies only to the index. If you press d when in the pager it will delete the email, not move it to the trash! Here's a version that applies to both index and pager: # Rebind d to move messages to Trash instead of deleting them. # Warning: this does not affect delete-pattern (D). folder-hook . 'macro index,pager d "<save-message>=Trash<enter>"' folder-hook =Trash 'macro index,pager d <delete-message>'