From 40a6a9868af71a982686063c71d73170561b57e8 Mon Sep 17 00:00:00 2001 From: yoctocell Date: Tue, 5 Jan 2021 22:41:04 +0100 Subject: Add function to apply patch in current buffer * git-email.el (git-email-apply-patch): --- git-email.el | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'git-email.el') diff --git a/git-email.el b/git-email.el index 954eafa..801e57b 100644 --- a/git-email.el +++ b/git-email.el @@ -149,6 +149,14 @@ If no marks are found, return the filename at point." (t (message "Not a supported major mode")))) +;;;###autoload +(defun git-email-apply-patch (project) + "Apply the patch in the current buffer using 'git am' in PROJECT." + (interactive (list (project-prompt-project-dir))) + (let ((default-directory project)) + (push (list project) project--list) + (shell-command-on-region (point-min) (point-max) "git am"))) + ;;;###autoload (defun git-email-send-email () "Send patch(es) to someone." -- cgit v1.2.3