aboutsummaryrefslogtreecommitdiff
path: root/git-email.el
diff options
context:
space:
mode:
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