After deleting or saving a message in pager view in the MUA mutt, the program remains in pager view and jumps to the next message in the current folder. Can this default behavior be changed so that after deleting or filing an email, the pager mode is exited and the folder index is displayed?
You want to execute two functions (
exit) at once so you have to use a macro:
macro pager d '<delete-message><exit>'
This will bind
d to delete the current message and exit the pager.
You can do the same for
s but it gets a little bit more complicated as you need to have user input, if you just accept the default save location or use
save-hooks you can simply use
macro pager s '<save-message><enter><exit>'
If you want to alter the save location interactively I unfortunately don't have a tip how to change it, I'd try to use/leverage save-hooks
To make a macro for this that doesn't close mutt when you're on the last message you can do something like this:
macro pager d "<delete-message>i" "Delete message"
Or (if you're using Gmail)
macro pager e "<save-message>+archive<enter>i" "Archive message"
This way since
i isn't mapped by default in the index, it will just tell you 'key not bound' rather than exiting mutt. But since in the pager it is the default mapping for exiting the pager it will work as expected.
Note that this does mark the next message as read if it was not already. You could probably add something to the end of that to fix that if you wanted to though.