You might get what you are looking for from Gregor Hoffleit's patch in
a message posted earlier today. I will attach it at the end.
L
On 07/26/01 11:44 AM, Kai Weber sat at the `puter and typed:
> Hi,
>
> I am searching for a way to get the current selected folder for
> scripting. I want something like this:
>
> folder-hook . source $MATCHED_FOLDER.rc
>
> Depending on what folder I entered, I want to know what folder that
> was. Maybe storing the wohle path in a shell variable, something like
> that.
>
> Kai.
> --
> k a i w e b e r | mailto:[EMAIL PROTECTED]
> w w w | http://www.glorybox.de/
>
--
Louis LeBlanc [EMAIL PROTECTED]
Fully Funded Hobbyist, KeySlapper Extrordinaire :)
http://acadia.ne.mediaone.net ԿԬ
QOTD:
"Sure, I turned down a drink once. Didn't understand the question."
On Wed, Jul 18, 2001 at 03:14:28PM +0200, Gregor Hoffleit wrote:
> echo -ne "\033]2;MUTT - $MBOX\007" 1>&2
>
> I started with a "folder-hook . source ~/bin/mutt-xtitle" where
> mutt-xtitle was a shell script with a command like the one above. That
> somehow worked, but I haven't found any way to detect the name of the
> mbox that's currently opened, and to pass this name to the shell script.
I think I may have found a solution for this idea. I patched mx.c to
set the current folder in the environment (attached). Then I created a
script which does something similar:
#!/bin/sh
echo -ne "\033]2;MUTT - $MUTTMAILBOX\007"
However, I couldn't get a folder-hook like the one you suggest to work.
Instead I had to do:
folder-hook . 'push !~/bin/mutt-xterm-title\n'
Is there a better way to do that? Unfortunately that interferes with
the typing of my imap password. I don't like storing the password in
the configuration file, but at least it works.
- Peter
--
Peter D. Kovacs <[EMAIL PROTECTED]>
Software Developer
Webmachines, Inc. http://webmachines.com
--- mx.c~ Thu Jul 26 10:37:37 2001
+++ mx.c Thu Jul 26 10:40:19 2001
@@ -727,6 +727,9 @@
}
unset_option (OPTFORCEREFRESH);
+
+ setenv("MUTTMAILBOX", path, 1 );
+
return (ctx);
}
PGP signature