From 54bb3284cac9d4799d09b456e36876f9d660ef31 Mon Sep 17 00:00:00 2001 From: yoctocell Date: Fri, 15 Jan 2021 21:13:44 +0100 Subject: Add `git-email--get-project' Modularize `git-email-apply-patch', this way other functions can also use `git-email--get-project'. * git-email.el (git-email--get-project): (git-email-apply-patch): --- git-email.el | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'git-email.el') diff --git a/git-email.el b/git-email.el index e38dee6..e0fd6ac 100644 --- a/git-email.el +++ b/git-email.el @@ -372,12 +372,17 @@ behavior is to delete them after sending email." "Get the body of the message in the current buffer and run COMMAND on it." (shell-command-on-region (point-min) (point-max) command)) +(defun git-email--get-project () + "Get the path to a project using `project-prompt-project-dir'." + (let ((project (project-prompt-project-dir))) + (add-to-list 'project--list (list project)) + project)) + ;;;###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))) + (interactive (list (git-email--get-project))) (let ((default-directory project)) - (push (list project) project--list) (funcall git-email-apply-patch-function git-email-apply-patch-command))) -- cgit v1.2.3