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

Re: use current folder name as argument to abitrary command



* Cameron Simpson <cs@xxxxxxxxxx> [2009-06-03 23:56 -0500]:
> On 31May2009 21:29, David J. Weller-Fahy 
> <dave-lists-mutt-users@xxxxxxxxxxxxxxx> wrote:
> | * Cameron Simpson <cs@xxxxxxxxxx> [2009-05-31 01:41 -0500]:
> [...big snip...]
> | As you suggested, I changed the \\\` to \`, and voilà!  It works without
> | the macro!  I can only plead tired-eye-rushing syndrome, as that's the
> | only way I should have missed trying all the possibilities instead of
> | skipping the one that worked.
>
> I suggested it deductively, but had the advantage of starting my debug
> from your example.

;) As usual, multiple heads being better than one.

> Thank you, I've adopted exactly this incantation in my own muttrc:
>
>   folder-hook . "macro index '\$' \"<change-folder>\$my_folder<enter>\""
>   folder-hook . 'push ":\`cs-mutt-per-folder\ $my_folder\`\<enter\>"'

Hrm... so every-time you sync your mailbox, you change folders to the
current folder?  Why is that - checking for new mail?

> | Also, I'll attach my little Perl script, as someone might find it handy.
>
> Wouldn't it be better to set from= always, and merely omit the subscribe
> command for non-lists? That way, if you switch _from_ a lists.* folder
> into a non-lists folder your from= will be repaired for non-list use.
> i.e. replace "set wait_key" with "set from=your-core-address".

That is the problem (apparently) with having a muttrc which evolves with
you.  On one hand it is excellent because you have a muttrc to start
with, on the other hand that muttrc is full of the most interesting
cruft. ;)

It turns out I had a number of legacy methods of setting various knobs
depending on folder, which I've now rolled into the script.  Thanks for
the nudge!  I'm still working on setting the signature based on the
sender of a message (I want particular signature for one of my email
addresses, regardless of folder), but that can wait.

> I think that I rely on the "alternates" setting to control my fromness.
> (Except that I see there's a "set from=" in my config too. I shall have
> to check which one wins.)

Yep, I do that as well, but that doesn't help when composing a message
(I'll need to set up macros for that, and macros are low priority right
now).

> my own folder config script is here:
>   http://www.cskk.ezoshosting.com/cs/css/bin/cs-mutt-per-folder
>
> [snips]

Hrm... <tucking URL away for future analysis>... thanks!

> Anyway, many thanks for the code simplification!

No worries - I'm just glad I've got this solved.  Now I can clean out my
mutt config folder again, and update my master muttrc file.  This will
be quite a change to the master muttrc considering the lines made
obsolete.

Thanks for the brainstorming, as I'm pretty sure it would have taken
infinitely longer on one brain.

Take care,
-- 
dave [ please don't CC me ]