On 25Sep2015 17:54, Paul Tansom <p...@aptanet.com> wrote:
** Cameron Simpson <c...@zip.com.au> [2015-09-25 09:22]:
On 24Sep2015 12:22, Paul Tansom <p...@aptanet.com> wrote:
>Is there a way to change the status_format when you change folders / accounts?
[...]
It looks like account-hook should do the trick for you but I don't have an
myself at present. [...]
In my main muttrc file I have:
account-hook imaps://em...@domain1.com@imap.localdomain.com 'set imap_user =
p...@domain1.com'
source ~/.mutt/muttrc.domain1.com
account-hook imaps://em...@domain2.com@imap.localdomain.com 'set imap_user =
p...@domain2.com'
source ~/.mutt/muttrc.domain2.com
account-hook imaps://em...@domain3.com@imap.localdomain.com 'set imap_user =
p...@domain3.com'
source ~/.mutt/muttrc.domain3.com
account-hook imaps://em...@domain0.com@imap.localdomain.com 'set imap_user =
p...@domain0.com'
source ~/.mutt/muttrc.domain0.com
The last one seems to end up as the default one you log into and then it
cycles through from the top. Not quite sure why.
The muttrc is read just once at startup. It looks like you want to source your
per-domain files on folder switch. I'd be inclined to prepend "set imap_user =
p...@domain1.com" to your muttrc.domain1.com file, and write the hooks like
this:
account-hook imaps://em...@domain1.com@imap.localdomain.com 'source
~/.mutt/muttrc.domain1.com'
account-hook imaps://em...@domain2.com@imap.localdomain.com 'source
~/.mutt/muttrc.domain2.com'
and so forth. That way the _entire_ domainX.com setup is sources on folder
switch.
As you have it above you source the various per-domain things once at mutt
startup, ending up with the last one. Your account hooks only change imap_user;
they don't re-source the per domain setup files.
Cheers,
Cameron Simpson <c...@zip.com.au>