From 2967fd0108c5ff79e0d583dda3fa5ad8d702cb7f Mon Sep 17 00:00:00 2001 From: yoctocell Date: Wed, 6 Jan 2021 10:32:06 +0100 Subject: Add function to send all mails at once * git-email.el (git-email-send-email-function): (git-email-send-all): --- git-email.el | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'git-email.el') diff --git a/git-email.el b/git-email.el index 801e57b..e88e2f5 100644 --- a/git-email.el +++ b/git-email.el @@ -57,6 +57,11 @@ :group 'git-email :type 'symbol) +(defcustom git-email-send-email-function 'message-send-and-exit + "The function used to send mail." + :type 'symbol + :group 'git-email) + (defcustom git-email-pre-compose-email-hook nil "A list of functions called before running `git-email--compose-email'." :type '(hook) @@ -86,6 +91,14 @@ in you git config. If the variable is not set, the 'to' address will be empty." :type '(string) :group 'git-email) +(defun git-email-send-all () + "Send all unsent emails." + (interactive) + (let ((buffers (message-buffers))) + (mapc (lambda (b) (switch-to-buffer b) + (funcall git-email-send-email-function)) + buffers))) + (defun git-email--extract-header (header) "Extract HEADER from current buffer." (goto-char (point-min)) -- cgit v1.2.3