On 2009-01-17, Cameron Simpson <c...@zip.com.au> wrote: > I'm currently playing with this: > > folder-hook . 'macro index,pager d > "<copy-message>+ham<enter><save-message><enter>" "archive message" > folder-hook . 'save-hook . "$DELETE_FOLDER"' > folder-hook '^=me$' 'save-hook "~s ^LogWatch" "+bos-reports"' > > This should load up a sequence of save-hooks based on the folder. > Is there any way to flush all the save-hooks if I change folders, or am > I stuck with just loading up the new set to override the older ones?
Yes, there is a way: unhook. I've been using the same sort of setup you're playing with for several years now and it works very well. All my save-hooks are folder-independent, but I do have a lot of folder-dependent message-hooks. My first folder-hook is this: folder-hook . 'unhook message-hook' > My current difficulty is writing complex rules for the save-hook, because > that requires a third level of quote nesting. I ran into the same thing and finally decided on this: folder-hook . 'source ~/.mutt/default-message-hooks' where the default-message-hooks file contains all my message-hooks that set the pager because the quoting for them was especially nasty. Those hooks are _much_ easier to maintain this way. In your case, you could have a file of save-hooks for each of your folders and source each file with a folder-hook. Regards, Gary