From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms12 with LMTPS id 3SO3AdBkOV9OaAAAsNZ9tg (envelope-from ) for ; Sun, 16 Aug 2020 16:54:40 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id ELrKOM9kOV9LbwAA1q6Kng (envelope-from ) for ; Sun, 16 Aug 2020 16:54:39 +0000 Received: from pb-smtp2.pobox.com (pb-smtp2.pobox.com [64.147.108.71]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 1692C940715 for ; Sun, 16 Aug 2020 16:54:38 +0000 (UTC) Received: from pb-smtp2.pobox.com (unknown [127.0.0.1]) by pb-smtp2.pobox.com (Postfix) with ESMTP id A2BAD7B5E8; Sun, 16 Aug 2020 12:54:36 -0400 (EDT) (envelope-from kyle@kyleam.com) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to :subject:date:message-id:mime-version:content-transfer-encoding; s=sasl; bh=4byey3RdE02Z7kyIArhdiezILho=; b=bsy3WVDjBhp9CQluoyG7 QUSbThgaVmgRfgcGTlaq6vgmycA2VeNzXuK6/srRP+q5o2U2ozivQK39nRN1QdEM A7zW5Oag8KMxRI2iht/BjgOmfW1QIDUxi/JQ50Oh1O0TB5gMhS37P+Q/oC+H61Xn CqNb4CSn3k2oE5Cn1fpOJsk= Received: from pb-smtp2.nyi.icgroup.com (unknown [127.0.0.1]) by pb-smtp2.pobox.com (Postfix) with ESMTP id 9B2157B5E7; Sun, 16 Aug 2020 12:54:36 -0400 (EDT) (envelope-from kyle@kyleam.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=kyleam.com; h=from:to:subject:date:message-id:mime-version:content-transfer-encoding; s=mesmtp; bh=XEpT3xr+Rmuao/3EoVik4mdSeHqVpcB8pXHgZIho0oA=; b=gTNzkHO2aog2DWJ7TsHhDXVqtcK4/1M0WyW6E8L3FJNZ2AOqxI1blQv608K/QkjdSCikx3KNnoczJf09Or3iFEe72LLLt0NyTp6Co9OHvagDDr5wVod9WjuEaW392MGFMO8UNp+aKyn89LCHMTwhXtpxV7fzO88j7hodPLHpDwI= Received: from localhost (unknown [45.33.91.115]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp2.pobox.com (Postfix) with ESMTPSA id 1ADDC7B5E6; Sun, 16 Aug 2020 12:54:36 -0400 (EDT) (envelope-from kyle@kyleam.com) From: Kyle Meyer To: piem@inbox.kyleam.com Subject: [PATCH] piem-inbox-coderepo-maybe-read: Include current projectile project Date: Sun, 16 Aug 2020 12:54:31 -0400 Message-Id: <20200816165431.18195-1-kyle@kyleam.com> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 X-Pobox-Relay-ID: 2A761F92-DFE1-11EA-A413-2F5D23BA3BAF-24757444!pb-smtp2.pobox.com Content-Transfer-Encoding: quoted-printable X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=pobox.com header.s=sasl header.b=bsy3WVDj; dkim=fail (body hash did not verify) header.d=kyleam.com header.s=mesmtp header.b=gTNzkHO2; dmarc=none; spf=pass (aspmx1.migadu.com: domain of kyle@kyleam.com designates 64.147.108.71 as permitted sender) smtp.mailfrom=kyle@kyleam.com X-Spam-Score: 2.50 X-TUID: 1Jo6ysyDaVXi 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. --- piem.el | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/piem.el b/piem.el index 6a3c2b3..941b7d7 100644 --- a/piem.el +++ b/piem.el @@ -293,10 +293,13 @@ (defun piem-inbox-url () (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) + (and (bound-and-true-p projectile-known-projects) (completing-read "Project: " - (projectile-relevant-known-projects))) + 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)) base-commit: ff3b7724a75427c8d73a9b80f9ee5057250479cd --=20 2.28.0