aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/guile/mail-tools.scm20
1 files changed, 11 insertions, 9 deletions
diff --git a/lib/guile/mail-tools.scm b/lib/guile/mail-tools.scm
index d496c5b..b158d93 100644
--- a/lib/guile/mail-tools.scm
+++ b/lib/guile/mail-tools.scm
@@ -9,7 +9,8 @@
get-uidvalidity
get-folder-uidvalidity
new-path
- with-new
+ tags-with-new
+ query-with-new
nm-open-database
nm-query-db
nm-result-messages
@@ -39,14 +40,15 @@
(string-join (list destination submaildir filename)
file-name-separator-string)))
-(define (with-new rule new)
- (list
- (if new (string-append (car rule) " -new") (car rule))
- (if new
- (if (string=? (cadr rule) "*")
- "tag:new"
- (simple-format #f "(~a) and ~a" (cadr rule) "tag:new"))
- (cadr rule))))
+(define (tags-with-new rule new)
+ (if new (string-append (car rule) " -new") (car rule)))
+
+(define (query-with-new rule new)
+ (if new
+ (if (string=? (cadr rule) "*")
+ "tag:new"
+ (simple-format #f "(~a) and ~a" (cadr rule) "tag:new"))
+ (cadr rule)))
;; NOTMUCH interface
(define (nm-open-database path mode)