diff options
author | Óscar Nájera <hi@oscarnajera.com> | 2022-05-06 13:41:17 +0200 |
---|---|---|
committer | Óscar Nájera <hi@oscarnajera.com> | 2022-05-06 13:56:08 +0200 |
commit | 206db42b91577677e61f9128653a8e81af3a5d80 (patch) | |
tree | 70e7388c0dadb2fbcbaab08c0cb66ea9b71673cc /lib/guile | |
parent | da2085ffd87c0354de2396a06c855cfd76113ae1 (diff) | |
download | dotfiles-206db42b91577677e61f9128653a8e81af3a5d80.tar.gz dotfiles-206db42b91577677e61f9128653a8e81af3a5d80.tar.bz2 dotfiles-206db42b91577677e61f9128653a8e81af3a5d80.zip |
Review tagmail
Diffstat (limited to 'lib/guile')
-rw-r--r-- | lib/guile/mail-tools.scm | 20 |
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) |