> Hi mutt-users,
> 
> I have a problem that is driving me mad which I'm failing to solve myself.
> 
> Let's say I'm reading a message in the mutt folder. Then I hit 'c' to change 
> to
> a folder containing a new message. I read that message and then hit 'r' to
> reply to it. And I see in the To: line the right address, but also, and that's
> what is driving me crazy, the address of the mutt-users mailing list (from the
> previous folder).
> 
> I would like to reset the configuration when I change folder and then read a
> new configuration file for that specific folder. I have tried to put 
> 
> unhook *
> 
> at the beginning of the new configuration file but it doesn't work, I still 
> see
> this residual email address in the To: line.

I also wanted to have per-folder configuration in mutt without one
folder's configuration 'leaking' into another folder when I change
folders. What I want is that every time I change folders mutt should:
reset all settings to their system defaults, reload my personal default
settings (which apply to all my folders), then load any folder-specific
settings.

I particularly use this to have different configurations for
different email accounts (where mail from each account is sorted into a
different folder).

And I didn't want to have to remember to reset every variable and unhook
every hook in each per-folder config file.

Here's what I have in my muttrc currently, it works but I'm not sure if
it's the best way to do it:

    # When changing folders reset all config variables.
    folder-hook . 'reset all'

    # When changing folders, unhook most types of hook.
    # account-hooks don't need to be unhooked because they're account-specific
    # anyway.
    # folder-hooks and mbox-hooks don't need to be unhooked because they're
    # folder-specific anyway.
    folder-hook . 'unhook charset-hook'
    folder-hook . 'unhook iconv-hook'
    folder-hook . 'unhook message-hook'
    folder-hook . 'unhook save-hook'
    folder-hook . 'unhook fcc-hook'
    folder-hook . 'unhook fcc-save-hook'
    folder-hook . 'unhook send-hook'
    folder-hook . 'unhook send2-hook'
    folder-hook . 'unhook crypt-hook'

    # When changing folders reload the default config variables and hooks.
    folder-hook . 'source ~/.mutt/defaults'

    # When changing folders load folder-specific config variables and hooks.
    folder-hook some_folder 'source ~/.mutt/some_folder'
    ...

Reply via email to