aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2020-08-16 14:51:27 -0400
committerKyle Meyer <kyle@kyleam.com>2020-08-16 21:39:40 -0400
commit56314bc68e52464bf85784d759886798e1e446f0 (patch)
treeec24a387d765bda53062dd633c189fe7fc50fd2d
parentff3b7724a75427c8d73a9b80f9ee5057250479cd (diff)
downloadpiem-56314bc68e52464bf85784d759886798e1e446f0.tar.gz
piem-inbox-coderepo-maybe-read: Reject invalid empty-string inbox
-rw-r--r--piem.el22
1 files changed, 13 insertions, 9 deletions
diff --git a/piem.el b/piem.el
index 6a3c2b3..55915f6 100644
--- a/piem.el
+++ b/piem.el
@@ -292,15 +292,19 @@ intended to be used by libraries implementing a function for
(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: ")))
+ (let ((inbox
+ (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: "))))
+ (if (equal inbox "")
+ (user-error "No inbox specified")
+ inbox)))
(defun piem-mid ()
"Return the current buffer's message ID."