On Sun, May 20, 2001 at 08:48:06PM +0100, Ailbhe Leamy sat at the 'puter and typed:
> On (20/05/01 14:33), Louis LeBlanc wrote:
> > On Sun, May 20, 2001 at 11:45:50AM -0400, Brendan Cully sat at the 'puter and 
>typed:
> 
> > > macro index d "<save-message>=Trash\n" "Move message to the trash folder"
> > > macro pager d "<save-message>=Trash\n" "Move message to the trash folder"
> > > 
> > > might work for you, although I don't guarantee it (I hardly ever write
> > > macros, and don't use a trash folder). Search the archives if it
> > > doesn't, this is asked a lot.
> 
> > When I go to the Trash folder and try to purge it, naturally I do so
> > by marking each one as deleted.  So mutt does what it is told and
> > copies each one to the Trash folder - hmm.  Eventually mutt crashes
> > and I have a hundred or more copies in the Trash folder.
> 
> folder-hook =Trash macro index d "<delete-message>"
> folder-hook =Trash macro pager d "<delete-message>"
> 
> Untested...

And very nearly right.  here is what I have now:

# This makes mutt behave a little more like some imap clients by
# moving messages to the Trash folder when they are deleted. Once
# in the Trash folder, D will purge the trash folder, and d will
# delete one at a time.  Unfortunately, the delete-pattern macro
# doesn't save to Trash, so be warned.
folder-hook . 'macro index D "<delete-pattern>"'
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-pattern>~A\n"'
folder-hook =Trash 'macro index d "<delete-message>"'
folder-hook =Trash 'macro pager d "<delete-message>"'

Notice the single quotes enclosing the hooks entire function?  It
doesn't seem to work quite right without them.  With this, D is just a
delete-pattern by default, but in the Trash folder, it just whacks
everything off - this was the desired behavior.  As for d, same thing,
but only on a single message.  I'd also rather find a way to effectively
'save-pattern' or 'save-thread' so that I can extend this behavior to
the delete-pattern and delete-thread behaviors. Maybe next release? :)

Thanks for your help everyone!
-- 
Louis LeBlanc
Fully Funded Hobbyist, KeySlapper Extrordinaire :)
[EMAIL PROTECTED]
http://acadia.ne.mediaone.net                ԿԬ

Reply via email to