<<< Date Index >>>     <<< Thread Index >>>

bind key to change to previous mailbox?



Hi all,

I'd like to enable a key combination that would take me back to the
most recent mailbox I've visited before the current one.

My current idea how I'd go about this:

(1) Make a folder-hook for all folders that pushes a key sequence
calling a shell command: the shell command would just write the path
of the current mailbox to an arbitrary file.

(2) Bind a key to <change-folder> and 'cat" that file as the argument.

Well, I'm already stuck with the first point:

I can do !pwd > ~/thefile

but this prints the location of the top-level maildir (understandably,
since I start mutt from a terminal with that dir as the working
directory.)

How would I get mutt to pass the current mailbox to a file? I know I
can use "%f" to display the current mailbox in the status bar, but how
to pass it to a shell script?

In fact, I'm stumped with point (2) as well. 

Any pointers? Or is this a hopeless endeavor?

Thanks,

m.