From 59d673bbf24a94d4cbf2e9b3e2f01896ad0ee244 Mon Sep 17 00:00:00 2001 From: Xinglu Chen Date: Sat, 6 Feb 2021 11:24:46 +0100 Subject: git-email-send-all: Sort message buffers * git-email.el (git-email-send-all): Sort the message buffers so they get sent in the correct order. --- git-email.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'git-email.el') diff --git a/git-email.el b/git-email.el index 2a4addc..01bd65a 100644 --- a/git-email.el +++ b/git-email.el @@ -380,7 +380,9 @@ default behavior is to delete them after sending the message." (defun git-email-send-all () "Send all unsent emails." (interactive) - (let ((buffers (message-buffers))) + ;; Sort the buffers so that [PATCH 0/N] comes first, this prevents + ;; the ordering to get messed up. + (let ((buffers (sort (message-buffers) #'string-greaterp))) (mapc (lambda (b) (switch-to-buffer b) (funcall git-email-send-email-function)) buffers))) -- cgit v1.2.3