Hi Sébastien,

On 2022-09-15 20:26, Sébastien Hinderer wrote:
> Hello Jan, thanks a lot for your response and the link!
> 
> Jan Eden via Mutt-users (2022/09/15 11:42 +0200):
> > I defined aliases for my accounts in .zshrc, because I do not mind
> > restarting mutt when switching to a different account:
> > 
> > alias m1='cd ~/Downloads && /opt/homebrew/bin/mutt -F ~/.mutt/account1.cf 
> > && cd'
> > alias m2='cd ~/Downloads && /opt/homebrew/bin/mutt -F
> > ~/.mutt/account2.cf && cd'
> 
> That's what I am doing currently, yse. But then, am I correct that each
> of your account.cf file needs to source the main configuration file to
> get the default values in? Precisely, it's the repetition of this line
> that I wanted to avoid.

Yes, that line is repeated in each account configuration.

> Plus, that way, when you change configuraiton
> interactively, all the common settings are read in again useessly. It's
> cheap of course but I'de still like to avoid it.

Not really, because I only re-set a few parameters interactively (i.e. I
do not source a complete account configuration, but an address
configuration):

macro generic \e1 ":source ~/.mutt/default_address.cf\r"

# default_address.cf
set my_address = "x...@eden.one"
set my_pgp_key = '257A9B6F3DEDCA11319000877CD4656792A3A1F4'
source '~/.mutt/set_address.cf'

# set_address.cf
set from=$my_address
set pgp_default_key = $my_pgp_key
set status_format="-%r $my_address: %f [Msgs:%?M?%M/?%m%?n? New:%n?%?o? 
Old:%o?%?d? Del:%d?%?F? Flag:%F?%?t? Tag:%t?%?p? Post:%p?%?b? Inc:%b?%?l? 
%l?]---(%s/%S)-%>-(%P)---"
unmy_hdr *
my_hdr Bcc: $my_address

Each macro sources only six lines of configuration. To use a different
account, I restart mutt (or rather, I have four terminal tabs running
mutt for different accounts).

- Jan

Attachment: signature.asc
Description: PGP signature

Reply via email to