aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2020-08-16 14:51:29 -0400
committerKyle Meyer <kyle@kyleam.com>2020-08-16 21:39:40 -0400
commit2b658414c62ee00266fa24a7f7c4685b9d2276d8 (patch)
tree66be7f67f632e1828da840bfde535190eff55f53
parent9cfa6e709c0c364e12ff58216eebc825274813a1 (diff)
downloadpiem-2b658414c62ee00266fa24a7f7c4685b9d2276d8.tar.gz
piem-inbox-coderepo-maybe-read: Include current projectile project
When piem-inbox-coderepo-maybe-read is called from within a project, the current project isn't included in the collection because projectile-relevant-known-projects excludes it when projectile-current-project-on-switch is at its default value. That's undesirable in this context; if there's a current project, it's likely the one of interest (e.g., calling piem-b4-am-ready-from-mbox from a project's directory). Add the current project to the collection and make it the default. Also, don't bother going down the projectile branch if there are no known projects. Message-Id: <20200816185130.32703-3-kyle@kyleam.com>
-rw-r--r--piem.el9
1 files changed, 6 insertions, 3 deletions
diff --git a/piem.el b/piem.el
index de298a1..f4ba96b 100644
--- a/piem.el
+++ b/piem.el
@@ -294,11 +294,14 @@ intended to be used by libraries implementing a function for
"Like `piem-inbox-coderepo', but fall back to reading the repo."
(let ((inbox
(or (piem-inbox-coderepo)
- (and (fboundp 'projectile-relevant-known-projects)
+ (and (bound-and-true-p projectile-known-projects)
(completing-read
"Project: "
- (projectile-relevant-known-projects)
- nil t))
+ projectile-known-projects nil t nil nil
+ (when-let ((current (and (fboundp 'projectile-project-root)
+ (projectile-project-root))))
+ (abbreviate-file-name current))))
+
(and piem-use-magit
(fboundp 'magit-read-repository)
(magit-read-repository))