From unknown Sun Jun 15 09:01:26 2025 X-Loop: help-debbugs@gnu.org Subject: bug#77566: [PATCH] Add option for automatically delete non-existent projects. Resent-From: Elijah Gabe =?UTF-8?Q?P=C3=A9rez?= Original-Sender: "Debbugs-submit" Resent-CC: dmitry@gutov.dev, bug-gnu-emacs@gnu.org Resent-Date: Sat, 05 Apr 2025 23:52:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 77566 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: 77566@debbugs.gnu.org Cc: dmitry@gutov.dev X-Debbugs-Original-To: bug-gnu-emacs@gnu.org X-Debbugs-Original-Xcc: dmitry@gutov.dev Received: via spool by submit@debbugs.gnu.org id=B.174389707315010 (code B ref -1); Sat, 05 Apr 2025 23:52:02 +0000 Received: (at submit) by debbugs.gnu.org; 5 Apr 2025 23:51:13 +0000 Received: from localhost ([127.0.0.1]:45314 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u1DI8-0003tx-NI for submit@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 ) id 1u1DI6-0003tW-54 for submit@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 ) id 1u1DHy-0004xe-05 for bug-gnu-emacs@gnu.org; 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 ) id 1u1DHw-0001rm-9g for bug-gnu-emacs@gnu.org; Sat, 05 Apr 2025 19:51:01 -0400 Received: by mail-ot1-x343.google.com with SMTP id 46e09a7af769-72b7a53ceb6so1757549a34.0 for ; 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 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 05 Apr 2025 16:50:57 -0700 (PDT) From: Elijah Gabe =?UTF-8?Q?P=C3=A9rez?= Date: Sat, 05 Apr 2025 17:50:56 -0600 Message-ID: <87jz7y2mn3.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2607:f8b0:4864:20::343; envelope-from=eg642616@gmail.com; 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-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" 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

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/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?= 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. --=-=-=-- From unknown Sun Jun 15 09:01:26 2025 X-Loop: help-debbugs@gnu.org Subject: bug#77566: [PATCH] Add option for automatically delete non-existent projects. Resent-From: Sean Whitton Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 06 Apr 2025 00:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 77566 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Elijah Gabe =?UTF-8?Q?P=C3=A9rez?= Cc: dmitry@gutov.dev, 77566@debbugs.gnu.org Received: via spool by 77566-submit@debbugs.gnu.org id=B77566.174389937021791 (code B ref 77566); Sun, 06 Apr 2025 00:30:02 +0000 Received: (at 77566) by debbugs.gnu.org; 6 Apr 2025 00:29:30 +0000 Received: from localhost ([127.0.0.1]:45353 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u1DtC-0005fP-DM for submit@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 ) id 1u1Dt9-0005f7-B1 for 77566@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@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 In-Reply-To: <87jz7y2mn3.fsf@gmail.com> References: <87jz7y2mn3.fsf@gmail.com> Date: Sun, 06 Apr 2025 08:29:15 +0800 Message-ID: <87jz7ynndw.fsf@melete.silentflame.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" 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 From unknown Sun Jun 15 09:01:26 2025 X-Loop: help-debbugs@gnu.org Subject: bug#77566: [PATCH] Add option for automatically delete non-existent projects. Resent-From: Elijah Gabe =?UTF-8?Q?P=C3=A9rez?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 06 Apr 2025 00:53:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 77566 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Sean Whitton Cc: dmitry@gutov.dev, 77566@debbugs.gnu.org Received: via spool by 77566-submit@debbugs.gnu.org id=B77566.174390074226066 (code B ref 77566); Sun, 06 Apr 2025 00:53:02 +0000 Received: (at 77566) by debbugs.gnu.org; 6 Apr 2025 00:52:22 +0000 Received: from localhost ([127.0.0.1]:45375 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u1EFK-0006mM-Hv for submit@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 ) id 1u1EFH-0006m6-OH for 77566@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@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: Elijah Gabe =?UTF-8?Q?P=C3=A9rez?= In-Reply-To: <87jz7ynndw.fsf@melete.silentflame.com> References: <87jz7y2mn3.fsf@gmail.com> <87jz7ynndw.fsf@melete.silentflame.com> Date: Sat, 05 Apr 2025 18:52:11 -0600 Message-ID: <87frim2jt0.fsf@gmail.com> 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-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) Sean Whitton 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. From unknown Sun Jun 15 09:01:26 2025 X-Loop: help-debbugs@gnu.org Subject: bug#77566: [PATCH] Add option for automatically delete non-existent projects. Resent-From: Elijah Gabe =?UTF-8?Q?P=C3=A9rez?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 06 Apr 2025 01:39:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 77566 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: eg642616@gmail.com Cc: dmitry@gutov.dev, 77566@debbugs.gnu.org, Sean Whitton Received: via spool by 77566-submit@debbugs.gnu.org id=B77566.17439035262053 (code B ref 77566); Sun, 06 Apr 2025 01:39:02 +0000 Received: (at 77566) by debbugs.gnu.org; 6 Apr 2025 01:38:46 +0000 Received: from localhost ([127.0.0.1]:45427 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u1EyD-0000X2-6Y for submit@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 ) id 1u1Ey3-0000We-IV for 77566@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@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: Elijah Gabe =?UTF-8?Q?P=C3=A9rez?= In-Reply-To: <87frim2jt0.fsf@gmail.com> References: <87jz7y2mn3.fsf@gmail.com> <87jz7ynndw.fsf@melete.silentflame.com> <87frim2jt0.fsf@gmail.com> Date: Sat, 05 Apr 2025 19:38:27 -0600 Message-ID: <875xji2hnw.fsf@gmail.com> 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-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" 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?= 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. --=-=-=-- From unknown Sun Jun 15 09:01:26 2025 X-Loop: help-debbugs@gnu.org Subject: bug#77566: [PATCH] Add option for automatically delete non-existent projects. Resent-From: Ship Mints Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 06 Apr 2025 11:27:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 77566 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Elijah Gabe =?UTF-8?Q?P=C3=A9rez?= Cc: dmitry@gutov.dev, 77566@debbugs.gnu.org, Sean Whitton Received: via spool by 77566-submit@debbugs.gnu.org id=B77566.174393879913563 (code B ref 77566); Sun, 06 Apr 2025 11:27:02 +0000 Received: (at 77566) by debbugs.gnu.org; 6 Apr 2025 11:26:39 +0000 Received: from localhost ([127.0.0.1]:46229 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u1O99-0003Wg-0R for submit@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 ) id 1u1O96-0003WN-C6 for 77566@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@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@gmail.com> <87jz7ynndw.fsf@melete.silentflame.com> <87frim2jt0.fsf@gmail.com> <875xji2hnw.fsf@gmail.com> In-Reply-To: <875xji2hnw.fsf@gmail.com> From: Ship Mints Date: Sun, 6 Apr 2025 07:26:18 -0400 X-Gm-Features: ATxdqUFtUWI4t_ystqTY_iLyNxR4jOq2H6HYgj_BI-EbPyw39g1YqvJlJ8fHwIM Message-ID: Content-Type: multipart/alternative; boundary="0000000000001de4a706321a648e" X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" 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 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
= On Sat, Apr 5, 2025 at 9:39=E2=80=AFPM Elijah Gabe P=C3=A9rez <eg642616@gmail.com> wrote:
Sending a better patch.

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.

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">'project-auto-forget-zombie-projects'=C2=A0'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.=C2=A0 In long-lived Em= acs sessions just doing it at list read time seems insufficient.

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.

++++
*** New user option 'project-au= to-forget-zombie-projects'.
- This user option automatically remove = projects from 'project-list-file'
+ This user option automatical= ly removes projects from 'project-list-file'
- that have been deleted.
+ that cannot be accessed. [this l= anguage 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&= #39;list-read...etc.
+ If \\=3D'list-= write...etc.
+ [whatever other conditions= seem reasonable]
+ If nil, no prunin= g is performed."

-Stephane
--0000000000001de4a706321a648e-- From unknown Sun Jun 15 09:01:26 2025 X-Loop: help-debbugs@gnu.org Subject: bug#77566: [PATCH] Add option for automatically delete non-existent projects. Resent-From: Elijah Gabe =?UTF-8?Q?P=C3=A9rez?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 07 Apr 2025 00:40:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 77566 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Ship Mints Cc: dmitry@gutov.dev, 77566@debbugs.gnu.org, Sean Whitton Received: via spool by 77566-submit@debbugs.gnu.org id=B77566.17439863807832 (code B ref 77566); Mon, 07 Apr 2025 00:40:02 +0000 Received: (at 77566) by debbugs.gnu.org; 7 Apr 2025 00:39:40 +0000 Received: from localhost ([127.0.0.1]:50236 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u1aWZ-00022G-By for submit@debbugs.gnu.org; Sun, 06 Apr 2025 20:39:40 -0400 Received: from mail-ot1-x343.google.com ([2607:f8b0:4864:20::343]:55732) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1u1aWX-00021m-8I for 77566@debbugs.gnu.org; Sun, 06 Apr 2025 20:39:38 -0400 Received: by mail-ot1-x343.google.com with SMTP id 46e09a7af769-72c13802133so1000463a34.3 for <77566@debbugs.gnu.org>; Sun, 06 Apr 2025 17:39:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1743986371; x=1744591171; 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=RfAqdz+/zfU38NbJd4nWMoozO4ESerFrCyRcrA38+Oo=; b=Fn7nzFwlBjqamet8u6/DDLzGmHfaIVpysmiRItDX6unCzQnlrmJvsuTALx8GN8Kiv8 q4ZxfEzEsc4sWPEKeSRqaAwilZddEPXsBl3NEvtyk1lzMV0wLZsU+doYp2RSoKchoWDk EyRPhBzlUGwCv3rRyqisQiQ62nCzMAjLPveHjUuZWY0YIlQdOuTUQGNsl/Vwcb/ItC/O Hk0lFKLCY52QGtLk5yMPrqkghw773WglGL+CqXcoSZ55pV7W7KV/2q3mQmfo0V2F3JD2 ZFcK7bVhZxdjQdIav4N1GlD/2LF/vper9fxP319LrLHqBV2p2El8AkRT8pFbUO+X0tSx vl0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743986371; x=1744591171; 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=RfAqdz+/zfU38NbJd4nWMoozO4ESerFrCyRcrA38+Oo=; b=n5/YZO9Kn5DydGUsx8eq0HCuRK/oaFZBr+dpPvL8kv0lN+STol51HmX9fzCHug1sRg flXagdLg8Yrwpthlq9AWxvW9QKPTayTEGE4XYLIMLJApXuyMODdaPAl+gWJqkGTOu/hS uP1UF3NiXUIhfxWqVRnNEApp+ia9++o9ekzdzvKn2KY6+NdTPex2fJhNGeLswO0u9DIz 6ZIyMyrHMIInwUm08o9vruOU6qOBcwzLzu/QBHl/nDOMTCk8BdKGx9ARH+YOokkCbpOf pv5guQ1YugTsBVaq4jjYnICKD4sVxF12p5kogARf0hSa7LXK3h7qU4NENOIupZ8VHXhF WUng== X-Forwarded-Encrypted: i=1; AJvYcCU5+hOfZELB5W+krOnR/q6SWJIxaEWvv7fTmq6Jh9iAOHTvW0N6L2QtBhPwYlp9fCZI8aP3Qw==@debbugs.gnu.org X-Gm-Message-State: AOJu0Yxk0ix+0NXxnIKNdMffnSrNCQ0teprSgt7Qo6paGPsTnUsHA9MD CuTIjcWneS98mklQiDZ4YrLEBUBDGMT5sbEgpK/ylpXQQuRGHzl+ X-Gm-Gg: ASbGncuuqBvtAwl3gzSB+dODD/Tx6mBARDLmyyQiUctDQ3alkWI5cq47WY9bH5Oq6Lb 85R87SMrOC0SUs8CUJI7LUXMfyvbZihVYp+Zv6M639tSLC2zDFapUBxCLezC3TNUB06KkB+Wms7 LIqHZ3A454JX9+h0OJAGs901j4YXrUvZl3QSPCNvBeQsNzAPyUniyCjzwZLUyvvifqd/G/pOBKx pHvVfyKF/Tg7m/mOLddp5OZPw+xDk1BljlaifkhgC8/wBbqtzMgM+OxN5r2xUY1qfLkAvNMuaOX swIMKB4RUs8X X-Google-Smtp-Source: AGHT+IFT77Yo1rpEyvNeTubZa9h+UiF9qv+zz1VBttTm1m6+ICIolvOQ1TYFgr8jGuvIZVsA7/Sbiw== X-Received: by 2002:a05:6830:6801:b0:72b:b8d8:3995 with SMTP id 46e09a7af769-72e36957415mr6245587a34.19.1743986371087; Sun, 06 Apr 2025 17:39:31 -0700 (PDT) Received: from fedora ([2806:10ae:e:79da::1]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-72e30529cc5sm1525433a34.33.2025.04.06.17.39.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 06 Apr 2025 17:39:30 -0700 (PDT) From: Elijah Gabe =?UTF-8?Q?P=C3=A9rez?= In-Reply-To: References: <87jz7y2mn3.fsf@gmail.com> <87jz7ynndw.fsf@melete.silentflame.com> <87frim2jt0.fsf@gmail.com> <875xji2hnw.fsf@gmail.com> Date: Sun, 06 Apr 2025 18:39:28 -0600 Message-ID: <87zfgseren.fsf@gmail.com> 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-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) --=-=-= Content-Type: text/plain Ship Mints writes: > 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. Something like to this patch? --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Add-option-for-automatically-delete-non-existent-pro.patch >From adfd76d9d7f046b10548fad30861afb260c888e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?El=C3=ADas=20Gabriel=20P=C3=A9rez?= 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-prune-zombie-projects) (project-dont-prune-remote-zombie-projects): New user options. (project--remove-from-project-list, project-forget-project): Allow not to show forgotten projects. (project-forget-zombie-projects): Add new function arguments. (project--ensure-read-project-list, project--write-project-list): Call `project-forget-zombie-projects' only if according `project-auto-forget-zombie-projects' value. --- etc/NEWS | 15 +++++++++ lisp/progmodes/project.el | 66 ++++++++++++++++++++++++++++++--------- 2 files changed, 66 insertions(+), 15 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index cc63d03eafe..f88074d7f0f 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -362,6 +362,21 @@ 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-prune-zombie-projects'. +This user option automatically removes projects from 'project-list-file' +that cannot be accessed. + +--- +*** New user option 'project-dont-prune-remote-zombie-projects'. +This user option tells to `project-forget-zombie-projects' if +remote projects must be removed from 'project-list-file' only if +'project-prune-zombie-projects' is non-nil. + +*** New argument NO-REMOTE for 'project-forget-zombie-projects'. +This function argument tells 'project-forget-zombie-projects' not to +forget projects that are remote. + --- *** 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..f0e54f90722 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -1551,6 +1551,28 @@ project-ignore-buffer-conditions :group 'project :package-version '(project . "0.8.2")) +(defcustom project-prune-zombie-projects nil + "Automatically remove from project list projects that were deleted. +If set to `all', remove projects when project list file +is being read or written. +If set to `list-read', only remove projects when project list file +is being read. +If set to `list-write', only remove projects when project list file is +being written. +If nil, no pruning is performed." + :type '(choice (const :tag "All" all) + (const :tag "Only when project list is being read" list-read) + (const :tag "Only when project list is being written" list-write) + (const :tag "Disabled" nil)) + :version "31.1" + :group 'project) + +(defcustom project-dont-prune-remote-zombie-projects nil + "If non-nil, remote files will no be pruned by `project-forget-zombie-projects'." + :type 'boolean + :version "31.1" + :group 'project) + (defun project--read-project-buffer () (let* ((pr (project-current t)) (current-buffer (current-buffer)) @@ -1888,7 +1910,11 @@ 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) + (or (eq project-prune-zombie-projects 'list-read) + (eq project-prune-zombie-projects 'all))) + (project-forget-zombie-projects nil 'no-message))) (defun project--write-project-list () "Save `project--list' in `project-list-file'." @@ -1903,7 +1929,11 @@ project--write-project-list (expand-file-name name))))) project--list) (current-buffer))) - (write-region nil nil filename nil 'silent)))) + (write-region nil nil filename nil 'silent))) + (when (and (consp project--list) + (or (eq project-prune-zombie-projects 'list-write) + (eq project-prune-zombie-projects 'all))) + (project-forget-zombie-projects nil 'no-message))) (defun project--remember-dir (root &optional no-write) "Add project root ROOT to the front of the project list. @@ -1933,26 +1963,27 @@ project-remember-project project-list-exclude) (project--remember-dir root no-write)))) -(defun project--remove-from-project-list (project-root report-message) +(defun project--remove-from-project-list (project-root report-message &optional no-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 NO-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) + (unless no-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 "Project `%s' removed from known projects" no-message)) (defvar project--dir-history) @@ -2117,12 +2148,17 @@ project-remember-projects-under count) count)) count)) -(defun project-forget-zombie-projects () - "Forget all known projects that don't exist any more." - (interactive) +(defun project-forget-zombie-projects (&optional no-remote no-message) + "Forget all known projects that don't exist any more. +If NO-REMOTE is non-nil, don't forget remote projects. +If NO-MESSAGE is non-nil, don't display a message about projects removed." + (interactive "P") (dolist (proj (project-known-project-roots)) - (unless (file-exists-p proj) - (project-forget-project proj)))) + (unless (or (and no-remote (file-exists-p proj) (not (file-remote-p proj))) + (and project-dont-prune-remote-zombie-projects + (file-exists-p proj) (not (file-remote-p proj))) + (file-exists-p 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 I don't have a remote project so I can't test it. > 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. I've added them and also an `all' option which mix `list-read' and `list-write'. > 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. I've added it as an additional optional argument. -- - E.G via GNU Emacs and Org. --=-=-=-- From unknown Sun Jun 15 09:01:26 2025 X-Loop: help-debbugs@gnu.org Subject: bug#77566: [PATCH] Add option for automatically delete non-existent projects. Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 07 Apr 2025 06:42:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 77566 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Elijah Gabe =?UTF-8?Q?P=C3=A9rez?= Cc: dmitry@gutov.dev, 77566@debbugs.gnu.org, Ship Mints , Sean Whitton Received: via spool by 77566-submit@debbugs.gnu.org id=B77566.174400812123366 (code B ref 77566); Mon, 07 Apr 2025 06:42:02 +0000 Received: (at 77566) by debbugs.gnu.org; 7 Apr 2025 06:42:01 +0000 Received: from localhost ([127.0.0.1]:51903 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u1gBE-00064k-MV for submit@debbugs.gnu.org; Mon, 07 Apr 2025 02:42:01 -0400 Received: from relay3-d.mail.gandi.net ([2001:4b98:dc4:8::223]:41849) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u1gBB-00063u-SM for 77566@debbugs.gnu.org; Mon, 07 Apr 2025 02:41:58 -0400 Received: by mail.gandi.net (Postfix) with ESMTPSA id CDDF02047E; Mon, 7 Apr 2025 06:41:48 +0000 (UTC) From: Juri Linkov In-Reply-To: <87zfgseren.fsf@gmail.com> Organization: LINKOV.NET References: <87jz7y2mn3.fsf@gmail.com> <87jz7ynndw.fsf@melete.silentflame.com> <87frim2jt0.fsf@gmail.com> <875xji2hnw.fsf@gmail.com> <87zfgseren.fsf@gmail.com> Date: Mon, 07 Apr 2025 09:40:40 +0300 Message-ID: <87y0wcjwyf.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-GND-State: clean X-GND-Score: -100 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdduleelgeekucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuifetpfffkfdpucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvfevufgjohhffffkfgggtgesthdtredttdertdenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucggtffrrghtthgvrhhnpeffgeetfeevlefhleejfeeuheeiudeitdffhfdutdekfeffgffhveehteegueekheenucfkphepledurdduvdelrddutdehrdduudejnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepledurdduvdelrddutdehrdduudejpdhhvghlohepmhgrihhlrdhgrghnughirdhnvghtpdhmrghilhhfrhhomhepjhhurhhisehlihhnkhhovhdrnhgvthdpnhgspghrtghpthhtohephedprhgtphhtthhopehsphifhhhithhtohhnsehsphifhhhithhtohhnrdhnrghmvgdprhgtphhtthhopeejjeehieeiseguvggssghughhsrdhgnhhurdhorhhgpdhrtghpthhtohepughmihhtrhihsehguhhtohhvrdguvghvpdhrtghpthhtohepshhhihhpmhhinhhtshesghhmrghilhdrtghomhdprhgtphhtthhopegvgheigedvieduieesghhmrghilhdrtghomh X-GND-Sasl: juri@linkov.net X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > +(defcustom project-dont-prune-remote-zombie-projects nil > + "If non-nil, remote files will no be pruned by `project-forget-zombie-projects'." > + :type 'boolean > + :version "31.1" > + :group 'project) Maybe it's possible to do with one option like there is remote-ignoring 'recentf-keep-default-predicate' in the default value of 'recentf-keep'. > I don't have a remote project so I can't test it. 'sudo' counts as a remote project too. So you can just type 'C-x x @' and the current project will be added as remote. From unknown Sun Jun 15 09:01:26 2025 X-Loop: help-debbugs@gnu.org Subject: bug#77566: [PATCH] Add option for automatically delete non-existent projects. Resent-From: Ship Mints Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 07 Apr 2025 13:21:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 77566 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Juri Linkov Cc: dmitry@gutov.dev, Elijah Gabe =?UTF-8?Q?P=C3=A9rez?= , 77566@debbugs.gnu.org, Sean Whitton Received: via spool by 77566-submit@debbugs.gnu.org id=B77566.174403201317683 (code B ref 77566); Mon, 07 Apr 2025 13:21:01 +0000 Received: (at 77566) by debbugs.gnu.org; 7 Apr 2025 13:20:13 +0000 Received: from localhost ([127.0.0.1]:53384 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u1mOa-0004b5-UW for submit@debbugs.gnu.org; Mon, 07 Apr 2025 09:20:13 -0400 Received: from mail-vk1-xa2c.google.com ([2607:f8b0:4864:20::a2c]:58786) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1u1mOY-0004VS-Ak for 77566@debbugs.gnu.org; Mon, 07 Apr 2025 09:20:10 -0400 Received: by mail-vk1-xa2c.google.com with SMTP id 71dfb90a1353d-52446b21cfdso1868963e0c.1 for <77566@debbugs.gnu.org>; Mon, 07 Apr 2025 06:20:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1744032004; x=1744636804; 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=9DH5SxQ0tTGI81hEk35iONWhp7DsU8enuRdbBkgB8s0=; b=K45jyKqjS5FKqziPgXRJPqW28Xr1+doqgM2rXf7Ta36uIXtBGa1UjYfH52Mbra8SJW fmwSPTQVxqq1CWQgx6c92z1IVEZXLe7tDfY7CCcfdV9VF9LFrkFPevyZIHKaLAra5Cqn vR527nv3QuVRAvlRSaliYjE9Z974P8DAU7Er7XZAHNkBMj9vlBEop52M3MwM7oKK8njh d9XfEzMMinMGDCiWHlyQIT2G3zIMG2pVL49kz4RmyzlS7PrsNM/Bjm58jPKP4pkofmcc SpryZVP5TxjUeICHfELKh0NAa2FYv94IYEJo8w9z8b/ibD3b0Jfi2sVaVWkMCaSAplrD 88Ag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744032004; x=1744636804; 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=9DH5SxQ0tTGI81hEk35iONWhp7DsU8enuRdbBkgB8s0=; b=cFKoRGWbMMA2/Qlt8P9H/m83741SKzilEzpk9zJyBZKFi4cOmT8T3MH/BExddjW/xt pHs71n71c9Tv3LeRxrVfkVYx4fwr8Z3m4z6lfK4z0pDJtUiDq5Kb7iAFd+aCVS6m8VyF xd6p8XVy6dSkQxn+zA1Jv6HboVX0I5LZjIprR4A9NYsW8hbsij4Awea4VbucLWOEPxRC /3EBQwmX449nzz8N8KHHznTZdiPHog3sUyOR8WHi92lbGOiVfCZ+cio5+PlbTjpgzU14 UG0E7hwwwYaN6UtS09TqQEjIEcRtmr4SusbuOE8RXhB1iwEgzEi3oT97OT9LLBZmBqop u7ug== X-Forwarded-Encrypted: i=1; AJvYcCUCiKkm1BQM53Owi8BUImb1di4gstc4nlQ1VIg3qPsChM7WqUJ5/yklsZepu5ytntNrUgkxgA==@debbugs.gnu.org X-Gm-Message-State: AOJu0Yxd1+++HGb4Per4ryXxwgX6FaldShRW9duZ13ibdvszzIzZwt/R GHsRhdnLplNYWBYLg/TIKpP+g6iyYL1Luexg6JWpdNSSJntnQnqBgaj15u/3n0/Pk89Su7BEArs MMw93o2SChjHo/6LaxHVFMdroRkA= X-Gm-Gg: ASbGncvONeS39ul5fFG9qHe2yUgD2qY/fB4KkYUlbvS34iNsXxz7X9LjryMrlLcwirn 7hriWLYbF589UucAijtrK109/7YToJMcV87AqD9kDKUeBMNJ2Y546zfeaYno/zIrNJ83ysYtf8y qiYIf5CLangmpZrEvTbru5ADlwMw== X-Google-Smtp-Source: AGHT+IHp9PjfHUN0q47Shp2XO5sk9kFTfznFKKf66Xx98jsICXS1ycE6BgRkGEWD9YHzL8/q66DoPGldVLveS+LT0Fw= X-Received: by 2002:a05:6122:2207:b0:520:3536:feb5 with SMTP id 71dfb90a1353d-52765da6a79mr7986408e0c.11.1744032004306; Mon, 07 Apr 2025 06:20:04 -0700 (PDT) MIME-Version: 1.0 References: <87jz7y2mn3.fsf@gmail.com> <87jz7ynndw.fsf@melete.silentflame.com> <87frim2jt0.fsf@gmail.com> <875xji2hnw.fsf@gmail.com> <87zfgseren.fsf@gmail.com> <87y0wcjwyf.fsf@mail.linkov.net> In-Reply-To: <87y0wcjwyf.fsf@mail.linkov.net> From: Ship Mints Date: Mon, 7 Apr 2025 09:19:53 -0400 X-Gm-Features: ATxdqUEVdHMqNXJUKHWzmiHoQ49lI3tnCIFDpWe9hBlKK9HPgbg-yeFagCY4rfQ Message-ID: Content-Type: multipart/alternative; boundary="00000000000017fbdd0632301899" X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --00000000000017fbdd0632301899 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Apr 7, 2025 at 2:41=E2=80=AFAM Juri Linkov wrote: > > +(defcustom project-dont-prune-remote-zombie-projects nil > > + "If non-nil, remote files will no be pruned by > `project-forget-zombie-projects'." > > + :type 'boolean > > + :version "31.1" > > + :group 'project) > > Maybe it's possible to do with one option like there is > remote-ignoring 'recentf-keep-default-predicate' > in the default value of 'recentf-keep'. > > > I don't have a remote project so I can't test it. > > 'sudo' counts as a remote project too. > So you can just type 'C-x x @' and the current project > will be added as remote. > Indeed, and you can also open a local project via ssh to get the same thing if you want to test other remote methods. I think this is backwards + (unless (or (and no-remote (file-exists-p proj) (not (file-remote-p proj))) and should be + (unless (or (and no-remote (not (file-remote-p proj) (file-exists-p proj))) to avoid the cost of a remote file-exists-p. --00000000000017fbdd0632301899 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
= On Mon, Apr 7, 2025 at 2:41=E2=80=AFAM Juri Linkov <juri@linkov.net> wrote:
> +(defcustom project-dont-prune-remote-zombie-projects ni= l
> +=C2=A0 "If non-nil, remote files will no be pruned by `project-f= orget-zombie-projects'."
> +=C2=A0 :type 'boolean
> +=C2=A0 :version "31.1"
> +=C2=A0 :group 'project)

Maybe it's possible to do with one option like there is
remote-ignoring 'recentf-keep-default-predicate'
in the default value of 'recentf-keep'.

> I don't have a remote project so I can't test it.

'sudo' counts as a remote project too.
So you can just type 'C-x x @' and the current project
will be added as remote.

Indeed, and you can also open a l= ocal project via ssh to get the same thing if you want to test other remote= methods.

I t= hink this is backwards

+ =C2=A0 =C2=A0(unless (or (and no-remote (file-exists-p proj) (n= ot (file-remote-p proj)))

and should be

+ =C2=A0 =C2=A0(unless (or (and = no-remote (not (file-remote-p proj) (file-exists-p proj)))

to avoid the cost= of a remote file-exists-p.

--00000000000017fbdd0632301899-- From unknown Sun Jun 15 09:01:26 2025 X-Loop: help-debbugs@gnu.org Subject: bug#77566: [PATCH] Add option for automatically delete non-existent projects. Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 07 Apr 2025 17:36:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 77566 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Sean Whitton , Elijah Gabe =?UTF-8?Q?P=C3=A9rez?= Cc: 77566@debbugs.gnu.org Received: via spool by 77566-submit@debbugs.gnu.org id=B77566.17440473061917 (code B ref 77566); Mon, 07 Apr 2025 17:36:02 +0000 Received: (at 77566) by debbugs.gnu.org; 7 Apr 2025 17:35:06 +0000 Received: from localhost ([127.0.0.1]:56702 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u1qNF-0000UY-RF for submit@debbugs.gnu.org; Mon, 07 Apr 2025 13:35:06 -0400 Received: from fhigh-b2-smtp.messagingengine.com ([202.12.124.153]:59371) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u1qNC-0000Rk-Rf for 77566@debbugs.gnu.org; Mon, 07 Apr 2025 13:35:04 -0400 Received: from phl-compute-02.internal (phl-compute-02.phl.internal [10.202.2.42]) by mailfhigh.stl.internal (Postfix) with ESMTP id EAC13254009E; Mon, 7 Apr 2025 13:34:56 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-02.internal (MEProxy); Mon, 07 Apr 2025 13:34:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1744047296; x=1744133696; bh=WlRoNUFL80BR/+J1R+aKtBq4NzSdGIB0tWcCGiGHshA=; b= STdGXsIZ8KnzbbyCVDQce2ld/BxzESdE2DGcn5wyUogW9p9aRQuslLdSxspJPWdd xdljB65TlrBpgwtUSwtBLOlj67PhpZoQcQxDv/PBdIAk8qpXQr3rjDExVj0lAo39 rpEE6ritjlyz79IRXcac3ap/bueVT5bjPek/XWqMjZXBJA0VVv0vcdRidqPCkuDQ zEURzBiV3fP3+DqkcruT/sZygSItZUPFMmndCo76p7S0ecUx8ECX/p4ifo50yJBO DDrD4hV24wPZEiiRUoAYoS6VdO3N4Ro0DfaFtyzzCd+04vxdsvk6Adxc/Nz9ISI7 3vpJQgQWj4LVkWnpOS8e/A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1744047296; x= 1744133696; bh=WlRoNUFL80BR/+J1R+aKtBq4NzSdGIB0tWcCGiGHshA=; b=T Bjx2hwOJpE/Z6LmH07RbolL/ET4dtUcCthB6rZcmN9cFHPTHaEhnwUYHYkVjzh3f pGVmls4dhLzAOHJc57KsyxX/x1IzEnEYt1bi13LjIr8Zn0V9anEZ2tgidWlVEdgw q3Ttkq0B69+II7BlJ/LMkBD7Ifks1h6cyI43Nekq/KLSTUvaJDPy9WAavGQ90kgx 758hJciJFt/wEEpfx8HnfG1ucSkLLvyLvDLMCU2lAUcc+3kVd5b+jhPa4Gjx2BwJ sfPvn+zaZw2gkut5IdZ0e3srhfMHMszsU2PR2+w6FUUWPP8vOB8gq1wXZqVKDazr eXPaue8HYZgoZXEDLK+0w== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddvtddtkeduucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggv pdfurfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpih gvnhhtshculddquddttddmnecujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddt vdejnecuhfhrohhmpeffmhhithhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovh druggvvheqnecuggftrfgrthhtvghrnhepteduleejgeehtefgheegjeekueehvdevieek ueeftddvtdevfefhvdevgedujeehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrg hmpehmrghilhhfrhhomhepughmihhtrhihsehguhhtohhvrdguvghvpdhnsggprhgtphht thhopeefpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopehsphifhhhithhtohhnse hsphifhhhithhtohhnrdhnrghmvgdprhgtphhtthhopegvgheigedvieduieesghhmrghi lhdrtghomhdprhgtphhtthhopeejjeehieeiseguvggssghughhsrdhgnhhurdhorhhg X-ME-Proxy: Feedback-ID: i07de48aa:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 7 Apr 2025 13:34:54 -0400 (EDT) Message-ID: <3f8dc4f0-81ce-4343-9351-4fede1516825@gutov.dev> Date: Mon, 7 Apr 2025 20:34:50 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird References: <87jz7y2mn3.fsf@gmail.com> <87jz7ynndw.fsf@melete.silentflame.com> Content-Language: en-US From: Dmitry Gutov In-Reply-To: <87jz7ynndw.fsf@melete.silentflame.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) On 06/04/2025 03:29, Sean Whitton wrote: > Thanks, though why do this only when switching projects? > Why not do it proactively whenever fetching the list of projects? > Performance concerns? I'm concerned about performance, yes. With my SSD, it takes about 4ms to "clean up" ~70 projects. The number could be higher, and the hard drive could be spinning media. So could someone point out what will we get by proactively cleaning up the list, rather than doing that only when a project is being prompted for? From unknown Sun Jun 15 09:01:26 2025 X-Loop: help-debbugs@gnu.org Subject: bug#77566: [PATCH] Add option for automatically delete non-existent projects. Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 07 Apr 2025 17:37:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 77566 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Elijah Gabe =?UTF-8?Q?P=C3=A9rez?= , Ship Mints Cc: 77566@debbugs.gnu.org, Sean Whitton Received: via spool by 77566-submit@debbugs.gnu.org id=B77566.17440473852449 (code B ref 77566); Mon, 07 Apr 2025 17:37:01 +0000 Received: (at 77566) by debbugs.gnu.org; 7 Apr 2025 17:36:25 +0000 Received: from localhost ([127.0.0.1]:56711 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u1qOX-0000dQ-1v for submit@debbugs.gnu.org; Mon, 07 Apr 2025 13:36:25 -0400 Received: from fhigh-b2-smtp.messagingengine.com ([202.12.124.153]:38251) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u1qOV-0000cu-9d for 77566@debbugs.gnu.org; Mon, 07 Apr 2025 13:36:23 -0400 Received: from phl-compute-04.internal (phl-compute-04.phl.internal [10.202.2.44]) by mailfhigh.stl.internal (Postfix) with ESMTP id D052A25400A4; Mon, 7 Apr 2025 13:36:17 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-04.internal (MEProxy); Mon, 07 Apr 2025 13:36:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1744047377; x=1744133777; bh=gyo8M6MsLCjIU7arJSmSMHwCexy9KApsrWWTtycJaDc=; b= kCBaJKaDdxI+r+shkDfCKK6nhTAibv2EOjqoHd6F33umNB2aDeWeSY0ZSmzfkmpY CNetSxdB2QX4XP6EDEOj248X7zL/iUI8+3UpzhpGE0Z3etmrnvsfy0wZtl+PENqA i0uaMCn9d7qQgZU1EOIyFclQcuxO48xgh8ytufVSNv75+ezXimiPiql6tskUg98A Rez2DZJjZfYiI7zpHpPz0hcV8ec5xIhgoS0YiN69yunaZHpp1xWZQYOuQfapDdOn 88Rt+kDKPCexXCuiUoXA42svDpJCuuF4S0D/ql1A+5KkYFWWBcq5bq12MrnBufnn EBLwBYIuYt4VdUwDwe9/gg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1744047377; x= 1744133777; bh=gyo8M6MsLCjIU7arJSmSMHwCexy9KApsrWWTtycJaDc=; b=B rtL1UrO36DyVk5wOqnIGXu5rlOhgIjqGpTd+V/XpahRNc8KiR7ujvxZFgbb+A8BU DqdZXv4FvGRK0CQuNiT5IlHydgBRaZG5PukPbBRLL8k0jDvbEzD6R7XDxrYEZlt7 lyK3p9QQGnWUmo6t4jtqF5eo1yLXc0RZdy/BogKSD9/0E4xXvu28wKeqiVaRVCau e4oqEkvYjIEppARXKraNhLmVM+uq4QH1CskZrpbki4C6j4SzNOP+9iczSTM/sUFT KyAGBwmuW2hGBRa6qClqgEqEr1hCDKvfr+bDyIC1PimJuoeyA0Fp+J34sTJhrV9P RRBqEwmc1yfyyl21g3bxg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddvtddtkedtucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggv pdfurfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpih gvnhhtshculddquddttddmnecujfgurhepkfffgggfuffvvehfhfgjtgfgsehtkeertddt vdejnecuhfhrohhmpeffmhhithhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovh druggvvheqnecuggftrfgrthhtvghrnhepgeelfeetkefghfdvhfdtgeevveevteetgeet veegtedthefhudekteehffeukeeknecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrg hmpehmrghilhhfrhhomhepughmihhtrhihsehguhhtohhvrdguvghvpdhnsggprhgtphht thhopeegpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopegvgheigedvieduieesgh hmrghilhdrtghomhdprhgtphhtthhopehshhhiphhmihhnthhssehgmhgrihhlrdgtohhm pdhrtghpthhtohepjeejheeiieesuggvsggsuhhgshdrghhnuhdrohhrghdprhgtphhtth hopehsphifhhhithhtohhnsehsphifhhhithhtohhnrdhnrghmvg X-ME-Proxy: Feedback-ID: i07de48aa:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 7 Apr 2025 13:36:15 -0400 (EDT) Message-ID: <43b3792c-d917-4be6-b9bf-7fb1f8184a81@gutov.dev> Date: Mon, 7 Apr 2025 20:36:11 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird References: <87jz7y2mn3.fsf@gmail.com> <87jz7ynndw.fsf@melete.silentflame.com> <87frim2jt0.fsf@gmail.com> <875xji2hnw.fsf@gmail.com> <87zfgseren.fsf@gmail.com> Content-Language: en-US From: Dmitry Gutov In-Reply-To: <87zfgseren.fsf@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) On 07/04/2025 03:39, Elijah Gabe Pérez wrote: > +(defcustom project-prune-zombie-projects nil > + "Automatically remove from project list projects that were deleted. > +If set to `all', remove projects when project list file > +is being read or written. > +If set to `list-read', only remove projects when project list file > +is being read. > +If set to `list-write', only remove projects when project list file is > +being written. That's a lot of alternatives. Do we have a picture of the users who would use each of the values? And speaking of remote projects, maybe we should add a prefix argument to project-forget-zombie-projects instead of an option. From unknown Sun Jun 15 09:01:26 2025 X-Loop: help-debbugs@gnu.org Subject: bug#77566: [PATCH] Add option for automatically delete non-existent projects. Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 07 Apr 2025 17:41:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 77566 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Ship Mints , Elijah Gabe =?UTF-8?Q?P=C3=A9rez?= Cc: 77566@debbugs.gnu.org, Sean Whitton Received: via spool by 77566-submit@debbugs.gnu.org id=B77566.17440476263713 (code B ref 77566); Mon, 07 Apr 2025 17:41:01 +0000 Received: (at 77566) by debbugs.gnu.org; 7 Apr 2025 17:40:26 +0000 Received: from localhost ([127.0.0.1]:56720 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u1qSQ-0000xp-2a for submit@debbugs.gnu.org; Mon, 07 Apr 2025 13:40:26 -0400 Received: from fout-b2-smtp.messagingengine.com ([202.12.124.145]:46483) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u1qSM-0000xD-Pe for 77566@debbugs.gnu.org; Mon, 07 Apr 2025 13:40:23 -0400 Received: from phl-compute-02.internal (phl-compute-02.phl.internal [10.202.2.42]) by mailfout.stl.internal (Postfix) with ESMTP id 3A1C2114013D; Mon, 7 Apr 2025 13:40:17 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-02.internal (MEProxy); Mon, 07 Apr 2025 13:40:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1744047617; x=1744134017; bh=T1520tsMRIILTHjNZMamVq01HO/QXGZ+ckc75D7Untg=; b= jTBivHaGE0yzsZBP/T2UaoH0CaSh4FDowmOgfR6RGcsc7fQDJUsac6fArI2HCS7Q Hl4pOcyXJWxF7WIc9AQDsMWBZ+fR2OZAwWVE8W4cjEWMqhNR6gVzDD8BdZH27WHf +t51jfTY0ynFMxe7ExsllBQVeslU1T5cPe12ksYxVKRYefxS/Ins9F724npmZ/0Z HSx48sKUJLd7V9+6Jr+j3FdDovIbHYf4zD2huktJDE3aUrE60tolwLvekJZD/PKt GOyMA/vzaEppTeJ9k4Kwip4FFXd62KIKnbAllKECmgJYy1aRLUeuCdAzTDPzfThR PeHZFKVMAcNy0/pJ6gLsgQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1744047617; x= 1744134017; bh=T1520tsMRIILTHjNZMamVq01HO/QXGZ+ckc75D7Untg=; b=U 26dg3YOtlw+4WH1HQ8ekM/eK5e43SdEyia3PSUZBxb3aigXFhAeNkVAJNJs8qZRR YEeSxZrZCDDAXzUP5mRSPauaOA5z7wkdzR5+WiMhFG6LoGomL804SIHglyvNivtF vjapKHltsVrafSzi7xL3qR5rEbtn30I/zurLK/SjJC51RkzTTQTjIHtK1+el8F/a PmaknsugIqBD/dADKyQpGCL2xYNlFw9E+4Xa+3tSmr+u4nEXNmW0h4SMSaoh+gAl jM5gjXR4oYT6KNBmrrnqdjTPsPcckQDnSlB2rPaY1pt0LvnopPQkZHy67yJzA6Cj eb9ijQnSPteiuQ2om4Nvw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddvtddtkeduucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggv pdfurfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpih gvnhhtshculddquddttddmnecujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddt vdejnecuhfhrohhmpeffmhhithhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovh druggvvheqnecuggftrfgrthhtvghrnhepteduleejgeehtefgheegjeekueehvdevieek ueeftddvtdevfefhvdevgedujeehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrg hmpehmrghilhhfrhhomhepughmihhtrhihsehguhhtohhvrdguvghvpdhnsggprhgtphht thhopeegpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopehshhhiphhmihhnthhsse hgmhgrihhlrdgtohhmpdhrtghpthhtohepvghgieegvdeiudeisehgmhgrihhlrdgtohhm pdhrtghpthhtohepjeejheeiieesuggvsggsuhhgshdrghhnuhdrohhrghdprhgtphhtth hopehsphifhhhithhtohhnsehsphifhhhithhtohhnrdhnrghmvg X-ME-Proxy: Feedback-ID: i07de48aa:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 7 Apr 2025 13:40:15 -0400 (EDT) Message-ID: <999a66ed-498d-4e7b-99d4-d38723a88565@gutov.dev> Date: Mon, 7 Apr 2025 20:40:12 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird References: <87jz7y2mn3.fsf@gmail.com> <87jz7ynndw.fsf@melete.silentflame.com> <87frim2jt0.fsf@gmail.com> <875xji2hnw.fsf@gmail.com> Content-Language: en-US From: Dmitry Gutov In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) On 06/04/2025 14:26, Ship Mints wrote: > 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. Speaking of remote projects, even when a connection is available, checking all of the projects for existence might create a large latency, simply because of the lag to the remote host. So I'm not sure what's the best approach here. Though we could just add the option as off by default and say that if you turned it on, you accept the consequences. From unknown Sun Jun 15 09:01:26 2025 X-Loop: help-debbugs@gnu.org Subject: bug#77566: [PATCH] Add option for automatically delete non-existent projects. Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 07 Apr 2025 18:36:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 77566 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Dmitry Gutov Cc: Elijah Gabe =?UTF-8?Q?P=C3=A9rez?= , 77566@debbugs.gnu.org, Ship Mints , Sean Whitton Received: via spool by 77566-submit@debbugs.gnu.org id=B77566.174405095720546 (code B ref 77566); Mon, 07 Apr 2025 18:36:01 +0000 Received: (at 77566) by debbugs.gnu.org; 7 Apr 2025 18:35:57 +0000 Received: from localhost ([127.0.0.1]:56868 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u1rK9-0005LI-7h for submit@debbugs.gnu.org; Mon, 07 Apr 2025 14:35:57 -0400 Received: from relay6-d.mail.gandi.net ([217.70.183.198]:59277) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u1rK6-0005Kk-Cr for 77566@debbugs.gnu.org; Mon, 07 Apr 2025 14:35:55 -0400 Received: by mail.gandi.net (Postfix) with ESMTPSA id 8DE1C4424C; Mon, 7 Apr 2025 18:35:43 +0000 (UTC) From: Juri Linkov In-Reply-To: <43b3792c-d917-4be6-b9bf-7fb1f8184a81@gutov.dev> Organization: LINKOV.NET References: <87jz7y2mn3.fsf@gmail.com> <87jz7ynndw.fsf@melete.silentflame.com> <87frim2jt0.fsf@gmail.com> <875xji2hnw.fsf@gmail.com> <87zfgseren.fsf@gmail.com> <43b3792c-d917-4be6-b9bf-7fb1f8184a81@gutov.dev> Date: Mon, 07 Apr 2025 21:33:31 +0300 Message-ID: <87plhnq0sk.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-GND-State: clean X-GND-Score: -100 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddvtddtledvucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuifetpfffkfdpucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvfevufgjohhffffkfgggtgesthdtredttdertdenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucggtffrrghtthgvrhhnpeffgeetfeevlefhleejfeeuheeiudeitdffhfdutdekfeffgffhveehteegueekheenucfkphepledurdduvdelrddutdehrdduudejnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepledurdduvdelrddutdehrdduudejpdhhvghlohepmhgrihhlrdhgrghnughirdhnvghtpdhmrghilhhfrhhomhepjhhurhhisehlihhnkhhovhdrnhgvthdpnhgspghrtghpthhtohephedprhgtphhtthhopehsphifhhhithhtohhnsehsphifhhhithhtohhnrdhnrghmvgdprhgtphhtthhopeejjeehieeiseguvggssghughhsrdhgnhhurdhorhhgpdhrtghpthhtohepshhhihhpmhhinhhtshesghhmrghilhdrtghomhdprhgtphhtthhopegvgheigedvieduieesghhmrghilhdrtghomhdprhgtphhtthhopegumhhithhrhiesghhuthhovhdruggvvh X-GND-Sasl: juri@linkov.net X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) >> +(defcustom project-prune-zombie-projects nil >> + "Automatically remove from project list projects that were deleted. >> +If set to `all', remove projects when project list file >> +is being read or written. >> +If set to `list-read', only remove projects when project list file >> +is being read. >> +If set to `list-write', only remove projects when project list file is >> +being written. > > That's a lot of alternatives. Do we have a picture of the users who would > use each of the values? Instead of desperately cleaning zombies that are popping up again and again, I'd prefer an option with a list of directories that should be never added to the project list. Or maybe improve 'project-forget-projects-under' to remember what projects it forgot to not add them again, e.g. by a new property in ~/.emacs.d/projects file: (("/dir1" (forgotten . t)) ...) From unknown Sun Jun 15 09:01:26 2025 X-Loop: help-debbugs@gnu.org Subject: bug#77566: [PATCH] Add option for automatically delete non-existent projects. Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 07 Apr 2025 21:50:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 77566 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Juri Linkov Cc: Elijah Gabe =?UTF-8?Q?P=C3=A9rez?= , 77566@debbugs.gnu.org, Ship Mints , Sean Whitton Received: via spool by 77566-submit@debbugs.gnu.org id=B77566.174406254913457 (code B ref 77566); Mon, 07 Apr 2025 21:50:02 +0000 Received: (at 77566) by debbugs.gnu.org; 7 Apr 2025 21:49:09 +0000 Received: from localhost ([127.0.0.1]:57305 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u1uL7-0003Uz-7e for submit@debbugs.gnu.org; Mon, 07 Apr 2025 17:49:09 -0400 Received: from fout-b4-smtp.messagingengine.com ([202.12.124.147]:37509) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u1uL4-0003UC-VX for 77566@debbugs.gnu.org; Mon, 07 Apr 2025 17:49:07 -0400 Received: from phl-compute-10.internal (phl-compute-10.phl.internal [10.202.2.50]) by mailfout.stl.internal (Postfix) with ESMTP id A09DB114019D; Mon, 7 Apr 2025 17:48:59 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-10.internal (MEProxy); Mon, 07 Apr 2025 17:48:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1744062539; x=1744148939; bh=pvz2JcLp1517giw82iiasbpsjlqtUz987pIjCcZKEZo=; b= FNqYr+gh5jR4f/hwtcJaK6g+qPpfFbUZuOUmyiJ4wwYVl/NXoZsoLpYrN8T4TGk7 c6ugr3HDhtm+vG9MptzxP55ziHw6phPP2CuPFLpKy3Yv7xYlre+cblvcgl8DD8WD YtBPGy3Jnh+sP8leCzVcNQUc327G0Obtxq4yRgWsT2fuJHLm8ufSW67B+9MRCSDx 4KiVASyZBO+7VyLr/QFDqUUCEedkuDWkOVyhgjnuOlc6+YG5y3kt7DNl6EZYMyYD QHrvvrmyuNiPdq5PrMS7x9ZuLat9SpgJZet4xBa2awZ0kTZ1pKRQSqAmNffv4LVZ aIFGd1KWSjDggVGCyFqedQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1744062539; x= 1744148939; bh=pvz2JcLp1517giw82iiasbpsjlqtUz987pIjCcZKEZo=; b=h /6+Kr4lVK8/liAxWF4Bj50M2ItUKkhbDZ7k4HVWvn5hPC1FF4LXO8eje5SzIcu3O pBLxpq5SfP7WiUnDzznnweklzLvHijBl1V7FXt9diALxMa7tWfSRWX69+3RVVUGm mx9Z4Oa2SGJF3Jx3cxjpqXDOm1HrkOeu5rQgNdG9flBxZCc9zfgu2OgVbLb6caXp foQzq9RR8dj76faOdk9xVHNKvrvJEyUQSUtTiqotY+d+0QGlCNLYkiVia6bt/YPG 4uJPkBl+l77f06TIp3C8GtPV2W0L0Bpv3Kxeu7bkPPGTMFgUzWFZdnuZZZdNPpTN pNMIhfR9eqosKLc80j4Sg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddvtddufeduucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggv pdfurfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpih gvnhhtshculddquddttddmnecujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddt vdejnecuhfhrohhmpeffmhhithhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovh druggvvheqnecuggftrfgrthhtvghrnhepteduleejgeehtefgheegjeekueehvdevieek ueeftddvtdevfefhvdevgedujeehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrg hmpehmrghilhhfrhhomhepughmihhtrhihsehguhhtohhvrdguvghvpdhnsggprhgtphht thhopeehpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopehjuhhriheslhhinhhkoh hvrdhnvghtpdhrtghpthhtohepvghgieegvdeiudeisehgmhgrihhlrdgtohhmpdhrtghp thhtohepshhhihhpmhhinhhtshesghhmrghilhdrtghomhdprhgtphhtthhopeejjeehie eiseguvggssghughhsrdhgnhhurdhorhhgpdhrtghpthhtohepshhpfihhihhtthhonhes shhpfihhihhtthhonhdrnhgrmhgv X-ME-Proxy: Feedback-ID: i07de48aa:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 7 Apr 2025 17:48:57 -0400 (EDT) Message-ID: <1cc09ffc-0c5c-4409-b74c-3b59a588e8d4@gutov.dev> Date: Tue, 8 Apr 2025 00:48:55 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird References: <87jz7y2mn3.fsf@gmail.com> <87jz7ynndw.fsf@melete.silentflame.com> <87frim2jt0.fsf@gmail.com> <875xji2hnw.fsf@gmail.com> <87zfgseren.fsf@gmail.com> <43b3792c-d917-4be6-b9bf-7fb1f8184a81@gutov.dev> <87plhnq0sk.fsf@mail.linkov.net> Content-Language: en-US From: Dmitry Gutov In-Reply-To: <87plhnq0sk.fsf@mail.linkov.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) On 07/04/2025 21:33, Juri Linkov wrote: > Instead of desperately cleaning zombies that are popping up again and again, > I'd prefer an option with a list of directories that should be never added > to the project list. I think we have that in the recently added option project-list-exclude. From unknown Sun Jun 15 09:01:26 2025 X-Loop: help-debbugs@gnu.org Subject: bug#77566: [PATCH] Add option for automatically delete non-existent projects. Resent-From: Elijah Gabe =?UTF-8?Q?P=C3=A9rez?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 08 Apr 2025 01:26:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 77566 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Dmitry Gutov Cc: 77566@debbugs.gnu.org, Sean Whitton Received: via spool by 77566-submit@debbugs.gnu.org id=B77566.174407555523598 (code B ref 77566); Tue, 08 Apr 2025 01:26:01 +0000 Received: (at 77566) by debbugs.gnu.org; 8 Apr 2025 01:25:55 +0000 Received: from localhost ([127.0.0.1]:57709 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u1xis-00068X-E1 for submit@debbugs.gnu.org; Mon, 07 Apr 2025 21:25:54 -0400 Received: from mail-qv1-xf41.google.com ([2607:f8b0:4864:20::f41]:60682) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1u1xip-000681-2s for 77566@debbugs.gnu.org; Mon, 07 Apr 2025 21:25:51 -0400 Received: by mail-qv1-xf41.google.com with SMTP id 6a1803df08f44-6eeb7589db4so52849406d6.1 for <77566@debbugs.gnu.org>; Mon, 07 Apr 2025 18:25:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1744075545; x=1744680345; 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=YD87dS95VUCM2xMSjhVztXGrnvznHl7tCk/S5m3HE40=; b=jJUTI79O8BvMnpYQl/bFsn7Ho/GPfUqP7LiZNyMH8Zo/S94d7yL+s4dFz5y8R1RyJW Vj79KzgdDjNFWqehY9cDvrvRkuYuTTEk187e/yiRMJeHFWTQLPcd8oiYRcxWPtIXCDov 1VyZ7M0O18Jmxz2GZGCHyPkdI8s9zXROCTc7Dnpz5btpNJhWXH0Cfc82ZhM1hKRdSoim hso+Vc8hKeHs07Cx9QTkbaUxn6o/OHdt4fSKH/2ENOJ579MFivg9repm/g/bs6hVxae5 KHorKz2VBpZHOqoiqV/UbXXXkg/r7XUCNeL0K2EXpanjIeAXzf8DX4H/FywMPqLapkIG FdBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744075545; x=1744680345; 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=YD87dS95VUCM2xMSjhVztXGrnvznHl7tCk/S5m3HE40=; b=k+RH4jNbxgVwMOZwiKC/LCp3RsKj6C3QcQnbT5xcnY2qDSYLEPf3hqZ1ISNlixYcj7 7nuaO+ACb83YEAeIGFCZxryp+RS+ML8sj8WtfshNpi7Vol6M41XBlfAzNoXzEplVWnnQ +yj/ztvBzdQArkDfZIVn6g33nymZpk4gHTuI08Uc6BU6YCr/dVWivTFDap5diVxS7Uat GWky2Li/nGQVxsq00i0B66C75yA+VU0ybgvW2TMRJ5KV0YIGiTnJLQpX8KWltsgHZGPg WlQaCVK+uFWfhnsynu9Beztr6mCoajf2D/A2q+lwXxVFxPWrVPJfj33r27NaCb/PZMHM ck6g== X-Forwarded-Encrypted: i=1; AJvYcCVNuYJxbqFzs5B/rwAiUE5D1mhZYcSPvkps91ZjxegqWawl3RizIKKhgdqoZEhOsxtESd57Hw==@debbugs.gnu.org X-Gm-Message-State: AOJu0YxrVBdpQ8KhWTszAaIiNaOjwVURjDLrZobibZgBI4hcKy388jBV oJV2ZHm7Tv1R2hP7rCOyiwfQuJrf9ldQrQTh5LoKmvfkOQQikhRH22PC+eH/KaaR03CFyY6sanz JRZ2q3HJSDuoxFu1EsiEOXFsh7iHErDjE X-Gm-Gg: ASbGncuayoXSGMIod8SSrLuUBam4qZmmgTEzveld1tHjLm83nRDbt8KUGraCu73ZKmR sLwbj1VybIWP5NQ0BDlmuSAi0SjX86lDBthKKV1J7IOoJ5FxUfneNIN8CwNLB1zUHDxq4ZKopMI 53EjZ5D1uDkIc8hv03N8UJHSD5+86RD8Jaurdbj1neSc/R8nrwki37Ng== X-Google-Smtp-Source: AGHT+IH5bVAmaUvwCOH/0cqqHYj989F2l5GmngM6wR2MG6d9ur22lQpQh3ZGwErS4tfCU91jPGWBS8bA52tfVUjU6TQ= X-Received: by 2002:ad4:4eaa:0:b0:6e8:feae:9291 with SMTP id 6a1803df08f44-6f0584c05d3mr191959706d6.24.1744075545240; Mon, 07 Apr 2025 18:25:45 -0700 (PDT) MIME-Version: 1.0 References: <87jz7y2mn3.fsf@gmail.com> <87jz7ynndw.fsf@melete.silentflame.com> <3f8dc4f0-81ce-4343-9351-4fede1516825@gutov.dev> In-Reply-To: <3f8dc4f0-81ce-4343-9351-4fede1516825@gutov.dev> From: Elijah Gabe =?UTF-8?Q?P=C3=A9rez?= Date: Mon, 7 Apr 2025 19:25:33 -0600 X-Gm-Features: ATxdqUGG7fVrzxnqDE7m942O0EqKuuluQaiQsc-M8XByAmCVSG4sfmqr6b7izn4 Message-ID: Content-Type: multipart/alternative; boundary="00000000000055ec9506323a3b29" X-Spam-Score: 0.3 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) --00000000000055ec9506323a3b29 Content-Type: text/plain; charset="UTF-8" Dmitry Gutov writes: > On 06/04/2025 03:29, Sean Whitton wrote: > > Thanks, though why do this only when switching projects? > > Why not do it proactively whenever fetching the list of projects? > > Performance concerns? > > I'm concerned about performance, yes. With my SSD, it takes about 4ms to > "clean up" ~70 projects. The number could be higher, and the hard drive > could be spinning media. > Yeah, that is why i originally added it only when switching projects, projectile does the same. So could someone point out what will we get by proactively cleaning up > the list, rather than doing that only when a project is being prompted for? Maybe for ensure that the zombies were removed? For example, packages that use project--list for read the projects. Instead what about purge it once after emacs startup? > --00000000000055ec9506323a3b29 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Dmitry Gutov <dmitry@gu= tov.dev> writes:
On 06/04/20= 25 03:29, Sean Whitton wrote:
> Thanks, though why do this only when switching projects?
> Why not do it proactively whenever fetching the list of projects?
> Performance concerns?

I'm concerned about performance, yes. With my SSD, it takes about 4ms t= o
"clean up" ~70 projects. The number could be higher, and the hard= drive
could be spinning media.

=
Yeah, that is why i originally added it only when s= witching projects, projectile does the same.

So could someone point out what will we get by proactively cleaning up
the list, rather than doing that only when a project is being prompted for?=

Mayb= e for ensure that the zombies were removed?

For example, packages that use project--list for read t= he projects.

Instead wha= t about purge it once after emacs startup?
--00000000000055ec9506323a3b29-- From unknown Sun Jun 15 09:01:26 2025 X-Loop: help-debbugs@gnu.org Subject: bug#77566: [PATCH] Add option for automatically delete non-existent projects. Resent-From: Elijah Gabe =?UTF-8?Q?P=C3=A9rez?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 08 Apr 2025 01:35:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 77566 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Dmitry Gutov Cc: 77566@debbugs.gnu.org, Ship Mints , Sean Whitton Received: via spool by 77566-submit@debbugs.gnu.org id=B77566.174407607325841 (code B ref 77566); Tue, 08 Apr 2025 01:35:01 +0000 Received: (at 77566) by debbugs.gnu.org; 8 Apr 2025 01:34:33 +0000 Received: from localhost ([127.0.0.1]:57730 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u1xrE-0006ih-Q0 for submit@debbugs.gnu.org; Mon, 07 Apr 2025 21:34:33 -0400 Received: from mail-qk1-x744.google.com ([2607:f8b0:4864:20::744]:51424) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1u1xrC-0006i9-1h for 77566@debbugs.gnu.org; Mon, 07 Apr 2025 21:34:30 -0400 Received: by mail-qk1-x744.google.com with SMTP id af79cd13be357-7c08fc20194so962129285a.2 for <77566@debbugs.gnu.org>; Mon, 07 Apr 2025 18:34:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1744076064; x=1744680864; 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=/ZPmYundOey57cj8+xtyvJohXngYi84MSpPdbdsgiPM=; b=WoMOTZzgawG9IArOxVgqPbwdsji/1CcIgsZnTo3ghb+lutE/rQPxe8Ryqf5TkirOuM C8qMzsk6E3rt0F0dSYcKHafLExlPRt/YwQwdc2V0a9UMhYPw/imeWyhqwRi76r7LgNJc lJ+4DGL/TPkGCi1pwf9aGGYilBYiQw33qi3KXISXRDvXgj3fDvtNUjPNHL8ym5yHbVD2 iqWWH/ZKkPGFqPvRcbEc67V1UC0J/UlACz94MUNXNpXzJq3N4gKpNSJ5aIcSORv49o46 nHUITYbMrVzA02G96TUoZ17oczHGS566ncJe7fM+UcKJBLwGzC/0aZHGVBDRKIcxFJx4 d3IA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744076064; x=1744680864; 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=/ZPmYundOey57cj8+xtyvJohXngYi84MSpPdbdsgiPM=; b=LxBPv58kE95UKrThUOrVpId3T86N6KsaIw/j40mWpSNwMG9lSPyh0C1O+4le85+Lbe +6vHl6zZHda2yus531Jyie2KhZeFG0P/5wpIPAfZ0b05kw5asspxPW5pgADNYYMacX4F aG/LayYRYRiQiH+WXJzk/8Ps8uTL8LkZNHj/ojukOK6w133h+vkV+0SkU5XAQL2W1+2H HM7zaqfLeAcBPfP2QEmoIYoPvH+mh3kN9cHI8nVI0usa2WcqQf6LTHHgK3cu6I9M2fAE TOa3zWXdPEBUxn/jyVm3ydUwCIx+viQys3ux/Ymg+RVCk0tSeDaPtxP2TSjfYdboff8g sVfA== X-Forwarded-Encrypted: i=1; AJvYcCVk9I+nGIThVhcBYG5XlZ2109Oi7VxehJiJHOJd854O2hEDbT/0dJrqkweQPDZ2+0JTXw5+Gw==@debbugs.gnu.org X-Gm-Message-State: AOJu0Ywq65gZ/60KwR/PoE+Wa4ECf4rmd+P/ZHqkg2mikyoPrDAi8udR 5o1TsAKVJ5Njiwkakz38+8DxvOpA5ckythel2aKdr6KXEbqEmTDXJOGuvtnIXEgQIgIIbwLwcxo 9LeVBo/D4OsVN9QuUgZ7r0UnlmlM= X-Gm-Gg: ASbGncvpCdkV59PGEOYbST7j94OY8n6c/Sk/PnLodELIL5aQwNtDBSwQe4O4tBAUFNW 3YXPlAayYaktDyhNTwGkj80NQpnKVtcndrckRS72nUfzg2wf87DioHNymUiMllMpTJAPobesEcK FvBZ2DKtZfAXiP/xP7fjFZFjpKIMXYw8OUR2490UneaEzFGwwiTfLtTA== X-Google-Smtp-Source: AGHT+IHLEKyAIWclAmjlxwJk/cywhK63t+m7e/HU/sqPgqg1V9F4c7z3UaORMqlkIKFtqsA7quowbUznHFvQ50+1FLI= X-Received: by 2002:ae9:e30a:0:b0:7c5:99a6:7883 with SMTP id af79cd13be357-7c774dfadbamr2436516685a.54.1744076064211; Mon, 07 Apr 2025 18:34:24 -0700 (PDT) MIME-Version: 1.0 References: <87jz7y2mn3.fsf@gmail.com> <87jz7ynndw.fsf@melete.silentflame.com> <87frim2jt0.fsf@gmail.com> <875xji2hnw.fsf@gmail.com> <87zfgseren.fsf@gmail.com> <43b3792c-d917-4be6-b9bf-7fb1f8184a81@gutov.dev> In-Reply-To: <43b3792c-d917-4be6-b9bf-7fb1f8184a81@gutov.dev> From: Elijah Gabe =?UTF-8?Q?P=C3=A9rez?= Date: Mon, 7 Apr 2025 19:34:12 -0600 X-Gm-Features: ATxdqUFfbFRAfVo1dyC9SFKhBRxID5arQ3bS2sUeDl1_Dyu9089aLDwl-RaWdf4 Message-ID: Content-Type: multipart/alternative; boundary="00000000000044c89006323a5a20" X-Spam-Score: 0.3 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) --00000000000044c89006323a5a20 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Dmitry Gutov writes: > On 07/04/2025 03:39, Elijah Gabe P=C3=A9rez wrote: > > +(defcustom project-prune-zombie-projects nil > > + "Automatically remove from project list projects that were deleted. > > +If set to `all', remove projects when project list file > > +is being read or written. > > +If set to `list-read', only remove projects when project list file > > +is being read. > > +If set to `list-write', only remove projects when project list file is > > +being written. > > That's a lot of alternatives. Do we have a picture of the users who > would use each of the values? > AFAIK, no, I would honestly prefer just a booelan, this can be confused. And speaking of remote projects, maybe we should add a prefix argument > to project-forget-zombie-projects instead of an option. > The patch already provides this, should the option be removed?: @@ -2117,12 +2148,17 @@ project-remember-projects-under count) count)) count)) -(defun project-forget-zombie-projects () - "Forget all known projects that don't exist any more." - (interactive) +(defun project-forget-zombie-projects (&optional no-remote no-message) + "Forget all known projects that don't exist any more. +If NO-REMOTE is non-nil, don't forget remote projects. +If NO-MESSAGE is non-nil, don't display a message about projects removed." + (interactive "P") (dolist (proj (project-known-project-roots)) - (unless (file-exists-p proj) - (project-forget-project proj)))) + (unless (or (and no-remote (file-exists-p proj) (not (file-remote-p proj))) + (and project-dont-prune-remote-zombie-projects + (file-exists-p proj) (not (file-remote-p proj))) + (file-exists-p proj)) + (project-forget-project proj no-message)))) > --00000000000044c89006323a5a20 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Dmitry Gutov <dmitry@gu= tov.dev> writes:
On 07/04/20= 25 03:39, Elijah Gabe P=C3=A9rez wrote:
> +(defcustom project-prune-zombie-projects nil
> +=C2=A0 "Automatically remove from project list projects that wer= e deleted.
> +If set to `all', remove projects when project list file
> +is being read or written.
> +If set to `list-read', only remove projects when project list fil= e
> +is being read.
> +If set to `list-write', only remove projects when project list fi= le is
> +being written.

That's a lot of alternatives. Do we have a picture of the users who would use each of the values?

AFAIK, no, I would honestly prefer just a booe= lan, this can be confused.

And speaking of remote projects, maybe we should add a prefix argument
to project-forget-zombie-projects instead of an option.

The patch already pr= ovides this, should the option be removed?:

@@ -2117,12 +2148,17 @@ project-remember-projects-under=
=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 count) count))
=C2=A0 =C2=A0 =C2=A0count))
=C2=A0
-(defun project-forget-zombie-projects ()
-=C2=A0 "Forget all known projects that don't exist any more.&quo= t;
-=C2=A0 (interactive)
+(de= fun project-forget-zombie-projects (&optional no-remote no-message)
+=C2=A0 "Forget all known projects that don't = exist any more.
+If NO-REMOTE is non-nil, don't = forget remote projects.
+If NO-MESSAGE is non-nil, d= on't display a message about projects removed."
+=C2=A0 (interactive "P")
=C2=A0 =C2= =A0(dolist (proj (project-known-project-roots))
-=C2= =A0 =C2=A0 (unless (file-exists-p proj)
-=C2=A0 =C2= =A0 =C2=A0 (project-forget-project proj))))
+=C2=A0 = =C2=A0 (unless (or (and no-remote (file-exists-p proj) (not (file-remote-p = proj)))
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 (and project-dont-prune-remote-zombie-projects
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0(file-exists-p proj) (not (file-remote-p proj)))
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (file-ex= ists-p proj))
+=C2=A0 =C2=A0 =C2=A0 (project-forget-= project proj no-message))))=C2=A0
--00000000000044c89006323a5a20-- From unknown Sun Jun 15 09:01:26 2025 X-Loop: help-debbugs@gnu.org Subject: bug#77566: [PATCH] Add option for automatically delete non-existent projects. Resent-From: Sean Whitton Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 08 Apr 2025 02:34:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 77566 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Dmitry Gutov Cc: Elijah Gabe =?UTF-8?Q?P=C3=A9rez?= , 77566@debbugs.gnu.org Received: via spool by 77566-submit@debbugs.gnu.org id=B77566.174407959510184 (code B ref 77566); Tue, 08 Apr 2025 02:34:01 +0000 Received: (at 77566) by debbugs.gnu.org; 8 Apr 2025 02:33:15 +0000 Received: from localhost ([127.0.0.1]:57843 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u1ym2-0002eC-JC for submit@debbugs.gnu.org; Mon, 07 Apr 2025 22:33:14 -0400 Received: from sendmail.purelymail.com ([34.202.193.197]:44476) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u1ylz-0002df-Lj for 77566@debbugs.gnu.org; Mon, 07 Apr 2025 22:33:12 -0400 DKIM-Signature: a=rsa-sha256; b=yrP3d8rUmUiDE4U9nZcDZfDdliwJEogss3N8zTDqyCYWq9g0wpNbhp1R7QCUYZcgGIUXcJNxy3XlPYWxJlzbDksgcMT1OqARML/EipLIktrgsIAYGkB46apr5GLjdZxkouxHDXS18AR54nh2M93D1TRCqJDL2+RAsnbLfZYM2kJwV/0AqJ5dsv+jgByx9rcJhI8upDr9DpbKZx829R3KMNEFTsGHjPWNWPu5xhVaQxUSSUHaBJPe1CYpl1cFln11kde8FxYLzNI70oRgglLmGrTQKhP8N8MbXb/sgdF+N9V47feW0aRWIxeGWSLd0A2qdK12ikOnxr9wV0kjnWejTg==; s=purelymail1; d=spwhitton.name; v=1; bh=CZVk+0SQQdtsu0HYOfygMM9+Ki+uXIL6AOjrHj0Xgv4=; h=Received:Received:From:To:Subject:Date; DKIM-Signature: a=rsa-sha256; b=G40btHfqiUMF868UKtUf3lcZrWLfwWD/MvS+D+GcDqap+jCe3ZX2HSldNYZW3Aq/shuna2OST4bEq5vzEt5oXEIQClyuRgy9LKRyTe8eYc1rRGe9GpDw17zddI0dbs3NskgDfh9TJj6pcjShRz4SjrJzEA53oDhblXlgAWtAn8+z/WC5rIhiI042Du54SoqogKfeRdYzL2Ss/s4aDpD9mDrSJHBlIs9RIlS3MziHQewAKbeisLOJezdKUU6OT9P5Cur1poctM+XFznsbuCSyKDGMHxC6AY0SqVMKCmiFxT+OlhyPoLA3cCqbF36+0idcdxaX8jkBY1b9mqJieigv0A==; s=purelymail1; d=purelymail.com; v=1; bh=CZVk+0SQQdtsu0HYOfygMM9+Ki+uXIL6AOjrHj0Xgv4=; h=Feedback-ID:Received:Received:From:To:Subject:Date; Feedback-ID: 20115:3760:null:purelymail X-Pm-Original-To: 77566@debbugs.gnu.org Received: by smtp.purelymail.com (Purelymail SMTP) with ESMTPSA id 68380104; (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Tue, 08 Apr 2025 02:33:04 +0000 (UTC) Received: by melete.silentflame.com (Postfix, from userid 1000) id 0A70C7EF730; Tue, 08 Apr 2025 10:33:00 +0800 (CST) From: Sean Whitton In-Reply-To: <3f8dc4f0-81ce-4343-9351-4fede1516825@gutov.dev> References: <87jz7y2mn3.fsf@gmail.com> <87jz7ynndw.fsf@melete.silentflame.com> <3f8dc4f0-81ce-4343-9351-4fede1516825@gutov.dev> Date: Tue, 08 Apr 2025 10:33:00 +0800 Message-ID: <87zfgridr7.fsf@melete.silentflame.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello, On Mon 07 Apr 2025 at 08:34pm +03, Dmitry Gutov wrote: > On 06/04/2025 03:29, Sean Whitton wrote: >> Thanks, though why do this only when switching projects? >> Why not do it proactively whenever fetching the list of projects? >> Performance concerns? > > I'm concerned about performance, yes. With my SSD, it takes about 4ms to > "clean up" ~70 projects. The number could be higher, and the hard drive could > be spinning media. > > So could someone point out what will we get by proactively cleaning up the > list, rather than doing that only when a project is being prompted for? I see, yes. Doing it only when switching projects seems good to me. -- Sean Whitton From unknown Sun Jun 15 09:01:26 2025 X-Loop: help-debbugs@gnu.org Subject: bug#77566: [PATCH] Add option for automatically delete non-existent projects. Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 08 Apr 2025 06:28:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 77566 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Dmitry Gutov Cc: Elijah Gabe =?UTF-8?Q?P=C3=A9rez?= , 77566@debbugs.gnu.org, Ship Mints , Sean Whitton Received: via spool by 77566-submit@debbugs.gnu.org id=B77566.174409368014573 (code B ref 77566); Tue, 08 Apr 2025 06:28:02 +0000 Received: (at 77566) by debbugs.gnu.org; 8 Apr 2025 06:28:00 +0000 Received: from localhost ([127.0.0.1]:58433 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u22RE-0003my-2X for submit@debbugs.gnu.org; Tue, 08 Apr 2025 02:28:00 -0400 Received: from relay1-d.mail.gandi.net ([217.70.183.193]:51973) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u22RA-0003mK-Uq for 77566@debbugs.gnu.org; Tue, 08 Apr 2025 02:27:57 -0400 Received: by mail.gandi.net (Postfix) with ESMTPSA id 0C49C4433D; Tue, 8 Apr 2025 06:27:45 +0000 (UTC) From: Juri Linkov In-Reply-To: <1cc09ffc-0c5c-4409-b74c-3b59a588e8d4@gutov.dev> Organization: LINKOV.NET References: <87jz7y2mn3.fsf@gmail.com> <87jz7ynndw.fsf@melete.silentflame.com> <87frim2jt0.fsf@gmail.com> <875xji2hnw.fsf@gmail.com> <87zfgseren.fsf@gmail.com> <43b3792c-d917-4be6-b9bf-7fb1f8184a81@gutov.dev> <87plhnq0sk.fsf@mail.linkov.net> <1cc09ffc-0c5c-4409-b74c-3b59a588e8d4@gutov.dev> Date: Tue, 08 Apr 2025 09:20:22 +0300 Message-ID: <87jz7vi3ox.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-GND-State: clean X-GND-Score: -100 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddvtddvfeeiucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuifetpfffkfdpucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvfevufgjohhffffkfgggtgesthdtredttdertdenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucggtffrrghtthgvrhhnpeffgeetfeevlefhleejfeeuheeiudeitdffhfdutdekfeffgffhveehteegueekheenucfkphepledurdduvdelrddutdehrdduudejnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepledurdduvdelrddutdehrdduudejpdhhvghlohepmhgrihhlrdhgrghnughirdhnvghtpdhmrghilhhfrhhomhepjhhurhhisehlihhnkhhovhdrnhgvthdpnhgspghrtghpthhtohephedprhgtphhtthhopehsphifhhhithhtohhnsehsphifhhhithhtohhnrdhnrghmvgdprhgtphhtthhopeejjeehieeiseguvggssghughhsrdhgnhhurdhorhhgpdhrtghpthhtohepshhhihhpmhhinhhtshesghhmrghilhdrtghomhdprhgtphhtthhopegvgheigedvieduieesghhmrghilhdrtghomhdprhgtphhtthhopegumhhithhrhiesghhuthhovhdruggvvh X-GND-Sasl: juri@linkov.net X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) >> Instead of desperately cleaning zombies that are popping up again and again, >> I'd prefer an option with a list of directories that should be never added >> to the project list. > > I think we have that in the recently added option project-list-exclude. Ok, this works nicely: (define-advice project-forget-projects-under (:after (dir &optional _recursive) remember) (add-to-list 'project-list-exclude dir)) From unknown Sun Jun 15 09:01:26 2025 X-Loop: help-debbugs@gnu.org Subject: bug#77566: [PATCH] Add option for automatically delete non-existent projects. Resent-From: Elijah Gabe =?UTF-8?Q?P=C3=A9rez?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 09 Apr 2025 04:24:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 77566 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Dmitry Gutov Cc: 77566@debbugs.gnu.org, Sean Whitton Received: via spool by 77566-submit@debbugs.gnu.org id=B77566.174417262230713 (code B ref 77566); Wed, 09 Apr 2025 04:24:01 +0000 Received: (at 77566) by debbugs.gnu.org; 9 Apr 2025 04:23:42 +0000 Received: from localhost ([127.0.0.1]:36653 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u2MyT-0007zI-QG for submit@debbugs.gnu.org; Wed, 09 Apr 2025 00:23:42 -0400 Received: from mail-ot1-x344.google.com ([2607:f8b0:4864:20::344]:43176) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1u2MyQ-0007yz-Jh for 77566@debbugs.gnu.org; Wed, 09 Apr 2025 00:23:40 -0400 Received: by mail-ot1-x344.google.com with SMTP id 46e09a7af769-72bceb93f2fso214849a34.0 for <77566@debbugs.gnu.org>; Tue, 08 Apr 2025 21:23:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1744172612; x=1744777412; 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=ddry1D3mbTnW5p72txPjuduF/QJRskPNV58onSGVX44=; b=SLXVeJFZokx6MF7gWwzRDahG0AoHy5ROkD6VtsNZbZokInMedVpktX5QMcZpy653FV HSXeY0Xcw34PfR8Sb2rb791AeN4KeWtdl3KQOyXrmC0S/oSehHYlhzspEFfv1CCFMk01 sFKhmFpecoy3wKLc+4n8ZEi50NQnwpkPlk51VCuw9TAwWvgvqTyV88qJnXlP/Kdm8gzK 0SJLjSQJrE4CZF4z/8uU4QjamKsE6F6Kx6uVxFyJINGwJMiK0/AsG9FauzZZf7RzxcPT PmThQEZwHGd0oZ+m4mj6U4tgWqwBg1R2iQ2dNwTA99Q9NW32JqwbwSVl8a4w1Kyml9D+ ygNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744172612; x=1744777412; 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=ddry1D3mbTnW5p72txPjuduF/QJRskPNV58onSGVX44=; b=U4732OQnBwuINv8lW7Vn3vBQ7q18i7egfnY7isOE4dBW5j8xlVUgXrufobnpaXfDxB CJLGw5G/oPOZomk66tv6UF+udnwzxhSPN/Z6EiRXoIbIsfmyLtjFEi/tG6lN/1U4EN2Q lPEawsorlbNeh9el2C8CozbmJlXzaGn19mHXZ/nulu8eJZfcOiLgkfTN0Qw4pXBrLwFG fqR5LVjEmCznVBmujmhKi9bJZZYyXA0lza/W2G+pjsLHKdNFtFfLnBYAUMDFPVo9V57c u91b2WIGP19EZcpkYULQmeqIuRZPNfCAkbS9reUf1fnnwpPcw7CU+Lm9cEG+ZZm8j/6g TPmA== X-Gm-Message-State: AOJu0YxFsNqlW3VUiX5lW40qgy9f0NhEVgN31/n5q8OgE5ngN5XXiTMU JSRO3YAARmYQknpyi5i1nlSm1CiFjYJMpfKLrnbGQBYewlL8sB4C X-Gm-Gg: ASbGnctwJAPu0gNnC0xdZgtGLTlnEbJFTTzQcCU3TuVgasdnNQAlIncVWpPzJRVkqm6 SXBj7hP3j/DDbuCcfO3x5pfsQ6GbPoFv1BFGMfDgh6+/OtthAFcFUcs7jSKe5PCArOZmtYfmtwm +89v3YHARGCBsFELfCEF2Zww/9+nZl98ogxm5RU8EMmZxHYZP41yEjYZRee+1iVD5DvtYMX8AfT JYqdehXtfhtve3djBzVlfrF7e6pdQlrtYDdnJN/j0Vkyw7QNZf4FTb3ckBqd6RVTIgMBYutSKRs T9UtzwVGYEv2 X-Google-Smtp-Source: AGHT+IFf11jamYHveMTopU9AShdAKlf8w7/NUHR0BG+O/oaqQD+bEPTW3WFLTyO9YhpYxM3/lFhH1w== X-Received: by 2002:a05:6830:6e8d:b0:72a:b78:1c5a with SMTP id 46e09a7af769-72e70c4f56fmr1013561a34.10.1744172612049; Tue, 08 Apr 2025 21:23:32 -0700 (PDT) Received: from fedora ([2806:10ae:e:79da::1]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-72e73d8d90bsm48995a34.34.2025.04.08.21.23.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Apr 2025 21:23:31 -0700 (PDT) From: Elijah Gabe =?UTF-8?Q?P=C3=A9rez?= In-Reply-To: References: <87jz7y2mn3.fsf@gmail.com> <87jz7ynndw.fsf@melete.silentflame.com> <3f8dc4f0-81ce-4343-9351-4fede1516825@gutov.dev> Date: Tue, 08 Apr 2025 22:23:29 -0600 Message-ID: <87o6x6dku6.fsf@gmail.com> 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-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Elijah Gabe P=C3=A9rez writes: > Dmitry Gutov writes: > > On 06/04/2025 03:29, Sean Whitton wrote: > > Thanks, though why do this only when switching projects? > > Why not do it proactively whenever fetching the list of projects? > > Performance concerns? > > I'm concerned about performance, yes. With my SSD, it takes about 4ms to= =20 > "clean up" ~70 projects. The number could be higher, and the hard drive= =20 > could be spinning media. > > Yeah, that is why i originally added it only when switching projects, pro= jectile does the same. > > So could someone point out what will we get by proactively cleaning up=20 > the list, rather than doing that only when a project is being prompted f= or? > > Maybe for ensure that the zombies were removed? > > For example, packages that use project--list for read the projects. > > Instead what about purge it once after emacs startup? Something like this patch(?), it now clean up when project-prompt-project-name or project-prompt-project-dir are being called and after project--list was initialized: --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Add-option-for-automatically-delete-non-existent-pro.patch >From 5fc38a5205d0c44f695453751352353212b3bd80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?El=C3=ADas=20Gabriel=20P=C3=A9rez?= 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-prune-zombie-projects): New user option. (project--remove-from-project-list, project-forget-project): Allow not to show forgotten projects. (project-forget-zombie-projects): Add new function arguments. (project--ensure-read-project-list, project-prompt-project-dir) (project-prompt-project-name): Call `project-forget-zombie-projects'. --- etc/NEWS | 9 ++++++++ lisp/progmodes/project.el | 43 ++++++++++++++++++++++++++------------- 2 files changed, 38 insertions(+), 14 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index cc63d03eafe..057f08776f1 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -362,6 +362,15 @@ 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-prune-zombie-projects'. +This user option automatically removes projects from 'project-list-file' +that cannot be accessed when switching projects. + +*** New argument NO-REMOTE for 'project-forget-zombie-projects'. +This function argument tells 'project-forget-zombie-projects' not to +forget projects that are remote. + --- *** 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..5c2e0b358a2 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -1551,6 +1551,13 @@ project-ignore-buffer-conditions :group 'project :package-version '(project . "0.8.2")) +(defcustom project-prune-zombie-projects nil + "Automatically remove from project list projects that were deleted. +If non-nil, remove deleted projects only when switching projects." + :type 'boolean + :version "31.1" + :group 'project) + (defun project--read-project-buffer () (let* ((pr (project-current t)) (current-buffer (current-buffer)) @@ -1888,7 +1895,9 @@ 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) + (if (and project-prune-zombie-projects (consp project--list)) + (project-forget-zombie-projects nil t)))) (defun project--write-project-list () "Save `project--list' in `project-list-file'." @@ -1933,26 +1942,27 @@ project-remember-project project-list-exclude) (project--remember-dir root no-write)))) -(defun project--remove-from-project-list (project-root report-message) +(defun project--remove-from-project-list (project-root report-message &optional no-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 NO-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) + (unless no-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 "Project `%s' removed from known projects" no-message)) (defvar project--dir-history) @@ -1963,6 +1973,7 @@ project-prompt-project-dir It's also possible to enter an arbitrary directory not in the list. When PROMPT is non-nil, use it as the prompt string." (project--ensure-read-project-list) + (if project-prune-zombie-projects (project-forget-zombie-projects nil t)) (let* ((dir-choice "... (choose a dir)") (choices ;; XXX: Just using this for the category (for the substring @@ -1992,6 +2003,7 @@ project-prompt-project-name see `project-list-file'. It's also possible to enter an arbitrary directory not in the list. When PROMPT is non-nil, use it as the prompt string." + (if project-prune-zombie-projects (project-forget-zombie-projects nil t)) (let* ((dir-choice "... (choose a dir)") project--name-history (choices @@ -2117,12 +2129,15 @@ project-remember-projects-under count) count)) count)) -(defun project-forget-zombie-projects () - "Forget all known projects that don't exist any more." - (interactive) +(defun project-forget-zombie-projects (&optional no-remote no-message) + "Forget all known projects that don't exist any more. +If NO-REMOTE is non-nil, don't forget remote projects. +If NO-MESSAGE is non-nil, don't display a message about projects removed." + (interactive "P") (dolist (proj (project-known-project-roots)) - (unless (file-exists-p proj) - (project-forget-project proj)))) + (when (or (and no-remote (not (file-remote-p proj)) (not (file-exists-p proj))) + (not (file-exists-p 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. --=-=-=-- From unknown Sun Jun 15 09:01:26 2025 X-Loop: help-debbugs@gnu.org Subject: bug#77566: [PATCH] Add option for automatically delete non-existent projects. Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 09 Apr 2025 12:52:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 77566 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Elijah Gabe =?UTF-8?Q?P=C3=A9rez?= Cc: 77566@debbugs.gnu.org, Sean Whitton Received: via spool by 77566-submit@debbugs.gnu.org id=B77566.174420309015676 (code B ref 77566); Wed, 09 Apr 2025 12:52:02 +0000 Received: (at 77566) by debbugs.gnu.org; 9 Apr 2025 12:51:30 +0000 Received: from localhost ([127.0.0.1]:38251 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u2Utt-00044m-N0 for submit@debbugs.gnu.org; Wed, 09 Apr 2025 08:51:29 -0400 Received: from fhigh-b4-smtp.messagingengine.com ([202.12.124.155]:60591) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u2Uto-00044J-CE for 77566@debbugs.gnu.org; Wed, 09 Apr 2025 08:51:27 -0400 Received: from phl-compute-01.internal (phl-compute-01.phl.internal [10.202.2.41]) by mailfhigh.stl.internal (Postfix) with ESMTP id 44D422540104; Wed, 9 Apr 2025 08:51:18 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-01.internal (MEProxy); Wed, 09 Apr 2025 08:51:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1744203078; x=1744289478; bh=3ixqrpe2/MwFfLmuERWav1NZMFEH3xc/lM805GUP9hM=; b= Us53bdMWsZIT12jGWvN3FCIO2q3MOvM8aGwXIr26Pm/StPB94UE4pjyGQZDk2KLx QtQz93UwgnR2NbeS5jYtdDnHAyBxN7aH99dPHy+S4vPKQU1sElVGAbRez0cDXsJL mTZBHgyzYvV6agB+6j5bQINbQ7PLfRuVxtdoUBS/w0NnwCTdHYhtsU8l5O6MqJ31 XYuFXYpFyIvxjvwuXICib+O3431pS4qBn/dKOIn+NMn/aaGd8H1LN/d9nj62rhNz flAAkWZByiNyhnxd1ihYjUpxAWLYr8F3ONL/MX9I9zeYl7/8JaBUMyjBlhl713KG 91lcau3oLQmm1DOS0/OHjQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1744203078; x= 1744289478; bh=3ixqrpe2/MwFfLmuERWav1NZMFEH3xc/lM805GUP9hM=; b=a VtwHQ+ZTF8gnBVgFw8onuKtHEhN4puCvLT97G/4FZSAgfODvDdyypweIxN2hwz97 qB/iJYvSWPU4XDAmjBYaOzRgC+u8fHNzHIDdEn5O/Eo8CyEQXvFIqZ24wLybGKn9 C0zVrztNpOtSnYZr/nqilAlFZohTGuCL5E2ixrBUHVE7jQ1jiFDhZbccu4NIzXHH s6frmYlZ+1zOxr9Xn+UD9vgtcoEHn1TrovKt9sc9wMAFCbCEzZx9h2eTstoH/7qR w/dDuIu77rlmushgsgkv93dvU2nNvuCxLVHbmG9Q6nDROOW++++EKKJB1kQ5OMuR ti3dHme8Of1kT3YoE/UIg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddvtdeitdegucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggv pdfurfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpih gvnhhtshculddquddttddmnecujfgurhepkfffgggfuffvvehfhfgjtgfgsehtkeertddt vdejnecuhfhrohhmpeffmhhithhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovh druggvvheqnecuggftrfgrthhtvghrnhepgeelfeetkefghfdvhfdtgeevveevteetgeet veegtedthefhudekteehffeukeeknecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrg hmpehmrghilhhfrhhomhepughmihhtrhihsehguhhtohhvrdguvghvpdhnsggprhgtphht thhopeefpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopegvgheigedvieduieesgh hmrghilhdrtghomhdprhgtphhtthhopeejjeehieeiseguvggssghughhsrdhgnhhurdho rhhgpdhrtghpthhtohepshhpfihhihhtthhonhesshhpfihhihhtthhonhdrnhgrmhgv X-ME-Proxy: Feedback-ID: i07de48aa:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 9 Apr 2025 08:51:16 -0400 (EDT) Message-ID: Date: Wed, 9 Apr 2025 15:51:14 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird References: <87jz7y2mn3.fsf@gmail.com> <87jz7ynndw.fsf@melete.silentflame.com> <3f8dc4f0-81ce-4343-9351-4fede1516825@gutov.dev> <87o6x6dku6.fsf@gmail.com> Content-Language: en-US From: Dmitry Gutov In-Reply-To: <87o6x6dku6.fsf@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) On 09/04/2025 07:23, Elijah Gabe Pérez wrote: > Instead what about purge it once after emacs startup? I think a concern was voiced that during a long-running session directories can get removed at any time. + (project-forget-zombie-projects nil t)))) Are we sure that we want to suppress the messages about the removals in this case? Personally, I'd just print it in any case (if some were removed anyway). +(defun project-forget-zombie-projects (&optional no-remote no-message) > + "Forget all known projects that don't exist any more. > +If NO-REMOTE is non-nil, don't forget remote projects. Maybe NO-REMOTE should be called INCLUDE-REMOTE instead? Right now it sounds like the opposite of its actual meaning. From unknown Sun Jun 15 09:01:26 2025 X-Loop: help-debbugs@gnu.org Subject: bug#77566: [PATCH] Add option for automatically delete non-existent projects. Resent-From: Elijah Gabe =?UTF-8?Q?P=C3=A9rez?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 09 Apr 2025 19:29:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 77566 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Dmitry Gutov Cc: 77566@debbugs.gnu.org, Sean Whitton Received: via spool by 77566-submit@debbugs.gnu.org id=B77566.174422689710928 (code B ref 77566); Wed, 09 Apr 2025 19:29:02 +0000 Received: (at 77566) by debbugs.gnu.org; 9 Apr 2025 19:28:17 +0000 Received: from localhost ([127.0.0.1]:42178 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u2b5s-0002qC-CI for submit@debbugs.gnu.org; Wed, 09 Apr 2025 15:28:16 -0400 Received: from mail-ot1-x342.google.com ([2607:f8b0:4864:20::342]:54509) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1u2b5p-0002ps-GA for 77566@debbugs.gnu.org; Wed, 09 Apr 2025 15:28:14 -0400 Received: by mail-ot1-x342.google.com with SMTP id 46e09a7af769-72c7336ed99so21530a34.0 for <77566@debbugs.gnu.org>; Wed, 09 Apr 2025 12:28:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1744226887; x=1744831687; 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=gSSfEnkgWi3xIwFLpjfM/+TP4xnkjlj4Y6y3/VnM6cQ=; b=Bujw2u7hJAr5zvKOkOxk3RNq0hqhxTttzrALl0tMG+FjLSGGHUo+GH80iskIGfQcem zbja6ugz7/a+/a6abMsfI1qITpLL82APWmAADsdhdABAXt6CFU77mvnQa6nbWX1UG2NN taDIJYjY6bl1LAYqy0JEVLPaK30VKFDb7bzWrzO4UYSXUsrhavg1jCGk2B2XlFQVaSA9 zziA9mGHR2c0JOeeF2fsZUAqydI6+B2v1KerZUIpFokbCGO+brgp1FnsRYsZbhEEJQXK lmpGOcmAJGhYeDpLy5UBfeb9RNLThn8zzTIV9kZUEzgzOSVJchE78DQWWcTfiCEfJiOG OGTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744226887; x=1744831687; 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=gSSfEnkgWi3xIwFLpjfM/+TP4xnkjlj4Y6y3/VnM6cQ=; b=kBwx9J5jjTF2LTlfHv+C//qJsmlwkpR8d4UxT8oF9G435yuWC8LzrMzeV2GbXebvy+ oYFS9kYmQPO/rX/Vws0sIoLHC7fwnWmvRL6hZNbDlDgcNaLdFBqN2yJ37gzs4DaAjjVa kPT+KhhTFyVxqkY0K+cEZK9nJVQRWdF+n3XeXFqTjKaiN/U4MvLHpp47O2L/vljZwMa1 a+7WIvreMlcu88S68rzS7/QwDUzluZDyQHxSeO7wtMO6W8SDlp/7xozNPGzQ85QNshxo boC+tPVf2oHYrMZgHOoLPtWBI12FDSls2h3YIUjtpmCxl9RPncTFVUrUHA1fwQflnnRL qLUQ== X-Gm-Message-State: AOJu0YxX7GFyBLk8LmVYj8fbZtkbAiQ4jp4RprI6UCL/wVWGnJPh6tYR 0SjoxWNQMe0YhPzTLjr0dWxr/DO3UVX+XgYOyQ8xEdNivGdRYuRz X-Gm-Gg: ASbGncurMfW73M2yb43LLNyoRcLSfnyfZE+xFWk4Gyl/lJRib+EuSvtbjluJAgSIqzP mpKVoSXJjQ0B40NE8KFIn+aVbS9ks7RXX2fsuoFB2lafelkEaU+XJCEzZBSxL+p9PMF+IERAj9J ZsesJYWxGU9LcOKADKY9yKHLbF8EUwaxE7f2xOjRa4ImbxcWvqduCqOD9VGvZOCYML2DY0KWGtW Qnmez//ZmMlOO4jPjoYZkLk4izU9fkwbzVtXh2XRxiYth8QROffroN/j5s+3H4P8PBH6s6ryzq3 oJQ3PHlNMT6Xm9pe8jw= X-Google-Smtp-Source: AGHT+IGlFb8FONfgddHssqI6IoxOvlZZXjSQl/GhY6+R28t1tdrl7G4tt/LpoaIzHhGO9UEah+5JEQ== X-Received: by 2002:a05:6830:620d:b0:72b:9724:6a82 with SMTP id 46e09a7af769-72e7bb2b3demr101524a34.17.1744226887413; Wed, 09 Apr 2025 12:28:07 -0700 (PDT) Received: from fedora ([2806:10ae:e:79da::1]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-72e73d51b15sm284711a34.1.2025.04.09.12.28.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Apr 2025 12:28:06 -0700 (PDT) From: Elijah Gabe =?UTF-8?Q?P=C3=A9rez?= In-Reply-To: References: <87jz7y2mn3.fsf@gmail.com> <87jz7ynndw.fsf@melete.silentflame.com> <3f8dc4f0-81ce-4343-9351-4fede1516825@gutov.dev> <87o6x6dku6.fsf@gmail.com> Date: Wed, 09 Apr 2025 13:28:05 -0600 Message-ID: <87h62x3zju.fsf@gmail.com> 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-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Dmitry Gutov writes: > On 09/04/2025 07:23, Elijah Gabe P=C3=A9rez wrote: >> Instead what about purge it once after emacs startup? > > I think a concern was voiced that during a long-running session directori= es can get removed at any time. > > + (project-forget-zombie-projects nil t)))) > > Are we sure that we want to suppress the messages about the removals in t= his case? Personally, I'd just print it in any case (if some were removed a= nyway). It would display the message after `startup-echo-area-message'. I think it would be intrusive. I've changed it to `inhibit-message' instead, which will include the message into *Messages* buffer but will not be displayed. > +(defun project-forget-zombie-projects (&optional no-remote no-message) >> + "Forget all known projects that don't exist any more. >> +If NO-REMOTE is non-nil, don't forget remote projects. > > Maybe NO-REMOTE should be called INCLUDE-REMOTE instead? > > Right now it sounds like the opposite of its actual meaning. I think EXCLUDE-REMOTES would be a better name, the INCLUDE-REMOTE name would give the impression that it does not delete remote projects by default. `project-forget-zombie-projects' by default includes remote and no remote projects. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Add-option-for-automatically-delete-non-existent-pro.patch >From 0feaabcf32428c97afc7967e4a51adaab88c290a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?El=C3=ADas=20Gabriel=20P=C3=A9rez?= Date: Tue, 8 Apr 2025 22:30:28 -0600 Subject: [PATCH] Add option for automatically delete non-existent projects. (bug#77566) * etc/NEWS: Announce changes. * lisp/progmodes/project.el (project-prune-zombie-projects): New user option. (project-forget-zombie-projects): Add new function argument for exclude projects that are remotes. (project--ensure-read-project-list, project-prompt-project-dir) (project-prompt-project-name): Call `project-forget-zombie-projects' but inhibit its message. --- etc/NEWS | 9 +++++++++ lisp/progmodes/project.el | 30 +++++++++++++++++++++++++----- 2 files changed, 34 insertions(+), 5 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index cc63d03eafe..bb71ac0b80b 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -362,6 +362,15 @@ 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-prune-zombie-projects'. +This user option automatically removes projects from 'project-list-file' +that cannot be accessed when switching projects. + +*** New argument EXCLUDE-REMOTES for 'project-forget-zombie-projects'. +This function argument tells 'project-forget-zombie-projects' to +exclude remote projects from being forgotten. + --- *** 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..34788a34954 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -1551,6 +1551,13 @@ project-ignore-buffer-conditions :group 'project :package-version '(project . "0.8.2")) +(defcustom project-prune-zombie-projects nil + "Automatically remove from project list projects that were deleted. +If non-nil, remove deleted projects only when switching projects." + :type 'boolean + :version "31.1" + :group 'project) + (defun project--read-project-buffer () (let* ((pr (project-current t)) (current-buffer (current-buffer)) @@ -1888,7 +1895,11 @@ 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) + (if-let* (project-prune-zombie-projects + ((consp project--list)) + (inhibit-message t)) + (project-forget-zombie-projects)))) (defun project--write-project-list () "Save `project--list' in `project-list-file'." @@ -1963,6 +1974,9 @@ project-prompt-project-dir It's also possible to enter an arbitrary directory not in the list. When PROMPT is non-nil, use it as the prompt string." (project--ensure-read-project-list) + (if-let* (project-prune-zombie-projects + (inhibit-message t)) + (project-forget-zombie-projects)) (let* ((dir-choice "... (choose a dir)") (choices ;; XXX: Just using this for the category (for the substring @@ -1992,6 +2006,9 @@ project-prompt-project-name see `project-list-file'. It's also possible to enter an arbitrary directory not in the list. When PROMPT is non-nil, use it as the prompt string." + (if-let* (project-prune-zombie-projects + (inhibit-message t)) + (project-forget-zombie-projects)) (let* ((dir-choice "... (choose a dir)") project--name-history (choices @@ -2117,11 +2134,14 @@ project-remember-projects-under count) count)) count)) -(defun project-forget-zombie-projects () - "Forget all known projects that don't exist any more." - (interactive) +(defun project-forget-zombie-projects (&optional exclude-remotes) + "Forget all known projects that don't exist any more. +If EXCLUDE-REMOTES is non-nil, exclude remote projects from being +forgotten." + (interactive "P") (dolist (proj (project-known-project-roots)) - (unless (file-exists-p proj) + (when (or (and exclude-remotes (not (file-remote-p proj)) (not (file-exists-p proj))) + (not (file-exists-p proj))) (project-forget-project proj)))) (defun project-forget-projects-under (dir &optional recursive) -- 2.49.0 --=-=-= Content-Type: text/plain -- - E.G via GNU Emacs and Org. --=-=-=-- From unknown Sun Jun 15 09:01:26 2025 X-Loop: help-debbugs@gnu.org Subject: bug#77566: [PATCH] Add option for automatically delete non-existent projects. Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 09 Apr 2025 23:55:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 77566 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Elijah Gabe =?UTF-8?Q?P=C3=A9rez?= Cc: 77566@debbugs.gnu.org, Sean Whitton Received: via spool by 77566-submit@debbugs.gnu.org id=B77566.17442428803215 (code B ref 77566); Wed, 09 Apr 2025 23:55:02 +0000 Received: (at 77566) by debbugs.gnu.org; 9 Apr 2025 23:54:40 +0000 Received: from localhost ([127.0.0.1]:42730 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u2fFg-0000pn-8H for submit@debbugs.gnu.org; Wed, 09 Apr 2025 19:54:40 -0400 Received: from fout-b3-smtp.messagingengine.com ([202.12.124.146]:39473) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u2fFd-0000pV-VO for 77566@debbugs.gnu.org; Wed, 09 Apr 2025 19:54:38 -0400 Received: from phl-compute-02.internal (phl-compute-02.phl.internal [10.202.2.42]) by mailfout.stl.internal (Postfix) with ESMTP id 16A1A114010B; Wed, 9 Apr 2025 19:54:32 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-02.internal (MEProxy); Wed, 09 Apr 2025 19:54:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1744242871; x=1744329271; bh=vvcK/rAhMdtXd22PeG6jv+EKAQflgdFm5UCNAaydmwE=; b= DwJudWzXkXbeREqhLMP86mfYfadRLOkeZcIqS5q9zTCG0Y2QSKRInEQWvlQOL/Hm 7PI0UXJMQRrKmPinOZkwL+7Fexin95O5sDAIn2dXSqMT0BZ0yqxLmdN4Cogyf78N QbtswXmTG3M9IChHfdviwx9mLUF3aL3o+VfpU9mFt8HsYDhpS9aYb7zlCUIaD2bX dkhb4UIgzoWMB2eLxBWVPzEep8Y8qpd9X0Ic+ITnbVe4rRK7CllcCCvQM0w6qs7i PK9lkxH/AJLA8Gn/lE2ZabA/wsA1itdRetcxGwmfqFxwTb3aDIejo8bMDZsyXIxH ynJJSrIZ0hC0lELmCMjGCw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1744242871; x= 1744329271; bh=vvcK/rAhMdtXd22PeG6jv+EKAQflgdFm5UCNAaydmwE=; b=m 4Ak8tEHdaU8JI0sAO8Z1NKMpGNp++NfSE1VsGJpdxjLgO9u2/YFBMx+WJKEnGwAd AGC++8tiyE1bOZv3T/w3Ko3hUl/Tz02luADYeDy8kilDVW4VriUpJHK331QBcEXY iXXBI6+Yja1yS2FIzLVpNRjgAt6FpD3tqnXycBkRJ2WQFc/uD3sLGF9VTvaIr4Lx 5WSWG6uSi1VbBx6yMXWlAH8lxG+X4rcds/vDeictJWz5nY8SpY5iYQ4OOJ3F3RWR GBDU1e1c1CADyZDXlYeBKm/QnTjV9SQKkU9X8yHseeeLibQYqkKJXmW3fzvUQ+lv aIP0fX4Wop/BuyR4MUymA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddvtdejfeejucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggv pdfurfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpih gvnhhtshculddquddttddmnecujfgurhepkfffgggfuffvvehfhfgjtgfgsehtkeertddt vdejnecuhfhrohhmpeffmhhithhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovh druggvvheqnecuggftrfgrthhtvghrnhepgeelfeetkefghfdvhfdtgeevveevteetgeet veegtedthefhudekteehffeukeeknecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrg hmpehmrghilhhfrhhomhepughmihhtrhihsehguhhtohhvrdguvghvpdhnsggprhgtphht thhopeefpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopegvgheigedvieduieesgh hmrghilhdrtghomhdprhgtphhtthhopeejjeehieeiseguvggssghughhsrdhgnhhurdho rhhgpdhrtghpthhtohepshhpfihhihhtthhonhesshhpfihhihhtthhonhdrnhgrmhgv X-ME-Proxy: Feedback-ID: i07de48aa:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 9 Apr 2025 19:54:30 -0400 (EDT) Message-ID: <9eac3b54-62fb-45fc-8e7d-628baf532ec5@gutov.dev> Date: Thu, 10 Apr 2025 02:54:27 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird References: <87jz7y2mn3.fsf@gmail.com> <87jz7ynndw.fsf@melete.silentflame.com> <3f8dc4f0-81ce-4343-9351-4fede1516825@gutov.dev> <87o6x6dku6.fsf@gmail.com> <87h62x3zju.fsf@gmail.com> Content-Language: en-US From: Dmitry Gutov In-Reply-To: <87h62x3zju.fsf@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) On 09/04/2025 22:28, Elijah Gabe Pérez wrote: > Dmitry Gutov writes: > >> On 09/04/2025 07:23, Elijah Gabe Pérez wrote: >>> Instead what about purge it once after emacs startup? >> >> I think a concern was voiced that during a long-running session directories can get removed at any time. >> >> + (project-forget-zombie-projects nil t)))) >> >> Are we sure that we want to suppress the messages about the removals in this case? Personally, I'd just print it in any case (if some were removed anyway). > > It would display the message after `startup-echo-area-message'. > I think it would be intrusive. Do we read the project list at startup? Even so, the message might only be there if there are projects to clean up. So it won't show up every time. > I've changed it to `inhibit-message' instead, which will include > the message into *Messages* buffer but will not be displayed. That's fine too, although we probably do want to show it when called interactively. >> +(defun project-forget-zombie-projects (&optional no-remote no-message) >>> + "Forget all known projects that don't exist any more. >>> +If NO-REMOTE is non-nil, don't forget remote projects. >> >> Maybe NO-REMOTE should be called INCLUDE-REMOTE instead? >> >> Right now it sounds like the opposite of its actual meaning. > > I think EXCLUDE-REMOTES would be a better name, > the INCLUDE-REMOTE name would give the impression that it does not > delete remote projects by default. `project-forget-zombie-projects' by > default includes remote and no remote projects. Don't we want to avoid remote projects by default? It might take a long time. Does it here in my testing anyway. Having the "fast" path to be the default and the "thorough" as the prefix command alternative seems to be a common approach. From unknown Sun Jun 15 09:01:26 2025 X-Loop: help-debbugs@gnu.org Subject: bug#77566: [PATCH] Add option for automatically delete non-existent projects. Resent-From: Elijah Gabe =?UTF-8?Q?P=C3=A9rez?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 10 Apr 2025 04:08:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 77566 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Dmitry Gutov Cc: 77566@debbugs.gnu.org, Sean Whitton Received: via spool by 77566-submit@debbugs.gnu.org id=B77566.17442580771552 (code B ref 77566); Thu, 10 Apr 2025 04:08:02 +0000 Received: (at 77566) by debbugs.gnu.org; 10 Apr 2025 04:07:57 +0000 Received: from localhost ([127.0.0.1]:43150 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u2jCm-0000Ow-Tn for submit@debbugs.gnu.org; Thu, 10 Apr 2025 00:07:57 -0400 Received: from mail-oa1-x42.google.com ([2001:4860:4864:20::42]:45338) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1u2jCk-0000OX-1k for 77566@debbugs.gnu.org; Thu, 10 Apr 2025 00:07:55 -0400 Received: by mail-oa1-x42.google.com with SMTP id 586e51a60fabf-2c1caacc1f7so184162fac.3 for <77566@debbugs.gnu.org>; Wed, 09 Apr 2025 21:07:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1744258068; x=1744862868; 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=L2QF5Dp97IqSTgRCS2XShRh8AHJUzHEdr0z/Etazwdg=; b=WFtAo1PWRzm2Geg518K9K/zJtrfF+UH1D7nwZ1mUy6NjQotGhZwj5GxFr7Gex3dn40 jQdL2B9h4uId0vhMCBjv5gJAHNd/Adc+bnWuJNBT5Bj8BGfoFK/sc/MjWW6COVMKvwhe 4+feCRGaAbZXh3ZHPrQ/TBtOR7HJSQCogWeembC0HdIEjcZoeB5n3HT1qb7uoxXQ53gq AAnWbt4mK6e3ZNM5EJ5iD8ry1amZbwQhpeBpHQ9Mm6xOGpXxxX6V5y2eoEwC4G3Yt1Jp H2uCEnsuXJY7veOZOS0wYQ4VQ9abJofQL0dSR/D+SD36jmdUCBNH74Qkb6ugJQEESzRH NAhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744258068; x=1744862868; 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=L2QF5Dp97IqSTgRCS2XShRh8AHJUzHEdr0z/Etazwdg=; b=Mu5znGUrr+KAVA48j4h+w66IJSoTtCxB6UScvrikwG5sFO7gFBAPE0FIlCds26UUPa eaehMo2Xg7UBm+wiF95LqaQ9hW5JBZgDWJNFvOtfeWS9vA3TivH0P2fGMslMuMLWRF2x I1dHX7BcdzsUk2UoeCFWOhWD2ADHYnTs7BnP2U+wWiqTaTsl9Tx9XnrQxNfgdO0GOMwe wjOBNEsaRS3Qw2alw903gCuv5lQcn0E4iLeLNweX4qq8f6ai0fMSyoojDqCPsbKoUmCO AKFRcqQ7bCU6551luluvOpV2bwYWfDMSs14oy8Kxsl0n+H4/Nr15ZHfqv0zBPMJAuPJb 6MPA== X-Gm-Message-State: AOJu0YytLcTOPou9fwluNLUlM0sTgBJTq5x2ACiK1ZK1fLC8hZlTUKJr +Jy94jHNXllign+kE103J+Iupq2QAMc+RF18meQDd8pBopwojubq X-Gm-Gg: ASbGncsR3H1R9yLs7QXeA3kaK17olRyBwxuvXQ43Acpzhl5Vu3LeIW5m0G2k+EtsSDo Jc+xjM41obW8tSBorgKIT9ThkQR/U6kgdso2YCRqquys26AF3uv/wdxoS1xGaDD0EJQ/WmSvixe iTdyyaiyUVKMStN/RasBG15LmhnJFpHrVgf7niSopkaal7vKmqNl3/iRmkRS/mcNLN0gDNCX2JB fssPdkqKSa6arfqNAxlL4DqwvnLKoPlGWVW2J80HQU+iH2av1SCPjNVTBI3QV6mxZh4KiMfLyu8 ECbXjjiK X-Google-Smtp-Source: AGHT+IFipmrPdSe6pVxOpsaTxStFg1RL8fRhi+uOqsidnVjvTjQ6IPoUBHx9ytOUTcRlnb6nAu6kIQ== X-Received: by 2002:a05:6870:ef0c:b0:2c2:dfbb:2dbd with SMTP id 586e51a60fabf-2d0b359ebd5mr730047fac.8.1744258067773; Wed, 09 Apr 2025 21:07:47 -0700 (PDT) Received: from fedora ([2806:10ae:e:79da::1]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-72e73e6735esm427283a34.59.2025.04.09.21.07.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Apr 2025 21:07:47 -0700 (PDT) From: Elijah Gabe =?UTF-8?Q?P=C3=A9rez?= In-Reply-To: <9eac3b54-62fb-45fc-8e7d-628baf532ec5@gutov.dev> References: <87jz7y2mn3.fsf@gmail.com> <87jz7ynndw.fsf@melete.silentflame.com> <3f8dc4f0-81ce-4343-9351-4fede1516825@gutov.dev> <87o6x6dku6.fsf@gmail.com> <87h62x3zju.fsf@gmail.com> <9eac3b54-62fb-45fc-8e7d-628baf532ec5@gutov.dev> Date: Wed, 09 Apr 2025 22:07:45 -0600 Message-ID: <87h62wfylq.fsf@gmail.com> 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-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Dmitry Gutov writes: > On 09/04/2025 22:28, Elijah Gabe P=C3=A9rez wrote: >> Dmitry Gutov writes: >>=20 >>> On 09/04/2025 07:23, Elijah Gabe P=C3=A9rez wrote: >>>> Instead what about purge it once after emacs startup? >>> >>> I think a concern was voiced that during a long-running session directo= ries can get removed at any time. >>> >>> + (project-forget-zombie-projects nil t)))) >>> >>> Are we sure that we want to suppress the messages about the removals in= this case? Personally, I'd just print it in any case (if some were removed= anyway). >> It would display the message after `startup-echo-area-message'. >> I think it would be intrusive. > > Do we read the project list at startup? Apparently no, I didn't notice it's just my configuration that does it. >> I've changed it to `inhibit-message' instead, which will include >> the message into *Messages* buffer but will not be displayed. > > That's fine too, although we probably do want to show it when called inte= ractively. Sure. I've added it as an user option. >>> +(defun project-forget-zombie-projects (&optional no-remote no-message) >>>> + "Forget all known projects that don't exist any more. >>>> +If NO-REMOTE is non-nil, don't forget remote projects. >>> >>> Maybe NO-REMOTE should be called INCLUDE-REMOTE instead? >>> >>> Right now it sounds like the opposite of its actual meaning. >> I think EXCLUDE-REMOTES would be a better name, >> the INCLUDE-REMOTE name would give the impression that it does not >> delete remote projects by default. `project-forget-zombie-projects' by >> default includes remote and no remote projects. > > Don't we want to avoid remote projects by default? It might take a long t= ime. Does it here in my testing anyway. > > Having the "fast" path to be the default and the "thorough" as the prefix= command alternative seems to be a common approach. You are right, I've change it for exclude remote projects by default. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Add-option-for-automatically-delete-non-existent-pro.patch >From f5e9ac3a37eb74a979c6bf803316c3f3a25fe4b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?El=C3=ADas=20Gabriel=20P=C3=A9rez?= Date: Tue, 8 Apr 2025 22:30:28 -0600 Subject: [PATCH] Add option for automatically delete non-existent projects. (bug#77566) * etc/NEWS: Announce changes. * lisp/progmodes/project.el (project-prune-zombie-projects) (project-inhibit-message): New user options. (project-forget-zombie-projects): Add new function argument for include projects that are remotes, by default it exclude them. (project--ensure-read-project-list, project-prompt-project-dir) (project-prompt-project-name): Call `project-forget-zombie-projects' but inhibit its message. (project-kill-buffers, project-remember-projects-under) (project-forget-projects-under): Inhibit message if `project-inhibit-message' is non-nil. --- etc/NEWS | 17 +++++++++++ lisp/progmodes/project.el | 59 ++++++++++++++++++++++++++++++++------- 2 files changed, 66 insertions(+), 10 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index cc63d03eafe..0e021a06ec2 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -362,6 +362,23 @@ 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-prune-zombie-projects'. +This user option automatically removes projects from 'project-list-file' +that cannot be accessed when prompting for a project. +By default it is set to 'exclude-remote', which exclude remote projects +from being removed. If set to 'all', include remote and no remote +projects from being removed. + ++++ +*** New user option 'project-inhibit-message'. +This option, if non-nil, project commands will not display messages +in echo area. + +*** New optional argument INCLUDE-REMOTES for 'project-forget-zombie-projects'. +This argument tells 'project-forget-zombie-projects' to include remote +projects from being forgotten. + --- *** 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..78266c6682d 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -1551,6 +1551,25 @@ project-ignore-buffer-conditions :group 'project :package-version '(project . "0.8.2")) +(defcustom project-prune-zombie-projects 'exclude-remote + "Automatically remove from project list projects that were deleted. +If set to `exclude-remote' (default), remove deleted projects except +those that are remote. +If set to `all', include remote and no remote projects from being +removed." + :type '(choice (const :tag "Exclude remote projects" exclude-remote) + (const :tag "All projects" all)) + :version "31.1" + :group 'project) + +(defcustom project-inhibit-message nil + "Non-nil means any project command will not display messages in echo area. +The messages are displayed in the messages buffer but it won't +be shown in the echo area." + :type 'boolean + :version "31.1" + :group 'project) + (defun project--read-project-buffer () (let* ((pr (project-current t)) (current-buffer (current-buffer)) @@ -1803,7 +1822,8 @@ project-kill-buffers (yes-or-no-p (format "Kill %d buffers in %s? " (length bufs) - (project-name pr)))))) + (project-name pr))))) + (inhibit-message project-inhibit-message)) (cond (no-confirm (mapc #'kill-buffer bufs)) ((null bufs) @@ -1888,7 +1908,12 @@ 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) + (if-let* (project-prune-zombie-projects + ((consp project--list)) + (inhibit-message t)) + (project-forget-zombie-projects + (eq project-prune-zombie-projects 'all))))) (defun project--write-project-list () "Save `project--list' in `project-list-file'." @@ -1963,6 +1988,10 @@ project-prompt-project-dir It's also possible to enter an arbitrary directory not in the list. When PROMPT is non-nil, use it as the prompt string." (project--ensure-read-project-list) + (if-let* (project-prune-zombie-projects + (inhibit-message t)) + (project-forget-zombie-projects + (eq project-prune-zombie-projects 'all))) (let* ((dir-choice "... (choose a dir)") (choices ;; XXX: Just using this for the category (for the substring @@ -1992,6 +2021,10 @@ project-prompt-project-name see `project-list-file'. It's also possible to enter an arbitrary directory not in the list. When PROMPT is non-nil, use it as the prompt string." + (if-let* (project-prune-zombie-projects + (inhibit-message t)) + (project-forget-zombie-projects + (eq project-prune-zombie-projects 'all))) (let* ((dir-choice "... (choose a dir)") project--name-history (choices @@ -2097,7 +2130,8 @@ project-remember-projects-under (directory-files dir t))) (known (make-hash-table :size (* 2 (length project--list)) :test #'equal)) - (count 0)) + (count 0) + (inhibit-message project-inhibit-message)) (dolist (project (mapcar #'car project--list)) (puthash project t known)) (dolist (subdir dirs) @@ -2117,12 +2151,16 @@ project-remember-projects-under count) count)) count)) -(defun project-forget-zombie-projects () - "Forget all known projects that don't exist any more." - (interactive) - (dolist (proj (project-known-project-roots)) - (unless (file-exists-p proj) - (project-forget-project proj)))) +(defun project-forget-zombie-projects (&optional include-remotes) + "Forget all known projects that don't exist any more. +This don't include remote projects, set INCLUDE-REMOTES to non-nil for +include remote projects from being forgotten." + (interactive "P") + (let ((inhibit-message project-inhibit-message)) + (dolist (proj (project-known-project-roots)) + (when (or (and include-remotes (not (file-exists-p proj))) + (not (and (file-remote-p proj) (file-exists-p proj)))) + (project-forget-project proj))))) (defun project-forget-projects-under (dir &optional recursive) "Forget all known projects below a directory DIR. @@ -2133,7 +2171,8 @@ project-forget-projects-under Display a message at the end summarizing what was forgotten. Return the number of forgotten projects." (interactive "DDirectory: \nP") - (let ((count 0)) + (let ((count 0) + (inhibit-message project-inhibit-message)) (if recursive (dolist (proj (project-known-project-roots)) (when (file-in-directory-p proj dir) -- 2.49.0 --=-=-= Content-Type: text/plain -- - E.G via GNU Emacs and Org. --=-=-=--