From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#66649: 29.1; `project-remember-projects-under' behavior doesn't match its doc Date: Fri, 20 Oct 2023 18:46:41 +0300 Message-ID: <057a5ddf-2974-ce53-f795-b146e205db1e@yandex.ru> References: <87v8b18qh7.fsf@cassou.me> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14785"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 To: Damien Cassou , 66649@debbugs.gnu.org, "Philip K." Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Oct 20 17:47:56 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qtrjA-0003hw-9c for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 20 Oct 2023 17:47:56 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qtrj4-0006BK-0z; Fri, 20 Oct 2023 11:47:50 -0400 Original-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 1qtrio-0006Aq-N4 for bug-gnu-emacs@gnu.org; Fri, 20 Oct 2023 11:47:35 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtrio-00046P-Es for bug-gnu-emacs@gnu.org; Fri, 20 Oct 2023 11:47:34 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qtrjF-0003hW-LX for bug-gnu-emacs@gnu.org; Fri, 20 Oct 2023 11:48:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 20 Oct 2023 15:48:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66649 X-GNU-PR-Package: emacs Original-Received: via spool by 66649-submit@debbugs.gnu.org id=B66649.169781684614164 (code B ref 66649); Fri, 20 Oct 2023 15:48:01 +0000 Original-Received: (at 66649) by debbugs.gnu.org; 20 Oct 2023 15:47:26 +0000 Original-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 Original-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 Original-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) Original-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 Original-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) Original-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 Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 20 Oct 2023 11:46:43 -0400 (EDT) Content-Language: en-US In-Reply-To: <87v8b18qh7.fsf@cassou.me> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:272798 Archived-At: 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?