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 22:16:04 +0200 Message-ID: <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> 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="12551"; 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, "Philip K." To: Damien Cassou Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Nov 08 21:16:37 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 1r0oyZ-00033G-NC for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 08 Nov 2023 21:16:35 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r0oyT-0006yK-1q; Wed, 08 Nov 2023 15:16:29 -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 1r0oyO-0006wy-A3 for bug-gnu-emacs@gnu.org; Wed, 08 Nov 2023 15:16:24 -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 1r0oyO-00042G-1x for bug-gnu-emacs@gnu.org; Wed, 08 Nov 2023 15:16:24 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1r0oz0-0003oy-BG for bug-gnu-emacs@gnu.org; Wed, 08 Nov 2023 15:17:02 -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 20:17:02 +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.169947462114678 (code B ref 66649); Wed, 08 Nov 2023 20:17:02 +0000 Original-Received: (at 66649) by debbugs.gnu.org; 8 Nov 2023 20:17:01 +0000 Original-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 Original-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 Original-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) Original-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 Original-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) Original-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 Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 8 Nov 2023 15:16:06 -0500 (EST) Content-Language: en-US In-Reply-To: <87wmusow3w.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:274012 Archived-At: 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.