Re: Getting mutt to NOT open default IMAP folder at startup
- To: mutt-users@xxxxxxxx
- Subject: Re: Getting mutt to NOT open default IMAP folder at startup
- From: Kyle Wheeler <kyle-mutt@xxxxxxxxxxxxxx>
- Date: Thu, 29 May 2008 14:52:17 -0500
- Comment: DomainKeys? See http://domainkeys.sourceforge.net/
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed; d=memoryhole.net; h=date :from:to:subject:message-id:references:mime-version:content-type :in-reply-to; s=default; bh=mMQNAM2PvJYgB5Vs5ZYaOKoOc44=; b=S/P6 STkH5Ysa2SOEYwX3KVfzH+n9R5rK6tb/A1VYL+8h3Fag/Bl7e8owc7bKQjpSQAPc qyyhcNjTXO+0NYwvW03PiefYeqdNvcIxng2X1Yij26ATxRcs1JZNXjeATfjs5e62 EqeNudKSUt63eN4HkoFAVRxW+W19/9i7Y6QNAZ4=
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=memoryhole.net; b=Hb2GfQNZFTEdw3qQ+Q3PhhpV2hjetrUTTiZyThUJ8VfJN+CgJzWmdEOHosKiPp5P78SRYyhB4s7/lYLEbWSBxzZlWg9iTk0T1QBcAE3k4Btk3UV7IwKSwJPFoMOM/gWGz5eh38ICbDkQ8F7Hlf8J8CDxnhm7IKEUD2DghWkzYFM=; h=Received:Received:Date:From:To:Subject:Message-ID:Mail-Followup-To:References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To:OpenPGP:User-Agent;
- In-reply-to: <20080529190646.GA18053@xxxxxxx>
- List-post: <mailto:mutt-users@mutt.org>
- List-unsubscribe: send mail to majordomo@mutt.org, body only "unsubscribe mutt-users"
- Mail-followup-to: mutt-users@xxxxxxxx
- Openpgp: id=CA8E235E; url=http://www.memoryhole.net/~kyle/kyle-pgp.asc; preference=signencrypt
- References: <20080529190646.GA18053@xxxxxxx>
- Sender: owner-mutt-users@xxxxxxxx
- User-agent: Mutt/1.5.18 (2008-05-22)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Thursday, May 29 at 03:06 PM, quoth Ethan Mallove:
> When mutt starts up, it immediately selects my =Inbox. Is there a
> way to turn this behavior off? I ask because I'm launching mutt
> using -e, e.g.,
>
> $ mutt -e 'push "c=foo\n"'
>
> (It may seem odd to not just do "-f =foo". I'm using "push"
> to get the "foo" folder in my "Open mailbox" history.) The
> problem is that when I use the "-e push" command, mutt opens
> two folders one after the other: first Inbox (default?), and
> then "foo". Is there a way to tell mutt to *not* open Inbox
> at startup?
So, if I understand you, the goal is to get mutt to have "foo" in the
history, and the issue here is that your workaround to manually put
something into the history has a side-effect you don't like (namely,
opening the inbox).
How about combining things? Like so:
$ mutt -f =foo -e 'push "c=foo\n"'
Of course, what'll happen there is that mutt will do exactly what it's
told. It'll open the foo mailbox, and then will re-open it. But at
least it won't open the inbox first.
I think you may be able to avoid opening it twice by telling mutt to
do something other than open a mailbox at first. Like so:
$ mutt -y -e 'push "c<kill-line>=foo\n "'
What that'll do is tell mutt to open up to a mailbox listing first,
and THEN change into the foo mailbox, thereby only opening foo once
(the "kill-line" bit is because the chdir prompt in the mailbox
browser behaves a little differently than the chdir prompt in the
index listing, and the space at the end is important for the same
reason).
One last thing... when you're doing macros (that includes push
commands), it's *best* to avoid using command letters. What can happen
is that someday you may change a key binding and then discover that
all your macros need to be modified. You should really get into the
habit of calling functions directly. Presumably you're going to be
using a script to call mutt, so you don't have to retype this all the
time. So, try this:
$ mutt -y -e 'push "<change-dir><kill-line>=foo<enter><view-file>"'
... of course, if all you want is for mutt to have a specific thing in
its history, it's more direct to simply use the $history_file setting,
and then add something to the end of it just before launching mutt.
For example...
$ echo '6:=foo|' >> ~/.mutthistory && mutt -f =foo
~Kyle
- --
What progress we are making. In the Middle Ages they would have burned
me. Now they are content with burning my books.
-- Sigmund Freud
-----BEGIN PGP SIGNATURE-----
Comment: Thank you for using encryption!
iEYEARECAAYFAkg/CXEACgkQBkIOoMqOI15nVgCfVJbSAMqUH+3A4GhG0cxaQZLZ
nBUAoMXY9MYJV3lmVkX1AiZ7L8R/3Epp
=CehC
-----END PGP SIGNATURE-----