From 75c64e36abf66959ae435a1188b036a74d6fd135 Mon Sep 17 00:00:00 2001 From: Christophe Troestler Date: Tue, 19 Apr 2016 20:25:35 +0200 Subject: [PATCH 1/2] Remove the mention of unsure spam functions that do not exist --- mu4e/mu4e-contrib.el | 4 ---- 1 file changed, 4 deletions(-) diff --git a/mu4e/mu4e-contrib.el b/mu4e/mu4e-contrib.el index d70902a4..16a7af48 100644 --- a/mu4e/mu4e-contrib.el +++ b/mu4e/mu4e-contrib.el @@ -113,10 +113,6 @@ BOOKMARK is a bookmark name or a bookmark record." ;; '("sMark as spam" . mu4e-register-msg-as-spam) t) ;; (add-to-list 'mu4e-headers-actions ;; '("hMark as ham" . mu4e-register-msg-as-ham) t) -;; (add-to-list 'mu4e-headers-actions -;; '("aMark unsure as spam" . mu4e-mark-unsure-as-spam) t) -;; (add-to-list 'mu4e-headers-actions -;; '("bMark unsure as ham" . mu4e-mark-unsure-as-ham) t) (defvar mu4e-register-as-spam-cmd nil "Command for invoking spam processor to register message as spam, From e398f336a0256423e92959faf18b7f9a2caf8f66 Mon Sep 17 00:00:00 2001 From: Christophe Troestler Date: Tue, 19 Apr 2016 20:27:38 +0200 Subject: [PATCH 2/2] Add spam-filtering functions suitable for the view mode --- mu4e/mu4e-contrib.el | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/mu4e/mu4e-contrib.el b/mu4e/mu4e-contrib.el index 16a7af48..89524014 100644 --- a/mu4e/mu4e-contrib.el +++ b/mu4e/mu4e-contrib.el @@ -138,6 +138,27 @@ For example for bogofile, use \"/usr/bin/bogofilter -Sn < %s\"") (shell-command command)) (mu4e-mark-at-point 'something nil)) +;; (add-to-list 'mu4e-view-actions +;; '("sMark as spam" . mu4e-view-register-msg-as-spam) t) +;; (add-to-list 'mu4e-view-actions +;; '("hMark as ham" . mu4e-view-register-msg-as-ham) t) + +(defun mu4e-view-register-msg-as-spam (msg) + "Mark message as spam (view mode)." + (interactive) + (let* ((path (shell-quote-argument (mu4e-message-field msg :path))) + (command (format mu4e-register-as-spam-cmd path))) + (shell-command command)) + (mu4e-view-mark-for-delete)) + +(defun mu4e-view-register-msg-as-ham (msg) + "Mark message as ham (view mode)." + (interactive) + (let* ((path (shell-quote-argument(mu4e-message-field msg :path))) + (command (format mu4e-register-as-ham-cmd path))) + (shell-command command)) + (mu4e-view-mark-for-something)) + ;;; end of spam-filtering functions (provide 'mu4e-contrib)