Stefano Zacchiroli wrote: > Right, but still a more graceful failure model would be nice. > > Please find attached a patch that in such cases should 1) give a > supposedly nice error message explaining what's going on and 2) empty > the results dir to avoid showing you unrelated results. It works for me. > But extra checking never hurts, in particular for the tag action, which > I don't personally use. The patch works for me (for thread reconstruction - I don't use the tagging features either). > I guess it would also be nice to actually disable $pipe_decode in the > relevant Mutt macros, but I'm not sure about to do that without > interfering with user desired configuration. Kevin: do you know if there > is a common Mutt trick to store the value of a variable before changing > it, and restoring it a posteriori? More isolation for this kind of > things in Mutt would definitely be welcome... It looks like this is possible, as Suvayu Ali mentioned too. An improvement to his example is also mentioned in the manual at http://www.mutt.org/doc/devel/manual.html#set-myvar You can defer evaluation of the variables until runtime by prefixing them with \$. Here are some proposed improved macros. (I'll attach a patch file in another email.) Despite my earlier warning about not line-breaking macros, these are getting a bit unreadable. We may want to see if/where we can safely line-break them. macro index \ "set my_old_pipe_decode=\$pipe_decode my_old_wait_key=\$wait_key nopipe_decode nowait_keynotmuch-mutt -r --prompt search`echo ${XDG_CACHE_HOME:-$HOME/.cache}/notmuch/mutt/results`set pipe_decode=\$my_old_pipe_decode wait_key=\$my_old_wait_key" \ "notmuch: search mail" macro index \ "set my_old_pipe_decode=\$pipe_decode my_old_wait_key=\$wait_key nopipe_decode nowait_keynotmuch-mutt -r thread`echo ${XDG_CACHE_HOME:-$HOME/.cache}/notmuch/mutt/results`set pipe_decode=\$my_old_pipe_decode wait_key=\$my_old_wait_key" \ "notmuch: reconstruct thread" macro index \ "set my_old_pipe_decode=\$pipe_decode my_old_wait_key=\$wait_key nopipe_decode nowait_keynotmuch-mutt tag -- -inboxset pipe_decode=\$my_old_pipe_decode wait_key=\$my_old_wait_key" \ "notmuch: remove message from inbox" -Kevin