aboutsummaryrefslogtreecommitdiff
path: root/git-email.el
diff options
context:
space:
mode:
authoryoctocell <public@yoctocell.xyz>2021-01-06 11:10:24 +0100
committeryoctocell <public@yoctocell.xyz>2021-01-06 11:10:24 +0100
commitaddb74e9a98d37e649b2d0e94018981c62abc087 (patch)
treeed61da8c01cd2ea8ea5bc75ed747a294f4fe2313 /git-email.el
parent1b2b6e5abe22c70e618780d5bab7651ab04ca5bf (diff)
Fallback to minibuffer prompt when sending patch
If the current major mode isn't supported, ask the user for a file in the minibuffer. * git-email.el (git-email--minibuffer-file): (git-email--get-filenames):
Diffstat (limited to 'git-email.el')
-rw-r--r--git-email.el7
1 files changed, 6 insertions, 1 deletions
diff --git a/git-email.el b/git-email.el
index 4398171..5fe7cfc 100644
--- a/git-email.el
+++ b/git-email.el
@@ -157,6 +157,11 @@ If no marks are found, return the filename at point."
(ibuffer-get-marked-buffers)))))
marked-files))
+(defun git-email--minibuffer-file ()
+ "Prompt for a file to send as a patch."
+ (list (car (find-file-read-args "Find patch: "
+ (confirm-nonexistent-file-or-buffer)))))
+
(defun git-email--get-filenames ()
"Return list of filenames for marked files in `vc-dir'.
If no marks are found, return the filename at point."
@@ -167,7 +172,7 @@ If no marks are found, return the filename at point."
((eq major-mode 'ibuffer-mode)
(git-email--ibuffer-files))
(t
- (message "Not a supported major mode"))))
+ (git-email--minibuffer-file))))
;;;###autoload
(defun git-email-apply-patch (project)