From c95ba817188d6e2c1ae561c920f4589a0dfba750 Mon Sep 17 00:00:00 2001 From: jao Date: Thu, 6 Jan 2022 02:17:50 +0000 Subject: notmuch: offer 'todo' tag in org capture --- notmuch.org | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'notmuch.org') diff --git a/notmuch.org b/notmuch.org index 27ffa13..cac76cb 100644 --- a/notmuch.org +++ b/notmuch.org @@ -324,8 +324,6 @@ (replace-regexp-in-string "\"" "" (buffer-string))) (replace-regexp-in-string jao-mail-clean-rx "" address))))) - (defun jao-notmuch-show-setup () (setq header-line-format nil)) - (use-package notmuch-show :init (setq gnus-blocked-images "." @@ -340,6 +338,7 @@ :config (advice-add 'notmuch-clean-address :filter-args #'jao-mail-clean-address) + (defun jao-notmuch-show-setup () (setq header-line-format nil)) (add-hook 'notmuch-show-hook #'jao-notmuch-show-setup) (jao-notmuch-show-prefer-html) @@ -469,6 +468,11 @@ (defvar jao-org-notmuch-last-subject nil) (defun jao-org-notmuch-last-subject () jao-org-notmuch-last-subject) + (defun jao-notmuch--add-tags (tags) + (if (derived-mode-p 'notmuch-show-mode) + (notmuch-show-add-tag tags) + (notmuch-tree-add-tag tags))) + (defun org-notmuch-store-link () "Store a link to a notmuch mail message." (cl-case major-mode @@ -480,13 +484,9 @@ (description (format "Mail: %s" subj))) (setq jao-org-notmuch-last-subject subj) (when (y-or-n-p "Archive message? ") - (if (derived-mode-p 'notmuch-show-mode) - (notmuch-show-archive-message) - (notmuch-tree-archive-message))) - (when (y-or-n-p "Flag message? ") - (if (derived-mode-p 'notmuch-show-mode) - (notmuch-show-add-tag '("+flagged")) - (notmuch-tree-add-tag '("+flagged")))) + (jao-notmuch--add-tags '("+trove"))) + (when (y-or-n-p "Flag message as todo? ") + (jao-notmuch--add-tags '("+todo"))) (org-store-link-props :type "notmuch" :link link -- cgit v1.2.3