From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms12 with LMTPS id WADiJEGAOV83PgAAsNZ9tg (envelope-from ) for ; Sun, 16 Aug 2020 18:51:45 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id sNOIIEGAOV+gVAAAbx9fmQ (envelope-from ) for ; Sun, 16 Aug 2020 18:51:45 +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 018829403EE for ; Sun, 16 Aug 2020 18:51:45 +0000 (UTC) Received: from pb-smtp2.pobox.com (unknown [127.0.0.1]) by pb-smtp2.pobox.com (Postfix) with ESMTP id A95997C07D; Sun, 16 Aug 2020 14:51:43 -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:in-reply-to:references:mime-version :content-transfer-encoding; s=sasl; bh=Nf/4FexupBpmndAAY5gnsXdUe gU=; b=w8Mi6uetXjrBH56kapIUFB3qjFikbCIVlfZPrzQGDlIVYhAFqAcnZP1m1 FzPqtqNYDVDln6vvErPbSKRAMQjDFJ9lwa63oemcUBIE7DAdD3KGSmhfleLfYFI7 nScyFCEIIC2AaaDOuHV88MrE1T5jfssLkK7wjcagy8IGAJc1Z8= Received: from pb-smtp2.nyi.icgroup.com (unknown [127.0.0.1]) by pb-smtp2.pobox.com (Postfix) with ESMTP id A07617C07C; Sun, 16 Aug 2020 14:51:43 -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:in-reply-to:references:mime-version:content-transfer-encoding; s=mesmtp; bh=gYIJGSGkCcD/9ot0FfpjKPT0hISncVy4H3GCC3VBJRw=; b=bbbwAUuTaHSgKbYK/UVQdooDpC/DMkRKB/BoaqOJ0UGRPJt/vVds9g48xKCtDClGse+eZ4POTY3LVzTjRCr3p0zDflYOQ9kweyGP7Hs1eFdI+fqNe6DQyUpCvJrK7AbtvepufRAviIL8g32ipwpFN8qBbPh5vMAqRGdPsGX3p8M= 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 1F2C97C07B; Sun, 16 Aug 2020 14:51:43 -0400 (EDT) (envelope-from kyle@kyleam.com) From: Kyle Meyer To: piem@inbox.kyleam.com Subject: [PATCH v2 3/4] piem-inbox-coderepo-maybe-read: Include current projectile project Date: Sun, 16 Aug 2020 14:51:29 -0400 Message-Id: <20200816185130.32703-3-kyle@kyleam.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <877dty4eme.fsf@kyleam.com> References: <877dty4eme.fsf@kyleam.com> MIME-Version: 1.0 X-Pobox-Relay-ID: 86E4497E-DFF1-11EA-B5DA-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=w8Mi6uet; dkim=fail (body hash did not verify) header.d=kyleam.com header.s=mesmtp header.b=bbbwAUuT; 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: AfOxKwMnHGgF 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 | 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 @@ (defun piem-inbox-coderepo-maybe-read () "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)) --=20 2.28.0