X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=emacs%2Fnotmuch-address.el;h=36c796f9e34d11145dda5162a3360cf5db2f31c6;hp=b2e1fba797592869de3628d088e28f8f2aac9b53;hb=343534d82dc8882b3f0e2a847ee9d10ba5392809;hpb=e5786283e7465377d828c36c951f77fe629a0885 diff --git a/emacs/notmuch-address.el b/emacs/notmuch-address.el index b2e1fba7..36c796f9 100644 --- a/emacs/notmuch-address.el +++ b/emacs/notmuch-address.el @@ -98,6 +98,17 @@ to know how address selection is made by default." :group 'notmuch-send :group 'notmuch-external) +(defcustom notmuch-address-completion-hook nil + "Functions called after completing address. + +The completed address is passed as an argument to each function. +Note that this hook will be invoked for completion in headers +matching `notmuch-address-completion-headers-regexp'. +" + :type 'hook + :group 'notmuch-address + :group 'notmuch-hooks) + (defun notmuch-address-selection-function (prompt collection initial-input) "Call (`completing-read' PROMPT COLLECTION nil nil INITIAL-INPUT 'notmuch-address-history)" @@ -206,7 +217,8 @@ external commands." (progn (push chosen notmuch-address-history) (delete-region beg end) - (insert chosen)) + (insert chosen) + (run-hook-with-args 'notmuch-address-completion-hook chosen)) (message "No matches.") (ding)))) (t nil)))