X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=emacs%2Fnotmuch-mua.el;h=7b0aa3154109608f3f11459f11437872e3edce51;hp=dee2279a0e860c70508df66d72d23be4b3b37684;hb=1a8aae6fa7be108819fa848df3dc98e1840f5eba;hpb=fda6416745b51450b6aa41dcd0d72df843fd3292 diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el index dee2279a..7b0aa315 100644 --- a/emacs/notmuch-mua.el +++ b/emacs/notmuch-mua.el @@ -161,6 +161,31 @@ name and addresses configured in the notmuch configuration file." (ido-completing-read "Send mail From: " collection nil 'confirm nil 'notmuch-mua-sender-history (car collection)))) +(defun notmuch-mua-new-mail (&optional prompt-for-sender) + "Invoke the notmuch mail composition window. + +If PROMPT-FOR-SENDER is non-nil, the user will be prompted for +the From: address first." + (interactive "P") + (let ((other-headers + (when prompt-for-sender + (list (cons 'from (notmuch-mua-prompt-for-sender)))))) + (notmuch-mua-mail nil nil other-headers))) + +(defun notmuch-mua-new-forward-message (&optional prompt-for-sender) + "Invoke the notmuch message forwarding window. + +If PROMPT-FOR-SENDER is non-nil, the user will be prompted for +the From: address first." + (interactive "P") + (if prompt-for-sender + (let* ((sender (notmuch-mua-prompt-for-sender)) + (address-components (mail-extract-address-components sender)) + (user-full-name (car address-components)) + (user-mail-address (cadr address-components))) + (notmuch-mua-forward-message)) + (notmuch-mua-forward-message))) + (defun notmuch-mua-send-and-exit (&optional arg) (interactive "P") (message-send-and-exit arg))