aboutsummaryrefslogtreecommitdiff
path: root/git-email.el
diff options
context:
space:
mode:
authoryoctocell <public@yoctocell.xyz>2021-01-03 20:10:12 +0100
committeryoctocell <public@yoctocell.xyz>2021-01-03 20:11:05 +0100
commitcfed1ff81df6d08d635853e9be31be3a49657d94 (patch)
treedccb58ad9ad761161b52bb60617947d3fb76b42b /git-email.el
parentc971b9e0bacb8816cfa26e036469f2b3aebafbe9 (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.el19
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