On Tue, Dec 31, 2024 at 09:54:06AM +0800, Kevin J. McCarthy wrote:

> > for my next mutt tweak, my goal is to set up a macro key binding
> > which will go in the pager keymap and, as its main job, will
> > execute a <shell-escape>. The part which -- as far as I can see --
> > is nontrivial: I need to pass the name of the current folder as an
> > argument to the executed script.

> > It is easy enough to set up a series of folder-hook mutt config
> > commands so that the name ends up in a user mutt variable, say
> > $my_folder_name.  The seeming difficulty is in exporting this
> > value to the external environment (in the precise Unix sense of
> > this term). So far, any way I've thought of doing this turned out
> > to only "beg the question".

> The safest way might be to just use an environment variable
> instead. Then, you can deal with parameter quoting issues properly
> in your script, in a way that Mutt can't.

> folder-hook . 'set my_mailbox=$visual;setenv MYMAILBOX $visual'

Ta-daa !! I have not known about setenv. Thanks!

-- 
Ian

Reply via email to