GNU bug report logs - #76307
[PATCH] Add 'project-forget-projects-under-dirs', limit dir selection to relevant dirs

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Ship Mints <shipmints@HIDDEN>; Keywords: patch; dated Sat, 15 Feb 2025 17:51:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 76307 <at> debbugs.gnu.org:


Received: (at 76307) by debbugs.gnu.org; 16 Feb 2025 12:26:36 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Feb 16 07:26:36 2025
Received: from localhost ([127.0.0.1]:60722 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tjdjI-00032d-2K
	for submit <at> debbugs.gnu.org; Sun, 16 Feb 2025 07:26:36 -0500
Received: from mail-vs1-xe2d.google.com ([2607:f8b0:4864:20::e2d]:48253)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <shipmints@HIDDEN>)
 id 1tjdjD-00032K-QC
 for 76307 <at> debbugs.gnu.org; Sun, 16 Feb 2025 07:26:33 -0500
Received: by mail-vs1-xe2d.google.com with SMTP id
 ada2fe7eead31-4be4de0c038so154836137.0
 for <76307 <at> debbugs.gnu.org>; Sun, 16 Feb 2025 04:26:31 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1739708786; x=1740313586; darn=debbugs.gnu.org;
 h=cc:to:subject:message-id:date:from:in-reply-to:references
 :mime-version:from:to:cc:subject:date:message-id:reply-to;
 bh=irMfuDJ9QsU9pHHd9/zJofhK41Rak/yl02UOKin9k6s=;
 b=fG63MhHQP61CMYpjf04oVXAMavDeVPiN5yy2pROrk62eRDxDoVfz3wZsO66WCo+G50
 Ub2/2Pm3TO8zxH0jcVTBdfth+GMlQNLxyymFEoqFfRQyT+JZKSnV0UJ7AupCpGo3KZ2o
 gJA5axq3o2tY0Ov/6wFhOmHj8EoX+DLCxTjRkVyQtegymry75cb2EB98AXCsthv9Ix+R
 8wy5qFvaNxM0UxReIw04NCjH/RpSFBDgKqbvX1Q/gmSvNAL+3PMj1vdjIstKXv/lskcT
 65NyKtXbangNlUKEb9kH8h+u23PictQh1JENaV2CO6W93gswdaFkqLA33MwbfkN52R/c
 WDgQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1739708786; x=1740313586;
 h=cc:to:subject:message-id:date:from:in-reply-to:references
 :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id
 :reply-to;
 bh=irMfuDJ9QsU9pHHd9/zJofhK41Rak/yl02UOKin9k6s=;
 b=qA+pBaEKP9YCXy5DgoPaBdP8I5WG9Cy/WQdWVmghutryOfX5mRjWiXw9jCGQnfAzeY
 deGdsJaXS7jGtdlWyyWcA2E5PEdWMBgX525tfPW+eTzNW+7wHHZ1c9//px+YCt44QJsU
 wlgG3DQ+a5eXjkfoVWapL5StKhkX1whrfVhkwG0xyOJydO/7qy/dLuPjrC0kPjjn0I9/
 C1uQOcZp3IaJ1Jl6BuciNRx2kmHhYFQcvh2c+F2sZTceZX+aetP9ekEtJx/szPLBIrMY
 aKYTCxfxjjpxcXlbTipLNfAzRo3KVm7+9X34doLgzmNh9/UB9JgHexmFjFLQAu98TEDi
 6RRQ==
X-Gm-Message-State: AOJu0Yzg9Dv3Gg5PACy5ASND1Rppb8sByB4ktjRE9kBuY2Dk9SARYqh1
 BJntDMmNMgwNwKqaJ1ycPInJSR/bWg91X19SK6xlqI3Y6AFDiaznHupbuRdPGdMUHuPdbathKCm
 X4/a+j/I+sSR/nxIzc+jqkPjL268=
X-Gm-Gg: ASbGncuti5aMNK9+gzA51M9JUaTe4zjR6eXLJV+/54sBM9IaeSbmMxFYue3QA/3kVYq
 9idLYBW2Y5MY0fP0BqatHP6aF/GBAUF5N8BVF5MjGCq5Sh8+b6dwE9e2p8j0HinmtYCG8Fh7G
X-Google-Smtp-Source: AGHT+IE7IU18zU0Jr/062sSZt3rGXfbpdRQdDn7sFRKoFUBo1zyv10DUgijrphyTExutrilwA9nb2oJfXRK2iBWYuto=
X-Received: by 2002:a05:6102:91a:b0:4b2:48ba:9943 with SMTP id
 ada2fe7eead31-4bd3fe2f7e8mr2847065137.24.1739708785845; Sun, 16 Feb 2025
 04:26:25 -0800 (PST)
MIME-Version: 1.0
References: <CAN+1Hbqgnc7kaLfXqBV5XbNnSyY2-7ygKFREa4enmLqzStrBjg@HIDDEN>
 <m1seofdnkq.fsf@HIDDEN>
 <CAN+1HbpGR_=HSszd7xAY7M6zXiZ04aCjAo_VtAVfzZAnL5Wkjg@HIDDEN>
 <m1tt8uc12h.fsf@HIDDEN>
In-Reply-To: <m1tt8uc12h.fsf@HIDDEN>
From: Ship Mints <shipmints@HIDDEN>
Date: Sun, 16 Feb 2025 07:26:14 -0500
X-Gm-Features: AWEUYZm2SLM9JR5Os7zzaMx9mP5N_OnZoVXq_BCaLP8eBjgcIAvkIUFtBmwn4-s
Message-ID: <CAN+1HbpyCkm86RzZZaKMiXCHYGGD7o_CboBxLZmA-3Q=diZEaQ@HIDDEN>
Subject: Re: bug#76307: [PATCH] Add 'project-forget-projects-under-dirs',
 limit dir selection to relevant dirs
To: Eshel Yaron <me@HIDDEN>
Content-Type: multipart/alternative; boundary="000000000000316e8f062e41845f"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 76307
Cc: 76307 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--000000000000316e8f062e41845f
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Sat, Feb 15, 2025 at 5:09=E2=80=AFPM Eshel Yaron <me@HIDDEN> wro=
te:

> Ship Mints <shipmints@HIDDEN> writes:
>
> > Thank you for your thoughtful feedback.
> >
> > A couple of things stand out. First, calling completing-read directly
> means we can reuse the project-file
> > completion category (and if you use something like marginalia, you get
> nice metadata in your completion list),
>
> In my suggested approach we get the "file" completion category, which
> AFAICT marginalia picks up just as well and provides the same kind of
> completion annotations.
>
> > and which also now can inhibit sorting the completion candidate list,
> which I find can be annoying for this kind of
> > use case.
>
> Sorry, I'm not sure I understand the problem.
>
> FWIW there are several ways to control sorting besides specifying
> display-sort-function in the completion metadata, like completions-sort,
> completion-category-overrides and completion-extra-properties.
>

Hewing to the style of the project.el code base, considered choices like a
dedicated project-file category, and reusing/improving its own code seem
like good things to me. I'm not one of its maintainers, so I try to keep it
easy for those who are.


> > Second, since this is forget "under" directories, prompting with the
> common prefixes that allow one to forget
> > under the whole shebang makes more sense to me.
>
> You could still select a common ancestor directory (prefix) to forget
> all projects under it, if that's what you mean.
>
> > Perhaps your ancestor list generator can be more efficient than the
> > common-prefix code that I quickly wrote, and it would be helpful for
> > it to show all common prefixes, don't you agree?
>
> I don't see a lot of benefit in the flat list of all possible choices in
> this case, but no strong objection either, just a personal preference.
>

Not sure the common-prefix list is "flatter" than any other kind of list,
but it is convenient when one wants to forget projects on a remote host en
masse, or in the root of a directory tree that has script-kiddie git repos
everywhere (one day, they'll all learn that monorepos are the way) and I
want to forget everything I've seen (for more than one reason!).

--000000000000316e8f062e41845f
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><div class=3D"gmail_default" style=3D"fon=
t-family:monospace"><span style=3D"font-family:Arial,Helvetica,sans-serif">=
On Sat, Feb 15, 2025 at 5:09=E2=80=AFPM Eshel Yaron &lt;<a href=3D"mailto:m=
e@HIDDEN">me@HIDDEN</a>&gt; wrote:</span></div></div><div c=
lass=3D"gmail_quote gmail_quote_container"><blockquote class=3D"gmail_quote=
" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);=
padding-left:1ex">Ship Mints &lt;<a href=3D"mailto:shipmints@HIDDEN" tar=
get=3D"_blank">shipmints@HIDDEN</a>&gt; writes:<br>
<br>
&gt; Thank you for your thoughtful feedback.<br>
&gt;<br>
&gt; A couple of things stand out. First, calling completing-read directly =
means we can reuse the project-file<br>
&gt; completion category (and if you use something like marginalia, you get=
 nice metadata in your completion list),<br>
<br>
In my suggested approach we get the &quot;file&quot; completion category, w=
hich<br>
AFAICT marginalia picks up just as well and provides the same kind of<br>
completion annotations.<br>
<br>
&gt; and which also now can inhibit sorting the completion candidate list, =
which I find can be annoying for this kind of<br>
&gt; use case.<br>
<br>
Sorry, I&#39;m not sure I understand the problem.<br>
<br>
FWIW there are several ways to control sorting besides specifying<br>
display-sort-function in the completion metadata, like completions-sort,<br=
>
completion-category-overrides and completion-extra-properties.<br></blockqu=
ote><div><br></div><div><div class=3D"gmail_default" style=3D"font-family:m=
onospace">Hewing to the style of the project.el code base, considered choic=
es like a dedicated project-file category, and reusing/improving its=C2=A0o=
wn code seem like good things to=C2=A0me. I&#39;m not one of its maintainer=
s, so I try to keep it easy for those who are.</div></div><div>=C2=A0</div>=
<blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-=
left:1px solid rgb(204,204,204);padding-left:1ex">
&gt; Second, since this is forget &quot;under&quot; directories, prompting =
with the common prefixes that allow one to forget<br>
&gt; under the whole shebang makes more sense to me. <br>
<br>
You could still select a common ancestor directory (prefix) to forget<br>
all projects under it, if that&#39;s what you mean.<br>
<br>
&gt; Perhaps your ancestor list generator can be more efficient than the<br=
>
&gt; common-prefix code that I quickly wrote, and it would be helpful for<b=
r>
&gt; it to show all common prefixes, don&#39;t you agree?<br>
<br>
I don&#39;t see a lot of benefit in the flat list of all possible choices i=
n<br>
this case, but no strong objection either, just a personal preference.<br><=
/blockquote><div><br></div><div class=3D"gmail_default" style=3D"font-famil=
y:monospace">Not sure the common-prefix list is &quot;flatter&quot; than an=
y other kind of list, but it is convenient when one wants to forget project=
s on a remote host en masse, or in the root of a directory tree that has sc=
ript-kiddie git repos everywhere (one day, they&#39;ll all learn that monor=
epos are the way) and I want to forget everything I&#39;ve seen (for more t=
han one reason!).</div></div></div>

--000000000000316e8f062e41845f--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#76307; Package emacs. Full text available.

Message received at 76307 <at> debbugs.gnu.org:


Received: (at 76307) by debbugs.gnu.org; 15 Feb 2025 22:09:32 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Feb 15 17:09:32 2025
Received: from localhost ([127.0.0.1]:58384 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tjQLr-0005JT-Qj
	for submit <at> debbugs.gnu.org; Sat, 15 Feb 2025 17:09:32 -0500
Received: from mail.eshelyaron.com ([107.175.124.16]:45430 helo=eshelyaron.com)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <me@HIDDEN>) id 1tjQLp-0005JJ-Jh
 for 76307 <at> debbugs.gnu.org; Sat, 15 Feb 2025 17:09:30 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eshelyaron.com;
 s=mail; t=1739657368;
 bh=vN3wLcr1uKCBcVeuvOYOLBMdG7DK5SDrx7//w/idXyI=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date:From;
 b=jJVJZZ9+TSIOUL3/qSIyJy1vCjtMYzSZQrBbZeac9JlF+205di4Ptr6SkqgjvzO7F
 CSQay27TpLX6jd3uFz3JacMZSWq1lCRbUQ4MRKe5FF6rgJzgsEUloDYrgjErDUlxwu
 3abqI9NlDAbmmOYt6DUUvSDsB0j2rMjd/JUlfA+jj22JlCyzHGkmwlIZcUM/J1pf7F
 1hsIR/ffnkoILHZmB5EmRMJr8EWz0GRF3pMVe6ZMG3FzvYQryiqZPr8nKsDmHTBLCk
 dUFxQeUHgWKujNBXXoyR9lWo3waPODnMLic/KdMZrL95mmfKQCVPZqmP2uvtei6Ota
 T/pLdSFHAT6Hw==
From: Eshel Yaron <me@HIDDEN>
To: Ship Mints <shipmints@HIDDEN>
Subject: Re: bug#76307: [PATCH] Add 'project-forget-projects-under-dirs',
 limit dir selection to relevant dirs
In-Reply-To: <CAN+1HbpGR_=HSszd7xAY7M6zXiZ04aCjAo_VtAVfzZAnL5Wkjg@HIDDEN>
References: <CAN+1Hbqgnc7kaLfXqBV5XbNnSyY2-7ygKFREa4enmLqzStrBjg@HIDDEN>
 <m1seofdnkq.fsf@HIDDEN>
 <CAN+1HbpGR_=HSszd7xAY7M6zXiZ04aCjAo_VtAVfzZAnL5Wkjg@HIDDEN>
Date: Sat, 15 Feb 2025 23:09:26 +0100
Message-ID: <m1tt8uc12h.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 76307
Cc: 76307 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Ship Mints <shipmints@HIDDEN> writes:

> Thank you for your thoughtful feedback.
>
> A couple of things stand out. First, calling completing-read directly means we can reuse the project-file
> completion category (and if you use something like marginalia, you get nice metadata in your completion list),

In my suggested approach we get the "file" completion category, which
AFAICT marginalia picks up just as well and provides the same kind of
completion annotations.

> and which also now can inhibit sorting the completion candidate list, which I find can be annoying for this kind of
> use case.

Sorry, I'm not sure I understand the problem.

FWIW there are several ways to control sorting besides specifying
display-sort-function in the completion metadata, like completions-sort,
completion-category-overrides and completion-extra-properties.

> Second, since this is forget "under" directories, prompting with the common prefixes that allow one to forget
> under the whole shebang makes more sense to me. 

You could still select a common ancestor directory (prefix) to forget
all projects under it, if that's what you mean.

> Perhaps your ancestor list generator can be more efficient than the
> common-prefix code that I quickly wrote, and it would be helpful for
> it to show all common prefixes, don't you agree?

I don't see a lot of benefit in the flat list of all possible choices in
this case, but no strong objection either, just a personal preference.


Eshel




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#76307; Package emacs. Full text available.

Message received at 76307 <at> debbugs.gnu.org:


Received: (at 76307) by debbugs.gnu.org; 15 Feb 2025 19:32:42 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Feb 15 14:32:42 2025
Received: from localhost ([127.0.0.1]:57958 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tjNu5-0005Sq-MD
	for submit <at> debbugs.gnu.org; Sat, 15 Feb 2025 14:32:42 -0500
Received: from mail-ua1-x934.google.com ([2607:f8b0:4864:20::934]:54347)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <shipmints@HIDDEN>)
 id 1tjNu2-0005SV-7p
 for 76307 <at> debbugs.gnu.org; Sat, 15 Feb 2025 14:32:39 -0500
Received: by mail-ua1-x934.google.com with SMTP id
 a1e0cc1a2514c-868f35fdd27so600482241.0
 for <76307 <at> debbugs.gnu.org>; Sat, 15 Feb 2025 11:32:38 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1739647952; x=1740252752; darn=debbugs.gnu.org;
 h=cc:to:subject:message-id:date:from:in-reply-to:references
 :mime-version:from:to:cc:subject:date:message-id:reply-to;
 bh=OzgHIBOZ6aVzbIETYHxFz0RscG+Pf/lKO2ad8egeR/A=;
 b=c7Nuo0QTFHsvrHzzeLo0+eC6DJosRjsqMk1Oct2428Mc5vfoEj6vz0x3LMeZI+0xHR
 cvp73hYs3Rw6711yY7vKp9GOGF1tWQ1rA6fityvb+XKhbmZlWUokcL3Sgut7DoY/8PkJ
 kgBIRgDQajGbOslpfZ8khcbEkFWCheYQHDiY/jotkCXbqbz8i5ZTqn2PXIRk/R11V4L9
 E2xXYklDYNblu7H04lJxtJUIhObBKOOwxEaHHvE3XT+BNksFBBXniDoZr53kHXx/UrUh
 lFgvdjCFhshvRX7VsqZ8rVXz/Ud18Ze3cnAQUpgUsJIs73tO7enDgRgat1frsh7R0luE
 Yx0w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1739647952; x=1740252752;
 h=cc:to:subject:message-id:date:from:in-reply-to:references
 :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id
 :reply-to;
 bh=OzgHIBOZ6aVzbIETYHxFz0RscG+Pf/lKO2ad8egeR/A=;
 b=AmjwvAvHcGCLka0t5siBJrp0hnwKS/OxFwJa7eaDX8of+El8MumiXob3PD+W8up8iy
 KuLo/Y5YO0CLJFZM4REtMO8T26Ae6LZO9rMvBwlCG96pLQ6oPbxNxVxFXryOnTZ7SskX
 7cZaqpCnwTZYU3JK65FRTRdJEAmzxV8yi/RCNTpdWwCB2mUmCZo1jU7Gcq+6smlf9v6j
 Nkjc5OplyqBbVqssKn7/JDwfiFZlPr/01FfxHZeUUCo4mX8W87eUy8YE2zLGDHDGvWT7
 mB77dU03dfFJkbekHE/pG4g8Itabmx9nsxweK4C7OwI6Fa75ZQdPp4HgpjDRNJ6aOJ/o
 EXdA==
X-Gm-Message-State: AOJu0Yw1/jwekSc41rRBHcO3PMzFqDpmrXQ32AgYeHY0AV8493uwUkS7
 dHl7B9HflkvqsgxDPhBPTSJ+bWkigRQhW/WeRrSf6hDSV7xoWbe4dID+KjKjRshgjr3Aa3EsBuJ
 PiqZqLSv9C+9QjD1XljcXfboqMtoiCw==
X-Gm-Gg: ASbGncsKPwHaAbzAkZEv7Hf8YCAMzk+mmiSPzP0hRB1ypoOxCjrblNjuqELkOTJZNzp
 Nf5ghyn8WQXDiaiIhDN9CVvxCep+ZztkT4u16HY8ukq6wI+w1p3k6x3s0/6fem7MiVOPfYpyr
X-Google-Smtp-Source: AGHT+IFjKncZ1Pjmn6YuFqOTPRZgxWQLHP+wU2PtV177ZCiugW1Arc/l9/Z5uP5MunnClEpIdneUDLNfUiBIg7lMN80=
X-Received: by 2002:a05:6102:290a:b0:4b9:bc52:e050 with SMTP id
 ada2fe7eead31-4bd3fc66f5cmr2562367137.2.1739647952472; Sat, 15 Feb 2025
 11:32:32 -0800 (PST)
MIME-Version: 1.0
References: <CAN+1Hbqgnc7kaLfXqBV5XbNnSyY2-7ygKFREa4enmLqzStrBjg@HIDDEN>
 <m1seofdnkq.fsf@HIDDEN>
In-Reply-To: <m1seofdnkq.fsf@HIDDEN>
From: Ship Mints <shipmints@HIDDEN>
Date: Sat, 15 Feb 2025 14:32:21 -0500
X-Gm-Features: AWEUYZkz8qHdZoR22o39GBPwYo0-IWHiqEfTpOcsOx_aEBEwfWpEEEpZA_-D4wU
Message-ID: <CAN+1HbpGR_=HSszd7xAY7M6zXiZ04aCjAo_VtAVfzZAnL5Wkjg@HIDDEN>
Subject: Re: bug#76307: [PATCH] Add 'project-forget-projects-under-dirs',
 limit dir selection to relevant dirs
To: Eshel Yaron <me@HIDDEN>
Content-Type: multipart/alternative; boundary="0000000000003dd1f5062e335a5c"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 76307
Cc: 76307 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--0000000000003dd1f5062e335a5c
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Sat, Feb 15, 2025 at 2:18=E2=80=AFPM Eshel Yaron <me@HIDDEN> wro=
te:

> Hi there,
>
> Ship Mints <shipmints@HIDDEN> writes:
>
> > *** Improved directory selection in 'project-forget-projects-under'.
> >
> > This command now prompts using a directory list limited to those in the
> > remembered project list.  Previously, it would prompt using general
> > directories from the file system.
> >
> > I hope this isn't controversial...it made limited sense to me that the
> prompt candidates had no relationship to
> > remembered projects.
>
> I fully agree, the project-forget-projects-under prompt could be more
> helpful.
>
> > +(defun project--list-common-dir-prefixes ()
> > +  "Return a list of common directory prefixes from `project--list'.
> > +The returned list is lexically sorted."
> > +  (project--ensure-read-project-list)
> > +  (let ((non-essential t) ; inhibit remote-file actions
> > +        (file-name-handler-alist nil) ; ditto
> > +        (dirs (seq-uniq
> > +               (mapcar (lambda (x)
> > +                         (expand-file-name (file-name-as-directory (ca=
r
> x))))
> > +                       project--list)))
> > +        (prefixes))
> > +    ;; Surely, there's a better algorithm than n^2.
> > +    (dolist (dir dirs)
> > +      (dolist (dir2 dirs)
> > +        ;; dir equal dir2 might be a singlet we want, so don't prune.
> > +        (when-let* ((common-prefix
> > +                     (fill-common-string-prefix dir dir2))
> > +                    ((string-suffix-p "/" common-prefix)) ; ignore
> naked remote ":" prefixes
> > +                    (common-prefix (abbreviate-file-name common-prefix=
))
> > +                    ((not (member common-prefix prefixes))))
> > +          (push common-prefix prefixes))))
> > +    (sort prefixes #'string<)))
> > +
> >  (defun project-forget-zombie-projects ()
> >    "Forget all known projects that don't exist any more."
> >    (interactive)
> > @@ -2099,13 +2125,25 @@ project-forget-zombie-projects
> >
> >  (defun project-forget-projects-under (dir &optional recursive)
> >    "Forget all known projects below a directory DIR.
> > -Interactively, prompt for DIR.
> > +Interactively, prompt for DIR, and default to the current directory.
> >  Optional argument RECURSIVE, if non-nil (interactively, the prefix
> >  argument), means recurse into subdirectories under DIR
> >  to remove those projects from the index.
> >  Display a message at the end summarizing what was forgotten.
> >  Return the number of forgotten projects."
> > -  (interactive "DDirectory: \nP")
> > +  (interactive
> > +   (list
> > +    (let* ((candidates
> > +            (append (list (abbreviate-file-name
> > +                           (file-name-as-directory
> > +                            default-directory)))
> > +                    (project--list-common-dir-prefixes)))
> > +           (comps
> > +            (completing-read "Directory: "
> > +                             (project--file-completion-table candidate=
s
> 'no-sort)
> > +                             nil t))
> > +           comps))
> > +    (not (null current-prefix-arg))))
> >    (let ((count 0))
> >      (if recursive
> >          (dolist (proj (project-known-project-roots))
>
> ISTM that we can stick to read-directory-name, but add a completion
> predicate that only keeps directories that lead to project roots.
>
> Here's how that could look:
>
> diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el
> index 35bf66c9ffb..b20e3d5981d 100644
> --- a/lisp/progmodes/project.el
> +++ b/lisp/progmodes/project.el
> @@ -2097,6 +2097,18 @@ project-forget-zombie-projects
>      (unless (file-exists-p proj)
>        (project-forget-project proj))))
>
> +(defun project-read-ancestor-directory (prompt)
> +  "Prompt with PROMPT for an ancestor directory of one or more project
> roots."
> +  (project--ensure-read-project-list)
> +  (read-directory-name
> +   prompt nil nil nil nil
> +   (let ((ps (mapcar (lambda (p) (expand-file-name (car p)))
> project--list)))
> +     (lambda (dir)
> +       (catch 'ball
> +         (dolist (p ps)
> +           (when (string-prefix-p (expand-file-name dir) p)
> +             (throw 'ball t))))))))
> +
>  (defun project-forget-projects-under (dir &optional recursive)
>    "Forget all known projects below a directory DIR.
>  Interactively, prompt for DIR.
> @@ -2105,7 +2117,9 @@ project-forget-projects-under
>  to remove those projects from the index.
>  Display a message at the end summarizing what was forgotten.
>  Return the number of forgotten projects."
> -  (interactive "DDirectory: \nP")
> +  (interactive
> +   (list (project-read-ancestor-directory "Forget projects under
> directory: ")
> +         current-prefix-arg))
>    (let ((count 0))
>      (if recursive
>          (dolist (proj (project-known-project-roots))
>

Thank you for your thoughtful feedback.

A couple of things stand out. First, calling completing-read directly means
we can reuse the project-file completion category (and if you use something
like marginalia, you get nice metadata in your completion list), and which
also now can inhibit sorting the completion candidate list, which I find
can be annoying for this kind of use case.

Second, since this is forget "under" directories, prompting with the common
prefixes that allow one to forget under the whole shebang makes more sense
to me. Perhaps your ancestor list generator can be more efficient than the
common-prefix code that I quickly wrote, and it would be helpful for it to
show all common prefixes, don't you agree?

-Stephane

--0000000000003dd1f5062e335a5c
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><div class=3D"gmail_default" style=3D"fon=
t-family:monospace"><span style=3D"font-family:Arial,Helvetica,sans-serif">=
On Sat, Feb 15, 2025 at 2:18=E2=80=AFPM Eshel Yaron &lt;<a href=3D"mailto:m=
e@HIDDEN">me@HIDDEN</a>&gt; wrote:</span></div></div><div c=
lass=3D"gmail_quote gmail_quote_container"><blockquote class=3D"gmail_quote=
" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);=
padding-left:1ex">Hi there,<br>
<br>
Ship Mints &lt;<a href=3D"mailto:shipmints@HIDDEN" target=3D"_blank">shi=
pmints@HIDDEN</a>&gt; writes:<br>
<br>
&gt; *** Improved directory selection in &#39;project-forget-projects-under=
&#39;.<br>
&gt;<br>
&gt; This command now prompts using a directory list limited to those in th=
e<br>
&gt; remembered project list.=C2=A0 Previously, it would prompt using gener=
al<br>
&gt; directories from the file system.<br>
&gt;<br>
&gt; I hope this isn&#39;t controversial...it made limited sense to me that=
 the prompt candidates had no relationship to<br>
&gt; remembered projects.<br>
<br>
I fully agree, the project-forget-projects-under prompt could be more helpf=
ul.<br>
<br>
&gt; +(defun project--list-common-dir-prefixes ()<br>
&gt; +=C2=A0 &quot;Return a list of common directory prefixes from `project=
--list&#39;.<br>
&gt; +The returned list is lexically sorted.&quot;<br>
&gt; +=C2=A0 (project--ensure-read-project-list)<br>
&gt; +=C2=A0 (let ((non-essential t) ; inhibit remote-file actions<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 (file-name-handler-alist nil) ; ditto<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 (dirs (seq-uniq<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(mapcar (lambd=
a (x)<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0(expand-file-name (file-name-as-directory (car x))))<b=
r>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0project--list)))<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 (prefixes))<br>
&gt; +=C2=A0 =C2=A0 ;; Surely, there&#39;s a better algorithm than n^2.<br>
&gt; +=C2=A0 =C2=A0 (dolist (dir dirs)<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 (dolist (dir2 dirs)<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 ;; dir equal dir2 might be a singlet we w=
ant, so don&#39;t prune.<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 (when-let* ((common-prefix<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0(fill-common-string-prefix dir dir2))<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 ((string-suffix-p &quot;/&quot; common-prefix)) ; ignore naked remote &quo=
t;:&quot; prefixes<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 (common-prefix (abbreviate-file-name common-prefix))<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 ((not (member common-prefix prefixes))))<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (push common-prefix prefixes))))<b=
r>
&gt; +=C2=A0 =C2=A0 (sort prefixes #&#39;string&lt;)))<br>
&gt; +<br>
&gt;=C2=A0 (defun project-forget-zombie-projects ()<br>
&gt;=C2=A0 =C2=A0 &quot;Forget all known projects that don&#39;t exist any =
more.&quot;<br>
&gt;=C2=A0 =C2=A0 (interactive)<br>
&gt; @@ -2099,13 +2125,25 @@ project-forget-zombie-projects<br>
&gt;=C2=A0 <br>
&gt;=C2=A0 (defun project-forget-projects-under (dir &amp;optional recursiv=
e)<br>
&gt;=C2=A0 =C2=A0 &quot;Forget all known projects below a directory DIR.<br=
>
&gt; -Interactively, prompt for DIR.<br>
&gt; +Interactively, prompt for DIR, and default to the current directory.<=
br>
&gt;=C2=A0 Optional argument RECURSIVE, if non-nil (interactively, the pref=
ix<br>
&gt;=C2=A0 argument), means recurse into subdirectories under DIR<br>
&gt;=C2=A0 to remove those projects from the index.<br>
&gt;=C2=A0 Display a message at the end summarizing what was forgotten.<br>
&gt;=C2=A0 Return the number of forgotten projects.&quot;<br>
&gt; -=C2=A0 (interactive &quot;DDirectory: \nP&quot;)<br>
&gt; +=C2=A0 (interactive<br>
&gt; +=C2=A0 =C2=A0(list<br>
&gt; +=C2=A0 =C2=A0 (let* ((candidates<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (append (list (abbreviate-f=
ile-name<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0(file-name-as-directory<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 default-directory)))<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 (project--list-common-dir-prefixes)))<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(comps<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (completing-read &quot;Dire=
ctory: &quot;<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(project--file-completion-table candidat=
es &#39;no-sort)<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0nil t))<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0comps))<br>
&gt; +=C2=A0 =C2=A0 (not (null current-prefix-arg))))<br>
&gt;=C2=A0 =C2=A0 (let ((count 0))<br>
&gt;=C2=A0 =C2=A0 =C2=A0 (if recursive<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (dolist (proj (project-known-project=
-roots))<br>
<br>
ISTM that we can stick to read-directory-name, but add a completion<br>
predicate that only keeps directories that lead to project roots.<br>
<br>
Here&#39;s how that could look:<br>
<br>
diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el<br>
index 35bf66c9ffb..b20e3d5981d 100644<br>
--- a/lisp/progmodes/project.el<br>
+++ b/lisp/progmodes/project.el<br>
@@ -2097,6 +2097,18 @@ project-forget-zombie-projects<br>
=C2=A0 =C2=A0 =C2=A0(unless (file-exists-p proj)<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0(project-forget-project proj))))<br>
<br>
+(defun project-read-ancestor-directory (prompt)<br>
+=C2=A0 &quot;Prompt with PROMPT for an ancestor directory of one or more p=
roject roots.&quot;<br>
+=C2=A0 (project--ensure-read-project-list)<br>
+=C2=A0 (read-directory-name<br>
+=C2=A0 =C2=A0prompt nil nil nil nil<br>
+=C2=A0 =C2=A0(let ((ps (mapcar (lambda (p) (expand-file-name (car p))) pro=
ject--list)))<br>
+=C2=A0 =C2=A0 =C2=A0(lambda (dir)<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0(catch &#39;ball<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(dolist (p ps)<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(when (string-prefix-p (expand-fi=
le-name dir) p)<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(throw &#39;ball t))))))))=
<br>
+<br>
=C2=A0(defun project-forget-projects-under (dir &amp;optional recursive)<br=
>
=C2=A0 =C2=A0&quot;Forget all known projects below a directory DIR.<br>
=C2=A0Interactively, prompt for DIR.<br>
@@ -2105,7 +2117,9 @@ project-forget-projects-under<br>
=C2=A0to remove those projects from the index.<br>
=C2=A0Display a message at the end summarizing what was forgotten.<br>
=C2=A0Return the number of forgotten projects.&quot;<br>
-=C2=A0 (interactive &quot;DDirectory: \nP&quot;)<br>
+=C2=A0 (interactive<br>
+=C2=A0 =C2=A0(list (project-read-ancestor-directory &quot;Forget projects =
under directory: &quot;)<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0current-prefix-arg))<br>
=C2=A0 =C2=A0(let ((count 0))<br>
=C2=A0 =C2=A0 =C2=A0(if recursive<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(dolist (proj (project-known-project-root=
s))<br></blockquote><div><br></div><div class=3D"gmail_default" style=3D"fo=
nt-family:monospace">Thank you for your thoughtful feedback.</div><div clas=
s=3D"gmail_default" style=3D"font-family:monospace"><br></div><div class=3D=
"gmail_default" style=3D"font-family:monospace">A couple of things stand ou=
t. First, calling completing-read directly means we can reuse the project-f=
ile completion category (and if you use something like marginalia, you get =
nice metadata in your completion list), and which also now can inhibit sort=
ing the completion candidate list,=C2=A0which I find can be annoying for=C2=
=A0this kind of use case.</div><div class=3D"gmail_default" style=3D"font-f=
amily:monospace"><br></div><div class=3D"gmail_default" style=3D"font-famil=
y:monospace">Second, since this is forget &quot;under&quot; directories, pr=
ompting with the common prefixes that allow one to forget under the whole s=
hebang makes more sense to me. Perhaps your ancestor list generator can be =
more efficient than the common-prefix code that I quickly wrote, and it wou=
ld be helpful for it to show all common prefixes, don&#39;t you agree?</div=
><div class=3D"gmail_default" style=3D"font-family:monospace"><br></div><di=
v class=3D"gmail_default" style=3D"font-family:monospace">-Stephane</div></=
div></div>

--0000000000003dd1f5062e335a5c--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#76307; Package emacs. Full text available.

Message received at 76307 <at> debbugs.gnu.org:


Received: (at 76307) by debbugs.gnu.org; 15 Feb 2025 19:18:03 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Feb 15 14:18:03 2025
Received: from localhost ([127.0.0.1]:57933 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tjNfv-0004kB-9I
	for submit <at> debbugs.gnu.org; Sat, 15 Feb 2025 14:18:03 -0500
Received: from mail.eshelyaron.com ([107.175.124.16]:39418 helo=eshelyaron.com)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <me@HIDDEN>) id 1tjNfs-0004jk-RE
 for 76307 <at> debbugs.gnu.org; Sat, 15 Feb 2025 14:18:01 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eshelyaron.com;
 s=mail; t=1739647080;
 bh=YXvmPS2+twWp5pLsy01TYdwqLxKBOtZJ1qeFhIesLhk=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date:From;
 b=srAm5Kh/R1y5mEk3JLT5HQ8mfn5JTKfdcA9GMWH6fiR1nqbtPasoGmakVzKV2eJWv
 /3iRGMY/5OYHnC3QGX3VB1Qr+qYVhyHTS8bxx0jhepdPYMQ5tgwtLx0ATIJI/eBV9R
 kChhS3rbMXQNfBHkAJjcXHmLtfo8EXBNo84eMK5aBIoJMDensTHQ0MKqTkA0V7jPLm
 CSW8f1zEvvKhU98ejuIG3uexLnGubvTBfITlkeQZJCXNQax7AZCNzB+4s5afv4qWH4
 +7CH4nJwup2RrnvLm0E9JgBrxP7QYPMXmjgChbKFislFa1Pt1rT1/SETaEpb/kgucA
 RBwv1syuE3Zxw==
From: Eshel Yaron <me@HIDDEN>
To: Ship Mints <shipmints@HIDDEN>
Subject: Re: bug#76307: [PATCH] Add 'project-forget-projects-under-dirs',
 limit dir selection to relevant dirs
In-Reply-To: <CAN+1Hbqgnc7kaLfXqBV5XbNnSyY2-7ygKFREa4enmLqzStrBjg@HIDDEN>
References: <CAN+1Hbqgnc7kaLfXqBV5XbNnSyY2-7ygKFREa4enmLqzStrBjg@HIDDEN>
Date: Sat, 15 Feb 2025 20:17:57 +0100
Message-ID: <m1seofdnkq.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 76307
Cc: 76307 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Hi there,

Ship Mints <shipmints@HIDDEN> writes:

> *** Improved directory selection in 'project-forget-projects-under'.
>
> This command now prompts using a directory list limited to those in the
> remembered project list.  Previously, it would prompt using general
> directories from the file system.
>
> I hope this isn't controversial...it made limited sense to me that the prompt candidates had no relationship to
> remembered projects.

I fully agree, the project-forget-projects-under prompt could be more helpful.


> +(defun project--list-common-dir-prefixes ()
> +  "Return a list of common directory prefixes from `project--list'.
> +The returned list is lexically sorted."
> +  (project--ensure-read-project-list)
> +  (let ((non-essential t) ; inhibit remote-file actions
> +        (file-name-handler-alist nil) ; ditto
> +        (dirs (seq-uniq
> +               (mapcar (lambda (x)
> +                         (expand-file-name (file-name-as-directory (car x))))
> +                       project--list)))
> +        (prefixes))
> +    ;; Surely, there's a better algorithm than n^2.
> +    (dolist (dir dirs)
> +      (dolist (dir2 dirs)
> +        ;; dir equal dir2 might be a singlet we want, so don't prune.
> +        (when-let* ((common-prefix
> +                     (fill-common-string-prefix dir dir2))
> +                    ((string-suffix-p "/" common-prefix)) ; ignore naked remote ":" prefixes
> +                    (common-prefix (abbreviate-file-name common-prefix))
> +                    ((not (member common-prefix prefixes))))
> +          (push common-prefix prefixes))))
> +    (sort prefixes #'string<)))
> +
>  (defun project-forget-zombie-projects ()
>    "Forget all known projects that don't exist any more."
>    (interactive)
> @@ -2099,13 +2125,25 @@ project-forget-zombie-projects
>  
>  (defun project-forget-projects-under (dir &optional recursive)
>    "Forget all known projects below a directory DIR.
> -Interactively, prompt for DIR.
> +Interactively, prompt for DIR, and default to the current directory.
>  Optional argument RECURSIVE, if non-nil (interactively, the prefix
>  argument), means recurse into subdirectories under DIR
>  to remove those projects from the index.
>  Display a message at the end summarizing what was forgotten.
>  Return the number of forgotten projects."
> -  (interactive "DDirectory: \nP")
> +  (interactive
> +   (list
> +    (let* ((candidates
> +            (append (list (abbreviate-file-name
> +                           (file-name-as-directory
> +                            default-directory)))
> +                    (project--list-common-dir-prefixes)))
> +           (comps
> +            (completing-read "Directory: "
> +                             (project--file-completion-table candidates 'no-sort)
> +                             nil t))
> +           comps))
> +    (not (null current-prefix-arg))))
>    (let ((count 0))
>      (if recursive
>          (dolist (proj (project-known-project-roots))

ISTM that we can stick to read-directory-name, but add a completion
predicate that only keeps directories that lead to project roots.

Here's how that could look:

diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el
index 35bf66c9ffb..b20e3d5981d 100644
--- a/lisp/progmodes/project.el
+++ b/lisp/progmodes/project.el
@@ -2097,6 +2097,18 @@ project-forget-zombie-projects
     (unless (file-exists-p proj)
       (project-forget-project proj))))
 
+(defun project-read-ancestor-directory (prompt)
+  "Prompt with PROMPT for an ancestor directory of one or more project roots."
+  (project--ensure-read-project-list)
+  (read-directory-name
+   prompt nil nil nil nil
+   (let ((ps (mapcar (lambda (p) (expand-file-name (car p))) project--list)))
+     (lambda (dir)
+       (catch 'ball
+         (dolist (p ps)
+           (when (string-prefix-p (expand-file-name dir) p)
+             (throw 'ball t))))))))
+
 (defun project-forget-projects-under (dir &optional recursive)
   "Forget all known projects below a directory DIR.
 Interactively, prompt for DIR.
@@ -2105,7 +2117,9 @@ project-forget-projects-under
 to remove those projects from the index.
 Display a message at the end summarizing what was forgotten.
 Return the number of forgotten projects."
-  (interactive "DDirectory: \nP")
+  (interactive
+   (list (project-read-ancestor-directory "Forget projects under directory: ")
+         current-prefix-arg))
   (let ((count 0))
     (if recursive
         (dolist (proj (project-known-project-roots))



Best,

Eshel




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#76307; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 15 Feb 2025 17:50:45 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Feb 15 12:50:45 2025
Received: from localhost ([127.0.0.1]:57795 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tjMJQ-0000dp-Sh
	for submit <at> debbugs.gnu.org; Sat, 15 Feb 2025 12:50:45 -0500
Received: from lists.gnu.org ([2001:470:142::17]:50840)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <shipmints@HIDDEN>)
 id 1tjMJO-0000dZ-Du
 for submit <at> debbugs.gnu.org; Sat, 15 Feb 2025 12:50:43 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <shipmints@HIDDEN>)
 id 1tjMJF-0006xW-ML
 for bug-gnu-emacs@HIDDEN; Sat, 15 Feb 2025 12:50:33 -0500
Received: from mail-ua1-x935.google.com ([2607:f8b0:4864:20::935])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <shipmints@HIDDEN>)
 id 1tjMJC-0007CR-Se
 for bug-gnu-emacs@HIDDEN; Sat, 15 Feb 2025 12:50:33 -0500
Received: by mail-ua1-x935.google.com with SMTP id
 a1e0cc1a2514c-86714f41f5bso939537241.3
 for <bug-gnu-emacs@HIDDEN>; Sat, 15 Feb 2025 09:50:30 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1739641829; x=1740246629; darn=gnu.org;
 h=to:subject:message-id:date:from:mime-version:from:to:cc:subject
 :date:message-id:reply-to;
 bh=D5PGwtbmjVDcr6u9CI8XCTwU7wakZw8OO12YOKPe028=;
 b=Wx39o5zcvAEtqXtxLPrjqj7DXK6pz4WDVdeAPDBN1dy8W03+rC5APUDu0aSgXT7SDq
 iFqZauytCZTXHsasGJMA6/t1YTGoi9zUdF9AEkpxDcWAU0n4xAMIF3AAq2ZtCLaYjLqG
 K+sp+hal85nTF2VpGJvdqd2UbI6aSKmPOSCMVrOB3ccjlmhkNgypt+pJy+tyDTFxx8yS
 Hubecv2Eqn9lPGNe+WIJyNl2dfo7vQeGx1aGQMpEvhBos96RP0fb3j04gaNUTxoVdfJO
 gQgRtB3h+phazIsIVwtaF3LG1VDr5ImcFCEWYPWHv2timH9+6rnNYDlvnqhQwoLy/cGz
 UEzQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1739641829; x=1740246629;
 h=to:subject:message-id:date:from:mime-version:x-gm-message-state
 :from:to:cc:subject:date:message-id:reply-to;
 bh=D5PGwtbmjVDcr6u9CI8XCTwU7wakZw8OO12YOKPe028=;
 b=Yl1vkOVtNAPh/0GL2zfwm/H51Z3OMX5MrQMpvK8DrSJXBbXsUK0QjgmOdbqoue4nol
 qDbXhMU6k7omo9/UwDXiKeyGDW5HpQuL/yRGP8DPwbdHnImpqRXF4CgVlV3/ICiqobTH
 m5uCTj2vYsjgsdrQHiHLjxG2DOnkIl7gJT6UwofIcOtXYKM7qi02HS0mPNyB5q0TJZvx
 7N6hXtwJ+g51ZFx3Tzgd16k+yF6ri1ogBlHru0n44mDQKDGTpLpMHfllBiW61ZJRJI9d
 uoi9y2xCO4WJAsjfxX2L46w7NlFDRBOBHzowFIZ98E/MetX2R9SlS422ng6mWWCLiNhH
 wIDQ==
X-Gm-Message-State: AOJu0YwD71nHBq1lUs/J+f97KaSjBQVAZIg9N5EFx34G8gGlkzrQEKdR
 PcMla5WB/KNZwsgRzYJ6wC19vUxxIRFFBMz2vIZadQTdX0OnQRypaOwzv9//cB2Xd0qB9Xfl/V1
 1yXqM15vJOouF3Qo0rbzgLCnj3vWaDUXC
X-Gm-Gg: ASbGncsFNRr0ffyAGxaWPpcRJoHiw0xyprr8tjphIS88Gxlhd/vlBbOLkp2IwfR21Go
 7igkDU0A2kJP/dFh+TzbDklnppxyhNXBL10Lnk4AFMXSRNTlgvOJb49IK0KNJ5Hb3bCrHV1pj
X-Google-Smtp-Source: AGHT+IE6J/s4a2fWvLpL5kNg9sBW1qRmN5bNQlgfcQfGJJ0Lkus9n37SmHOR0PU65zC08zfVfkOdMRYFqVQmynZN2jc=
X-Received: by 2002:a05:6102:d90:b0:4b2:5c0a:92c0 with SMTP id
 ada2fe7eead31-4bd3fc8b8d0mr2431585137.13.1739641827914; Sat, 15 Feb 2025
 09:50:27 -0800 (PST)
MIME-Version: 1.0
From: Ship Mints <shipmints@HIDDEN>
Date: Sat, 15 Feb 2025 12:50:16 -0500
X-Gm-Features: AWEUYZnjaGWuBEK0tMowyhLieDrfuPpudw-wBbqTLmMFmJJs_IixIYypgzdKD3g
Message-ID: <CAN+1Hbqgnc7kaLfXqBV5XbNnSyY2-7ygKFREa4enmLqzStrBjg@HIDDEN>
Subject: [PATCH] Add 'project-forget-projects-under-dirs', limit dir selection
 to relevant dirs
To: bug-gnu-emacs@HIDDEN
Content-Type: multipart/mixed; boundary="000000000000309aa2062e31ed70"
Received-SPF: pass client-ip=2607:f8b0:4864:20::935;
 envelope-from=shipmints@HIDDEN; helo=mail-ua1-x935.google.com
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001,
 HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

--000000000000309aa2062e31ed70
Content-Type: multipart/alternative; boundary="000000000000309a9f062e31ed6e"

--000000000000309a9f062e31ed6e
Content-Type: text/plain; charset="UTF-8"

*** Improved directory selection in 'project-forget-projects-under'.

This command now prompts using a directory list limited to those in the
remembered project list.  Previously, it would prompt using general
directories from the file system.

I hope this isn't controversial...it made limited sense to me that the
prompt candidates had no relationship to remembered projects.

*** New command 'project-forget-projects-under-dirs'.

This command prompts for multiple directories under which to forget
remembered projects.  The candidate directory list is limited to those
in the remembered project list.

-Stephane

--000000000000309a9f062e31ed6e
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div class=3D"gmail_default" style=3D"font-family:monospac=
e">*** Improved directory selection in &#39;project-forget-projects-under&#=
39;.</div><div class=3D"gmail_default" style=3D"font-family:monospace"><br>=
This command now prompts using a directory list limited to those in the<br>=
remembered project list.=C2=A0 Previously, it would prompt using general<br=
>directories from the file system.</div><div class=3D"gmail_default" style=
=3D"font-family:monospace"><br></div><div class=3D"gmail_default" style=3D"=
font-family:monospace">I hope this isn&#39;t controversial...it made limite=
d sense to me that the prompt candidates had no relationship to remembered =
projects.<br><br>*** New command &#39;project-forget-projects-under-dirs&#3=
9;.</div><div class=3D"gmail_default" style=3D"font-family:monospace"><br>T=
his command prompts for multiple directories under which to forget<br>remem=
bered projects.=C2=A0 The candidate directory list is limited to those<br>i=
n the remembered project list.</div><div class=3D"gmail_default" style=3D"f=
ont-family:monospace"><br></div><div class=3D"gmail_default" style=3D"font-=
family:monospace">-Stephane</div></div>

--000000000000309a9f062e31ed6e--

--000000000000309aa2062e31ed70
Content-Type: application/octet-stream; 
	name="0001-Add-project-forget-projects-under-dirs-limit-dir-sel.patch"
Content-Disposition: attachment; 
	filename="0001-Add-project-forget-projects-under-dirs-limit-dir-sel.patch"
Content-Transfer-Encoding: base64
Content-ID: <f_m76hss1z0>
X-Attachment-Id: f_m76hss1z0

RnJvbSBhOGIwNzFjMzg0ZDYwYzFiZTFkMTgzZWE3OGNjZGZiYmY1ZWZjZWZiIE1vbiBTZXAgMTcg
MDA6MDA6MDAgMjAwMQpGcm9tOiBzaGlwbWludHMgPHNoaXBtaW50c0BnbWFpbC5jb20+CkRhdGU6
IFNhdCwgMTUgRmViIDIwMjUgMTI6MTc6MzEgLTA1MDAKU3ViamVjdDogW1BBVENIXSBBZGQgJ3By
b2plY3QtZm9yZ2V0LXByb2plY3RzLXVuZGVyLWRpcnMnLCBsaW1pdCBkaXIgc2VsZWN0aW9uCiB0
byBwcm9qZWN0LS1saXN0CgoqIGxpc3AvcHJvZ21vZGVzL3Byb2plY3QuZWwKKHByb2plY3QtLWZp
bGUtY29tcGxldGlvbi10YWJsZSk6IEFkZCAmb3B0aW9uYWwgbm8tc29ydC4KKHByb2plY3QtLWxp
c3QtY29tbW9uLWRpci1wcmVmaXhlcyk6IE5ldyBwcml2YXRlIGZ1bmN0aW9uLgoocHJvamVjdC1m
b3JnZXQtcHJvamVjdHMtdW5kZXIpOiBMaW1pdCBkaXJzIHRvIHByb2plY3QtLWxpc3QuCihwcm9q
ZWN0LWZvcmdldC1wcm9qZWN0cy11bmRlci1kaXJzKTogTmV3IGNvbW1hbmQuCi0tLQogZXRjL05F
V1MgICAgICAgICAgICAgICAgICB8IDE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VtZW50KSwgbWVhbnMgcmVjdXJz
ZSBpbnRvIHN1YmRpcmVjdG9yaWVzIHVuZGVyIERJUgogdG8gcmVtb3ZlIHRob3NlIHByb2plY3Rz
IGZyb20gdGhlIGluZGV4LgogRGlzcGxheSBhIG1lc3NhZ2UgYXQgdGhlIGVuZCBzdW1tYXJpemlu
ZyB3aGF0IHdhcyBmb3Jnb3R0ZW4uCiBSZXR1cm4gdGhlIG51bWJlciBvZiBmb3Jnb3R0ZW4gcHJv
amVjdHMuIgotICAoaW50ZXJhY3RpdmUgIkREaXJlY3Rvcnk6IFxuUCIpCisgIChpbnRlcmFjdGl2
ZQorICAgKGxpc3QKKyAgICAobGV0KiAoKGNhbmRpZGF0ZXMKKyAgICAgICAgICAgIChhcHBlbmQg
KGxpc3QgKGFiYnJldmlhdGUtZmlsZS1uYW1lCisgICAgICAgICAgICAgICAgICAgICAgICAgICAo
ZmlsZS1uYW1lLWFzLWRpcmVjdG9yeQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlZmF1
bHQtZGlyZWN0b3J5KSkpCisgICAgICAgICAgICAgICAgICAgIChwcm9qZWN0LS1saXN0LWNvbW1v
bi1kaXItcHJlZml4ZXMpKSkKKyAgICAgICAgICAgKGNvbXBzCisgICAgICAgICAgICAoY29tcGxl
dGluZy1yZWFkICJEaXJlY3Rvcnk6ICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHBy
b2plY3QtLWZpbGUtY29tcGxldGlvbi10YWJsZSBjYW5kaWRhdGVzICduby1zb3J0KQorICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICBuaWwgdCkpCisgICAgICAgICAgIGNvbXBzKSkKKyAgICAo
bm90IChudWxsIGN1cnJlbnQtcHJlZml4LWFyZykpKSkKICAgKGxldCAoKGNvdW50IDApKQogICAg
IChpZiByZWN1cnNpdmUKICAgICAgICAgKGRvbGlzdCAocHJvaiAocHJvamVjdC1rbm93bi1wcm9q
ZWN0LXJvb3RzKSkKQEAgLTIxMjQsNiArMjE2MiwzMiBAQCBwcm9qZWN0LWZvcmdldC1wcm9qZWN0
cy11bmRlcgogICAgICAgICAgICAgICAgICAgICAgICAgIGNvdW50KSBjb3VudCkpCiAgICAgY291
bnQpKQogCisoZGVmdW4gcHJvamVjdC1mb3JnZXQtcHJvamVjdHMtdW5kZXItZGlycyAoZGlycyAm
b3B0aW9uYWwgcmVjdXJzaXZlKQorICAiRm9yZ2V0IGFsbCBrbm93biBwcm9qZWN0cyBiZWxvdyBl
YWNoIGRpcmVjdG9yeSBpbiBESVJTLgorSW50ZXJhY3RpdmVseSwgcHJvbXB0IGZvciBESVJTLgor
T3B0aW9uYWwgYXJndW1lbnQgUkVDVVJTSVZFLCBpZiBub24tbmlsIChpbnRlcmFjdGl2ZWx5LCB0
aGUgcHJlZml4Cithcmd1bWVudCksIG1lYW5zIHJlY3Vyc2UgaW50byBzdWJkaXJlY3RvcmllcyB1
bmRlciBESVJTCit0byByZW1vdmUgdGhvc2UgcHJvamVjdHMgZnJvbSB0aGUgaW5kZXguCitEaXNw
bGF5IG1lc3NhZ2VzIGF0IHRoZSBlbmQgb2YgcHJvY2Vzc2luZyBlYWNoIGRpcmVjdG9yeSBzdW1t
YXJpemluZword2hhdCB3YXMgZm9yZ290dGVuLiIKKyAgKGludGVyYWN0aXZlCisgICAobGlzdAor
ICAgIChvciAobGV0KiAoKGNvbXBzCisgICAgICAgICAgICAgICAgKGxldCAoKGNhbmRpZGF0ZXMg
KHByb2plY3QtLWxpc3QtY29tbW9uLWRpci1wcmVmaXhlcykpKQorICAgICAgICAgICAgICAgICAg
KGNvbXBsZXRpb24tYWxsLWNvbXBsZXRpb25zCisgICAgICAgICAgICAgICAgICAgKGNvbXBsZXRp
bmctcmVhZCAiRGlyZWN0b3JpZXM6ICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgIChwcm9qZWN0LS1maWxlLWNvbXBsZXRpb24tdGFibGUgY2FuZGlkYXRlcykKKyAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5pbCBuaWwpCisgICAgICAgICAgICAgICAgICAg
Y2FuZGlkYXRlcyBuaWwgbmlsKSkpCisgICAgICAgICAgICAgICAoXyAod2hlbiAoY2RyIChsYXN0
IGNvbXBzKSkgKHNldGNkciAobGFzdCBjb21wcykgbmlsKSkpCisgICAgICAgICAgICAgICAoY29t
cHMgKHNlcS11bmlxIChtYXBjYXIgKGxhbWJkYSAoeCkgKHN1YnN0cmluZy1uby1wcm9wZXJ0aWVz
IHgpKSBjb21wcykpKSkKKyAgICAgICAgICBjb21wcykKKyAgICAgICAgKHVzZXItZXJyb3IgIk5v
IGRpcmVjdG9yaWVzIHNlbGVjdGVkIikpCisgICAgKG5vdCAobnVsbCBjdXJyZW50LXByZWZpeC1h
cmcpKSkpCisgIChtYXBjYXIgKGxhbWJkYSAoZGlyKQorICAgICAgICAgICAgKHByb2plY3QtZm9y
Z2V0LXByb2plY3RzLXVuZGVyIGRpciByZWN1cnNpdmUpKQorICAgICAgICAgIGRpcnMpKQorCiAM
CiA7OzsgUHJvamVjdCBzd2l0Y2hpbmcKIAotLSAKMi40Ny4xCgo=
--000000000000309aa2062e31ed70--




Acknowledgement sent to Ship Mints <shipmints@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#76307; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Sun, 16 Feb 2025 12:30:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.