I have several folders defined in Mutt:
mailboxes "~/Mail/inbox"
mailboxes "~/Mail/sent"
mailboxes "~/Mail/archive"
I can save (move) a message to archive, by pressing s
and then ?
to see a list of folders, and then I can choose archive
from the list.
Since I always want only to save to archive
I would like to have a macro, so that pressing s
automatically saves selected message to archive
, without asking me.
Can somebody please help?
EDIT: I now have following macro, to save messages to my "archive" folder:
macro index,pager S "<tag-prefix><save-message>=archive<enter>\
:set delete=yes<enter><sync-mailbox>:set delete=no<enter>"
the problem is, the messages stay in index marked as deleted. They are not "synced" immediately. Second, the <enter>
at the end acts as <display-message>
, so that when I press S
, I end up in the pager of the current message.
In a similar way, I am trying to implement the trash
folder in mutt. The following is taken from the Mutt MacroSamples
set maildir_trash=yes
set wait_key=no
folder-hook . 'bind index q quit'
folder-hook inbox 'macro index q ":unset maildir_trash;push \"T~D\\n<tag-prefix-cond>m=trash\\n<end-cond><quit>\"\n"'
but this does not work either. Insted mutt asks me:
Append messages to etmaildir_trash;push"T~D\n<tag-prefix-cond>m=trash\n<end-cond><quit>"/maildir_trash;push"T~D\n<tag-prefix-cond>m=trash\n<end-co ([yes]/no):
what ever I press, nothing happens (the folders trash/{cur,new,tmp} do exist)
<sync-mailbox>
doesn't seem to do anything. When you use the normal delete command (d
) and messages are left in the index marked as deleted, what happens when you press$
(which is the default binding for<sync-mailbox>
)?$
mutt asks mePurge 1 deleted message?
. I can pressY
which will delete the message.<sync-mailbox>
command is expecting user input (y
), but seeing the immediately following:
instead, so the purge doesn't happen. I wonder what might happen if you put ay
after it...