From 92964e44a0842984879afd8da288f2a65e6359f8 Mon Sep 17 00:00:00 2001 From: Pierre Neidhardt Date: Tue, 19 Mar 2019 13:53:55 +0100 Subject: [PATCH] notmuch-sync: Get config tags dynamically --- .emacs.d/lisp/init-notmuch-sync.el | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) 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)