Re: Question(s) about folder-hook
On Fri, Aug 17, 2007 at 05:12:34PM +0200, Alain Bench wrote:
> Hello Kyle and Chris,
>
> On Sunday, August 12, 2007 at 9:23:50 -0600, Kyle Wheeler wrote:
>
> > I *believe* [the folder-hook regexp will] match against
> > /home/chris/Mail/france/meteo, but it's possible it might be only
> > against =france/meteo (I doubt it though).
>
> Both, in some way. A folder-hook regexp is matched against the full
> path, period. But if you write an "=" as first character of the regexp,
> this shortcut first gets expanded to the value of $folder (at hook's
> parsing time), then the result is matched against the full path.
>
> Note you can't usefully write a "^=blah" folder-hook regexp: Only
> the first character gets expanded. In fact you can neither use the "^"
> anchor: It gets expanded to the current folder name, which during muttrc
> parsing is the empty string. Fleature collision, see bug/2402 "damaged
> regexps in folder-hooks".
>
>
> > It will certainly be more than just meteo.
>
> Except in case the user does:
>
> | $ cd /home/chris/Mail/france/
> | $ mutt -f meteo
>
> But then the status line shows just "meteo", not "=france/meteo".
> We're not exactly in the initial conditions anymore.
>
> To trigger on a folder filename regardless of path, I tend to write
> regexps like: "\\<meteo$" (where "\\<" means beginning of a word). Such
> a folder-hook will also trigger on =espagne/meteo and /tmp/meteo though,
> which may be wanted or not.
>
Thank Alain for that very complete explanation.
--
Chris Green