[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: expire-alist syntax



At Mon, 03 May 2010 07:48:47 -0400,
Matt Price wrote:
> hi folks,
> 
> trying to set up auto-expiry but running into an error with
> expire-alist:
> Wrong type argument: numberp, nil
> with wl-expire-alist set thus:
> 
> (setq wl-expire-alist 
>  '(("^\\%inbox$" (date 40) ".archive")	
>   ("/(flag:digest)/%inbox:pricemat/clear@mailbox126.utcc.utoronto.ca:993" (date 40) ".archive")
> ))
> 
> --- 
> the second entry is there just bc i don't understand emacs regexes
> every well & mostly work with the filter folder explicitly named in
> that line.  anyway the format there looks about like this example
> from the manual:
> ("^\\+outbox$"  (number 300) "$outbox;lha")
> 
> if anyone can see what the problem is i'd be absolutely grateful!
> thanks,

Hi Matt -

You shouldn’t need to use backslashes before %. They are needed before
+ because + has special meaning in a regexp.

^ matches beginning of string, $ the end, so:

  ^%inbox$

will *only* match the string "%inbox". What you probably want is:

  ^%inbox.*$

which will match all folders that start with %inbox.

To test out a regex, create a buffer, add the string to be matched
(the folder name) in it, then use M-x re-builder.

best,
Erik

Attachment: pgp14bBrPF61G.pgp
Description: PGP signature