From cfed1ff81df6d08d635853e9be31be3a49657d94 Mon Sep 17 00:00:00 2001 From: yoctocell Date: Sun, 3 Jan 2021 20:10:12 +0100 Subject: Add function to send mail * git-email.el (git-email-send-email): Init. --- git-email.el | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'git-email.el') diff --git a/git-email.el b/git-email.el index 6729f03..22f4ca9 100644 --- a/git-email.el +++ b/git-email.el @@ -41,9 +41,22 @@ (insert-file-contents patch-file) (goto-char (point-min)) (buffer-substring-no-properties - (re-search-forward (format " *%s: .*" header)) - (point-at-bol)))) - + (re-search-forward (format " *%s: +" header)) + (point-at-eol)))) + +(defun git-email-send-email (patch-file) + "Given a PATCH-FILE, send an email." + (interactive) + (let ((subject (git-email--extract-header "subject" patch-file)) + (from (git-email--extract-header "from" patch-file)) + (in-reply-to (git-email--extract-header "in-reply-to" patch-file)) + (msg-id (git-email--extract-header "message-id" patch-file))) + (funcall git-email--compose-message-function "test" subject + `(("in-reply-to" ,in-reply-to) + ("message-id" ,msg-id) + ("from" ,from))))) + + (provide 'git-email) ;;; git-email.el ends here -- cgit v1.2.3