diff options
-rw-r--r-- | piem-b4.el | 10 | ||||
-rw-r--r-- | piem.el | 12 |
2 files changed, 13 insertions, 9 deletions
@@ -110,15 +110,7 @@ (match-string 1 arg))) args))) (user-error "%s is incompatible with this command" badopt)) - (pcase-let* ((coderepo (or (piem-inbox-coderepo) - (and (fboundp 'projectile-relevant-known-projects) - (completing-read - "Project: " - (projectile-relevant-known-projects))) - (and piem-use-magit - (fboundp 'magit-read-repository) - (magit-read-repository)) - (read-directory-name "Git repository: "))) + (pcase-let* ((coderepo (piem-inbox-coderepo-maybe-read)) (`(,cover ,mbox-file) (piem-b4--get-am-files mid coderepo args)) (default-directory coderepo)) @@ -236,6 +236,18 @@ the following information about the patch series: (repo (plist-get (cdr (assoc p piem-inboxes)) :coderepo))) (expand-file-name repo))) +(defun piem-inbox-coderepo-maybe-read () + "Like `piem-inbox-coderepo', but fall back to reading the repo." + (or (piem-inbox-coderepo) + (and (fboundp 'projectile-relevant-known-projects) + (completing-read + "Project: " + (projectile-relevant-known-projects))) + (and piem-use-magit + (fboundp 'magit-read-repository) + (magit-read-repository)) + (read-directory-name "Git repository: "))) + (defun piem-mid () "Return the current buffer's message ID." (run-hook-with-args-until-success 'piem-get-mid-functions)) |