GNU bug report logs - #77566
[PATCH] Add option for automatically delete non-existent projects.

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: Elijah Gabe Pérez <eg642616@HIDDEN>; Keywords: patch; dated Sat, 5 Apr 2025 23:52:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

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


Received: (at 77566) by debbugs.gnu.org; 6 Apr 2025 11:26:39 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Apr 06 07:26:39 2025
Received: from localhost ([127.0.0.1]:46229 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1u1O99-0003Wg-0R
	for submit <at> debbugs.gnu.org; Sun, 06 Apr 2025 07:26:39 -0400
Received: from mail-vk1-xa30.google.com ([2607:f8b0:4864:20::a30]:47155)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <shipmints@HIDDEN>)
 id 1u1O96-0003WN-C6
 for 77566 <at> debbugs.gnu.org; Sun, 06 Apr 2025 07:26:36 -0400
Received: by mail-vk1-xa30.google.com with SMTP id
 71dfb90a1353d-52403e39a23so2873360e0c.2
 for <77566 <at> debbugs.gnu.org>; Sun, 06 Apr 2025 04:26:36 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1743938790; x=1744543590; 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=RMSgfeJvjjI1/8EDElhMrGUGtvMk7cv0Sybb2bYwJOw=;
 b=Qg68PJ1++d7JsS24uUAYhpCt9L1/QDgH9czWh3mr2hnWd8QH8+4xq6hjKgi5TBzs7f
 7l0sSW5MMUOHHMZcjk9T0pUoYoWaB+el8+P7FaUltsvx1phlI+y4IoQGNKIo/qpcMQQe
 Giuq7oaAciNEvIUMwMgvmuaWPiyZV3+ZeZ0+C7n0PhmFmGL99mFWW1Jr5/tRtEYGJD+D
 8lxxt46d/6qvhtnJepin4K7WFSrfsW3+1shlMEg+yJbYNcBEdr581UjKp9YC2IJ4ibUO
 sM+ARQ/TmU3qSWXOfvWivMdtaH6leOQqXQKIQ1hf0iMr6zUYgW+ytwoL8XVbWh9mobXG
 9jKw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1743938790; x=1744543590;
 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=RMSgfeJvjjI1/8EDElhMrGUGtvMk7cv0Sybb2bYwJOw=;
 b=DJ/e9ZRt3ziA2phQeGu7dNuyagWZ/bEuybD/QWnVYhDtZ28SdTIQrQTJZlWpGkX1b4
 GQA7IbgfFC+8UkxD3awup3ZwjUrornG5tLR6lb5hVBqyrHpfCNgheVyepEBYo3osiFxz
 O1I0jM8ZcyUjbbXJFkClXe4dSwXO1yBpgmV+nft7asYIcxrtMXRmDKr8KlSUuAX/WEZR
 U1Ii/K3oUhaHzRG+lZjO1BjiK4iAoGuU5A6iVbqwpmx09xDQzAva9lq27NKXpPP1xo0R
 lkSqZGibxDIH9mqUfjQaM24rpwUbiW5sWEZUJCyYAdNtz7t6A3HEsmjNdJ6PG8Rug/jv
 XVlA==
X-Forwarded-Encrypted: i=1;
 AJvYcCU2hJ5hW0PgvuI3rjmaJVWi2IjoBofh5HrKzz30uVKUIIQ4omOLRKAZOrgRLUZ+VmUEQgTiIA==@debbugs.gnu.org
X-Gm-Message-State: AOJu0YxUW7QrA8GGHehokIyw3ZGrmgqmczMPmHGhbXRhVyoqPsCw2Kd1
 U855NhF1DeKK/RPn29aZF08IEryr0WnWvmlb1FMrsj7IojrHH4Jm27H13prVCaOfvaPTWhyHhU0
 1LwEE/xkmZBBJf6Vrq56PMEtpy2U=
X-Gm-Gg: ASbGncuSN3f98TlePCaADpp+u5agF/bj+9ovXJQtVUku3DuFeEHNnyqYMhHTZHU8x7R
 hh7MFyxb4zlBQnNfHWTywSh0+bzm65LKhyXJrTc0I134e4uwk4n4aVDi3cCWIPNqBuhWwX6WInp
 +kfbC9dKmHS7yTx2bB62bt92Rfh+xtnhg+4s+x
X-Google-Smtp-Source: AGHT+IGVutp1QWw56g4/MZRRMo+UiSmPFTm5EtVZxjqUhMuQ9O9nHtPAMvAEy4V6VDnxFKOHQK4Mt8xshFSXXc5LQbM=
X-Received: by 2002:a05:6122:908:b0:51f:3eee:89e7 with SMTP id
 71dfb90a1353d-527730e5f78mr3011964e0c.11.1743938790430; Sun, 06 Apr 2025
 04:26:30 -0700 (PDT)
MIME-Version: 1.0
References: <87jz7y2mn3.fsf@HIDDEN> <87jz7ynndw.fsf@HIDDEN>
 <87frim2jt0.fsf@HIDDEN> <875xji2hnw.fsf@HIDDEN>
In-Reply-To: <875xji2hnw.fsf@HIDDEN>
From: Ship Mints <shipmints@HIDDEN>
Date: Sun, 6 Apr 2025 07:26:18 -0400
X-Gm-Features: ATxdqUFtUWI4t_ystqTY_iLyNxR4jOq2H6HYgj_BI-EbPyw39g1YqvJlJ8fHwIM
Message-ID: <CAN+1HbpepsP5qeWRy4u9jEFCQU6nQWsVbj9O=mH4M761a_Oo2Q@HIDDEN>
Subject: Re: bug#77566: [PATCH] Add option for automatically delete
 non-existent projects.
To: =?UTF-8?Q?Elijah_Gabe_P=C3=A9rez?= <eg642616@HIDDEN>
Content-Type: multipart/alternative; boundary="0000000000001de4a706321a648e"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 77566
Cc: dmitry@HIDDEN, 77566 <at> debbugs.gnu.org,
 Sean Whitton <spwhitton@HIDDEN>
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 (-)

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

On Sat, Apr 5, 2025 at 9:39=E2=80=AFPM Elijah Gabe P=C3=A9rez <eg642616@gma=
il.com> wrote:

> Sending a better patch.
>

I think we need to call zombies something else and also consider that
remote files may need to be ignored by the zombie checker to reduce the
costs of checking project paths, to avoid tramp prompts for an internal
function, and to accommodate that not all tramp connections are available
all the time and those may not be reachable and should not be considered
zombies.

Setting aside the zombie name for now, hHow about calling
'project-auto-forget-zombie-projects' 'project-prune-zombie-projects' and
rather than boolean, accept symbols that could include something like
'list-read 'list-write nil so users can decide when pruning happens.  In
long-lived Emacs sessions just doing it at list read time seems
insufficient.

Could we rename report-message to no-message and change when to unless to
keep it uniform?  The word report suggests things other than merely
allowing messages.

++++
*** New user option 'project-auto-forget-zombie-projects'.
- This user option automatically remove projects from 'project-list-file'
+ This user option automatically removes projects from 'project-list-file'
- that have been deleted.
+ that cannot be accessed. [this language accommodates remote projects]

- "Automatically remove from project list projects that were deleted.
- If non-nil, remove automatically projects that doesn't exist anymore
- from the project list."
+ "Remove inaccessible project list entries.
+ If \\=3D'list-read...etc.
+ If \\=3D'list-write...etc.
+ [whatever other conditions seem reasonable]
+ If nil, no pruning is performed."

-Stephane

--0000000000001de4a706321a648e
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, Apr 5, 2025 at 9:39=E2=80=AFPM Elijah Gabe P=C3=A9rez &lt;<a href=
=3D"mailto:eg642616@HIDDEN">eg642616@HIDDEN</a>&gt; wrote:</span></di=
v></div><div class=3D"gmail_quote gmail_quote_container"><blockquote class=
=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rg=
b(204,204,204);padding-left:1ex">Sending a better patch.<br></blockquote><d=
iv><br></div><div><div class=3D"gmail_default" style=3D"font-family:monospa=
ce">I think we need to call zombies something else and also consider that r=
emote files may need to be ignored by the zombie checker to reduce the cost=
s of checking project paths, to avoid tramp prompts for an internal functio=
n, and to accommodate that not all tramp connections are available all the =
time and those may not be reachable and should not be considered zombies.</=
div></div><div><br></div><div class=3D"gmail_default" style=3D"font-family:=
monospace">Setting aside the zombie name for now, hHow about calling=C2=A0<=
span style=3D"color:rgb(97,97,97);font-size:14px;font-family:Arial,Helvetic=
a,sans-serif">&#39;project-auto-forget-zombie-projects&#39;=C2=A0</span><sp=
an style=3D"color:rgb(97,97,97);font-size:14px;font-family:Arial,Helvetica,=
sans-serif">&#39;project-prune-zombie-projects&#39; and rather than boolean=
, accept symbols that could include something like &#39;list-read &#39;list=
-write nil so users can decide when pruning happens.=C2=A0 In long-lived Em=
acs sessions just doing it at list read time seems insufficient.</span></di=
v><div class=3D"gmail_default" style=3D"font-family:monospace"><span style=
=3D"color:rgb(97,97,97);font-size:14px;font-family:Arial,Helvetica,sans-ser=
if"><br></span></div><div class=3D"gmail_default" style=3D"font-family:mono=
space"><span style=3D"color:rgb(97,97,97);font-size:14px;font-family:Arial,=
Helvetica,sans-serif">Could we rename report-message to no-message and chan=
ge when to unless to keep it uniform?=C2=A0 The word report suggests things=
 other than merely allowing messages.</span></div><div class=3D"gmail_defau=
lt" style=3D"font-family:monospace"><br></div><div class=3D"gmail_default" =
style=3D"font-family:monospace">++++<br>*** New user option &#39;project-au=
to-forget-zombie-projects&#39;.<br>- This user option automatically remove =
projects from &#39;project-list-file&#39;<br>+ This user option automatical=
ly removes projects from &#39;project-list-file&#39;<br><div class=3D"gmail=
_default">- that have been deleted.</div>+ that cannot be accessed. [this l=
anguage accommodates remote projects]<br></div><div class=3D"gmail_default"=
 style=3D"font-family:monospace"><br></div><div class=3D"gmail_default" sty=
le=3D"font-family:monospace">- &quot;Automatically remove from project list=
 projects that were deleted.<br>- If non-nil, remove automatically projects=
 that doesn&#39;t exist anymore<br>- from the project list.&quot;</div><div=
 class=3D"gmail_default" style=3D"font-family:monospace"><div class=3D"gmai=
l_default">+ &quot;Remove inaccessible project list entries.<br>+ If \\=3D&=
#39;list-read...etc.</div><div class=3D"gmail_default">+ If \\=3D&#39;list-=
write...etc.</div><div class=3D"gmail_default">+ [whatever other conditions=
 seem reasonable]<br></div><div class=3D"gmail_default">+ If nil, no prunin=
g is performed.&quot;</div><div class=3D"gmail_default"><br></div><div clas=
s=3D"gmail_default">-Stephane</div></div></div></div>

--0000000000001de4a706321a648e--




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

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


Received: (at 77566) by debbugs.gnu.org; 6 Apr 2025 01:38:46 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Apr 05 21:38:46 2025
Received: from localhost ([127.0.0.1]:45427 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1u1EyD-0000X2-6Y
	for submit <at> debbugs.gnu.org; Sat, 05 Apr 2025 21:38:46 -0400
Received: from mail-oo1-xc44.google.com ([2607:f8b0:4864:20::c44]:46512)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <eg642616@HIDDEN>)
 id 1u1Ey3-0000We-IV
 for 77566 <at> debbugs.gnu.org; Sat, 05 Apr 2025 21:38:41 -0400
Received: by mail-oo1-xc44.google.com with SMTP id
 006d021491bc7-5fcef5dc742so945378eaf.1
 for <77566 <at> debbugs.gnu.org>; Sat, 05 Apr 2025 18:38:35 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1743903509; x=1744508309; darn=debbugs.gnu.org;
 h=mime-version:user-agent:message-id:date:references:in-reply-to
 :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to;
 bh=ZO1mcwbNZVcxzNS2UWDgnFciBgYOCNtYdAptrihriVY=;
 b=XiNF/S1mu/s2Ld/1uRqS0FocfLh63svLAqTMMzlrU7cc7ObclXaMSk6/6sWUBuCGe1
 fsfjXrr15uRUmOcLvIPIFScBAgjTao+cmPq5R0mjKDSOyyydS3PzE2gFkuvgzN+Bna0d
 ZhhRWIrPSnqNzVKwoffUT3mMjDdEXIkpOE/fNrYM+3k58NY1LvUJu9fDAZ5/E+rMn7I0
 wKCZ+plHuvi3XMKkUVQ63SVHab5qdeRmt4vJy/SOLioZle97jyfZ/iSSNBCfOjXDWaSb
 Er8KRxHs33DPmEUTB6Nztn4nB8d1+x6KUO+4nAI6TsoXYDpi9ptU9gfsdegrmMM7KvkZ
 LgyA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1743903509; x=1744508309;
 h=mime-version:user-agent:message-id:date:references:in-reply-to
 :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date
 :message-id:reply-to;
 bh=ZO1mcwbNZVcxzNS2UWDgnFciBgYOCNtYdAptrihriVY=;
 b=uBVBy5sJ5fzVZn6c/8yfAwLnVhd9qbA8LIarsD97tlcQDgkypgK6JeZ3KLCwTKxHmv
 ZTQiuqjwH70BMYCleua7hjTbkck6RNwQLluHb71hBEOkWsWq/298fYSIqGFiUwcuxuEA
 KUAk28Im/YnTQQ1ZlgI8T6f3RXG5huzhBQOFl+PCtZfuP6tQJf/BMROMx7SgwuhP87fV
 5UYAs/dmbrF0llfFoUaZa9P92VINTKYMjJTMJRvgehZb/7Te3NytucIut9ffTzPjQBjc
 awcsLamOlO3dbzJjA6ov+ZNw7aM5DwHKB8GHlKRmbBc7aObd8nc6wY1xGlFbNNrebOE7
 OG1Q==
X-Forwarded-Encrypted: i=1;
 AJvYcCUdQT5YClTsm8HyNaVNhWvKgg8iCX7iM5ksoUPDQs8DRpRnwuvt2Qu3MCuf9a0CDCzFE+3elA==@debbugs.gnu.org
X-Gm-Message-State: AOJu0YxjQIjKoI2oDh+QncTs7irbmpmVUsHwrI6pv6JftITPOxHEP1Aj
 VBvYW9HejGEI4cMt2ebGVhZao+3nlNIkeoo0t/p9yybzd1LFR/8A
X-Gm-Gg: ASbGncsV5K4AjmWXRpdBa8Z/1neRWOeLOe4gn8oTZZxxVNBOY3oIRiaQvicZreRtuBF
 m1xhflVl/4lKPQOhhFc8EBr9ly92AFXca9iRrlHAcSEo18Gxc9nYAslxndV7bRZD0yx+7yDkuIT
 uva8EuNam2C3BIJspgOQ5yFxcOj/KwggeGGfwOnnnv6Vgf7sApwPSoSetMgaVfbxPIOtP7bt4Re
 Bza0enD+e32kGniEh08wsupSOYK7UPid8lKmtyRhQ7zXdnRZ02H4a/rOUCh6gfU8hdb4EkYjWQb
 MJdngifpKiNb
X-Google-Smtp-Source: AGHT+IG4C6sEyFwsDnUcBUPs/XgOexv8oz383/wMFLwgfdtGWMJ1TqkE/egE0Fbd8yPtuXfZWljxpg==
X-Received: by 2002:a05:6820:1606:b0:603:f903:c85a with SMTP id
 006d021491bc7-6041ff7dbaemr1919841eaf.4.1743903509449; 
 Sat, 05 Apr 2025 18:38:29 -0700 (PDT)
Received: from fedora ([2806:10ae:e:79da::1]) by smtp.gmail.com with ESMTPSA id
 006d021491bc7-6040c4cc891sm1245462eaf.9.2025.04.05.18.38.28
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sat, 05 Apr 2025 18:38:28 -0700 (PDT)
From: =?utf-8?Q?Elijah_Gabe_P=C3=A9rez?= <eg642616@HIDDEN>
To: eg642616@HIDDEN
Subject: Re: bug#77566: [PATCH] Add option for automatically delete
 non-existent projects.
In-Reply-To: <87frim2jt0.fsf@HIDDEN>
References: <87jz7y2mn3.fsf@HIDDEN> <87jz7ynndw.fsf@HIDDEN>
 <87frim2jt0.fsf@HIDDEN>
Date: Sat, 05 Apr 2025 19:38:27 -0600
Message-ID: <875xji2hnw.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Spam-Score: 0.3 (/)
X-Debbugs-Envelope-To: 77566
Cc: dmitry@HIDDEN, 77566 <at> debbugs.gnu.org,
 Sean Whitton <spwhitton@HIDDEN>
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.7 (/)

--=-=-=
Content-Type: text/plain

Sending a better patch.


--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment;
 filename=0001-Add-option-for-automatically-delete-non-existent-pro.patch

From 23dab12d06101f8f91c4994cc109774a81012767 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?El=C3=ADas=20Gabriel=20P=C3=A9rez?= <eg642616@HIDDEN>
Date: Sat, 5 Apr 2025 16:18:27 -0600
Subject: [PATCH] Add option for automatically delete non-existent projects. 
 (bug#77566)

* etc/NEWS: Announce changes.
* lisp/progmodes/project.el
(project-auto-forget-zombie-projects):
New user option.
(project--remove-from-project-list, project-forget-project)
(project-forget-zombie-projects): Allow not to show forgotten
projects.
(project--ensure-read-project-list): Call
`project-forget-zombie-projects' only if
`project-auto-forget-zombie-projects' is non-nil.
---
 etc/NEWS                  |  5 +++++
 lisp/progmodes/project.el | 35 ++++++++++++++++++++++++-----------
 2 files changed, 29 insertions(+), 11 deletions(-)

diff --git a/etc/NEWS b/etc/NEWS
index cc63d03eafe..34ffec598ad 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -362,6 +362,11 @@ invoked standalone or from the 'project-switch-commands' dispatch menu.
 This user option describes projects that should always be skipped by
 'project-remember-project'.
 
++++
+*** New user option 'project-auto-forget-zombie-projects'.
+This user option automatically remove projects from 'project-list-file'
+that have been deleted.
+
 ---
 *** New command 'project-save-some-buffers' bound to 'C-x p C-x s'.
 This is like 'C-x s', but only for this project's buffers.
diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el
index e2cd5bfa231..5d986cb60a0 100644
--- a/lisp/progmodes/project.el
+++ b/lisp/progmodes/project.el
@@ -1551,6 +1551,14 @@ project-ignore-buffer-conditions
   :group 'project
   :package-version '(project . "0.8.2"))
 
+(defcustom project-auto-forget-zombie-projects nil
+  "Automatically remove from project list projects that were deleted.
+If non-nil, remove automatically projects that doesn't exist anymore
+from the project list."
+  :type 'boolean
+  :version "31.1"
+  :group 'project)
+
 (defun project--read-project-buffer ()
   (let* ((pr (project-current t))
          (current-buffer (current-buffer))
@@ -1888,7 +1896,10 @@ project--read-project-list
 (defun project--ensure-read-project-list ()
   "Initialize `project--list' if it isn't already initialized."
   (when (eq project--list 'unset)
-    (project--read-project-list)))
+    (project--read-project-list))
+  (when (and (consp project--list)
+             project-auto-forget-zombie-projects)
+    (project-forget-zombie-projects 'no-message)))
 
 (defun project--write-project-list ()
   "Save `project--list' in `project-list-file'."
@@ -1936,23 +1947,24 @@ project-remember-project
 (defun project--remove-from-project-list (project-root report-message)
   "Remove directory PROJECT-ROOT of a missing project from the project list.
 If the directory was in the list before the removal, save the
-result in `project-list-file'.  Announce the project's removal
-from the list using REPORT-MESSAGE, which is a format string
-passed to `message' as its first argument."
+result in `project-list-file'.  If REPORT-MESSAGE is non-nil,
+Announce the project's removal from the list using REPORT-MESSAGE,
+which is a format string passed to `message' as its first argument."
   (project--ensure-read-project-list)
   (when-let* ((ent (assoc (abbreviate-file-name project-root) project--list)))
     (setq project--list (delq ent project--list))
-    (message report-message project-root)
+    (when report-message (message report-message project-root))
     (project--write-project-list)))
 
 ;;;###autoload
-(defun project-forget-project (project-root)
+(defun project-forget-project (project-root &optional no-message)
   "Remove directory PROJECT-ROOT from the project list.
 PROJECT-ROOT is the root directory of a known project listed in
-the project list."
+the project list.
+If NO-MESSAGE is non-nil, don't display a message about project removed."
   (interactive (list (funcall project-prompter)))
   (project--remove-from-project-list
-   project-root "Project `%s' removed from known projects"))
+   project-root (unless no-message "Project `%s' removed from known projects")))
 
 (defvar project--dir-history)
 
@@ -2117,12 +2129,13 @@ project-remember-projects-under
                          count) count))
     count))
 
-(defun project-forget-zombie-projects ()
-  "Forget all known projects that don't exist any more."
+(defun project-forget-zombie-projects (&optional no-message)
+  "Forget all known projects that don't exist any more.
+If NO-MESSAGE is non-nil, don't display a message about projects removed."
   (interactive)
   (dolist (proj (project-known-project-roots))
     (unless (file-exists-p proj)
-      (project-forget-project proj))))
+      (project-forget-project proj no-message))))
 
 (defun project-forget-projects-under (dir &optional recursive)
   "Forget all known projects below a directory DIR.
-- 
2.49.0


--=-=-=
Content-Type: text/plain


-- 
                                          - E.G via GNU Emacs and Org.

--=-=-=--




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

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


Received: (at 77566) by debbugs.gnu.org; 6 Apr 2025 00:52:22 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Apr 05 20:52:22 2025
Received: from localhost ([127.0.0.1]:45375 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1u1EFK-0006mM-Hv
	for submit <at> debbugs.gnu.org; Sat, 05 Apr 2025 20:52:22 -0400
Received: from mail-oo1-xc44.google.com ([2607:f8b0:4864:20::c44]:51219)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <eg642616@HIDDEN>)
 id 1u1EFH-0006m6-OH
 for 77566 <at> debbugs.gnu.org; Sat, 05 Apr 2025 20:52:20 -0400
Received: by mail-oo1-xc44.google.com with SMTP id
 006d021491bc7-601c469cce3so735314eaf.2
 for <77566 <at> debbugs.gnu.org>; Sat, 05 Apr 2025 17:52:19 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1743900734; x=1744505534; darn=debbugs.gnu.org;
 h=mime-version:user-agent:message-id:date:references:in-reply-to
 :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to;
 bh=tbA6uHUhCCiqwYFhHGXdpSyPPNvOlqfXTgKCzsVDiHY=;
 b=OL9/xzW/mElVjBVdUPGOpP0qdwsIbwstEjlplRMbd8PVtu2MLeJBZ2cZQcIdrICjID
 h9ANmZ651WSUow4IwsFgW5dhN+LKqPSgw47utvWCfnOv9gBI3ctvBZYetSnpsm99g9eO
 wYGFmbZEx/I2yPZx5ioASxSVon0Qh7tuKbjGZCm8e8hphgXyhK+ojRj+ktyZpZRNll5p
 nlaTAMv1wlTyui1/U5hNc+2Pqs0ksdABdMRZYo7K9XRb9GILpHMDO8GzzU57bzlbuz7I
 lXtkBksKadlyuUpqprRnmEm/coHtjqhuIbIvki1M729EOIqpWyaiGq7r8MyqIoSPM7tg
 Gguw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1743900734; x=1744505534;
 h=mime-version:user-agent:message-id:date:references:in-reply-to
 :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date
 :message-id:reply-to;
 bh=tbA6uHUhCCiqwYFhHGXdpSyPPNvOlqfXTgKCzsVDiHY=;
 b=ESTlPVIOns4jvz3hawNNqSd/+GgWI0TNuwNws070cm8rpnDxOUMGw2CmDTWROMqLiY
 HrukFosEwDbISL9gM7zyq9NjNweAhX4ZuSuhb1d05cV9tKkhpHBvEcNJ83QIqzlqrkCF
 EUHEOiLUCvKQET5Zj9XPmuiAgqlUo2fFQNJG4CO5lupgsdrtD792GMR0h2skqKWrQ8rs
 b8q80KmipE4nxzqMi7LavuzTC4ke5bNEKk1aP8k/xwP8fdIN/LdRQvRTRG/UOv9to52m
 14Se4uDt/gIXt0YCqfe6jlKotCkiTXDAhhGy052dhXVbj/VMa02uFiSe4vMMA/xSYnl7
 rpaQ==
X-Forwarded-Encrypted: i=1;
 AJvYcCVrxmd2Uoyd4SAWKkk5CM5qo2/7rJzjqNAJfPT4xotwaOq4EK4B4Iw9rRm81CE0IPhJHppWYg==@debbugs.gnu.org
X-Gm-Message-State: AOJu0YxoUtT7Vd1m+QeTqjYW21qQQOlVx6D+vzNGSng/m1RdknvcbvUF
 YAYN4bBLy/fBkqzWQCksEGPGcoeB5SaeqYQ42moCOxVeTd1alHzTDXkQ6+4e
X-Gm-Gg: ASbGnctSGwFpgarJvcCIUAEeYMIJgzY58y9Zja28trpMXj2xXd7y1r7QNeg/KGvN7PR
 7RwEOZIufEXhjS07aCQ6dj6Ab7vZCLFmenV7qr8eVOT+O5DIw47m3FPGdFPxtJ5fOctQiPxI1le
 alcwV5dhT5OEP69jE8wXkCmS1O+bo7IBYGQYiVVv+Y4kkx5qyQuVIFUvOkkWDIpaYlKEMOUEq2M
 unXJvI2AnI6N5jSsxGofYuNGkjQHPhzv+BwdS5FBv76Z2WTmyvvcEHpW2R4b5AFmp+z1yrWDXpr
 PUieE2ZpGTOW
X-Google-Smtp-Source: AGHT+IHI06d5lSn2wuYGKc92tdwy9FCJ89706EOw2mJOgq8nhE6tOvDHCDkXuNaNLzXO3MhLdgLjDw==
X-Received: by 2002:a05:6820:2214:b0:603:fd3b:aef6 with SMTP id
 006d021491bc7-60415810f78mr3682238eaf.8.1743900733705; 
 Sat, 05 Apr 2025 17:52:13 -0700 (PDT)
Received: from fedora ([2806:10ae:e:79da::1]) by smtp.gmail.com with ESMTPSA id
 006d021491bc7-6040c5aea3esm1256424eaf.37.2025.04.05.17.52.12
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sat, 05 Apr 2025 17:52:13 -0700 (PDT)
From: =?utf-8?Q?Elijah_Gabe_P=C3=A9rez?= <eg642616@HIDDEN>
To: Sean Whitton <spwhitton@HIDDEN>
Subject: Re: bug#77566: [PATCH] Add option for automatically delete
 non-existent projects.
In-Reply-To: <87jz7ynndw.fsf@HIDDEN>
References: <87jz7y2mn3.fsf@HIDDEN> <87jz7ynndw.fsf@HIDDEN>
Date: Sat, 05 Apr 2025 18:52:11 -0600
Message-ID: <87frim2jt0.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.3 (/)
X-Debbugs-Envelope-To: 77566
Cc: dmitry@HIDDEN, 77566 <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: -0.7 (/)

Sean Whitton <spwhitton@HIDDEN> writes:

> Hello,
>
> Thanks, though why do this only when switching projects?
> Why not do it proactively whenever fetching the list of projects?
> Performance concerns?

Yes, but depends on how many projects one has.
(and because i forgot to add it)

-- 
                                          - E.G via GNU Emacs and Org.




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

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


Received: (at 77566) by debbugs.gnu.org; 6 Apr 2025 00:29:30 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Apr 05 20:29:30 2025
Received: from localhost ([127.0.0.1]:45353 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1u1DtC-0005fP-DM
	for submit <at> debbugs.gnu.org; Sat, 05 Apr 2025 20:29:30 -0400
Received: from sendmail.purelymail.com ([34.202.193.197]:41342)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <spwhitton@HIDDEN>)
 id 1u1Dt9-0005f7-B1
 for 77566 <at> debbugs.gnu.org; Sat, 05 Apr 2025 20:29:28 -0400
DKIM-Signature: a=rsa-sha256;
 b=wt/+FNOaD5ueY3mA81FuoUF3P5t2tTV6zQAzCOuYc+m12mUK0CIJFKfwID+qVEVCNVy624sG/3Na191yNOhW/WozqM9KduCxFmT4ceFmYXiVqqNuRSM1Un5njhO2wfh1jjUgH/W5CQhxRCcneI0vemMs90qw0Alt0fLaXWdNig5f5IWk1Qffh+n2MAiOvKlWx7gHLHrpSkfshsloH9wv9MK0CPxtaR24L7IWJU4NnzVUnD3QQqTYaJ8pDW4BMy/URCWyo2OPkqP6cowxN6gqvn68uHjkuG/ltOcUd/jJEa+GIL29AkLJ9/Yz8GPqM+T8OXjrqMwkXr2j72drBN7x7Q==;
 s=purelymail1; d=spwhitton.name; v=1;
 bh=2b5j77VVS7Jq2lhWVBrPQ8wdF0o8FMxqeh1IF8R8iag=;
 h=Received:Received:From:To:Subject:Date; 
DKIM-Signature: a=rsa-sha256;
 b=D/e3JGHl8zKpRuZka9/CwYUti26SoiA8VveCWfj2ucEVOLg/lrJO1YBiHPX4JA8ijSxaI3SidIqJG7GmyX0OuevpIeys9Yui6MYXr0m7HJTmnEyH7DnC5HcdOET6XNh6T+2qZy/Wz4Yk0NOdR6ScfV8tVm1jYi+X3EDU86fBQtJA0/W44hO1M29SQKRQVmY6ZLRMkc9JpssKUk12Z0R7lD2xHtNlQIHFvYNXHZZXIUx6TQVXudVYzjViocIboBEetKyFIFC1ORm58gH8nDvLDfhUrISPI36oiSDvXR0CM9NO1+DRiNM9xudql3dTkdps/s1utuJOuqe/Qd1tZ34qUA==;
 s=purelymail1; d=purelymail.com; v=1;
 bh=2b5j77VVS7Jq2lhWVBrPQ8wdF0o8FMxqeh1IF8R8iag=;
 h=Feedback-ID:Received:Received:From:To:Subject:Date; 
Feedback-ID: 20115:3760:null:purelymail
X-Pm-Original-To: 77566 <at> debbugs.gnu.org
Received: by smtp.purelymail.com (Purelymail SMTP) with ESMTPSA id 1794527911; 
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Sun, 06 Apr 2025 00:29:21 +0000 (UTC)
Received: by melete.silentflame.com (Postfix, from userid 1000)
 id 343697EF4CB; Sun, 06 Apr 2025 08:29:15 +0800 (CST)
From: Sean Whitton <spwhitton@HIDDEN>
To: Elijah Gabe =?utf-8?Q?P=C3=A9rez?= <eg642616@HIDDEN>
Subject: Re: bug#77566: [PATCH] Add option for automatically delete
 non-existent projects.
In-Reply-To: <87jz7y2mn3.fsf@HIDDEN>
References: <87jz7y2mn3.fsf@HIDDEN>
Date: Sun, 06 Apr 2025 08:29:15 +0800
Message-ID: <87jz7ynndw.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: 77566
Cc: dmitry@HIDDEN, 77566 <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 (-)

Hello,

Thanks, though why do this only when switching projects?
Why not do it proactively whenever fetching the list of projects?
Performance concerns?

-- 
Sean Whitton




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

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


Received: (at submit) by debbugs.gnu.org; 5 Apr 2025 23:51:13 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Apr 05 19:51:13 2025
Received: from localhost ([127.0.0.1]:45314 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1u1DI8-0003tx-NI
	for submit <at> debbugs.gnu.org; Sat, 05 Apr 2025 19:51:13 -0400
Received: from lists.gnu.org ([2001:470:142::17]:58904)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <eg642616@HIDDEN>)
 id 1u1DI6-0003tW-54
 for submit <at> debbugs.gnu.org; Sat, 05 Apr 2025 19:51:10 -0400
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 <eg642616@HIDDEN>)
 id 1u1DHy-0004xe-05
 for bug-gnu-emacs@HIDDEN; Sat, 05 Apr 2025 19:51:02 -0400
Received: from mail-ot1-x343.google.com ([2607:f8b0:4864:20::343])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <eg642616@HIDDEN>)
 id 1u1DHw-0001rm-9g
 for bug-gnu-emacs@HIDDEN; Sat, 05 Apr 2025 19:51:01 -0400
Received: by mail-ot1-x343.google.com with SMTP id
 46e09a7af769-72b7a53ceb6so1757549a34.0
 for <bug-gnu-emacs@HIDDEN>; Sat, 05 Apr 2025 16:50:59 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1743897058; x=1744501858; darn=gnu.org;
 h=mime-version:message-id:date:subject:to:from:from:to:cc:subject
 :date:message-id:reply-to;
 bh=GzySl2ImKMuIOdhxZR60V9vgd7jfTSHBj38wSdnSMV4=;
 b=c6VKys+GyMUL581BY8nDJr+O9lSc6LsH5GC/4lGOrJht3CjGThXcGovD1yp1HTuzft
 6uDB5VWG/fxOtdWGIUyWFPsbJwWD4us8+fZYxuUkDZn8uZhv/Kia7zIqxzOlz665Ofew
 Dgxk1XrRa3YtEV0SOsyY33H8oanFCfTa7g+f1i8dmJZnyFw1BfxhAzVK17RD/HzZeshP
 pab5qICLQcM6ZK1rScx2SkGpGKdv0tT4XjMPUEMM/mwuntUfn+PZHWnKIe3PMy3cVrUe
 LAgkKEnsfJLo6L6JQz63o3pcAJGFUCuW1kFr8Jvqd3GtnBzreBfvx9HUWpVlaQqnlRkV
 PEhA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1743897058; x=1744501858;
 h=mime-version:message-id:date:subject:to:from:x-gm-message-state
 :from:to:cc:subject:date:message-id:reply-to;
 bh=GzySl2ImKMuIOdhxZR60V9vgd7jfTSHBj38wSdnSMV4=;
 b=onPvvBpt0CnciKxJVeV8OqAheAL/UM5dQf8g3oBfJOiMSIYG1/OTF3ynBQC1RBPp0T
 a6m5kKsVetMVOIpwrkm/0cVzdY4QA3GOA+9f1cAVUtLCLkzI0vpTq0kLDQO3a14A1i+a
 cI3mPGptD3tI2SrCmnkZVOq2GOp8pRZvGQAcEVvieO8iu0ru07enZ1F6BvH3W97wYH2x
 TTM1r9DobaCDmMwrZYNIGCsoG/xSf6kCjwo1KDzDt63X3ZBdqI8r4Yv9FCT6Pao8dt2C
 nIO59QENNEy8lufXYwSu0qn9snvX7kXYhKQ7zu0gEUvHVZi6f1qHABFT1lTm0Gcw9VXU
 O7Yg==
X-Gm-Message-State: AOJu0YwNpU+aqzShYMw5RdpjiRftBc0TvrTeuP7FQSQKq6hc36sr5QtG
 wPCySZp1jkTaqAUa/gt85CPoa8TrPpixI5O/DlqSYf99n0xrkloQuBTgNrqN
X-Gm-Gg: ASbGncvw+UCHrckC1q62grv1cCPo4QZKZwnkM2ORw2LJms8LH66yZdefWGLzv6io0S8
 6RF3YmRlcKr39I0/cn1NnSL5rvXllBz0p4M6Ui/Zwfi28OvfIqlOFqICquZ+YjpIC3hA/OZBTDn
 8eOJ8+W3N3rqb1TS1snyKNkKFAU6hImq7TXSXkT0lyaCKTYL81vzy/LY4jqxq76ykFztcQjdYtP
 9eJviuEHiA0J/AJCe7ln9Ivs/AxnqRWHoROgRhEI1r3QW2v0DdnL5DXwO6BFPfcNBq29fbfcY24
 QcPWbMIgnXBu
X-Google-Smtp-Source: AGHT+IGxclnaty7vso6kToD//6p+xUheC4OdDAXMZjPH0Aor32qdu121oQbWB3jkb3KUw1FeS+TmYQ==
X-Received: by 2002:a05:6830:6117:b0:72a:e65:e65c with SMTP id
 46e09a7af769-72e36e7f448mr4510120a34.11.1743897058417; 
 Sat, 05 Apr 2025 16:50:58 -0700 (PDT)
Received: from fedora ([2806:10ae:e:79da::1]) by smtp.gmail.com with ESMTPSA id
 46e09a7af769-72e305114a8sm1220488a34.18.2025.04.05.16.50.57
 for <bug-gnu-emacs@HIDDEN>
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sat, 05 Apr 2025 16:50:57 -0700 (PDT)
From: =?utf-8?Q?Elijah_Gabe_P=C3=A9rez?= <eg642616@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: [PATCH] Add option for automatically delete non-existent projects.
X-Debbugs-Cc: dmitry@HIDDEN
Date: Sat, 05 Apr 2025 17:50:56 -0600
Message-ID: <87jz7y2mn3.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
Received-SPF: pass client-ip=2607:f8b0:4864:20::343;
 envelope-from=eg642616@HIDDEN; helo=mail-ot1-x343.google.com
X-Spam_score_int: -17
X-Spam_score: -1.8
X-Spam_bar: -
X-Spam_report: (-1.8 / 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_ENVFROM_END_DIGIT=0.25, 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.2 (+)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 Content preview:  Tags: patch This feature automatically remove from project
 list projects that were deleted, only when `project-switch-project' is being
 used. This acts similar to `projectile-auto-cleanup-known-projects' from
 projectile.el 
 Content analysis details:   (1.2 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends
 in digit (eg642616[at]gmail.com)
 1.0 SPF_SOFTFAIL           SPF: sender does not match SPF record (softfail)
 -0.0 SPF_HELO_PASS          SPF: HELO matches SPF record
 0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail
 provider (eg642616[at]gmail.com)
 -0.0 RCVD_IN_DNSWL_NONE     RBL: Sender listed at https://www.dnswl.org/,
 no trust [2001:470:142:0:0:0:0:17 listed in] [list.dnswl.org]
 0.0 HTML_MESSAGE           BODY: HTML included in message
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.2 (/)

--=-=-=
Content-Type: multipart/alternative; boundary="==-=-="

--==-=-=
Content-Type: text/plain

Tags: patch

This feature automatically remove from project list projects that were
deleted, only when `project-switch-project' is being used.

This acts similar to `projectile-auto-cleanup-known-projects' from
projectile.el




--==-=-=
Content-Type: text/html

<p>
Tags: patch<br />
</p>

<p>
This feature automatically remove from project list projects that were<br />
deleted, only when `project-switch-project' is being used.<br />
</p>

<p>
This acts similar to `projectile-auto-cleanup-known-projects' from<br />
projectile.el<br />
</p>

--==-=-=--

--=-=-=
Content-Type: text/patch
Content-Disposition: attachment;
 filename=0001-Add-option-for-automatically-delete-non-existent-pro.patch

From d426ab218feb1b2ce8c203991374a9e987f2a379 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?El=C3=ADas=20Gabriel=20P=C3=A9rez?= <eg642616@HIDDEN>
Date: Sat, 5 Apr 2025 16:18:27 -0600
Subject: [PATCH] Add option for automatically delete non-existent projects. 
 (bug#)

* etc/NEWS: Announce changes.
* lisp/progmodes/project.el
(project-auto-forget-zombie-projects):
New user option.
(project--remove-from-project-list, project-forget-project)
(project-forget-zombie-projects): Allow not to show forgotten
projects.
(project-switch-project): Call `project-forget-zombie-projects'
only if `project-auto-forget-zombie-projects' is non-nil.
---
 etc/NEWS                  |  5 +++++
 lisp/progmodes/project.el | 26 ++++++++++++++++++--------
 2 files changed, 23 insertions(+), 8 deletions(-)

diff --git a/etc/NEWS b/etc/NEWS
index cc63d03eafe..37e7a32f09a 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -362,6 +362,11 @@ invoked standalone or from the 'project-switch-commands' dispatch menu.
 This user option describes projects that should always be skipped by
 'project-remember-project'.
 
++++
+*** New user option 'project-auto-forget-zombie-projects'.
+This user option automatically remove projects from 'project-list-file'
+that have been deleted when switching projects.
+
 ---
 *** New command 'project-save-some-buffers' bound to 'C-x p C-x s'.
 This is like 'C-x s', but only for this project's buffers.
diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el
index e2cd5bfa231..6a38f49978b 100644
--- a/lisp/progmodes/project.el
+++ b/lisp/progmodes/project.el
@@ -1551,6 +1551,14 @@ project-ignore-buffer-conditions
   :group 'project
   :package-version '(project . "0.8.2"))
 
+(defcustom project-auto-forget-zombie-projects nil
+  "Automatically remove projects that doesn't exist anymore.
+If non-nil, remove automatically projects that doesn't exist anymore
+when switching projects."
+  :type 'boolean
+  :version "31.1"
+  :group 'project)
+
 (defun project--read-project-buffer ()
   (let* ((pr (project-current t))
          (current-buffer (current-buffer))
@@ -1936,23 +1944,24 @@ project-remember-project
 (defun project--remove-from-project-list (project-root report-message)
   "Remove directory PROJECT-ROOT of a missing project from the project list.
 If the directory was in the list before the removal, save the
-result in `project-list-file'.  Announce the project's removal
-from the list using REPORT-MESSAGE, which is a format string
-passed to `message' as its first argument."
+result in `project-list-file'.  If REPORT-MESSAGE is non-nil,
+Announce the project's removal from the list using REPORT-MESSAGE,
+which is a format string passed to `message' as its first argument."
   (project--ensure-read-project-list)
   (when-let* ((ent (assoc (abbreviate-file-name project-root) project--list)))
     (setq project--list (delq ent project--list))
-    (message report-message project-root)
+    (when report-message (message report-message project-root))
     (project--write-project-list)))
 
 ;;;###autoload
-(defun project-forget-project (project-root)
+(defun project-forget-project (project-root &optional no-message)
   "Remove directory PROJECT-ROOT from the project list.
 PROJECT-ROOT is the root directory of a known project listed in
-the project list."
+the project list.
+If NO-MESSAGE is non-nil, don't display a message about project removed."
   (interactive (list (funcall project-prompter)))
   (project--remove-from-project-list
-   project-root "Project `%s' removed from known projects"))
+   project-root (unless no-message "Project `%s' removed from known projects")))
 
 (defvar project--dir-history)
 
@@ -2122,7 +2131,7 @@ project-forget-zombie-projects
   (interactive)
   (dolist (proj (project-known-project-roots))
     (unless (file-exists-p proj)
-      (project-forget-project proj))))
+      (project-forget-project proj 'no-message))))
 
 (defun project-forget-projects-under (dir &optional recursive)
   "Forget all known projects below a directory DIR.
@@ -2302,6 +2311,7 @@ project-switch-project
 to directory DIR."
   (interactive (list (funcall project-prompter)))
   (project-remember-project (project-current nil dir))
+  (if project-auto-forget-zombie-projects (project-forget-zombie-projects))
   (let ((command (if (symbolp project-switch-commands)
                      project-switch-commands
                    (project--switch-project-command dir)))
-- 
2.49.0


--=-=-=
Content-Type: text/plain


-- 
                                          - E.G via GNU Emacs and Org.

--=-=-=--




Acknowledgement sent to Elijah Gabe Pérez <eg642616@HIDDEN>:
New bug report received and forwarded. Copy sent to dmitry@HIDDEN, bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to dmitry@HIDDEN, bug-gnu-emacs@HIDDEN:
bug#77566; 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, 6 Apr 2025 11:30:02 UTC

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