Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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?

share|improve this question

3 Answers 3

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.

share|improve this answer

I solved it this way:

macro index d "s=Trash\n" "move message to trash"
macro pager d "C=Trash\n\n<exit><delete-message>" "move message to trash"

This also prevents to mark the next message as read

share|improve this answer

You want to execute two functions (delete-message and 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

share|improve this answer
    
I was not able to determine if there was a configuration option for these actions, but binding to a macro definitely works well. Please let me know if you figure out how to do key bindings that involve user interaction. Thanks for your help. –  user001 Jul 30 '12 at 20:37
    
@user001 i don't know of such an option but you can have a look at mutt.org/doc/manual/manual-6.html which should cover all config options –  Ulrich Dangel Jul 30 '12 at 20:41
    
Thanks -- I'm slowly making my way through the mutt documentation now. –  user001 Jul 30 '12 at 20:53
1  
Hello. I notice that sometimes, by default, I am returned to the index after deleting a message in pager view. As a result, the <exit> command in the macro definition causes exiting from mutt to the terminal. Is there a way to simple jump to index so that this unintentional behavior can be avoided? –  user001 Jul 31 '12 at 2:05
2  
@user001 if you are on the last message and delete a message mutt will automatically exit the pager. And no you can't create/test for things in a macro (as far as i know) –  Ulrich Dangel Jul 31 '12 at 2:40

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.