From b3ba3d94beec10aca442e06859fdecf34a8c440c Mon Sep 17 00:00:00 2001 From: djcb Date: Fri, 20 Apr 2012 18:23:16 +0300 Subject: [PATCH] * mu4e-hdrs.el: add support for arbitrary actions --- emacs/mu4e-hdrs.el | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/emacs/mu4e-hdrs.el b/emacs/mu4e-hdrs.el index 725f19f9..7007fcf4 100644 --- a/emacs/mu4e-hdrs.el +++ b/emacs/mu4e-hdrs.el @@ -278,6 +278,8 @@ after the end of the search results." (define-key map "U" 'mu4e-unmark-all) (define-key map "x" 'mu4e-execute-marks) + (define-key map "a" 'mu4e-hdrs-action) + ;; message composition (define-key map "R" 'mu4e-compose-reply) (define-key map "F" 'mu4e-compose-forward) @@ -892,7 +894,6 @@ for draft messages." ;; talk to the backend (mu4e-proc-compose compose-type docid)))))) - (defun mu4e-compose-reply () "Reply to the current message." (interactive) (mu4e-compose 'reply)) @@ -908,6 +909,15 @@ for draft messages." (defun mu4e-compose-new () "Compose a new message." (interactive) (mu4e-compose 'new)) + +(defun mu4e-hdrs-action () + "Ask user what to do with message-at-point, then do it. The +actions are specified in `mu4e-headers-actions'." + (interactive) + (let ((msg (mu4e-message-at-point t)) + (actionfunc (mu4e-choose-action "Action: " mu4e-headers-actions))) + (funcall actionfunc msg))) + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (provide 'mu4e-hdrs)