Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I created a macro in mutt to send the selected message to my archive folder:

macro index,pager ,m s=Archive

In many cases, new messages are archived right away, so I tried to extend the macro:

macro index,pager ,m Wnks=Archive

This works fine unless the last message is selected. In this case, the target message remains selected after clearing the N/O flag, and the k command moves the selection to the previous message in the list. Is there any way to apply multiple commands to a certain message, without having to resort to movement commands?

share|improve this question

1 Answer 1

up vote 2 down vote accepted

Mutt normally advances the cursor to the next message whenever a command that modifies the current message is executed. This behavior is controlled by the 'resolve' configuration variable. So, one solution would be to extend your macro to unset resolve before executing the other commands, then re-set it afterwards.

macro index,pager ,m ": unset resolve\nWnks=Archive\n: set resolve\n"

Note that that is untested. I put it together from your macro plus some macros in my muttrc in which I unset/set various configuration variables before/after executing the core of the macros. Also note the space after each colon. This prevents the following command from being saving in the command-line history. This is not important but can be convenient to avoid clutter in your history.

share|improve this answer
    
Excellent, I removed the "k" from your above solution (it is not required if the message focus does not change). Thanks! –  janeden Jun 6 '11 at 16:49

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.