diff options
author | yoctocell <public@yoctocell.xyz> | 2021-01-03 20:10:12 +0100 |
---|---|---|
committer | yoctocell <public@yoctocell.xyz> | 2021-01-03 20:11:05 +0100 |
commit | cfed1ff81df6d08d635853e9be31be3a49657d94 (patch) | |
tree | dccb58ad9ad761161b52bb60617947d3fb76b42b /git-email.el | |
parent | c971b9e0bacb8816cfa26e036469f2b3aebafbe9 (diff) |
Add function to send mail
* git-email.el (git-email-send-email): Init.
Diffstat (limited to 'git-email.el')
-rw-r--r-- | git-email.el | 19 |
1 files changed, 16 insertions, 3 deletions
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 |