From 7d0ff465220bec224c1f0c1163e6b4a88e1fb4c6 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Fri, 19 Aug 2022 13:39:13 -0500 Subject: bleh --- lisp/+notmuch.el | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'lisp/+notmuch.el') diff --git a/lisp/+notmuch.el b/lisp/+notmuch.el index 890edbe..9e79c5a 100644 --- a/lisp/+notmuch.el +++ b/lisp/+notmuch.el @@ -58,5 +58,40 @@ for search." nil) 'notmuch-address-history))) +(defcustom +notmuch-spam-tags '("+spam" "+Spam") + "A list of tag changes to apply when marking a thread as spam." + :type '(repeat string)) + +(defun +notmuch-tree-mark-spam-then-next (&optional ham beg end) + "Mark the current message as spam and move to the next." + (interactive "P") + (+notmuch-tree-mark-spam ham) + (notmuch-tree-next-matching-message)) + +(defun +notmuch-tree-mark-spam (&optional ham) + "Mark the current message as spam. +That is, apply the tag changes in `+notmuch-spam-tags' to it. If +an optional prefix HAM argument is given, the message will be +marked as not-spam (\"ham\"), i.e., the tag changes in +`+notmuch-spam-tags' will be reversed." + (interactive "P") + (when +notmuch-spam-tags + (notmuch-tree-tag + (notmuch-tag-change-list +notmuch-spam-tags ham)))) + +(defun +notmuch-search-mark-spam (&optional ham beg end) + "Mark the current thread or region as spam. +This adds the tags in `+notmuch-spam-tags' to the message. With +an optional HAM prefix argument, mark the messages as +not-spam (\"ham\"). + +This function advances the next thread when finished." + (interactive (cons current-prefix-arg (notmuch-interactive-region))) + (when +notmuch-spam-tags + (notmuch-search-tag + (notmuch-tag-change-list +notmuch-spam-tags ham) beg end)) + (when (eq beg end) + (notmuch-search-next-thread))) + (provide '+notmuch) ;;; +notmuch.el ends here -- cgit 1.4.1-21-gabe81