On Mi, 26 Feb 2014, Peter P. wrote: > * Patrick Shanahan <ptilopt...@gmail.com> [2014-02-26 17:23]: > > * Peter P. <p8...@aol.com> [02-26-14 10:48]: > > > Hi! > > > > > > I have noticed that I can delete ("save to trash folder") the same > > > message over and over again using, > > > > > > folder-hook . 'macro index d "<save-message>=Trash \r" > > > folder-hook . 'macro pager d "<save-message>=Trash \r" > > > > > > even after it has been marked as deleted. I end up with mutiple > > > accidental copies in the trash this way. Is there a way to > > > incoorporate the status/flag of a message as conditional for the above > > > key binding to only allow saving to trash if the message is not marked > > > as 'deleted'? > > > > You need "sync-mailbox" after the save_to_tash. As long as you remain in > > the same mailbox, destructive actions aside from editing are not applied > > until you close, move to another, or sync the mailbox. > > Thank you for the reply Patrick, I would prefer to not sync/expunge > the mailbox after every "copy to trash" key shortcut. > Perhaps there is a way to make key commands aware of a message's flag > instead.
I see three possibilities. - Instead of deleting the actual messages you tag them and on a key press, you move all tagged, not-deleted messages to your Archive/Trash folder. Something like this (untested): macro index,pager d <tag-pattern>!~D~T<enter><tag-prefix-cond><save-message><kill-line>=Trash<enter><untag-pattern>~A<enter> 'Delete messages' - Add an folder hook, to delete duplicate messages (something like this): folder-hook =Trash 'push <untag-pattern>~A<enter><tag-pattern>~=<enter><tag-prefix-cond><delete-message><untag-pattern>~A<enter><sync-mailbox><enter>' - Use the trash folder patch, that is floating around and even provided in some distributions like Debians mutt-patched, IIRC Best, Christian -- If it weren't for the last minute, nothing would ever get done.