Re: [Evolution] boolean searches - expression example



If I have time I plan to put together a HOW-TO on this and put it up on
my website. But since my time is very limited currently ... it may be a
while. :-)

Thanks for the long example though.

P.S. Evolution development team really should at least increase the size
of the expression editor, but a better idea would be to create an
expression builder :-) 

On Wed, 2003-07-16 at 14:01, Thomas Frayne wrote:
On Wed, 2003-07-16 at 08:23, Dan Winship wrote:
On Wed, 2003-07-16 at 10:55, Edward Muller wrote:
Thanks!

So I think what I really need now is a list of
tokens/variables/functions that evolution provides in the namespace of
the scheme expressions ...

For instance, until I looked there I didn't know about:
header-ends-with
header-contains
${subject}
${recipient}
etc....

The variables refer to the fields defined by the rest of the xml. Eg, in

    <code>(match-all (header-contains "From" ${sender}))</code>

the ${sender} refers to the:

    <input type="string" name="sender"/>

later on. It just tells the vfolder editor how to put the expression
together based on the various fields. You would need to replace it with
a literal string in your own expressions. (And if you can't figure out
what the string would be, for something like the date filters, etc, just
create a vfolder and then look at ~/evolution/vfolders.xml.)

-- Dan


I looked in:
/usr/share/evolution/vfoldertypes.xml
~/evolution/vfolders.xml

Using a combination of your hints and guesswork, I constructed a simple
vfolder with an expression, and then a more complex one.  The detailed
example is: 

Rule name: Exp

if all criteria are met

Expression (match-all 
(and
 (or
   (header-contains "From" "Muller")
   (header-contains "From" "TomF")
   (header-contains "From" "Eric")

 )
 (or
   (header-contains "To" "TomF")
   (header-contains "Subject" "boolean")
   (header-contains "Subject" "custom")
 )
))

Date sent is after 2 days ago

Specific folders only

vfolder:/home/tom/evolution/vfolder#Tom important recent unread


The Exp vfolder displayed all messages from the "Tom important recent
unread" vfolder that were sent after 2 days ago, were from one of TomF,
Eric, or Muller, and were either to TomF, or had boolean or custom in
the subject.


Note that Evolution is weak on syntax checking:  my first try at a
complex expression crashed because of a missing parenthesis.  I
submitted bug report http://bugzilla.ximian.com/show_bug.cgi?id=46463

Also, the vfolder editor has too little space for an expression, so I
used gedit to build the expression, and pasted it into the vfolder
editor.
-- 
Edward Muller

Interlix (http://www.interlix.com)
Phone: 417-862-0573 - Cell: 417-844-2435 - Fax: 417-862-0572

Web Hosting - PC Service & Support - Custom Programming - Network Service & Support
Specializing in Open Source Solutions

Attachment: signature.asc
Description: This is a digitally signed message part



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