diff --git a/.emacs.d/lisp/init-notmuch-sync.el b/.emacs.d/lisp/init-notmuch-sync.el index b3be60da..ed10fa01 100644 --- a/.emacs.d/lisp/init-notmuch-sync.el +++ b/.emacs.d/lisp/init-notmuch-sync.el @@ -13,9 +13,19 @@ (call-process notmuch-command nil t nil "search" "--output=tags" "--exclude=false" "*"))))) -(defvar notmuch-unimportant-tags '("attachment" "deleted" "draft" "encrypted" - "flagged" "inbox" "passed" "replied" "sent" - "signed" "unread")) +(defun notmuch-config-get-tags (query) + (split-string + (with-output-to-string + (with-current-buffer standard-output + (call-process notmuch-command nil t + nil "config" "get" query))))) + +(defvar notmuch-unimportant-tags (append '("attachment" "draft" "encrypted" + "flagged" "passed" "replied" "sent" + "signed") + (notmuch-config-get-tags "new.tags") + (notmuch-config-get-tags "search.exclude_tags"))) + (defvar notmuch-dump-file (expand-file-name "~/personal/mail/notmuch.dump")) (defun notmuch-dump-important-tags (&optional file)