aboutsummaryrefslogtreecommitdiff
path: root/git-email.el
diff options
context:
space:
mode:
authoryoctocell <public@yoctocell.xyz>2021-01-15 21:13:44 +0100
committeryoctocell <public@yoctocell.xyz>2021-01-15 21:13:44 +0100
commit54bb3284cac9d4799d09b456e36876f9d660ef31 (patch)
tree417fea238dc319261b185d93041cac33a5bc20c3 /git-email.el
parent2112b729fae29b2615c099c4cd45f78a6dd2b3c7 (diff)
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):
Diffstat (limited to 'git-email.el')
-rw-r--r--git-email.el9
1 files changed, 7 insertions, 2 deletions
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)))