* On Sun, 08 Sep 2002, Chuck Tuffli wrote:

> Hi -
> 
> I'm using mutt with an IMAP server and have a macro defined for d that
> saves a copy of the message to the Trash folder (i.e. macro index d
> "s=Trash\r"). I wanted to change the behavior of the d key back to
> its original meaning if I'm in the Trash folder (actually delete the
> message on the server).
> 
> When I tried to undefine the macro with 'bind index d noop', the macro
> definition goes away but so does the ability to delete the message.
> Trying things like 'bind index d delete-message' after the above warns
> about a circular macro definition. Where am I goofing this up? Should
> this work? Tnx!

You need folder-hooks.  Here's what I do:

## Move messages to trash rather than delete, unless
## we're in the trash folder.
folder-hook .       'macro index d "<save-message>=trash<enter>"'
folder-hook .       'macro pager d "<save-message>=trash<enter>"'
folder-hook trash   'macro index d "<delete-message>"'
folder-hook trash   'macro pager d "<delete-message>"'
## Delete old, non-flagged, non-new mail
folder-hook trash   'push <delete-pattern>~r>10d!(~F|~N)<enter>'

-- 
John

Reply via email to