Re: [Evolution-hackers] Filtering and mail split



On Thu, 2009-12-03 at 09:41 -0600, Jonathon Jongsma wrote:
> I like the concept in general, but I think the S-expression (or AST
> representing the s-expression) is not enough to properly re-construct
> a filter rule for editing.  Consider the following example (yes, it's
> slightly contrived, but the point is still valid I think):
> 
> User creates one filter with the following rule part:
>  - "Sender" "contains" "foo"
>  - evolution builds this into the following s-expression:
>    (and (match-all (header-contains "From" foo)))
> 
> User creates a second filter with 2 rule parts:
>  - "Specific Header" "From" "contains" "foo"
>  - evolution builds this into the exact same s-expression:
>    (and (match-all (header-contains "From" foo)))
> 
> If we only saved the s-expression to disk and then tried to build an
> widget to edit this filter, there would be no way to determine whether
> to use the 'sender' filter part or the 'header' filter part without
> some additional context.

Good point.  We'd have to expand our S-expression vocabulary to maintain
the distinction:

   "Sender" "contains" "foo"
   (and (match-all (sender-contains foo)))

   "Specific Header" "From" "contains" "foo"
   (and (match-all (header-contains "From" foo)))

Internally "sender-contains" would just be a simple alias that invokes
"header-contains".

Matthew Barnes




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