From unknown Fri Aug 15 03:56:56 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#66649 <66649@debbugs.gnu.org> To: bug#66649 <66649@debbugs.gnu.org> Subject: Status: 29.1; `project-remember-projects-under' behavior doesn't match its doc Reply-To: bug#66649 <66649@debbugs.gnu.org> Date: Fri, 15 Aug 2025 10:56:56 +0000 retitle 66649 29.1; `project-remember-projects-under' behavior doesn't matc= h its doc reassign 66649 emacs submitter 66649 Damien Cassou severity 66649 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 20 07:49:05 2023 Received: (at submit) by debbugs.gnu.org; 20 Oct 2023 11:49:05 +0000 Received: from localhost ([127.0.0.1]:38850 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qto00-0001iV-Mr for submit@debbugs.gnu.org; Fri, 20 Oct 2023 07:49:05 -0400 Received: from lists.gnu.org ([2001:470:142::17]:42366) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qtnzx-0001h3-It for submit@debbugs.gnu.org; Fri, 20 Oct 2023 07:49:03 -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 1qtnzI-0008Ic-VD for bug-gnu-emacs@gnu.org; Fri, 20 Oct 2023 07:48:24 -0400 Received: from mail.choca.pics ([2001:910:1410:500::1]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qtnzG-0005U6-C9 for bug-gnu-emacs@gnu.org; Fri, 20 Oct 2023 07:48:20 -0400 Received: from localhost (localhost.localdomain [IPv6:::1]) by mail.choca.pics (Postfix) with ESMTP id 5645018192DC8; Fri, 20 Oct 2023 13:48:06 +0200 (CEST) Received: from mail.choca.pics ([IPv6:::1]) by localhost (mail.choca.pics [IPv6:::1]) (amavis, port 10032) with ESMTP id iswXzcwBFHlz; Fri, 20 Oct 2023 13:48:05 +0200 (CEST) Received: from localhost (localhost.localdomain [IPv6:::1]) by mail.choca.pics (Postfix) with ESMTP id D04F418192DD5; Fri, 20 Oct 2023 13:48:05 +0200 (CEST) X-Virus-Scanned: amavis at choca.pics Received: from mail.choca.pics ([IPv6:::1]) by localhost (mail.choca.pics [IPv6:::1]) (amavis, port 10026) with ESMTP id GtRdW_J6tgop; Fri, 20 Oct 2023 13:48:05 +0200 (CEST) Received: from localhost (91.60.75.86.rev.sfr.net [86.75.60.91]) by mail.choca.pics (Postfix) with ESMTPSA id 769AC18192DC8; Fri, 20 Oct 2023 13:48:05 +0200 (CEST) From: Damien Cassou To: bug-gnu-emacs@gnu.org Subject: 29.1; `project-remember-projects-under' behavior doesn't match its doc Date: Fri, 20 Oct 2023 13:48:04 +0200 Message-ID: <87v8b18qh7.fsf@cassou.me> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2001:910:1410:500::1; envelope-from=damien@cassou.me; helo=mail.choca.pics X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.9 (/) X-Debbugs-Envelope-To: submit Cc: Dmitry Gutov 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.1 (/) Hi, the documentation of `project-remember-projects-under' is: "Index all projects below a directory DIR. If RECURSIVE is non-nil, recurse into all subdirectories to find more projects. After finishing, a message is printed summarizing the progress. The function returns the number of detected projects." Regardless of the value of RECURSIVE, I understand from the above that all child directories of the DIR argument will be investigated. The doc doesn't say anything about investigating if DIR is itself a project or not so I think it would make sense if the function wasn't. But the code says otherwise (as far as I understand it): (defun project-remember-projects-under (dir &optional recursive) (let ((queue (list dir))) ;; =E2=80=A6 (while queue (when-let ((subdir (pop queue)) ((file-directory-p subdir))) ;; maybe register `subdir' as a project ;; =E2=80=A6 (when (and recursive (file-directory-p subdir)) (setq queue (nconc (directory-files subdir =E2=80=A6) queue))))))) The code above seems to investigate DIR first and, if RECURSIVE is non-nil, look at the directories below it. Also, the second check (file-directory-p subdir) seems unnecessary because of the first one. There is a part of the code I don't understand: (unless (eq recursive 'in-progress) It seems nowhere in the code nor in the documentation do we say anything about this 'in-progress special value. Is it a left over from a previous (recursive) version of the algorithm? Best --=20 Damien Cassou "Success is the ability to go from one failure to another without losing enthusiasm." --Winston Churchill From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 20 11:47:26 2023 Received: (at 66649) by debbugs.gnu.org; 20 Oct 2023 15:47:26 +0000 Received: from localhost ([127.0.0.1]:41252 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qtrig-0003gO-4Z for submit@debbugs.gnu.org; Fri, 20 Oct 2023 11:47:26 -0400 Received: from forward502b.mail.yandex.net ([2a02:6b8:c02:900:1:45:d181:d502]:42072) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qtrid-0003g8-MR for 66649@debbugs.gnu.org; Fri, 20 Oct 2023 11:47:25 -0400 Received: from mail-nwsmtp-smtp-production-main-10.sas.yp-c.yandex.net (mail-nwsmtp-smtp-production-main-10.sas.yp-c.yandex.net [IPv6:2a02:6b8:c14:2481:0:640:e0:0]) by forward502b.mail.yandex.net (Yandex) with ESMTP id 365455ED83; Fri, 20 Oct 2023 18:46:48 +0300 (MSK) Received: by mail-nwsmtp-smtp-production-main-10.sas.yp-c.yandex.net (smtp/Yandex) with ESMTPSA id jkMLA61Dfa60-PH2e7VRE; Fri, 20 Oct 2023 18:46:47 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1697816807; bh=7OOaLz0x8bVTN8TTiFNd3YRWe+U7gLRjb6CJ8vuqUJg=; h=In-Reply-To:From:Subject:Message-ID:References:Date:To; b=baSaFiULzvbX+Q73Kx6rc4U9kTW48DB+pmH6WTTZOl7PRYxWBnIz2U4JV38jqnm7t csvMtuB0GXYKAqpjFfUOfz3d/ZFReLMTLn8l9Ja2+qJTVJmj7IRoBUjHBgwmPa/X8c M1TxNx30PaKTP5D8cJKbGhD1o2P5f6jhgcGBzNU4= Authentication-Results: mail-nwsmtp-smtp-production-main-10.sas.yp-c.yandex.net; dkim=pass header.i=@yandex.ru Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailauth.nyi.internal (Postfix) with ESMTP id 3EB7827C0054; Fri, 20 Oct 2023 11:46:45 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Fri, 20 Oct 2023 11:46:45 -0400 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrjeekgdeludcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefkffggfgfuvfhfhfgjtgfgsehtkeertddtfeejnecuhfhrohhmpeffmhhithhr hicuifhuthhovhcuoegughhuthhovheshigrnhguvgigrdhruheqnecuggftrfgrthhtvg hrnhepkeejfedtudefleelteegleevieefffekfeffheekkefhteegffffvefhfefgudff necuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepughguh htohhvodhmvghsmhhtphgruhhthhhpvghrshhonhgrlhhithihqddufeeffeelleehhedv qddvleegjeejjeejiedqughguhhtohhvpeephigrnhguvgigrdhruhesfhgrshhtmhgrih hlrdgtohhm X-ME-Proxy: Feedback-ID: ib1d9465d:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 20 Oct 2023 11:46:43 -0400 (EDT) Message-ID: <057a5ddf-2974-ce53-f795-b146e205db1e@yandex.ru> Date: Fri, 20 Oct 2023 18:46:41 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: bug#66649: 29.1; `project-remember-projects-under' behavior doesn't match its doc Content-Language: en-US To: Damien Cassou , 66649@debbugs.gnu.org, "Philip K." References: <87v8b18qh7.fsf@cassou.me> From: Dmitry Gutov In-Reply-To: <87v8b18qh7.fsf@cassou.me> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Score: -2.2 (--) X-Debbugs-Envelope-To: 66649 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: -3.2 (---) Hi Damien, thanks for the report. On 20/10/2023 14:48, Damien Cassou wrote: > the documentation of `project-remember-projects-under' is: > > "Index all projects below a directory DIR. If RECURSIVE is > non-nil, recurse into all subdirectories to find more projects. > After finishing, a message is printed summarizing the progress. The > function returns the number of detected projects." > > Regardless of the value of RECURSIVE, I understand from the above that > all child directories of the DIR argument will be investigated. The doc > doesn't say anything about investigating if DIR is itself a project or > not so I think it would make sense if the function wasn't. > > But the code says otherwise (as far as I understand it): > > (defun project-remember-projects-under (dir &optional recursive) > (let ((queue (list dir))) > ;; … > (while queue > (when-let ((subdir (pop queue)) > ((file-directory-p subdir))) > ;; maybe register `subdir' as a project > ;; … > (when (and recursive (file-directory-p subdir)) > (setq queue (nconc (directory-files subdir …) queue))))))) > > The code above seems to investigate DIR first and, if RECURSIVE is > non-nil, look at the directories below it. > > Also, the second check (file-directory-p subdir) seems unnecessary > because of the first one. > > There is a part of the code I don't understand: > > (unless (eq recursive 'in-progress) > > It seems nowhere in the code nor in the documentation do we say anything > about this 'in-progress special value. Is it a left over from a previous > (recursive) version of the algorithm? Philip, could you look into this? From debbugs-submit-bounces@debbugs.gnu.org Wed Nov 01 09:13:19 2023 Received: (at 66649) by debbugs.gnu.org; 1 Nov 2023 13:13:19 +0000 Received: from localhost ([127.0.0.1]:50184 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qyB23-0007vg-AW for submit@debbugs.gnu.org; Wed, 01 Nov 2023 09:13:19 -0400 Received: from mout02.posteo.de ([185.67.36.66]:49015) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qyB1x-0007vM-5b for 66649@debbugs.gnu.org; Wed, 01 Nov 2023 09:13:13 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id A069F240101 for <66649@debbugs.gnu.org>; Wed, 1 Nov 2023 14:12:28 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1698844348; bh=zAetayvNN8n4NngJMzTw2J/DcJKh+oQ1JhFBaSblFGU=; h=From:To:Cc:Subject:Autocrypt:Date:Message-ID:MIME-Version:From; b=O2876bdVdwQuoNhhyigv12A2RgQHA5zL4lMDv1wYuPSLLbpgXqCpjTDsGSKaHTjOR lxLl+GQL+1OB/19HFfVRQeRzJSavjN3bHTRiQ1eui8wDbEJS+90lzkIBX6pwCgp/3U 27bPuSv6tipuzJbPVc1SNKZKzR5WijhdZPbqd4zKR3HnyCfHE/Pm46032erEY6ZgOB nKCXsnARNzgwye+h1OVsJKPqcnuNzPwKh9ISJ1uJGR3/COonn9PGDqkc5/KCJFGvsN 35zbCg9F1ylfbBbHd+LLiDQRC/nZ7EL1qw3MOV/fBhR+w7c5/v2q4ig/B6AN4AfIwU FSHvD/ZlNBKdg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4SL6qc0J9jz6tvv; Wed, 1 Nov 2023 14:12:27 +0100 (CET) From: Philip Kaludercic To: Dmitry Gutov Subject: Re: bug#66649: 29.1; `project-remember-projects-under' behavior doesn't match its doc In-Reply-To: <057a5ddf-2974-ce53-f795-b146e205db1e@yandex.ru> (Dmitry Gutov's message of "Fri, 20 Oct 2023 18:46:41 +0300") References: <87v8b18qh7.fsf@cassou.me> <057a5ddf-2974-ce53-f795-b146e205db1e@yandex.ru> Autocrypt: addr=philipk@posteo.net; keydata= mDMEZBBQQhYJKwYBBAHaRw8BAQdAHJuofBrfqFh12uQu0Yi7mrl525F28eTmwUDflFNmdui0QlBo aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0 ZW8ubmV0PoiWBBMWCAA+FiEEDg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwMFCQHhM4AFCwkI BwIGFQoJCAsCBBYCAwECHgECF4AACgkQ8xYDWXahwulikAEA77hloUiSrXgFkUVJhlKBpLCHUjA0 mWZ9j9w5d08+jVwBAK6c4iGP7j+/PhbkxaEKa4V3MzIl7zJkcNNjHCXmvFcEuDgEZBBQQhIKKwYB BAGXVQEFAQEHQI5NLiLRjZy3OfSt1dhCmFyn+fN/QKELUYQetiaoe+MMAwEIB4h+BBgWCAAmFiEE Dg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwwFCQHhM4AACgkQ8xYDWXahwukm+wEA8cml4JpK NeAu65rg+auKrPOP6TP/4YWRCTIvuYDm0joBALw98AMz7/qMHvSCeU/hw9PL6u6R2EScxtpKnWof z4oM Date: Wed, 01 Nov 2023 13:12:27 +0000 Message-ID: <87bkcd1utg.fsf@posteo.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 66649 Cc: Damien Cassou , 66649@debbugs.gnu.org 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: -3.3 (---) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Dmitry Gutov writes: > Hi Damien, thanks for the report. > > On 20/10/2023 14:48, Damien Cassou wrote: >> the documentation of `project-remember-projects-under' is: >> "Index all projects below a directory DIR. If RECURSIVE is >> non-nil, recurse into all subdirectories to find more projects. >> After finishing, a message is printed summarizing the progress. The >> function returns the number of detected projects." >> Regardless of the value of RECURSIVE, I understand from the above >> that >> all child directories of the DIR argument will be investigated. The doc >> doesn't say anything about investigating if DIR is itself a project or >> not so I think it would make sense if the function wasn't. >> But the code says otherwise (as far as I understand it): >> (defun project-remember-projects-under (dir &optional recursive) >> (let ((queue (list dir))) >> ;; =E2=80=A6 >> (while queue >> (when-let ((subdir (pop queue)) >> ((file-directory-p subdir))) >> ;; maybe register `subdir' as a project >> ;; =E2=80=A6 >> (when (and recursive (file-directory-p subdir)) >> (setq queue (nconc (directory-files subdir =E2=80=A6) queue))= ))))) >> The code above seems to investigate DIR first and, if RECURSIVE is >> non-nil, look at the directories below it. >> Also, the second check (file-directory-p subdir) seems unnecessary >> because of the first one. >> There is a part of the code I don't understand: >> (unless (eq recursive 'in-progress) >> It seems nowhere in the code nor in the documentation do we say >> anything >> about this 'in-progress special value. Is it a left over from a previous >> (recursive) version of the algorithm? > > Philip, could you look into this? One idea would be to just simplify the entire implementation by relying on directory-files and directory-files-recursively. Say something like this: --=-=-= Content-Type: text/plain Content-Disposition: inline diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index fda1081eb62..e0d5e706e82 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -1821,35 +1821,28 @@ project-remember-projects-under projects." (interactive "DDirectory: \nP") (project--ensure-read-project-list) - (let ((queue (list dir)) - (count 0) - (known (make-hash-table - :size (* 2 (length project--list)) - :test #'equal ))) + (let ((dirs (if recursive + (directory-files-recursively dir "" t #'file-directory-p) + (cl-delete-if-not #'file-directory-p (directory-files dir t)))) + (known (make-hash-table :size (* 2 (length project--list)) + :test #'equal)) + (count 0)) (dolist (project (mapcar #'car project--list)) (puthash project t known)) - (while queue - (when-let ((subdir (pop queue)) - ((file-directory-p subdir))) - (when-let ((project (project--find-in-directory subdir)) - (project-root (project-root project)) - ((not (gethash project-root known)))) - (project-remember-project project t) - (puthash project-root t known) - (message "Found %s..." project-root) - (setq count (1+ count))) - (when (and recursive (file-directory-p subdir)) - (setq queue - (nconc - (directory-files - subdir t directory-files-no-dot-files-regexp t) - queue))))) - (unless (eq recursive 'in-progress) - (if (zerop count) - (message "No projects were found") - (project--write-project-list) - (message "%d project%s were found" - count (if (= count 1) "" "s")))) + (dolist (subdir dirs) + (when-let (((file-directory-p subdir)) + (project (project--find-in-directory subdir)) + (project-root (project-root project)) + ((not (gethash project-root known)))) + (project-remember-project project t) + (puthash project-root t known) + (message "Found %s..." project-root) + (setq count (1+ count)))) + (if (zerop count) + (message "No projects were found") + (project--write-project-list) + (message "%d project%s were found" + count (if (= count 1) "" "s"))) count)) (defun project-forget-zombie-projects () --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Wed Nov 01 15:04:57 2023 Received: (at 66649) by debbugs.gnu.org; 1 Nov 2023 19:04:57 +0000 Received: from localhost ([127.0.0.1]:52613 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qyGWP-0004yS-8c for submit@debbugs.gnu.org; Wed, 01 Nov 2023 15:04:57 -0400 Received: from forward502a.mail.yandex.net ([2a02:6b8:c0e:500:1:45:d181:d502]:55122) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qyGWI-0004y6-Qy for 66649@debbugs.gnu.org; Wed, 01 Nov 2023 15:04:55 -0400 Received: from mail-nwsmtp-smtp-production-main-84.vla.yp-c.yandex.net (mail-nwsmtp-smtp-production-main-84.vla.yp-c.yandex.net [IPv6:2a02:6b8:c0f:26a7:0:640:a2d5:0]) by forward502a.mail.yandex.net (Yandex) with ESMTP id 96BCB60FDD; Wed, 1 Nov 2023 22:04:07 +0300 (MSK) Received: by mail-nwsmtp-smtp-production-main-84.vla.yp-c.yandex.net (smtp/Yandex) with ESMTPSA id 54ci1cUWkSw0-tdDTpKWu; Wed, 01 Nov 2023 22:04:07 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1698865447; bh=mB7NC0OYwwyIy6LIudLSKdDhc2yOF/qLz9pSaaZkczA=; h=In-Reply-To:From:Subject:Message-ID:Cc:References:Date:To; b=JrZgfqaQUlBumh+BeJ+bcmddhrL11r/aPgXs1FQ1QJhCuUB3q/L2caYurAJJD0iv0 yvLdZuUTEkNcM6N+D5cj0bOc5lPR613JlRzvnI3FBMKAz8HzSd/f3+ts21onjhvSe1 sfFGZh5ncbw9d70a0udnYybw1lo1+SKG8lajCoP8= Authentication-Results: mail-nwsmtp-smtp-production-main-84.vla.yp-c.yandex.net; dkim=pass header.i=@yandex.ru Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailauth.nyi.internal (Postfix) with ESMTP id D479A27C005B; Wed, 1 Nov 2023 15:04:04 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Wed, 01 Nov 2023 15:04:04 -0400 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedruddtgedguddulecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefkffggfgfuvfevfhfhjggtgfesthejredttdefjeenucfhrhhomhepffhm ihhtrhihucfiuhhtohhvuceoughguhhtohhvseihrghnuggvgidrrhhuqeenucggtffrrg htthgvrhhnpedtffeggeekleetvedtkeeltefhfedtuddvgeektdekudejhfeftdevfedt ffduveenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe gughhuthhovhdomhgvshhmthhprghuthhhphgvrhhsohhnrghlihhthidqudeffeefleel heehvddqvdelgeejjeejjeeiqdgughhuthhovheppeihrghnuggvgidrrhhusehfrghsth hmrghilhdrtghomh X-ME-Proxy: Feedback-ID: ib1d9465d:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 1 Nov 2023 15:04:02 -0400 (EDT) Message-ID: Date: Wed, 1 Nov 2023 21:04:00 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: bug#66649: 29.1; `project-remember-projects-under' behavior doesn't match its doc Content-Language: en-US To: Philip Kaludercic References: <87v8b18qh7.fsf@cassou.me> <057a5ddf-2974-ce53-f795-b146e205db1e@yandex.ru> <87bkcd1utg.fsf@posteo.net> From: Dmitry Gutov In-Reply-To: <87bkcd1utg.fsf@posteo.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -2.2 (--) X-Debbugs-Envelope-To: 66649 Cc: Damien Cassou , 66649@debbugs.gnu.org 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: -3.2 (---) On 01/11/2023 15:12, Philip Kaludercic wrote: > One idea would be to just simplify the entire implementation by relying > on directory-files and directory-files-recursively. Say something like > this: Looks, good, just once thing: > + (directory-files-recursively dir "" t #'file-directory-p) The argument PREDICATE is not in Emacs 26.1 (which should remain compatible). But it doesn't help anyway, because that predicate is only used to determine whether to recurse into a subdirectory, and not to filter out files. So the full list of all files is generated anyway. If the performance still looks okay to you, I have no objections. Just remove that last argument, and it's good to install. From debbugs-submit-bounces@debbugs.gnu.org Wed Nov 01 17:37:11 2023 Received: (at 66649) by debbugs.gnu.org; 1 Nov 2023 21:37:11 +0000 Received: from localhost ([127.0.0.1]:52824 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qyIti-00061q-Sb for submit@debbugs.gnu.org; Wed, 01 Nov 2023 17:37:11 -0400 Received: from mout02.posteo.de ([185.67.36.66]:37589) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qyItf-00061Z-Pa for 66649@debbugs.gnu.org; Wed, 01 Nov 2023 17:37:09 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id D8281240101 for <66649@debbugs.gnu.org>; Wed, 1 Nov 2023 22:36:26 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1698874586; bh=rogWbQVCj2Uy7F3kDJS1xHkcR7BxP+P9xo/NVqeoDuo=; h=From:To:Cc:Subject:Autocrypt:Date:Message-ID:MIME-Version:From; b=U8prMiFQAci1aSGLKBmteAS9ZOQ7zBBRvA+DDjE98F9Awnzek7jaB/sw7bw/R65o9 rjPqKlivBi5bRT1QWp0IulKcrGy7GBcqLKRurXtCH5I5S46JuVjWHhR9WIafqITkTk x597901ZOfQ/mTieiH0CLwrDGtenjeeVvO/Q81GDVHKJBVizLl3XrcrszB7O+OP6rJ b/NMFay1TQHMLOmeb56RsGw1ANYP29zxgFwhUxGAsnDWARMh53yJ5zvNlHhyPIaw+c 35hp4VyuM5x8tXvbQXRdNb1idY8eoKBboe9O18taA4biWxZ6x6MJLdyfIIZbaqzI0Y AIyNvZuh66JMA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4SLL156zN2z9rxF; Wed, 1 Nov 2023 22:36:25 +0100 (CET) From: Philip Kaludercic To: Dmitry Gutov Subject: Re: bug#66649: 29.1; `project-remember-projects-under' behavior doesn't match its doc In-Reply-To: (Dmitry Gutov's message of "Wed, 1 Nov 2023 21:04:00 +0200") References: <87v8b18qh7.fsf@cassou.me> <057a5ddf-2974-ce53-f795-b146e205db1e@yandex.ru> <87bkcd1utg.fsf@posteo.net> Autocrypt: addr=philipk@posteo.net; keydata= mDMEZBBQQhYJKwYBBAHaRw8BAQdAHJuofBrfqFh12uQu0Yi7mrl525F28eTmwUDflFNmdui0QlBo aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0 ZW8ubmV0PoiWBBMWCAA+FiEEDg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwMFCQHhM4AFCwkI BwIGFQoJCAsCBBYCAwECHgECF4AACgkQ8xYDWXahwulikAEA77hloUiSrXgFkUVJhlKBpLCHUjA0 mWZ9j9w5d08+jVwBAK6c4iGP7j+/PhbkxaEKa4V3MzIl7zJkcNNjHCXmvFcEuDgEZBBQQhIKKwYB BAGXVQEFAQEHQI5NLiLRjZy3OfSt1dhCmFyn+fN/QKELUYQetiaoe+MMAwEIB4h+BBgWCAAmFiEE Dg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwwFCQHhM4AACgkQ8xYDWXahwukm+wEA8cml4JpK NeAu65rg+auKrPOP6TP/4YWRCTIvuYDm0joBALw98AMz7/qMHvSCeU/hw9PL6u6R2EScxtpKnWof z4oM Date: Wed, 01 Nov 2023 21:36:25 +0000 Message-ID: <87y1fhxijq.fsf@posteo.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 66649 Cc: Damien Cassou , 66649@debbugs.gnu.org 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: -3.3 (---) --=-=-= Content-Type: text/plain Dmitry Gutov writes: > On 01/11/2023 15:12, Philip Kaludercic wrote: >> One idea would be to just simplify the entire implementation by relying >> on directory-files and directory-files-recursively. Say something like >> this: > > Looks, good, just once thing: > >> + (directory-files-recursively dir "" t #'file-directory-p) > > The argument PREDICATE is not in Emacs 26.1 (which should remain > compatible). But it doesn't help anyway, because that predicate is > only used to determine whether to recurse into a subdirectory, and not > to filter out files. So the full list of all files is generated > anyway. OK, here is the updated patch: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Simplify-project-remember-projects-under.patch >From cf1541ddba61e3c6106a133a9b6b662f0f34749d Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Wed, 1 Nov 2023 22:34:28 +0100 Subject: [PATCH] Simplify 'project-remember-projects-under' * lisp/progmodes/project.el (project-remember-projects-under): Instead of traversing the directories manually, re-use `directory-files-recursively' to reduce complexity. (Bug#66649) --- lisp/progmodes/project.el | 47 +++++++++++++++++---------------------- 1 file changed, 20 insertions(+), 27 deletions(-) diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index fda1081eb62..935f7a7b873 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -1821,35 +1821,28 @@ project-remember-projects-under projects." (interactive "DDirectory: \nP") (project--ensure-read-project-list) - (let ((queue (list dir)) - (count 0) - (known (make-hash-table - :size (* 2 (length project--list)) - :test #'equal ))) + (let ((dirs (if recursive + (directory-files-recursively dir "" t) + (directory-files dir t))) + (known (make-hash-table :size (* 2 (length project--list)) + :test #'equal)) + (count 0)) (dolist (project (mapcar #'car project--list)) (puthash project t known)) - (while queue - (when-let ((subdir (pop queue)) - ((file-directory-p subdir))) - (when-let ((project (project--find-in-directory subdir)) - (project-root (project-root project)) - ((not (gethash project-root known)))) - (project-remember-project project t) - (puthash project-root t known) - (message "Found %s..." project-root) - (setq count (1+ count))) - (when (and recursive (file-directory-p subdir)) - (setq queue - (nconc - (directory-files - subdir t directory-files-no-dot-files-regexp t) - queue))))) - (unless (eq recursive 'in-progress) - (if (zerop count) - (message "No projects were found") - (project--write-project-list) - (message "%d project%s were found" - count (if (= count 1) "" "s")))) + (dolist (subdir dirs) + (when-let (((file-directory-p subdir)) + (project (project--find-in-directory subdir)) + (project-root (project-root project)) + ((not (gethash project-root known)))) + (project-remember-project project t) + (puthash project-root t known) + (message "Found %s..." project-root) + (setq count (1+ count)))) + (if (zerop count) + (message "No projects were found") + (project--write-project-list) + (message "%d project%s were found" + count (if (= count 1) "" "s"))) count)) (defun project-forget-zombie-projects () -- 2.39.2 --=-=-= Content-Type: text/plain > If the performance still looks okay to you, I have no objections. Just > remove that last argument, and it's good to install. I'd say that Damien can try it out and report if it works well enough. I worry that the files returned by `directory-files-recursively' might slow down the function considerably. Perhaps it might be better to write a little function just for project.el to only generate a list of directories. --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Wed Nov 01 18:40:47 2023 Received: (at 66649) by debbugs.gnu.org; 1 Nov 2023 22:40:47 +0000 Received: from localhost ([127.0.0.1]:53438 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qyJtH-0007y6-Ie for submit@debbugs.gnu.org; Wed, 01 Nov 2023 18:40:47 -0400 Received: from forward501a.mail.yandex.net ([2a02:6b8:c0e:500:1:45:d181:d501]:43626) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qyJtE-0007xm-0O for 66649@debbugs.gnu.org; Wed, 01 Nov 2023 18:40:47 -0400 Received: from mail-nwsmtp-smtp-production-main-84.vla.yp-c.yandex.net (mail-nwsmtp-smtp-production-main-84.vla.yp-c.yandex.net [IPv6:2a02:6b8:c0f:26a7:0:640:a2d5:0]) by forward501a.mail.yandex.net (Yandex) with ESMTP id A308B61064; Thu, 2 Nov 2023 01:40:00 +0300 (MSK) Received: by mail-nwsmtp-smtp-production-main-84.vla.yp-c.yandex.net (smtp/Yandex) with ESMTPSA id vdfEVOWWrOs0-rzqBsd2b; Thu, 02 Nov 2023 01:40:00 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1698878400; bh=k4HPiOWLcJUUPrbGYCqr8QTNITDVTS2hIRzjaB9iZ3E=; h=In-Reply-To:From:Subject:Message-ID:Cc:References:Date:To; b=LnH14FlDfujbXp6DxDj2K+SckzCYLX1wiN5muPve0zEkUe8A4rd6OQKUUUUH15TsS fGCC0dnPp2ygzh+jCjX2bxyeOTMjaecDwKvufv2LwzeTAiojiD7Tr7fIm8QQf8Q0oe SX8CyPoBWhohgdvudqHu0jNOTEzEKRxgQ/0yaqeQ= Authentication-Results: mail-nwsmtp-smtp-production-main-84.vla.yp-c.yandex.net; dkim=pass header.i=@yandex.ru Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailauth.nyi.internal (Postfix) with ESMTP id 84EAC27C0054; Wed, 1 Nov 2023 18:39:57 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Wed, 01 Nov 2023 18:39:57 -0400 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedruddthecutefuodetggdotefrodftvfcurf hrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjug hrpefkffggfgfuvfevfhfhjggtgfesthejredttdefjeenucfhrhhomhepffhmihhtrhih ucfiuhhtohhvuceoughguhhtohhvseihrghnuggvgidrrhhuqeenucggtffrrghtthgvrh hnpedtffeggeekleetvedtkeeltefhfedtuddvgeektdekudejhfeftdevfedtffduveen ucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegughhuth hovhdomhgvshhmthhprghuthhhphgvrhhsohhnrghlihhthidqudeffeefleelheehvddq vdelgeejjeejjeeiqdgughhuthhovheppeihrghnuggvgidrrhhusehfrghsthhmrghilh drtghomh X-ME-Proxy: Feedback-ID: ib1d9465d:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 1 Nov 2023 18:39:55 -0400 (EDT) Message-ID: Date: Thu, 2 Nov 2023 00:39:52 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: bug#66649: 29.1; `project-remember-projects-under' behavior doesn't match its doc Content-Language: en-US To: Philip Kaludercic References: <87v8b18qh7.fsf@cassou.me> <057a5ddf-2974-ce53-f795-b146e205db1e@yandex.ru> <87bkcd1utg.fsf@posteo.net> <87y1fhxijq.fsf@posteo.net> From: Dmitry Gutov In-Reply-To: <87y1fhxijq.fsf@posteo.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -2.2 (--) X-Debbugs-Envelope-To: 66649 Cc: Damien Cassou , 66649@debbugs.gnu.org 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: -3.2 (---) On 01/11/2023 23:36, Philip Kaludercic wrote: >> If the performance still looks okay to you, I have no objections. Just >> remove that last argument, and it's good to install. > I'd say that Damien can try it out and report if it works well enough. Let's wait, sure. > I worry that the files returned by `directory-files-recursively' might > slow down the function considerably. Perhaps it might be better to > write a little function just for project.el to only generate a list of > directories. It might, or it might not: the implementation of 'project-find-dir' is pretty unoptimized in this regard, and yet I'm still waiting for anyone to complain. From debbugs-submit-bounces@debbugs.gnu.org Thu Nov 02 15:58:47 2023 Received: (at 66649) by debbugs.gnu.org; 2 Nov 2023 19:58:47 +0000 Received: from localhost ([127.0.0.1]:56219 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qydq2-0008N1-Nz for submit@debbugs.gnu.org; Thu, 02 Nov 2023 15:58:47 -0400 Received: from mail.choca.pics ([80.67.172.235]:38224) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qydq0-0008Mr-JA for 66649@debbugs.gnu.org; Thu, 02 Nov 2023 15:58:45 -0400 Received: from localhost (localhost.localdomain [IPv6:::1]) by mail.choca.pics (Postfix) with ESMTP id 87C5618192DCC; Thu, 2 Nov 2023 20:58:07 +0100 (CET) Received: from mail.choca.pics ([IPv6:::1]) by localhost (mail.choca.pics [IPv6:::1]) (amavis, port 10032) with ESMTP id 5M8APygH0_7M; Thu, 2 Nov 2023 20:58:07 +0100 (CET) Received: from localhost (localhost.localdomain [IPv6:::1]) by mail.choca.pics (Postfix) with ESMTP id 0C79018192DD4; Thu, 2 Nov 2023 20:58:07 +0100 (CET) X-Virus-Scanned: amavis at choca.pics Received: from mail.choca.pics ([IPv6:::1]) by localhost (mail.choca.pics [IPv6:::1]) (amavis, port 10026) with ESMTP id NdfGDLYTQWsb; Thu, 2 Nov 2023 20:58:06 +0100 (CET) Received: from localhost (91.60.75.86.rev.sfr.net [86.75.60.91]) by mail.choca.pics (Postfix) with ESMTPSA id B2B8F18192DCC; Thu, 2 Nov 2023 20:58:06 +0100 (CET) From: Damien Cassou To: Dmitry Gutov , Philip Kaludercic Subject: Re: bug#66649: 29.1; `project-remember-projects-under' behavior doesn't match its doc In-Reply-To: References: <87v8b18qh7.fsf@cassou.me> <057a5ddf-2974-ce53-f795-b146e205db1e@yandex.ru> <87bkcd1utg.fsf@posteo.net> <87y1fhxijq.fsf@posteo.net> Date: Thu, 02 Nov 2023 20:58:05 +0100 Message-ID: <87zfzw6i7m.fsf@cassou.me> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 66649 Cc: 66649@debbugs.gnu.org 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 (-) Dmitry Gutov writes: > On 01/11/2023 23:36, Philip Kaludercic wrote: >> I'd say that Damien can try it out and report if it works well enough. > > Let's wait, sure. this is working great, thank you. The code is also simpler to understand in my opinion. Good job. If I may, the code of `project-remember-projects-under' seems to suffer from a similar mismatch between the docstring and implementation when RECURSIVE is nil: only the DIR directory is tested and not "known projects below a directory DIR". Best, -- Damien Cassou "Success is the ability to go from one failure to another without losing enthusiasm." --Winston Churchill From debbugs-submit-bounces@debbugs.gnu.org Thu Nov 02 16:42:49 2023 Received: (at 66649) by debbugs.gnu.org; 2 Nov 2023 20:42:49 +0000 Received: from localhost ([127.0.0.1]:56260 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qyeWb-000170-Cq for submit@debbugs.gnu.org; Thu, 02 Nov 2023 16:42:49 -0400 Received: from forward500b.mail.yandex.net ([2a02:6b8:c02:900:1:45:d181:d500]:50600) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qyeWO-00016V-Lk for 66649@debbugs.gnu.org; Thu, 02 Nov 2023 16:42:44 -0400 Received: from mail-nwsmtp-smtp-production-main-23.myt.yp-c.yandex.net (mail-nwsmtp-smtp-production-main-23.myt.yp-c.yandex.net [IPv6:2a02:6b8:c12:379d:0:640:1e2c:0]) by forward500b.mail.yandex.net (Yandex) with ESMTP id 91E8860DE9; Thu, 2 Nov 2023 23:41:49 +0300 (MSK) Received: by mail-nwsmtp-smtp-production-main-23.myt.yp-c.yandex.net (smtp/Yandex) with ESMTPSA id kfePkI4DSSw0-O8UYIJ8K; Thu, 02 Nov 2023 23:41:48 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1698957709; bh=1cNuF4AhQZAG9+1AKrXAO+RB3elOYOrjt8IZlH7ITy0=; h=In-Reply-To:From:Subject:Message-ID:Cc:References:Date:To; b=XaJQDVx/Z9JUZYPTcvbvNJFkrm9+4Ug/8oP19uaJ9kp6GPYw3aBfic6oUvS11BJ7q E3IIpYEOsvRIvV0UgJ/M4PHx3Y4IW9XV2xwOApb3HgXuoOmG30LbCG2/4fg8hpRpAA XBYUz8xyRSptQAszAYL2IHbtd99q4mweKOEMOU/E= Authentication-Results: mail-nwsmtp-smtp-production-main-23.myt.yp-c.yandex.net; dkim=pass header.i=@yandex.ru Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailauth.nyi.internal (Postfix) with ESMTP id 47E4427C005A; Thu, 2 Nov 2023 16:41:46 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Thu, 02 Nov 2023 16:41:46 -0400 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedruddtiedgudeflecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefkffggfgfuvfevfhfhjggtgfesthejredttdefjeenucfhrhhomhepffhm ihhtrhihucfiuhhtohhvuceoughguhhtohhvseihrghnuggvgidrrhhuqeenucggtffrrg htthgvrhhnpedtffeggeekleetvedtkeeltefhfedtuddvgeektdekudejhfeftdevfedt ffduveenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe gughhuthhovhdomhgvshhmthhprghuthhhphgvrhhsohhnrghlihhthidqudeffeefleel heehvddqvdelgeejjeejjeeiqdgughhuthhovheppeihrghnuggvgidrrhhusehfrghsth hmrghilhdrtghomh X-ME-Proxy: Feedback-ID: ib1d9465d:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 2 Nov 2023 16:41:44 -0400 (EDT) Message-ID: <540bbdb3-5861-146c-688f-41534962fdf5@yandex.ru> Date: Thu, 2 Nov 2023 22:41:41 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: bug#66649: 29.1; `project-remember-projects-under' behavior doesn't match its doc Content-Language: en-US To: Damien Cassou , Philip Kaludercic References: <87v8b18qh7.fsf@cassou.me> <057a5ddf-2974-ce53-f795-b146e205db1e@yandex.ru> <87bkcd1utg.fsf@posteo.net> <87y1fhxijq.fsf@posteo.net> <87zfzw6i7m.fsf@cassou.me> From: Dmitry Gutov In-Reply-To: <87zfzw6i7m.fsf@cassou.me> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -1.5 (-) X-Debbugs-Envelope-To: 66649 Cc: 66649@debbugs.gnu.org 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: -3.2 (---) On 02/11/2023 21:58, Damien Cassou wrote: > If I may, the code of `project-remember-projects-under' seems to suffer > from a similar mismatch between the docstring and implementation when > RECURSIVE is nil: only the DIR directory is tested and not "known > projects below a directory DIR". Have you seen this problem when testing it? The last line in + (let ((dirs (if recursive + (directory-files-recursively dir "" t) + (directory-files dir t))) seems to do the job of including the direct subdirectories in the search. From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 03 09:01:45 2023 Received: (at 66649) by debbugs.gnu.org; 3 Nov 2023 13:01:46 +0000 Received: from localhost ([127.0.0.1]:57269 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qytny-0001aP-1B for submit@debbugs.gnu.org; Fri, 03 Nov 2023 09:01:45 -0400 Received: from mail.choca.pics ([2001:910:1410:500::1]:45636) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qytnt-0001aB-BZ for 66649@debbugs.gnu.org; Fri, 03 Nov 2023 09:01:41 -0400 Received: from localhost (localhost.localdomain [IPv6:::1]) by mail.choca.pics (Postfix) with ESMTP id 1135318192DCC; Fri, 3 Nov 2023 14:00:58 +0100 (CET) Received: from mail.choca.pics ([IPv6:::1]) by localhost (mail.choca.pics [IPv6:::1]) (amavis, port 10032) with ESMTP id 0qJMdbU6Boct; Fri, 3 Nov 2023 14:00:57 +0100 (CET) Received: from localhost (localhost.localdomain [IPv6:::1]) by mail.choca.pics (Postfix) with ESMTP id 6D74018192DD4; Fri, 3 Nov 2023 14:00:57 +0100 (CET) X-Virus-Scanned: amavis at choca.pics Received: from mail.choca.pics ([IPv6:::1]) by localhost (mail.choca.pics [IPv6:::1]) (amavis, port 10026) with ESMTP id mesB8bv5tCD8; Fri, 3 Nov 2023 14:00:57 +0100 (CET) Received: from localhost (unknown [46.18.96.114]) by mail.choca.pics (Postfix) with ESMTPSA id D564018192DCC; Fri, 3 Nov 2023 14:00:56 +0100 (CET) From: Damien Cassou To: Dmitry Gutov , Philip Kaludercic Subject: Re: bug#66649: 29.1; `project-remember-projects-under' behavior doesn't match its doc In-Reply-To: <540bbdb3-5861-146c-688f-41534962fdf5@yandex.ru> References: <87v8b18qh7.fsf@cassou.me> <057a5ddf-2974-ce53-f795-b146e205db1e@yandex.ru> <87bkcd1utg.fsf@posteo.net> <87y1fhxijq.fsf@posteo.net> <87zfzw6i7m.fsf@cassou.me> <540bbdb3-5861-146c-688f-41534962fdf5@yandex.ru> Date: Fri, 03 Nov 2023 14:00:54 +0100 Message-ID: <87wmuzq9dl.fsf@cassou.me> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 66649 Cc: 66649@debbugs.gnu.org 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 (-) Dmitry Gutov writes: > On 02/11/2023 21:58, Damien Cassou wrote: >> If I may, the code of `project-remember-projects-under' seems to suffer >> from a similar mismatch between the docstring and implementation when >> RECURSIVE is nil: only the DIR directory is tested and not "known >> projects below a directory DIR". > > Have you seen this problem when testing it? The patch is working perfectly find, thank you. I was talking about an unrelated (but similar) problem in a different function: `project-forget-projects-under'. My message incorrectly referred to the function you already fixed. Sorry for the confusion. -- Damien Cassou "Success is the ability to go from one failure to another without losing enthusiasm." --Winston Churchill From debbugs-submit-bounces@debbugs.gnu.org Wed Nov 08 03:14:06 2023 Received: (at 66649) by debbugs.gnu.org; 8 Nov 2023 08:14:06 +0000 Received: from localhost ([127.0.0.1]:43956 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r0dhN-000171-PY for submit@debbugs.gnu.org; Wed, 08 Nov 2023 03:14:06 -0500 Received: from mout02.posteo.de ([185.67.36.66]:47955) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r0dhK-00016Q-QA for 66649@debbugs.gnu.org; Wed, 08 Nov 2023 03:14:04 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id E482B240101 for <66649@debbugs.gnu.org>; Wed, 8 Nov 2023 09:13:17 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1699431197; bh=jdpm0G26OCtXu60nxdLmwIHhhVyqdbJRK9SRwNiRhzs=; h=From:To:Cc:Subject:Autocrypt:Date:Message-ID:MIME-Version:From; b=L79gXPmKXk3yaC8u1aSRwL8SfJHzA2hi/L/mnY5kgWsD/9p7h31zb1fA+8CTkfa23 COVkLOhahmaF6Rujecmr2skF7p1XDz5gcTM2wvA5gH0Kbn2n2VqGBWoD3xYK1wCicJ pUNeR1YzKNCQHldOVVcLcpXfF7EQImalgIXlkTMGTftaetWO4/kl9ZgbIX2nfaT9HI 2mQKEV7PVMngUBB+fCU7/EvYr+pmcuRgPXGlG8as1sJymHHo8iRcRKoZaMGm8LrruR i2qu18AM2LAh1e2UcM3T0kf0BwqwwlOMXH47vWP4LQENchSaGyu7vhYZujKkeb30Di FUKKoGAart45A== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4SQHs91ZMTz6twb; Wed, 8 Nov 2023 09:13:17 +0100 (CET) From: Philip Kaludercic To: Damien Cassou Subject: Re: bug#66649: 29.1; `project-remember-projects-under' behavior doesn't match its doc In-Reply-To: <87wmuzq9dl.fsf@cassou.me> (Damien Cassou's message of "Fri, 03 Nov 2023 14:00:54 +0100") References: <87v8b18qh7.fsf@cassou.me> <057a5ddf-2974-ce53-f795-b146e205db1e@yandex.ru> <87bkcd1utg.fsf@posteo.net> <87y1fhxijq.fsf@posteo.net> <87zfzw6i7m.fsf@cassou.me> <540bbdb3-5861-146c-688f-41534962fdf5@yandex.ru> <87wmuzq9dl.fsf@cassou.me> Autocrypt: addr=philipk@posteo.net; keydata= mDMEZBBQQhYJKwYBBAHaRw8BAQdAHJuofBrfqFh12uQu0Yi7mrl525F28eTmwUDflFNmdui0QlBo aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0 ZW8ubmV0PoiWBBMWCAA+FiEEDg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwMFCQHhM4AFCwkI BwIGFQoJCAsCBBYCAwECHgECF4AACgkQ8xYDWXahwulikAEA77hloUiSrXgFkUVJhlKBpLCHUjA0 mWZ9j9w5d08+jVwBAK6c4iGP7j+/PhbkxaEKa4V3MzIl7zJkcNNjHCXmvFcEuDgEZBBQQhIKKwYB BAGXVQEFAQEHQI5NLiLRjZy3OfSt1dhCmFyn+fN/QKELUYQetiaoe+MMAwEIB4h+BBgWCAAmFiEE Dg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwwFCQHhM4AACgkQ8xYDWXahwukm+wEA8cml4JpK NeAu65rg+auKrPOP6TP/4YWRCTIvuYDm0joBALw98AMz7/qMHvSCeU/hw9PL6u6R2EScxtpKnWof z4oM Date: Wed, 08 Nov 2023 08:13:16 +0000 Message-ID: <87y1f8r7c3.fsf@posteo.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 66649 Cc: 66649@debbugs.gnu.org, Dmitry Gutov 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: -3.3 (---) --=-=-= Content-Type: text/plain Damien Cassou writes: > Dmitry Gutov writes: >> On 02/11/2023 21:58, Damien Cassou wrote: >>> If I may, the code of `project-remember-projects-under' seems to suffer >>> from a similar mismatch between the docstring and implementation when >>> RECURSIVE is nil: only the DIR directory is tested and not "known >>> projects below a directory DIR". >> >> Have you seen this problem when testing it? > > The patch is working perfectly find, thank you. I was talking about an > unrelated (but similar) problem in a different function: > `project-forget-projects-under'. My message incorrectly referred to the > function you already fixed. Sorry for the confusion. I don't think this is the same problem, in `project-forget-projects-under' there is no manual recursive descent, just some duplicated code. We could also re-write it to look like this: --=-=-= Content-Type: text/plain Content-Disposition: inline diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index 95db9d0ef4c..5f1cce160b2 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -1905,15 +1905,12 @@ project-forget-projects-under forgotten projects." (interactive "DDirectory: \nP") (let ((count 0)) - (if recursive - (dolist (proj (project-known-project-roots)) - (when (file-in-directory-p proj dir) - (project-forget-project proj) - (setq count (1+ count)))) - (dolist (proj (project-known-project-roots)) - (when (file-equal-p (file-name-directory proj) dir) - (project-forget-project proj) - (setq count (1+ count))))) + (dolist (proj (project-known-project-roots)) + (when (if recursive + (file-in-directory-p proj dir) + (file-equal-p (file-name-directory proj) dir)) + (project-forget-project proj) + (setq count (1+ count)))) (if (zerop count) (message "No projects were forgotten") (project--write-project-list) --=-=-= Content-Type: text/plain But that would incur a branch in every iteration of `dolist'. Either way, I'll push the first patch to master since there haven't been any objections to that change. --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Wed Nov 08 14:57:55 2023 Received: (at 66649) by debbugs.gnu.org; 8 Nov 2023 19:57:55 +0000 Received: from localhost ([127.0.0.1]:46321 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r0ogV-0003Iq-AT for submit@debbugs.gnu.org; Wed, 08 Nov 2023 14:57:55 -0500 Received: from forward500a.mail.yandex.net ([2a02:6b8:c0e:500:1:45:d181:d500]:35462) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r0ogS-0003Ib-Ax for 66649@debbugs.gnu.org; Wed, 08 Nov 2023 14:57:54 -0500 Received: from mail-nwsmtp-smtp-production-main-55.vla.yp-c.yandex.net (mail-nwsmtp-smtp-production-main-55.vla.yp-c.yandex.net [IPv6:2a02:6b8:c1d:7133:0:640:283e:0]) by forward500a.mail.yandex.net (Yandex) with ESMTP id CB8306143C; Wed, 8 Nov 2023 22:57:04 +0300 (MSK) Received: by mail-nwsmtp-smtp-production-main-55.vla.yp-c.yandex.net (smtp/Yandex) with ESMTPSA id 1vjXe54BTqM0-wmeUxM4E; Wed, 08 Nov 2023 22:57:04 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1699473424; bh=kiWG9UTyoVlMIst/12+w8MOwRjIcDRVPqYf2BrmQV+M=; h=In-Reply-To:From:Subject:Message-ID:Cc:References:Date:To; b=vZ7o6XN/imAy7r4PHib0iulsIYdNAmrMXHMIgjnXgp8rt1Y5IPY6saECI0arzoEBg duaPpkR0076AmfB0MgzlF2YABtEbJzkHKUcoBzJqn/Wr/wBXMQT1am45KdexYPP8bk p0zK5aWqFhO3GwK7XXsHxSX7YtNASpI5SK3uZF4Q= Authentication-Results: mail-nwsmtp-smtp-production-main-55.vla.yp-c.yandex.net; dkim=pass header.i=@yandex.ru Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailauth.nyi.internal (Postfix) with ESMTP id 3F5BE27C005A; Wed, 8 Nov 2023 14:57:01 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Wed, 08 Nov 2023 14:57:01 -0500 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrudduledguddvlecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefkffggfgfuvfevfhfhjggtgfesthejredttdefjeenucfhrhhomhepffhm ihhtrhihucfiuhhtohhvuceoughguhhtohhvseihrghnuggvgidrrhhuqeenucggtffrrg htthgvrhhnpedtffeggeekleetvedtkeeltefhfedtuddvgeektdekudejhfeftdevfedt ffduveenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe gughhuthhovhdomhgvshhmthhprghuthhhphgvrhhsohhnrghlihhthidqudeffeefleel heehvddqvdelgeejjeejjeeiqdgughhuthhovheppeihrghnuggvgidrrhhusehfrghsth hmrghilhdrtghomh X-ME-Proxy: Feedback-ID: ib1d9465d:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 8 Nov 2023 14:56:59 -0500 (EST) Message-ID: Date: Wed, 8 Nov 2023 21:56:57 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: bug#66649: 29.1; `project-remember-projects-under' behavior doesn't match its doc Content-Language: en-US To: Philip Kaludercic , Damien Cassou References: <87v8b18qh7.fsf@cassou.me> <057a5ddf-2974-ce53-f795-b146e205db1e@yandex.ru> <87bkcd1utg.fsf@posteo.net> <87y1fhxijq.fsf@posteo.net> <87zfzw6i7m.fsf@cassou.me> <540bbdb3-5861-146c-688f-41534962fdf5@yandex.ru> <87wmuzq9dl.fsf@cassou.me> <87y1f8r7c3.fsf@posteo.net> From: Dmitry Gutov In-Reply-To: <87y1f8r7c3.fsf@posteo.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -2.2 (--) X-Debbugs-Envelope-To: 66649 Cc: 66649@debbugs.gnu.org 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: -3.2 (---) On 08/11/2023 10:13, Philip Kaludercic wrote: > I don't think this is the same problem, in > `project-forget-projects-under' there is no manual recursive descent, > just some duplicated code. We could also re-write it to look like this: > > > diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el > index 95db9d0ef4c..5f1cce160b2 100644 > --- a/lisp/progmodes/project.el > +++ b/lisp/progmodes/project.el > @@ -1905,15 +1905,12 @@ project-forget-projects-under > forgotten projects." > (interactive "DDirectory: \nP") > (let ((count 0)) > - (if recursive > - (dolist (proj (project-known-project-roots)) > - (when (file-in-directory-p proj dir) > - (project-forget-project proj) > - (setq count (1+ count)))) > - (dolist (proj (project-known-project-roots)) > - (when (file-equal-p (file-name-directory proj) dir) > - (project-forget-project proj) > - (setq count (1+ count))))) > + (dolist (proj (project-known-project-roots)) > + (when (if recursive > + (file-in-directory-p proj dir) > + (file-equal-p (file-name-directory proj) dir)) > + (project-forget-project proj) > + (setq count (1+ count)))) > (if (zerop count) > (message "No projects were forgotten") > (project--write-project-list) > > > But that would incur a branch in every iteration of `dolist'. LGTM too. The branch-per-iteration is unlikely to move a needle in any realistic scenario. Up to you, whether to install this or keep the original version. From debbugs-submit-bounces@debbugs.gnu.org Wed Nov 08 14:59:37 2023 Received: (at 66649) by debbugs.gnu.org; 8 Nov 2023 19:59:37 +0000 Received: from localhost ([127.0.0.1]:46329 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r0oi8-0003Lm-IN for submit@debbugs.gnu.org; Wed, 08 Nov 2023 14:59:37 -0500 Received: from mout01.posteo.de ([185.67.36.65]:59063) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r0oi4-0003LI-Nu for 66649@debbugs.gnu.org; Wed, 08 Nov 2023 14:59:34 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 478BD240029 for <66649@debbugs.gnu.org>; Wed, 8 Nov 2023 20:58:46 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1699473527; bh=Zz0hzNrzDq7Izli9oTEYPD/e3UPWoAbwZOOhuFySQfw=; h=From:To:Cc:Subject:Autocrypt:Date:Message-ID:MIME-Version:From; b=kWO3RX6p10gQizViSK02A3vSYAxzQ/4tDe9B3VmrufSp4arxXWG3jUBSlYlNy2q5B ML1/McdZ/0ze2EcZGP1pE4P3QNYauy7Ka8XTVyWkuDECCmMo8KF2QU3FjpvT2nFhbO 1Rw3IZZpM4QBiNqGHtHrWjFTrVKDHWivpA9VQioU3Ldz76LdHVtBT03tEYWLMQU5IF BGfBhOtYgC5Q5/mA5L36BkYD0+yg+L6HGXkbDjBDv1eyMeWf1BEhLlkkqlpTo8A/Mi 1a/CnjRDhlPdqb9LP12spDuWuv3OhogUGmTHF/S45t8X6M+o46fzUwq8TBs3faFrYx VbQDolw0w0AMg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4SQbW96vJnz9rxB; Wed, 8 Nov 2023 20:58:45 +0100 (CET) From: Philip Kaludercic To: Dmitry Gutov Subject: Re: bug#66649: 29.1; `project-remember-projects-under' behavior doesn't match its doc In-Reply-To: (Dmitry Gutov's message of "Wed, 8 Nov 2023 21:56:57 +0200") References: <87v8b18qh7.fsf@cassou.me> <057a5ddf-2974-ce53-f795-b146e205db1e@yandex.ru> <87bkcd1utg.fsf@posteo.net> <87y1fhxijq.fsf@posteo.net> <87zfzw6i7m.fsf@cassou.me> <540bbdb3-5861-146c-688f-41534962fdf5@yandex.ru> <87wmuzq9dl.fsf@cassou.me> <87y1f8r7c3.fsf@posteo.net> Autocrypt: addr=philipk@posteo.net; keydata= mDMEZBBQQhYJKwYBBAHaRw8BAQdAHJuofBrfqFh12uQu0Yi7mrl525F28eTmwUDflFNmdui0QlBo aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0 ZW8ubmV0PoiWBBMWCAA+FiEEDg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwMFCQHhM4AFCwkI BwIGFQoJCAsCBBYCAwECHgECF4AACgkQ8xYDWXahwulikAEA77hloUiSrXgFkUVJhlKBpLCHUjA0 mWZ9j9w5d08+jVwBAK6c4iGP7j+/PhbkxaEKa4V3MzIl7zJkcNNjHCXmvFcEuDgEZBBQQhIKKwYB BAGXVQEFAQEHQI5NLiLRjZy3OfSt1dhCmFyn+fN/QKELUYQetiaoe+MMAwEIB4h+BBgWCAAmFiEE Dg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwwFCQHhM4AACgkQ8xYDWXahwukm+wEA8cml4JpK NeAu65rg+auKrPOP6TP/4YWRCTIvuYDm0joBALw98AMz7/qMHvSCeU/hw9PL6u6R2EScxtpKnWof z4oM Date: Wed, 08 Nov 2023 19:58:43 +0000 Message-ID: <87wmusow3w.fsf@posteo.net> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 66649 Cc: Damien Cassou , 66649@debbugs.gnu.org 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: -3.3 (---) Dmitry Gutov writes: > On 08/11/2023 10:13, Philip Kaludercic wrote: >> I don't think this is the same problem, in >> `project-forget-projects-under' there is no manual recursive descent, >> just some duplicated code. We could also re-write it to look like this: >> diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el >> index 95db9d0ef4c..5f1cce160b2 100644 >> --- a/lisp/progmodes/project.el >> +++ b/lisp/progmodes/project.el >> @@ -1905,15 +1905,12 @@ project-forget-projects-under >> forgotten projects." >> (interactive "DDirectory: \nP") >> (let ((count 0)) >> - (if recursive >> - (dolist (proj (project-known-project-roots)) >> - (when (file-in-directory-p proj dir) >> - (project-forget-project proj) >> - (setq count (1+ count)))) >> - (dolist (proj (project-known-project-roots)) >> - (when (file-equal-p (file-name-directory proj) dir) >> - (project-forget-project proj) >> - (setq count (1+ count))))) >> + (dolist (proj (project-known-project-roots)) >> + (when (if recursive >> + (file-in-directory-p proj dir) >> + (file-equal-p (file-name-directory proj) dir)) >> + (project-forget-project proj) >> + (setq count (1+ count)))) >> (if (zerop count) >> (message "No projects were forgotten") >> (project--write-project-list) >> But that would incur a branch in every iteration of `dolist'. > > LGTM too. The branch-per-iteration is unlikely to move a needle in any > realistic scenario. > > Up to you, whether to install this or keep the original version. I don't see a need, this is basically an aesthetic change. Should we close the bug report? From debbugs-submit-bounces@debbugs.gnu.org Wed Nov 08 15:17:01 2023 Received: (at 66649) by debbugs.gnu.org; 8 Nov 2023 20:17:01 +0000 Received: from localhost ([127.0.0.1]:46340 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r0oyz-0003of-12 for submit@debbugs.gnu.org; Wed, 08 Nov 2023 15:17:01 -0500 Received: from forward500c.mail.yandex.net ([2a02:6b8:c03:500:1:45:d181:d500]:45526) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r0oyu-0003oM-Ti for 66649@debbugs.gnu.org; Wed, 08 Nov 2023 15:16:59 -0500 Received: from mail-nwsmtp-smtp-production-main-91.sas.yp-c.yandex.net (mail-nwsmtp-smtp-production-main-91.sas.yp-c.yandex.net [IPv6:2a02:6b8:c08:47a7:0:640:b27a:0]) by forward500c.mail.yandex.net (Yandex) with ESMTP id 949EA61175; Wed, 8 Nov 2023 23:16:10 +0300 (MSK) Received: by mail-nwsmtp-smtp-production-main-91.sas.yp-c.yandex.net (smtp/Yandex) with ESMTPSA id 7GkfRM5BXGk0-iweGoT2C; Wed, 08 Nov 2023 23:16:09 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1699474570; bh=tlmWGIYbs4/axH7lYcFThX4Y7A4BlEqpefZ5Qeig+Wo=; h=In-Reply-To:From:Subject:Message-ID:Cc:References:Date:To; b=TWbTKQXtJ75ObLjiREw6qWQ85g0MzasEfmR+j1vN8fA+pTrO8+G7fF+lb3wxI09g1 NcW51UWn1YxATw61wj1Qa0q/WU25oPHuEqBUqRQ4UHqW1hBLCUo2FoJVEbCLOos2r8 wqSaB8fZCtMU3cDfTAoZNLEjTwLSA50LBe5rdK7s= Authentication-Results: mail-nwsmtp-smtp-production-main-91.sas.yp-c.yandex.net; dkim=pass header.i=@yandex.ru Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailauth.nyi.internal (Postfix) with ESMTP id 789FF27C0054; Wed, 8 Nov 2023 15:16:07 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Wed, 08 Nov 2023 15:16:07 -0500 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrudduledgudefvdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefkffggfgfuvfevfhfhjggtgfesthejredttdefjeenucfhrhhomhepffhm ihhtrhihucfiuhhtohhvuceoughguhhtohhvseihrghnuggvgidrrhhuqeenucggtffrrg htthgvrhhnpedtffeggeekleetvedtkeeltefhfedtuddvgeektdekudejhfeftdevfedt ffduveenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe gughhuthhovhdomhgvshhmthhprghuthhhphgvrhhsohhnrghlihhthidqudeffeefleel heehvddqvdelgeejjeejjeeiqdgughhuthhovheppeihrghnuggvgidrrhhusehfrghsth hmrghilhdrtghomh X-ME-Proxy: Feedback-ID: ib1d9465d:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 8 Nov 2023 15:16:06 -0500 (EST) Message-ID: <6c391eda-c893-1f57-c486-3a693b83ed73@yandex.ru> Date: Wed, 8 Nov 2023 22:16:04 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: bug#66649: 29.1; `project-remember-projects-under' behavior doesn't match its doc Content-Language: en-US To: Damien Cassou References: <87v8b18qh7.fsf@cassou.me> <057a5ddf-2974-ce53-f795-b146e205db1e@yandex.ru> <87bkcd1utg.fsf@posteo.net> <87y1fhxijq.fsf@posteo.net> <87zfzw6i7m.fsf@cassou.me> <540bbdb3-5861-146c-688f-41534962fdf5@yandex.ru> <87wmuzq9dl.fsf@cassou.me> <87y1f8r7c3.fsf@posteo.net> <87wmusow3w.fsf@posteo.net> From: Dmitry Gutov In-Reply-To: <87wmusow3w.fsf@posteo.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -2.2 (--) X-Debbugs-Envelope-To: 66649 Cc: 66649@debbugs.gnu.org, "Philip K." 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: -3.2 (---) On 08/11/2023 21:58, Philip Kaludercic wrote: > Dmitry Gutov writes: > >> On 08/11/2023 10:13, Philip Kaludercic wrote: >>> I don't think this is the same problem, in >>> `project-forget-projects-under' there is no manual recursive descent, >>> just some duplicated code. We could also re-write it to look like this: >>> diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el >>> index 95db9d0ef4c..5f1cce160b2 100644 >>> --- a/lisp/progmodes/project.el >>> +++ b/lisp/progmodes/project.el >>> @@ -1905,15 +1905,12 @@ project-forget-projects-under >>> forgotten projects." >>> (interactive "DDirectory: \nP") >>> (let ((count 0)) >>> - (if recursive >>> - (dolist (proj (project-known-project-roots)) >>> - (when (file-in-directory-p proj dir) >>> - (project-forget-project proj) >>> - (setq count (1+ count)))) >>> - (dolist (proj (project-known-project-roots)) >>> - (when (file-equal-p (file-name-directory proj) dir) >>> - (project-forget-project proj) >>> - (setq count (1+ count))))) >>> + (dolist (proj (project-known-project-roots)) >>> + (when (if recursive >>> + (file-in-directory-p proj dir) >>> + (file-equal-p (file-name-directory proj) dir)) >>> + (project-forget-project proj) >>> + (setq count (1+ count)))) >>> (if (zerop count) >>> (message "No projects were forgotten") >>> (project--write-project-list) >>> But that would incur a branch in every iteration of `dolist'. >> LGTM too. The branch-per-iteration is unlikely to move a needle in any >> realistic scenario. >> >> Up to you, whether to install this or keep the original version. > I don't see a need, this is basically an aesthetic change. Should we > close the bug report? Damien, is there anything else here to do? Did you perhaps also (or instead) saw a problem with either of the docstrings? I'm not sure if I understood the last complaint correctly. From debbugs-submit-bounces@debbugs.gnu.org Wed Nov 08 16:14:23 2023 Received: (at 66649) by debbugs.gnu.org; 8 Nov 2023 21:14:24 +0000 Received: from localhost ([127.0.0.1]:46393 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r0psV-0005R4-3y for submit@debbugs.gnu.org; Wed, 08 Nov 2023 16:14:23 -0500 Received: from mail.choca.pics ([2001:910:1410:500::1]:39892) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r0psQ-0005Qq-VE for 66649@debbugs.gnu.org; Wed, 08 Nov 2023 16:14:22 -0500 Received: from localhost (localhost.localdomain [IPv6:::1]) by mail.choca.pics (Postfix) with ESMTP id CB81718192DD5; Wed, 8 Nov 2023 22:13:36 +0100 (CET) Received: from mail.choca.pics ([IPv6:::1]) by localhost (mail.choca.pics [IPv6:::1]) (amavis, port 10032) with ESMTP id D0TlC-oSXOAX; Wed, 8 Nov 2023 22:13:36 +0100 (CET) Received: from localhost (localhost.localdomain [IPv6:::1]) by mail.choca.pics (Postfix) with ESMTP id 2341F18192DD6; Wed, 8 Nov 2023 22:13:36 +0100 (CET) X-Virus-Scanned: amavis at choca.pics Received: from mail.choca.pics ([IPv6:::1]) by localhost (mail.choca.pics [IPv6:::1]) (amavis, port 10026) with ESMTP id Quus4DylyWio; Wed, 8 Nov 2023 22:13:35 +0100 (CET) Received: from localhost (91.60.75.86.rev.sfr.net [86.75.60.91]) by mail.choca.pics (Postfix) with ESMTPSA id BD78E18192DD5; Wed, 8 Nov 2023 22:13:35 +0100 (CET) From: Damien Cassou To: Dmitry Gutov Subject: Re: bug#66649: 29.1; `project-remember-projects-under' behavior doesn't match its doc In-Reply-To: <6c391eda-c893-1f57-c486-3a693b83ed73@yandex.ru> References: <87v8b18qh7.fsf@cassou.me> <057a5ddf-2974-ce53-f795-b146e205db1e@yandex.ru> <87bkcd1utg.fsf@posteo.net> <87y1fhxijq.fsf@posteo.net> <87zfzw6i7m.fsf@cassou.me> <540bbdb3-5861-146c-688f-41534962fdf5@yandex.ru> <87wmuzq9dl.fsf@cassou.me> <87y1f8r7c3.fsf@posteo.net> <87wmusow3w.fsf@posteo.net> <6c391eda-c893-1f57-c486-3a693b83ed73@yandex.ru> Date: Wed, 08 Nov 2023 22:13:34 +0100 Message-ID: <87a5rokkxt.fsf@cassou.me> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 66649 Cc: 66649@debbugs.gnu.org, "Philip K." 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 (-) Dmitry Gutov writes: > Damien, is there anything else here to do? > > Did you perhaps also (or instead) saw a problem with either of the > docstrings? I'm not sure if I understood the last complaint correctly. The bug can be closed, no problem. Thanks everyone for your great work. -- Damien Cassou "Success is the ability to go from one failure to another without losing enthusiasm." --Winston Churchill From debbugs-submit-bounces@debbugs.gnu.org Wed Nov 08 16:17:08 2023 Received: (at 66649-done) by debbugs.gnu.org; 8 Nov 2023 21:17:08 +0000 Received: from localhost ([127.0.0.1]:46403 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r0pvA-0005W8-He for submit@debbugs.gnu.org; Wed, 08 Nov 2023 16:17:08 -0500 Received: from forward500b.mail.yandex.net ([2a02:6b8:c02:900:1:45:d181:d500]:42802) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r0pv8-0005VZ-AM for 66649-done@debbugs.gnu.org; Wed, 08 Nov 2023 16:17:08 -0500 Received: from mail-nwsmtp-smtp-production-main-91.sas.yp-c.yandex.net (mail-nwsmtp-smtp-production-main-91.sas.yp-c.yandex.net [IPv6:2a02:6b8:c08:47a7:0:640:b27a:0]) by forward500b.mail.yandex.net (Yandex) with ESMTP id 0A42660F3A; Thu, 9 Nov 2023 00:16:20 +0300 (MSK) Received: by mail-nwsmtp-smtp-production-main-91.sas.yp-c.yandex.net (smtp/Yandex) with ESMTPSA id IGlCAs5BUeA0-dhbVOXkv; Thu, 09 Nov 2023 00:16:19 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1699478179; bh=QY0VsmKV17HDUTnaWDBm6AC/4ZldgqVnyWlpqZRfc5Y=; h=In-Reply-To:From:Subject:Message-ID:Cc:References:Date:To; b=UGYHZDALgsyFKnZfrU2apuViILHwpexOCYZ1IzvUKcGtRAFrVWvApq01aRCRERYXr /L3v53NAyM2vR5Yj0WrueExN0kfreSedQUEGrlUdvgs39nCs/zzalb0vn6zj61XPXE FkJoHRk2x7Sg4VgRrtQD//kfWuraNfdThJbT1kDU= Authentication-Results: mail-nwsmtp-smtp-production-main-91.sas.yp-c.yandex.net; dkim=pass header.i=@yandex.ru Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailauth.nyi.internal (Postfix) with ESMTP id D9F1227C005B; Wed, 8 Nov 2023 16:16:17 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Wed, 08 Nov 2023 16:16:17 -0500 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrudduledgudeghecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefkffggfgfuvfevfhfhjggtgfesthejredttdefjeenucfhrhhomhepffhm ihhtrhihucfiuhhtohhvuceoughguhhtohhvseihrghnuggvgidrrhhuqeenucggtffrrg htthgvrhhnpedtffeggeekleetvedtkeeltefhfedtuddvgeektdekudejhfeftdevfedt ffduveenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe gughhuthhovhdomhgvshhmthhprghuthhhphgvrhhsohhnrghlihhthidqudeffeefleel heehvddqvdelgeejjeejjeeiqdgughhuthhovheppeihrghnuggvgidrrhhusehfrghsth hmrghilhdrtghomh X-ME-Proxy: Feedback-ID: ib1d9465d:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 8 Nov 2023 16:16:16 -0500 (EST) Message-ID: Date: Wed, 8 Nov 2023 23:16:15 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: bug#66649: 29.1; `project-remember-projects-under' behavior doesn't match its doc Content-Language: en-US To: Damien Cassou References: <87v8b18qh7.fsf@cassou.me> <057a5ddf-2974-ce53-f795-b146e205db1e@yandex.ru> <87bkcd1utg.fsf@posteo.net> <87y1fhxijq.fsf@posteo.net> <87zfzw6i7m.fsf@cassou.me> <540bbdb3-5861-146c-688f-41534962fdf5@yandex.ru> <87wmuzq9dl.fsf@cassou.me> <87y1f8r7c3.fsf@posteo.net> <87wmusow3w.fsf@posteo.net> <6c391eda-c893-1f57-c486-3a693b83ed73@yandex.ru> <87a5rokkxt.fsf@cassou.me> From: Dmitry Gutov In-Reply-To: <87a5rokkxt.fsf@cassou.me> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -2.2 (--) X-Debbugs-Envelope-To: 66649-done Cc: 66649-done@debbugs.gnu.org, "Philip K." 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: -3.2 (---) On 08/11/2023 23:13, Damien Cassou wrote: > Dmitry Gutov writes: >> Damien, is there anything else here to do? >> >> Did you perhaps also (or instead) saw a problem with either of the >> docstrings? I'm not sure if I understood the last complaint correctly. > > The bug can be closed, no problem. > > Thanks everyone for your great work. Thanks for reporting! From unknown Fri Aug 15 03:56:56 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 07 Dec 2023 12:24:08 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator