On 2015-07-27 14:11:07 -0700, Brendan Cully wrote:
> changeset: 6474:6d733cab6b45
> user:      Kevin McCarthy <[email protected]>
> date:      Mon Jul 27 14:09:55 2015 -0700
> link:      http://dev.mutt.org/hg/mutt/rev/6d733cab6b45
[...]
> +<sect2 id="mailbox-hook" xreflabel="Mailbox Matching in Hooks">
> +<title>Mailbox Matching in Hooks</title>
> +
> +<para>
> +Hooks that match against mailboxes (<command>folder-hook</command>,
> +<command>mbox-hook</command>) apply both <link linkend="regexp">regular
> +expression</link> syntax as well as <link linkend="shortcuts">mailbox
> +shortcut</link> expansion on the regexp parameter.  There is some
> +overlap between these, so special attention should be paid to the first
> +character of the regexp.
> +</para>
> +
> +<screen>
> +# Here, ^ will expand to "the current mailbox" not "beginning of string":
> +folder-hook ^/home/user/Mail/bar "set sort=threads"

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?

If I try to <change-folder> to ^home/vinc17/tst-mail
I get an error about:

  /home/vinc17/tst-mailhome/vinc17/tst-mail

as expected. Does this mean that ^ expands to the empty string
initially, making the impression that the regexp is correct while
it isn't? I think that this is buggy since "the current mailbox"
is supposed to be anchored at the beginning of the string.

-- 
Vincent Lefèvre <[email protected]> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)

Reply via email to