On 22Jun2022 01:02, Andy Spiegl <mutt.a...@spiegl.de> wrote: >Cool ideas. I started with defining a macro like that: > > macro index r "\ > <enter-command>unset implicit_autoview<enter>\ > <reply>" > >Works! But I don't know how to set it back afterwards, uhm. >I tried unsuccessfully: > macro index r "\ > <enter-command>unset implicit_autoview<enter>\ > <reply>\ > <enter-command>set implicit_autoview<enter>"
Does that not work? I would expect it to. For settings which are available as variables the common practice is to stash the "current" value in a $my_something variable, change it, then set it back. Crude and only single level, but usually enough. Example from my muttrc where I turn off $wait_key to stop mutt pausing during an operation: These 2 lines define a command string to save the current $wait_key then the beginning of the "set wait_key" command, then another string to reverse it: set my_push_wait_key=':set my_prior_wait_key=$wait_key; set wait_key' set my_pop_wait_key=':set wait_key=$my_prior_wait_key<enter>' Then they get used in my rot13 toggle command string: set my_toggle_rot13="$my_push_wait_key=no<enter><shell-escape>flag ! MUTT_ROT13 -e flag MUTT_ROT13<enter>$my_pop_wait_key" and then I've got some mac ros to run the toggle: macro index \Cx "$my_toggle_rot13" 'toggle MUTT_ROT13' macro pager \Cx "<exit>$my_toggle_rot13<display-message>" 'toggle MUTT_ROT13' The mechanics don't really matter, just the shuffle of the original into and out of $my_prior_wait_key. You should be able to do the same with $implicit_autoview. Cheers, Cameron Simpson <c...@cskk.id.au>