diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2002-10-13 20:31:47 +0000 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2002-10-13 20:31:47 +0000 |
commit | a81bb72aa0378023079a5e31d5779e218f4021cc (patch) | |
tree | 057489a4b87d53b1fed75725fa3035a9d1460fda /guimb | |
parent | ab49d52a9afcfd17e6b96bba3e903e70da7313d0 (diff) | |
download | mailutils-a81bb72aa0378023079a5e31d5779e218f4021cc.tar.gz mailutils-a81bb72aa0378023079a5e31d5779e218f4021cc.tar.bz2 |
Changed sieve-register-.* functions to allow for actions to accept tags.
(sieve-get-opt-arg): New function. Returns the argument to a given tag.
Diffstat (limited to 'guimb')
-rw-r--r-- | guimb/scm/sieve-core.scm | 35 |
1 files changed, 19 insertions, 16 deletions
diff --git a/guimb/scm/sieve-core.scm b/guimb/scm/sieve-core.scm index 480b98f02..473264517 100644 --- a/guimb/scm/sieve-core.scm +++ b/guimb/scm/sieve-core.scm @@ -120,19 +120,22 @@ ;;; Register standard actions (cond (sieve-parser - (sieve-register-action "keep" action-keep) - (sieve-register-action "discard" action-discard) - (sieve-register-action "fileinto" action-fileinto 'string))) + (sieve-register-action "keep" action-keep '() '()) + (sieve-register-action "discard" action-discard '() '()) + (sieve-register-action "fileinto" action-fileinto (list 'string) '()))) ;;; Some utilities. -(define (find-comp opt-args) +(define (sieve-get-opt-arg opt-args tag default) (cond - ((member #:comparator opt-args) => + ((member tag opt-args) => (lambda (x) (car (cdr x)))) (else - string-ci=?))) + default))) + +(define (find-comp opt-args) + (sieve-get-opt-arg opt-args #:comparator string-ci=?)) (define (find-match opt-args) (cond @@ -358,24 +361,24 @@ (sieve-parser (sieve-register-test "address" test-address - (append address-part comparator match-type) - (list 'string-list 'string-list)) + (list 'string-list 'string-list) + (append address-part comparator match-type)) (sieve-register-test "size" test-size - size-comp - (list 'number)) + (list 'number) + size-comp) (sieve-register-test "envelope" test-envelope - (append comparator address-part match-type) - (list 'string-list 'string-list)) + (list 'string-list 'string-list) + (append comparator address-part match-type)) (sieve-register-test "exists" test-exists - '() - (list 'string-list)) + (list 'string-list) + '()) (sieve-register-test "header" test-header - (append comparator match-type) - (list 'string-list 'string-list)) + (list 'string-list 'string-list) + (append comparator match-type)) (sieve-register-test "false" #f '() '()) (sieve-register-test "true" #t '() '()))) |