From addb74e9a98d37e649b2d0e94018981c62abc087 Mon Sep 17 00:00:00 2001 From: yoctocell Date: Wed, 6 Jan 2021 11:10:24 +0100 Subject: 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): --- git-email.el | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'git-email.el') 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) -- cgit v1.2.3