Vincent Lefevre wrote:
> I wonder how this is expanded. For instance, if I write in my muttrc:
> 
> folder-hook ^home/vinc17/tst-mail "set read_only"
> 
> then /home/vinc17/tst-mail matches. Why?

As you theorized, when you are initially reading the .muttrc, there is
no current mailbox, so it's expanded to nothing.  Further below in the
patch I mentioned:

  +Keep in mind that mailbox shortcut expansion on the regexp parameter
  +takes place when the hook is initially parsed, not when the hook is
  +matching against a mailbox.

but perhaps I should be explicit on this point for ^. I'll be glad to
add that to the docs.

> I think that this is buggy since "the current mailbox" is supposed to
> be anchored at the beginning of the string.

I agree it is surprising.  Peeking in main.c, it looks like
CurrentFolder is set far below where the initialization files are
read.  One idea would be to fall back on SpoolFile when CurrentFolder
isn't set, but this is incorrect if the -f flag is passed to mutt.
I'll have to think about it more, but for now I'll further add to the
documentation.

-- 
Kevin J. McCarthy
GPG Fingerprint: 8975 A9B3 3AA3 7910 385C  5308 ADEF 7684 8031 6BDA
http://www.8t8.us/configs/gpg-key-transition-statement.txt

Attachment: signature.asc
Description: PGP signature

Reply via email to