On Mon, May 15, 2000 at 04:42:51PM +0100, Chris Green wrote:
> I am trying to set my folder_format using folder-hook, I'm having
> terrible trouble generating any RE that matches a folder at all at the
> moment.
>
> folder-hook . 'set folder_format="%N %7s %f"'
>
> which works OK, I do get that folder_format, for *everything*!
> The question is how to match a remote IMAP folder name, the folder
> name will always start "{x-1.net:50143}" but whatever I try doesn't
> seem to work. I have even tried matching some local folders but I
> can't get them to work either.
>
> I have triend
> folder-hook x-1 'set folder_format="%N %F %f"'
> folder-hook 50143 'set folder_format="%N %F %f"'
> folder-hook .x-1 'set folder_format="%N %F %f"'
> folder-hook ^{ 'set folder_format="%N %F %f"a
Sorry, I don't know about IMAP, but ...
>
> I also tried:-
> folder-hook AFM 'set folder_format="%N %F %f"'
> to match a local folder called AFM but that didn't work either.
... this one should work. I just tested
folder-hook box ...
to match =inbox. It works, so obviouly you only need to match a
substring of the foldername, which is the desired behavior since we're
talking about regexp. To be more specific a substring of the PATH.
folder-hook in ...
matches =inbox aswell as =mailinglists/MUTT
^^ ^^
Consequently
folder-hook me ...
matches every folder located somewhere under /home
^^
Therefore, to match folders in your $folder you should always use a '='
in front of the foldername.
> I am fairly familiar with REs. However it's not clear (to me) from
> the mutt documetnation how the folder-hook REs are supposed to
> match should they match anywhere in the folder name or do they always
> start matching from the first character? Also does one have to match
> the whole string?
s.a.
>From the manual:
3.5 Setting variables based upon mailbox
Usage: folder-hook [!]regexp command
[snip]
and regexp being described as:
4.1 Regular Expressions
All string patterns in Mutt including those in more complex patterns
must be specified using regular expressions (regexp) in the `POSIX
extended'' syntax (which is more or less the syntax used by egrep and
GNU awk).
[snip]
all tested with mutt-1.2 which shouldn't matter anyway.
Michael
--
It was kinda like stuffing the wrong card in a computer, when you're
stickin' those artificial stimulants in your arm.
-- Dion, noted computer scientist
PGP-fingerprint: DECA E9D2 EBDD 0FE0 0A65 40FA 5967 ACA1 0B57 7C13