Macro to apply on current mailbox

Oleg A. Mamontov oleg at mamontov.net
Mon Feb 15 21:26:54 UTC 2021


On Mon, Feb 15, 2021 at 10:16:33PM +0100, Angel M Alganza wrote:
>On Tue, Feb 16, 2021 at 12:00:35AM +0300, Oleg A. Mamontov wrote:
>
>>The below approach works for me, probably it can be helpful somehow:
>>
>>.muttrc
>>---
>># the very first folder-hook
>>folder-hook . "source ~/.mutt/on-folder-change.muttrc"
>>---
>>
>># .mutt/on-folder-change.muttrc
>>---
>>set record = ^
>>set record = `echo $record | sed 's#.*/##'`
>>macro index,pager <esc>o "<sync-mailbox>:unset wait_key<enter><shell-escape>clear; mbsync full:$record<enter>:set wait_key<enter>" "sync current folder"
>>---
>
>Then what should I do to mbsync the current maildir?
>Hitting ESC-o doesn't seem to do it.

Yes, it is.
For debug I suggest to simplify macro as:
---
macro index,pager <esc>o "<shell-escape>mbsync full:$record"
---
And check the resulting shell command before pressing Enter.

>Thanks,
>Ángel

-- 
Cheers,
Oleg A. Mamontov

mailto: oleg at mamontov.net

skype:  lonerr11
cell:   +7 (903) 798-1352


More information about the Mutt-users mailing list