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

Re: wl-dispose-folder-alist regexes



Hi Erik,

At Tue, 28 Sep 2010 08:30:31 -0700,
Erik Hetzner wrote:
> 
> Hi Richard,
> 
> At Tue, 28 Sep 2010 16:19:23 +0100,
> Richard Lewis wrote:
> > 
> > (setq wl-dispose-folder-alist
> >       '(("^%system\\|junk\\|spam" . remove)
> 
> This will work but will match string contains “junk” or “spam”; if you
> just want to match strings that start with %junk or %spam or %system
> use:
> 
>   "^%\\(system\\|junk\\|spam\\)"
> 
OK, thanks. I was actually deliberately avoiding the brackets as I
assumed brackets in regexes are for capturing, and I'm not capturing
anything here.

> > which I guess might work.
> > 
> > But now I need a way of selecting all-other-folders. A negative
> > lookahead assertion might work but they require fixed-length patterns,
> > and also aren't available in Emacs regexes (afaik).
> > 
> > Can anyone think of such a regex? Or of another way of getting all the
> > other folders to dispose into "%junk"?
> 
> wl-dispose-folder-alist is tested in order, so:
> 
> (setq wl-dispose-folder-alist
>   '(("^%\\(system\\|junk\\|spam\\)" . remove)
>     ("^%" . "%junk")))
> 
> should do the trick.
> 
It does. Thanks. I think I was assuming that all the matches would be
tested and any that apply would be used (rather like omitting to
include a break statement at the end of a case block in a switch
statement in C-like languages). But now I think about it, it doesn't
really make a lot of sense that more than one action could apply for
disposing a message.

Best,
Richard
-- 
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Richard Lewis
ISMS, Computing
Goldsmiths, University of London
Tel: +44 (0)20 7078 5134
Skype: richardjlewis
JID: ironchicken@jabber.earth.li
http://www.richardlewis.me.uk/
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
+----------------------------------------------+
| Support open access to scholarship           |
| http://freeculture.org/ http://www.doaj.org/ |
+----------------------------------------------+