[PATCH 1/2] emacs: mua: extract a common message-send function.

Mark Walters markwalters1009 at gmail.com
Sun Oct 2 07:05:30 PDT 2016


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 | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el
index 55bc267..72fb770 100644
--- a/emacs/notmuch-mua.el
+++ b/emacs/notmuch-mua.el
@@ -490,15 +490,20 @@ will be addressed to all recipients of the source message."
     (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))
-	(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")
-  (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)
-- 
2.1.4



More information about the notmuch mailing list