diff options
author | yoctocell <public@yoctocell.xyz> | 2021-01-03 20:14:58 +0100 |
---|---|---|
committer | yoctocell <public@yoctocell.xyz> | 2021-01-03 20:14:58 +0100 |
commit | 8fce8385da33a998f37307031ef78d870067a914 (patch) | |
tree | 9fc91d6ff583afc944564a12198ff4a057e9436e | |
parent | cfed1ff81df6d08d635853e9be31be3a49657d94 (diff) |
Add function to extract diff
* git-email.el (git-email--extract-diff): Init
-rw-r--r-- | git-email.el | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/git-email.el b/git-email.el index 22f4ca9..1897bcd 100644 --- a/git-email.el +++ b/git-email.el @@ -44,6 +44,15 @@ (re-search-forward (format " *%s: +" header)) (point-at-eol)))) +(defun git-email--extract-diff (patch-file) + "Extract the diff from PATCH-FILE." + (with-temp-buffer + (insert-file-contents patch-file) + (goto-char (point-min)) + (buffer-substring-no-properties + (- (re-search-forward "\n\n") 1) + (point-max)))) + (defun git-email-send-email (patch-file) "Given a PATCH-FILE, send an email." (interactive) |