Erik -- ...and then Erik Rothwell said... % % I've run into problem where I've got folder-hooks & send-hooks, but, I % can't make them play nicely together. % % In my main muttrc, I've got: % % source ~/.mutt/default-hooks.muttrc % source ~/.mutt/folder-hooks.muttrc % source ~/.mutt/send-hooks.muttrc
That sounds nice and clean. % % "default-hooks.muttrc" resets headers, From: line, and signature to % defaults. Folder hooks, then, override the defaults on a per-folder How does it do this? Do you specify default folder-hook or send-hook commands or just set the settings once? % basis (I use some mailing lists from a particular From: or with a % particular sig)... send-hooks are meant to override the folder hook % defaults for particular addresses (For instance, everyone in my % company's domain gets my company's signature, despite the folder I'm in) That makes sense. % % However, the default-hooks.muttrc does not properly reset my signature % (nor message headers) to the default... Hmmm... % % If I use only folder-hooks, I put the content of default-hooks.muttrc % into a file called ~/.mutt/hooks/defaults.global which gets sourced % before every other folder hook... this works as expected... Sure; you have a default case. % % However, this falls apart if I go to use a send-hook, in which case, the % send hook's last defaults get used the next time around. It's very % frustrating. If I reset the defaults for both folder hooks *and* send % hooks, no hooks can be used at all, of course... I don't follow you here. Why can't you use hooks any more? % % So what's a proper order of precedence for something like this? Well, a little digging around in the manual tells us - folder-hook (3.5) ... If a mailbox matches multiple folder-hook's, they are executed in the order given in the muttrc. - send-hook (3.17) ... When multiple matches occur, commands are executed in the order they are specified in the muttrc. Since they both execute on multiple matches, you need to have a default version first (presumably in your defaults muttrc) and should then be able to mix and match. I suspect that your default muttrc doesn't have such goodies as folder-hook . 'my_hdr from [EMAIL PROTECTED]' send-hook . 'set signature=/some/default/sig' and the like. You could choose to group all of your defaults together regardless of hook type (perhaps not as pretty) or simply start your hook files with defaults (multiple places to maintain default values). % % Erik. % % -- % "...ironically, perhaps, the best organised dissenters in the world today % are anarchists, who are busily undermining capitalism while the rest of % the left is still trying to form committees." Jeremy Hardy, The Guardian. HTH & HAND :-D -- David T-G * It's easier to fight for one's principles (play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie (work) [EMAIL PROTECTED] http://www.justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg!
msg24824/pgp00000.pgp
Description: PGP signature