I have a folder-hook that's seeming to not work. It is thus: folder-hook . 'push ":set auto_tag=no<enter><untag-pattern>~T<enter><tag-pattern>~=<enter><tag-prefix-cond><tag-prefix><delete-message><untag-pattern>~T<enter><end-cond>:set auto_tag=yes<enter>"
(Sorry if that gets folded - it is one line.) For an assortment of reasons I get multiple copies of messages in my folders. This I don't mind. However, for readability I try to delete duplicates on entry to a folder. My previous efforts in this regard have been damaging, usually that if there are no duplicates the first mailbox entry gets deleted. The above macro tries to address this weakness. The log goes: - turn off auto_tag I've been using this "do stuff to the tagged messages or the current message without tag-prfix" for a while, and mostly like it. - untag all tagged messages, just in case - tag all duplicates - use tag-prefix-cond to wrap the "deleted tagged messages" code to prevent it running if there are no tagged messages - untag all, turn auto_tag back on The doco for tag-prefix-cond says: In macros or push commands, you can use the <tag-prefix-cond> operator. If there are no tagged messages, Mutt will “eat” the rest of the macro to abort it's execution. Mutt will stop “eating” the macro when it encounters the <end-cond> operator; after this operator the rest of the macro will be executed as normal. Entry to a folder is as if the code never runs. It has just occurred to me, as I type this, from the name "tag-prefix-cond", that it is not a little "if" statement but a variant of "tag-prefix" - is that the case? Should I just drop the inner "tag-prefix"? Stumped, -- Cameron Simpson <c...@zip.com.au> DoD#743 http://www.cskk.ezoshosting.com/cs/ BSD code sucks. Of course, everything else sucks far more. - Theo de Raadt (OpenBSD President)