aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--git-email.el11
1 files changed, 8 insertions, 3 deletions
diff --git a/git-email.el b/git-email.el
index f3b8aae..e89fcef 100644
--- a/git-email.el
+++ b/git-email.el
@@ -311,11 +311,15 @@ them into the message buffer."
(cadr (log-view-current-entry (point) t))))
;;;###autoload
-(defun git-email-format-patch (&optional args)
+(defun git-email-format-patch (&optional args keep)
"Format and send patch(es) using 'git format-patch'.
+
With optional ARGS (\\[universal-argument]) you can specify extra
arguments to give to 'git format-patch'. By default, the
-arguments in `git-email-format-patch-default-args' will be used."
+arguments in `git-email-format-patch-default-args' will be used.
+
+If KEEP is a non-nil value, keep the generated patches. The default
+behavior is to delete them after sending email."
(interactive "P")
(let* ((rev (or (seq-some (lambda (fn)
(funcall fn))
@@ -340,7 +344,8 @@ arguments in `git-email-format-patch-default-args' will be used."
(dolist (file files)
(run-hooks 'git-email-pre-compose-email-hook)
(git-email--compose-email file)
- (run-hooks 'git-email-post-compose-email-hook))))
+ (run-hooks 'git-email-post-compose-email-hook))
+ (mapc #'delete-file files)))
;;;; Operate on emails
(defun git-email-send-all ()