From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:aacc::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms12 with LMTPS id qHNVGwDAGGCmNQAAsNZ9tg (envelope-from ) for ; Tue, 02 Feb 2021 02:59:12 +0000 Received: from out2.migadu.com ([2001:41d0:2:aacc::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id CPbYD/6/GGCnYgAAbx9fmQ (envelope-from ) for ; Tue, 02 Feb 2021 02:59:10 +0000 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kyleam.com; s=key1; t=1612234750; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=RzJOOBn1Xp1LXZYmdZHOFYfODwQtkPKB2ClSQbkcQI8=; b=J6ydHjjlSYFDttO/s/YAbwEHLlbQtJ18o52O9A35ZrG5KSok3oMt8AwcTP414CEe/nf3Ak jX8lqqwWggewAMCU5v6SK0vNveEDnTowr1Xx+p1fwY28etqYTaIamEzVg2bZESTlzsiLkR beJUx5vuJRluuyXgYeJxvbwYnup0ME/d0Z2EHbyFcOdt8ExegIXlCvMx+6r8i49jZTeIPy CGhIiMxaCUVaKxwmmMMKWldn9+tEBUKnGA2hqaktNsm5KYVzPQm1CD5jaTNNOsmwD8C7uP 1D0jdMJEDpF78XlWiOf8l6IFBaIn7dODZQ947a+aJ7iAG+NxNNN4MqvUz54vpQ== From: Kyle Meyer To: Xinglu Chen Cc: piem@inbox.kyleam.com Subject: Re: [PATCH] Support reading directory using project.el In-Reply-To: <3c67863e03e49c3ae3ac0bb3e86f021e00a23255.1612212167.git.public@yoctocell.xyz> References: <3c67863e03e49c3ae3ac0bb3e86f021e00a23255.1612212167.git.public@yoctocell.xyz> Date: Mon, 01 Feb 2021 21:59:07 -0500 Message-ID: <874kiv9nus.fsf@kyleam.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: kyle@kyleam.com X-TUID: wXNyk6788dxi Thanks for the patch. I started using projectile before project.el existed and haven't had any motivation to explore project.el or other options, so this is very much appreciated. Xinglu Chen writes: > Since Emacs 28, project.el is built-in package that offers similar > functionality to projectile. It is also available on GNU ELPA. Hmm, project.el has existed longer than that, I think. lisp/progmodes/project.el has been in the Emacs repo since 2015 and was part of the Emacs 25 release. However, if I recall correctly, it's a bit of a moving target in terms of variable/function names. > * piem.el (piem-inbox-coderepo-maybe-read): Add support for reading > directory using project.el. Sorry, no changelog entries allowed in this code base :) You could map the gist of that onto the subject, though. Something like piem-inbox-coderepo-maybe-read: Support project.el > diff --git a/piem.el b/piem.el > index 7b198d1..f6458f9 100644 > --- a/piem.el > +++ b/piem.el > @@ -372,6 +372,9 @@ (defun piem-inbox-coderepo-maybe-read () > (when-let ((current (and (fboundp 'projectile-projec= t-root) > (projectile-project-root)))) > (abbreviate-file-name current))))) > + (and (bound-and-true-p project--list) > + (expand-file-name > + (project-prompt-project-dir))) I'd prefer to avoid inspecting a -- symbol if possible. Maybe a good indicator that project.el should be used is if project-list-file is bound and the file it points to exists. Also, `make compile' gives the following warning: piem.el:788:1:Warning: the function =E2=80=98project-prompt-project-dir= =E2=80=99 is not known to be defined. You can squelch that with (fboundp 'project-prompt-project-dir) Both project-prompt-project-dir and project-list-file won't be available until the Emacs 28 release, but, as you mention, project.el is on ELPA too, so I think it's fine to be forward-looking here.