From 206db42b91577677e61f9128653a8e81af3a5d80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=93scar=20N=C3=A1jera?= Date: Fri, 6 May 2022 13:41:17 +0200 Subject: Review tagmail --- lib/guile/mail-tools.scm | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'lib/guile') 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) -- cgit v1.2.3