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: Wed, 8 Nov 2023 21:56:57 +0200 Message-ID: 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> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40493"; 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 Cc: 66649@debbugs.gnu.org To: Philip Kaludercic , Damien Cassou Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Nov 08 20:57:46 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 1r0ogM-000ALi-At for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 08 Nov 2023 20:57:46 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r0og1-0000fD-8C; Wed, 08 Nov 2023 14:57:25 -0500 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 1r0ofz-0000ew-7p for bug-gnu-emacs@gnu.org; Wed, 08 Nov 2023 14:57:23 -0500 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 1r0ofz-0000Nf-01 for bug-gnu-emacs@gnu.org; Wed, 08 Nov 2023 14:57:23 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1r0ogb-0003JB-Lx for bug-gnu-emacs@gnu.org; Wed, 08 Nov 2023 14:58:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 08 Nov 2023 19:58: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.169947347512705 (code B ref 66649); Wed, 08 Nov 2023 19:58:01 +0000 Original-Received: (at 66649) by debbugs.gnu.org; 8 Nov 2023 19:57:55 +0000 Original-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 Original-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 Original-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) Original-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 Original-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) Original-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 Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 8 Nov 2023 14:56:59 -0500 (EST) Content-Language: en-US In-Reply-To: <87y1f8r7c3.fsf@posteo.net> 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:274010 Archived-At: 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.