]> git.notmuchmail.org Git - notmuch/blobdiff - emacs/notmuch-mua.el
emacs: Allow the user to choose the "From" address when composing a new message
[notmuch] / emacs / notmuch-mua.el
index dee2279a0e860c70508df66d72d23be4b3b37684..c792732ba5530b8db856cb77393c18600de0702a 100644 (file)
@@ -161,6 +161,17 @@ 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-send-and-exit (&optional arg)
   (interactive "P")
   (message-send-and-exit arg))