From 56314bc68e52464bf85784d759886798e1e446f0 Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Sun, 16 Aug 2020 14:51:27 -0400 Subject: piem-inbox-coderepo-maybe-read: Reject invalid empty-string inbox Message-Id: <20200816185130.32703-1-kyle@kyleam.com> --- piem.el | 22 +++++++++++++--------- 1 file 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." -- cgit v1.2.3