diff options
Diffstat (limited to 'lisp/+notmuch.el')
-rw-r--r-- | lisp/+notmuch.el | 35 |
1 files changed, 35 insertions, 0 deletions
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." | |||
58 | nil) | 58 | nil) |
59 | 'notmuch-address-history))) | 59 | 'notmuch-address-history))) |
60 | 60 | ||
61 | (defcustom +notmuch-spam-tags '("+spam" "+Spam") | ||
62 | "A list of tag changes to apply when marking a thread as spam." | ||
63 | :type '(repeat string)) | ||
64 | |||
65 | (defun +notmuch-tree-mark-spam-then-next (&optional ham beg end) | ||
66 | "Mark the current message as spam and move to the next." | ||
67 | (interactive "P") | ||
68 | (+notmuch-tree-mark-spam ham) | ||
69 | (notmuch-tree-next-matching-message)) | ||
70 | |||
71 | (defun +notmuch-tree-mark-spam (&optional ham) | ||
72 | "Mark the current message as spam. | ||
73 | That is, apply the tag changes in `+notmuch-spam-tags' to it. If | ||
74 | an optional prefix HAM argument is given, the message will be | ||
75 | marked as not-spam (\"ham\"), i.e., the tag changes in | ||
76 | `+notmuch-spam-tags' will be reversed." | ||
77 | (interactive "P") | ||
78 | (when +notmuch-spam-tags | ||
79 | (notmuch-tree-tag | ||
80 | (notmuch-tag-change-list +notmuch-spam-tags ham)))) | ||
81 | |||
82 | (defun +notmuch-search-mark-spam (&optional ham beg end) | ||
83 | "Mark the current thread or region as spam. | ||
84 | This adds the tags in `+notmuch-spam-tags' to the message. With | ||
85 | an optional HAM prefix argument, mark the messages as | ||
86 | not-spam (\"ham\"). | ||
87 | |||
88 | This function advances the next thread when finished." | ||
89 | (interactive (cons current-prefix-arg (notmuch-interactive-region))) | ||
90 | (when +notmuch-spam-tags | ||
91 | (notmuch-search-tag | ||
92 | (notmuch-tag-change-list +notmuch-spam-tags ham) beg end)) | ||
93 | (when (eq beg end) | ||
94 | (notmuch-search-next-thread))) | ||
95 | |||
61 | (provide '+notmuch) | 96 | (provide '+notmuch) |
62 | ;;; +notmuch.el ends here | 97 | ;;; +notmuch.el ends here |