]> git.notmuchmail.org Git - notmuch/commitdiff
emacs: mua: extract a common message-send function.
authorMark Walters <markwalters1009@gmail.com>
Sat, 8 Oct 2016 20:05:22 +0000 (21:05 +0100)
committerDavid Bremner <david@tethera.net>
Sun, 9 Oct 2016 11:53:01 +0000 (08:53 -0300)
This commit adds a common message-send function for message-send and
message-send-and-exit. At the moment the overlap is small, but the
message-send function will get more complex.

emacs/notmuch-mua.el

index 55bc267205756392fdbd6f243a420e0762b6c0a5..72fb770547cffefa38b855fc6a3a5feafe46dfa1 100644 (file)
@@ -490,15 +490,20 @@ will be addressed to all recipients of the source message."
     (notmuch-mua-reply query-string sender reply-all)
     (deactivate-mark)))
 
     (notmuch-mua-reply query-string sender reply-all)
     (deactivate-mark)))
 
-(defun notmuch-mua-send-and-exit (&optional arg)
+(defun notmuch-mua-send-common (arg &optional exit)
   (interactive "P")
   (letf (((symbol-function 'message-do-fcc) #'notmuch-maildir-message-do-fcc))
   (interactive "P")
   (letf (((symbol-function 'message-do-fcc) #'notmuch-maildir-message-do-fcc))
-       (message-send-and-exit arg)))
+       (if exit
+           (message-send-and-exit arg)
+         (message-send arg))))
+
+(defun notmuch-mua-send-and-exit (&optional arg)
+  (interactive "P")
+  (notmuch-mua-send-common arg 't))
 
 (defun notmuch-mua-send (&optional arg)
   (interactive "P")
 
 (defun notmuch-mua-send (&optional arg)
   (interactive "P")
-  (letf (((symbol-function 'message-do-fcc) #'notmuch-maildir-message-do-fcc))
-       (message-send arg)))
+  (notmuch-mua-send-common arg))
 
 (defun notmuch-mua-kill-buffer ()
   (interactive)
 
 (defun notmuch-mua-kill-buffer ()
   (interactive)