mirror of https://github.com/djcb/mu.git
mu4e: Add mu4e-mark-execute-pre-hook
Add a hook that runs just before executing a mark. Signed-off-by: Magnus Therning <magnus@therning.org>
This commit is contained in:
parent
974d728bd4
commit
fe1104a94f
|
@ -50,6 +50,10 @@ Value is one of the following symbols:
|
||||||
(const ignore :tag "ignore marks without asking"))
|
(const ignore :tag "ignore marks without asking"))
|
||||||
:group 'mu4e-headers)
|
:group 'mu4e-headers)
|
||||||
|
|
||||||
|
(defcustom mu4e-mark-execute-pre-hook nil
|
||||||
|
"Hook run just *before* a mark is applied to a message. The hook function
|
||||||
|
is called with two arguments, the mark being executed and the message itself.")
|
||||||
|
|
||||||
(defvar mu4e-headers-show-target t
|
(defvar mu4e-headers-show-target t
|
||||||
"Whether to show targets (such as '-> delete', '-> /archive')
|
"Whether to show targets (such as '-> delete', '-> /archive')
|
||||||
when marking message. Normally, this is useful information for the
|
when marking message. Normally, this is useful information for the
|
||||||
|
@ -404,7 +408,10 @@ If NO-CONFIRMATION is non-nil, don't ask user for confirmation."
|
||||||
;; note: whenever you do something with the message,
|
;; note: whenever you do something with the message,
|
||||||
;; it looses its N (new) flag
|
;; it looses its N (new) flag
|
||||||
(if markdescr
|
(if markdescr
|
||||||
(funcall (plist-get (cdr markdescr) :action) docid msg target)
|
(progn
|
||||||
|
(run-hook-with-args
|
||||||
|
'mu4e-mark-execute-pre-hook mark msg)
|
||||||
|
(funcall (plist-get (cdr markdescr) :action) docid msg target))
|
||||||
(mu4e-error "Unrecognized mark %S" mark))))
|
(mu4e-error "Unrecognized mark %S" mark))))
|
||||||
mu4e~mark-map))
|
mu4e~mark-map))
|
||||||
(mu4e-mark-unmark-all)
|
(mu4e-mark-unmark-all)
|
||||||
|
|
|
@ -2114,6 +2114,10 @@ the marks (@key{x}).
|
||||||
After you have marked some messages, you can execute them with @key{x}
|
After you have marked some messages, you can execute them with @key{x}
|
||||||
(@kbd{M-x mu4e-mark-execute-all}).
|
(@kbd{M-x mu4e-mark-execute-all}).
|
||||||
|
|
||||||
|
A hook, @code{mu4e-mark-execute-pre-hook}, is available which is run
|
||||||
|
right before execution of each mark. The hook is called with two
|
||||||
|
arguments, the mark and the message itself.
|
||||||
|
|
||||||
@node Leaving the headers buffer
|
@node Leaving the headers buffer
|
||||||
@section Leaving the headers buffer
|
@section Leaving the headers buffer
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue