Discussion:
source .muttrc after changes in script?
Orm Finnendahl
2018-08-03 12:42:14 UTC
Permalink
Hi,

I wrote a shell script to specify an fcc for the sender of an email
and insert it into .muttrc and bound it to ".f".

Is there a way to automatize sourcing the .muttrc after the insertion?

On a related issue:

When sourcing the .muttrc (using ": source ~/.muttrc") the mail
entries get resorted. Is there a way to inhibit this sorting?

--
Orm
Cameron Simpson
2018-08-03 22:04:11 UTC
Permalink
Post by Orm Finnendahl
I wrote a shell script to specify an fcc for the sender of an email
and insert it into .muttrc and bound it to ".f".
Is there a way to automatize sourcing the .muttrc after the insertion?
Please, just "automate" :-(

I don't think so. You could half way do it by making macros for several common
mutt keystrokes to test for a changed muttrc and resource things before doing
the primary action, but that feels cumbersome and fragile.

On the other hand, doing that for a choice specific set, such as just before
composing a new message, is less cumbersome, less fragile, and far less
impactful to perfomance.
Post by Orm Finnendahl
When sourcing the .muttrc (using ": source ~/.muttrc") the mail
entries get resorted. Is there a way to inhibit this sorting?
Likely your .muttrc sets the sorting criteria, and that resorted the index.

If you separate your .muttrc into a few files:

- fixed settings (eg your attributed etc)
- default initial settings (eg your sorting)
- modifiable settings (eg list of mail aliases etc which might be updated)

and make your main .muttrc source all 3 then you could just not source your
muttrc, instead sourcing only the relevant file such as that last "modifiable
settings" file. Then your sorting should not change.

Cheers,
Cameron Simpson <***@cskk.id.au>

Loading...