Managing identities without suspending Mutt
Ken Moffat
zarniwhoop at ntlworld.com
Tue Nov 10 23:12:57 UTC 2020
On Tue, Nov 10, 2020 at 10:15:36PM +0000, Gregory Heytings wrote:
>
> Hi list,
>
> Is there a trick to execute a macro after a shell-escape which asks for user
> input? I currently have:
>
> macro index A '<shell-escape>shell-script '
> macro index B '<enter-command>source ~/.mutt/mutt-script<return>'
>
> shell-script writes mutt-script, and I'd like to do 'B' when 'A' returns,
> without having to press 'B'.
>
> A few words about the context of this question: I'm trying to find a way to
> manage multiple profiles/identities without "leaving" Mutt. I tried the
> muttprofile Perl script, which works fine, except that Mutt is suspended
> while it is executed. The above question is however not limited to that use
> case.
>
> Gregory
I used to use two profiles, one for this address and a separate one
for linuxfromscratch. A quick test on a desktop (my mail is on a
local machine designated as my server) suggests that it still works,
but on my current laptop using Function keys is a very bad idea.
I'm not aware of that perl script, when I first needed this (perhaps
17 years ago) I found something online which I adapted.
First, some items from .muttrc -
# profiles for multiple identities
source ~/.mutt/profile.default
# macros to invoke a profile
macro index <F10> ":source ~/.mutt/profile.default\n" # "Load default profile"
macro pager <F10> ":source ~/.mutt/profile.default\n" # "Load default profile"
macro index <F9> ":source ~/.mutt/profile.lfs\n" # "Load profile: LFS"
macro pager <F9> ":source ~/.mutt/profile.lfs\n" # "Load profile: LFS"
Second, the contents of the default profile.
# Mutt sender profile: default
# Signature file
set signature='~/.signature'
# Customized headers
unmy_hdr * # remove all extra headers first.
my_hdr From: Ken Moffat <zarniwhoop at ntlworld.com>
# my_hdr Reply-To: Ken Moffat <zarniwhoop at ntlworld.com>
# Note: Reply-to is commented, not particularly useful for me.
# Include the profile name in the status line
set status_format="-%r-Mutt: %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)-default-%>-(%P)---"
The contents of the other profile is similar, except that I change
the from header.
ĸen
--
Brave Sir Nigel ran away! When reality reared its ugly head, Sir
Nigel turned his tail and fled. Brave brave brave Sir Nigel.
More information about the Mutt-users
mailing list