From 2b658414c62ee00266fa24a7f7c4685b9d2276d8 Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Sun, 16 Aug 2020 14:51:29 -0400 Subject: 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> --- piem.el | 9 ++++++--- 1 file 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)) -- cgit v1.2.3