From 1fc1c7e45b32421e17fcec1b23327bfb264a3fab Mon Sep 17 00:00:00 2001 From: Sacha Chua Date: Sun, 19 Nov 2023 16:02:53 -0500 Subject: New function emacsconf-mail-merge-check-drafts --- emacsconf-mail.el | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/emacsconf-mail.el b/emacsconf-mail.el index 0546a1e..1656bef 100644 --- a/emacsconf-mail.el +++ b/emacsconf-mail.el @@ -507,6 +507,21 @@ Include some other things, too, such as emacsconf-year, title, name, email, url, (when note (insert "#+NOTE: " note "\n======== Delete above before sending =============\n\n")) (insert body)))) +(defun emacsconf-mail-merge-check-drafts () + "Put all the drafts in one buffer to check." + (interactive) + (let (result) + (mapc (lambda (buffer) + (when (string-match "unsent" (buffer-name buffer)) + (with-current-buffer buffer + (add-to-list 'result (buffer-string))))) + (buffer-list)) + (with-current-buffer (get-buffer-create "*Drafts*") + (erase-buffer) + (insert (string-join result "\n-------------------------------------------------------\n")) + (goto-char (point-min)) + (switch-to-buffer (current-buffer))))) + (defun emacsconf-mail-merge-cancel () (interactive) (mapc (lambda (buffer) -- cgit v1.2.3