From f4baef952b1f054aa632b86bc336650ce6d6e767 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=93scar=20N=C3=A1jera?= Date: Sat, 8 Oct 2022 15:08:42 +0200 Subject: mail tagging & rules --- lib/guile/mail-tools.scm | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'lib/guile/mail-tools.scm') diff --git a/lib/guile/mail-tools.scm b/lib/guile/mail-tools.scm index b158d93..1186306 100644 --- a/lib/guile/mail-tools.scm +++ b/lib/guile/mail-tools.scm @@ -41,14 +41,13 @@ file-name-separator-string))) (define (tags-with-new rule new) - (if new (string-append (car rule) " -new") (car rule))) + (string-append (car rule) (if new " -new" ""))) (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))) + (cond + ((and new (string=? (cadr rule) "*")) "tag:new") + (new (simple-format #f "(~a) and ~a" (cadr rule) "tag:new")) + (else (cadr rule)))) ;; NOTMUCH interface (define (nm-open-database path mode) -- cgit v1.2.3