source .muttrc after changes in script?
cs at cskk.id.au
Fri Aug 3 22:04:11 UTC 2018
On 03Aug2018 14:42, Orm Finnendahl <orm.finnendahl at selma.hfmdk-frankfurt.de> wrote:
> 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.
>On a related issue:
>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.
Cameron Simpson <cs at cskk.id.au>
More information about the Mutt-users