From 272eca1d2e5c3b33d619d3feeddd3e049f7be16a Mon Sep 17 00:00:00 2001 From: yoctocell Date: Sun, 3 Jan 2021 20:32:18 +0100 Subject: Insert diff into message buffer * git-email.el (git-email-send-email): --- git-email.el | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'git-email.el') diff --git a/git-email.el b/git-email.el index 1897bcd..152b113 100644 --- a/git-email.el +++ b/git-email.el @@ -54,16 +54,23 @@ (point-max)))) (defun git-email-send-email (patch-file) - "Given a PATCH-FILE, send an email." + "Given a PATCH-FILE, send an email. +Extracts the relevant headers and the diff from the PATCH-FILE and inserts +them into the message buffer." (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))) + (msg-id (git-email--extract-header "message-id" patch-file)) + (diff (git-email--extract-diff patch-file))) (funcall git-email--compose-message-function "test" subject `(("in-reply-to" ,in-reply-to) ("message-id" ,msg-id) - ("from" ,from))))) + ("from" ,from))) + ;; (let ((body (or (re-search-forward "<#part .*>") + ;; (re-search-forward "--text follows this line--")))) + (goto-char (point-max)) + (insert diff))) (provide 'git-email) -- cgit v1.2.3