From unknown Sun Jul 20 09:47:22 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#65704 <65704@debbugs.gnu.org> To: bug#65704 <65704@debbugs.gnu.org> Subject: Status: 29.1; Most code of `project-ignores' seems to be dead code Reply-To: bug#65704 <65704@debbugs.gnu.org> Date: Sun, 20 Jul 2025 16:47:22 +0000 retitle 65704 29.1; Most code of `project-ignores' seems to be dead code reassign 65704 emacs submitter 65704 Damien Cassou severity 65704 wishlist thanks From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 02 12:03:42 2023 Received: (at submit) by debbugs.gnu.org; 2 Sep 2023 16:03:42 +0000 Received: from localhost ([127.0.0.1]:38276 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qcT66-0003iQ-BK for submit@debbugs.gnu.org; Sat, 02 Sep 2023 12:03:42 -0400 Received: from lists.gnu.org ([2001:470:142::17]:45348) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qcT60-0003i8-O5 for submit@debbugs.gnu.org; Sat, 02 Sep 2023 12:03:40 -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 1qcT5l-0004bL-60 for bug-gnu-emacs@gnu.org; Sat, 02 Sep 2023 12:03:21 -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 1qcT5i-0008MK-MZ for bug-gnu-emacs@gnu.org; Sat, 02 Sep 2023 12:03:20 -0400 Received: from localhost (localhost.localdomain [IPv6:::1]) by mail.choca.pics (Postfix) with ESMTP id 23C1D18193F46; Sat, 2 Sep 2023 18:03:07 +0200 (CEST) Received: from mail.choca.pics ([IPv6:::1]) by localhost (mail.choca.pics [IPv6:::1]) (amavis, port 10032) with ESMTP id To0o1uB6Jfyy; Sat, 2 Sep 2023 18:03:06 +0200 (CEST) Received: from localhost (localhost.localdomain [IPv6:::1]) by mail.choca.pics (Postfix) with ESMTP id 35B7518193F4A; Sat, 2 Sep 2023 18:03:06 +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 BmApQs5vtuOf; Sat, 2 Sep 2023 18:03: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 AB20018193F46; Sat, 2 Sep 2023 18:03:05 +0200 (CEST) From: Damien Cassou To: bug-gnu-emacs@gnu.org Subject: 29.1; Most code of `project-ignores' seems to be dead code Date: Sat, 02 Sep 2023 18:03:04 +0200 Message-ID: <87sf7wlg07.fsf@cassou.me> MIME-Version: 1.0 Content-Type: text/plain 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 function `project-ignores' starts like this: (cl-defmethod project-ignores ((project (head vc)) dir) (let* ((root (nth 2 project)) backend) (append (when (and backend (file-equal-p dir root)) It seems to me that `backend' is always going to be nil at this point and thus the 25-line long `when' block will always return nil without doing anything. Am I missing something? This code seems to have been introduced in commit 785fa801596ad7bb9f838cac865f00de29e253d1 "New user option: project-vc-extra-root-markers". 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 Sat Sep 02 12:17:50 2023 Received: (at 65704) by debbugs.gnu.org; 2 Sep 2023 16:17:50 +0000 Received: from localhost ([127.0.0.1]:38318 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qcTJl-0006jh-MU for submit@debbugs.gnu.org; Sat, 02 Sep 2023 12:17:49 -0400 Received: from mail.choca.pics ([80.67.172.235]:34428) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qcTJj-0006jY-Ei for 65704@debbugs.gnu.org; Sat, 02 Sep 2023 12:17:48 -0400 Received: from localhost (localhost.localdomain [IPv6:::1]) by mail.choca.pics (Postfix) with ESMTP id B506D181929E9 for <65704@debbugs.gnu.org>; Sat, 2 Sep 2023 18:17:35 +0200 (CEST) Received: from mail.choca.pics ([IPv6:::1]) by localhost (mail.choca.pics [IPv6:::1]) (amavis, port 10032) with ESMTP id sLnQ4zzTAy1S for <65704@debbugs.gnu.org>; Sat, 2 Sep 2023 18:17:35 +0200 (CEST) Received: from localhost (localhost.localdomain [IPv6:::1]) by mail.choca.pics (Postfix) with ESMTP id 15CDB18193F46 for <65704@debbugs.gnu.org>; Sat, 2 Sep 2023 18:17:35 +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 t_2v6s8FvfRe for <65704@debbugs.gnu.org>; Sat, 2 Sep 2023 18:17:34 +0200 (CEST) Received: from localhost (91.60.75.86.rev.sfr.net [86.75.60.91]) by mail.choca.pics (Postfix) with ESMTPSA id 6DA36181929E9 for <65704@debbugs.gnu.org>; Sat, 2 Sep 2023 18:17:34 +0200 (CEST) From: Damien Cassou To: 65704@debbugs.gnu.org Subject: [PATCH] project.el: Fix bug in project-ignores Date: Sat, 02 Sep 2023 18:17:33 +0200 Message-ID: <87o7iklfc2.fsf@cassou.me> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 65704 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 (-) --=-=-= Content-Type: text/plain In case what I said in the issue's description is correct, please find attach a possible patch. -- Damien Cassou "Success is the ability to go from one failure to another without losing enthusiasm." --Winston Churchill --=-=-= Content-Type: text/patch Content-Disposition: attachment; filename=0001-project.el-Fix-bug-in-project-ignores.patch >From f04731cc2a31510163dc2ed484f47467ea88f036 Mon Sep 17 00:00:00 2001 From: Damien Cassou Date: Sat, 2 Sep 2023 18:08:49 +0200 Subject: [PATCH] project.el: Fix bug in project-ignores The variable `backend' was always nil preventing the 25-line long `when' block to do anything. This bug seems to have been introduced in commit 785fa801596ad7bb9f838cac865f00de29e253d1 "New user option: project-vc-extra-root-markers". (Bug#65704) * lisp/progmodes/project.el: (project-ignores) Use backend-specific code if possible. --- lisp/progmodes/project.el | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index 37db677943a..29a81c7e151 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -733,11 +733,10 @@ project--git-submodules (cl-defmethod project-ignores ((project (head vc)) dir) (let* ((root (nth 2 project)) - backend) + (backend (cadr project))) (append (when (and backend (file-equal-p dir root)) - (setq backend (cadr project)) (delq nil (mapcar -- 2.41.0 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 02 20:27:16 2023 Received: (at 65704) by debbugs.gnu.org; 3 Sep 2023 00:27:16 +0000 Received: from localhost ([127.0.0.1]:38923 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qcaxP-0001e9-RS for submit@debbugs.gnu.org; Sat, 02 Sep 2023 20:27:16 -0400 Received: from forward500a.mail.yandex.net ([2a02:6b8:c0e:500:1:45:d181:d500]:35424) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qcaxN-0001dr-3L for 65704@debbugs.gnu.org; Sat, 02 Sep 2023 20:27:14 -0400 Received: from mail-nwsmtp-smtp-production-main-67.vla.yp-c.yandex.net (mail-nwsmtp-smtp-production-main-67.vla.yp-c.yandex.net [IPv6:2a02:6b8:c15:2c95:0:640:f90:0]) by forward500a.mail.yandex.net (Yandex) with ESMTP id 546A55E8D1; Sun, 3 Sep 2023 03:26:54 +0300 (MSK) Received: by mail-nwsmtp-smtp-production-main-67.vla.yp-c.yandex.net (smtp/Yandex) with ESMTPSA id pQIZGR1DgmI0-Q8lg5Jfs; Sun, 03 Sep 2023 03:26:53 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1693700813; bh=sM6k4iW14DLQu4jzzBs5QMWtrxb3x5FCtbiGs7Jw0Xw=; h=In-Reply-To:From:Subject:Message-ID:References:Date:To; b=UOB+Q67hmGxed49Gqt8bQQLCrWmP23GYOY+LMCRpUDpRKEVgoODvnnTdsXoVzTcMo qFr6kXxiCpzd3xTKietnHV+NN4b2ON1ylh4UQpy4qJnruss6pIhCO7p9CnsxsqDScC nKS5dP3/pKTMKAP7jNWj4ugUOQ1EOAz9WRrL+/Uc= Authentication-Results: mail-nwsmtp-smtp-production-main-67.vla.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 A3FAA27C0054; Sat, 2 Sep 2023 20:26:51 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Sat, 02 Sep 2023 20:26:51 -0400 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrudeghedgfeegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvfhfhjggtgfesthejredttdefjeenucfhrhhomhepffhmihht rhihucfiuhhtohhvuceoughguhhtohhvseihrghnuggvgidrrhhuqeenucggtffrrghtth gvrhhnpeefieelveevvdfhgefgtdefhffhvedvgeffkedtffdvtdegtddvffelieetuedv gfenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegugh huthhovhdomhgvshhmthhprghuthhhphgvrhhsohhnrghlihhthidqudeffeefleelheeh vddqvdelgeejjeejjeeiqdgughhuthhovheppeihrghnuggvgidrrhhusehfrghsthhmrg hilhdrtghomh X-ME-Proxy: Feedback-ID: ib1d9465d:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 2 Sep 2023 20:26:50 -0400 (EDT) Message-ID: Date: Sun, 3 Sep 2023 03:26:48 +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#65704: 29.1; Most code of `project-ignores' seems to be dead code Content-Language: en-US To: Damien Cassou , 65704@debbugs.gnu.org References: <87sf7wlg07.fsf@cassou.me> From: Dmitry Gutov In-Reply-To: <87sf7wlg07.fsf@cassou.me> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -4.2 (----) X-Debbugs-Envelope-To: 65704 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: -5.2 (-----) Hi Damien, Thanks for the patch, pushed to master (with a few amendments in summary). I'd like to backport it to emacs-29 as well, if Eli/Stefan don't mind. On 02/09/2023 19:03, Damien Cassou wrote: > Hi, > > The function `project-ignores' starts like this: > > (cl-defmethod project-ignores ((project (head vc)) dir) > (let* ((root (nth 2 project)) > backend) > (append > (when (and backend > (file-equal-p dir root)) > > It seems to me that `backend' is always going to be nil at this point > and thus the 25-line long `when' block will always return nil without > doing anything. > > Am I missing something? Not much. Maybe just that that code path isn't exercised by any in-tree function if the backend is Git (with recent enough git installed) or Hg (the project-files method uses faster, specialized shell invocations), so that might be the reason why this was missed in testing. Any chance you could tell us what made you notice the bug? From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 03 07:00:55 2023 Received: (at control) by debbugs.gnu.org; 3 Sep 2023 11:00:55 +0000 Received: from localhost ([127.0.0.1]:39752 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qckqd-00061t-94 for submit@debbugs.gnu.org; Sun, 03 Sep 2023 07:00:55 -0400 Received: from mail-lf1-x136.google.com ([2a00:1450:4864:20::136]:59542) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qckqb-0005o6-Cu for control@debbugs.gnu.org; Sun, 03 Sep 2023 07:00:53 -0400 Received: by mail-lf1-x136.google.com with SMTP id 2adb3069b0e04-500913779f5so871174e87.2 for ; Sun, 03 Sep 2023 04:00:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1693738837; x=1694343637; darn=debbugs.gnu.org; h=to:subject:message-id:date:mime-version:from:from:to:cc:subject :date:message-id:reply-to; bh=Pp4t+ssU29Cn250/L5yMGPf1B9TwAF5LCNaSbcPsEAE=; b=iR2BSqiQZsf43Et8G0s49Q4qeBQlRee1cGHu9Yyo93N9Ef+Ls1u8AsEDCOs/mrzyCU hYx39Qg42sgyTwxs5IEHF0iaTBlc3HWmPm0gOfo8YUmWky+F2v5cqkiYHpcZzO4htkV1 CAnYlJP0FZyGXWJW0bwHdIMaie2wSADmU4suTBoHM6ynZvBquygU2jyXpxt4n1dSBWu9 mxyLixkPfptXoEQ9cDlElibZZQD18qFoWzuAAGfWWHL4RFevKjDnwfv7+zAw089AihmT Nqw4Yl0it2RTZEUNleAUggy2Hjl8dNBZSGD/RFhvVtd78SOVqYSWR46ZmqkItJoQR1zv DkRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693738837; x=1694343637; h=to:subject:message-id:date:mime-version:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=Pp4t+ssU29Cn250/L5yMGPf1B9TwAF5LCNaSbcPsEAE=; b=f9+eY4fmDSOoDozY0WOMrdw+90Y5M9NnkfyoU6aKrT3fIJyP3Cwx8Lbomcn/AwGBFw iZg8PXgCdUApc6zpeXLGvOKuWkxwAbIGPrd2uHDYCnzR7jZb/P3ZMfqavI9Ig9W0X6YQ sMYR9sl2zN9r6Fys2ReCCdRtB2tC63wPYoiRZ07EZWLgwrgzYaJSM58qSBGXXgAdhbYf UiG2dBoxnr0cIZr7ymMg4EGLr2euAa1wApD1eggLY+t17OjIYcAcPr+9s7hRRke9ZEDx kzNVRvoqHO1kHl0DM+oqO1xURiZyvocRdt3FU5Pu8BTtfOdnmWJ3qjumESxPq2hqD6fY OyQQ== X-Gm-Message-State: AOJu0YxM+uy5O4F5ejicOE8z2j41mUoqm0KK+Bkf1tMhxUlQz7S31ajL qauZXSjDbNlcmzpC8sLPjKivaVSs91JEcAhYZAYjOrOiwpk= X-Google-Smtp-Source: AGHT+IH7tLAq+i61Aw7dvIRVUMtyGRGIOxiQIS3fLd/HuEldJwQlqrU4hinTk8tDd3bTcuoVI6iex3kVnGI0LiTPZFY= X-Received: by 2002:ac2:592a:0:b0:500:8146:9ebc with SMTP id v10-20020ac2592a000000b0050081469ebcmr4580086lfi.47.1693738837001; Sun, 03 Sep 2023 04:00:37 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Sun, 3 Sep 2023 04:00:36 -0700 From: Stefan Kangas MIME-Version: 1.0 Date: Sun, 3 Sep 2023 04:00:36 -0700 Message-ID: Subject: control message for bug #65704 To: control@debbugs.gnu.org Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control 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 (-) severity 65704 wishlist quit From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 04 12:03:11 2023 Received: (at 65704) by debbugs.gnu.org; 4 Sep 2023 16:03:11 +0000 Received: from localhost ([127.0.0.1]:52384 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qdC2g-0006fS-S1 for submit@debbugs.gnu.org; Mon, 04 Sep 2023 12:03:11 -0400 Received: from mail.choca.pics ([80.67.172.235]:59824) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qdC2e-0006fE-D6 for 65704@debbugs.gnu.org; Mon, 04 Sep 2023 12:03:09 -0400 Received: from localhost (localhost.localdomain [IPv6:::1]) by mail.choca.pics (Postfix) with ESMTP id 4CA1618193FAB; Mon, 4 Sep 2023 18:03:06 +0200 (CEST) Received: from mail.choca.pics ([IPv6:::1]) by localhost (mail.choca.pics [IPv6:::1]) (amavis, port 10032) with ESMTP id AodS3OmTAgJQ; Mon, 4 Sep 2023 18:03:05 +0200 (CEST) Received: from localhost (localhost.localdomain [IPv6:::1]) by mail.choca.pics (Postfix) with ESMTP id 8B41718193FAC; Mon, 4 Sep 2023 18:03: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 qf6uT-hmWjfI; Mon, 4 Sep 2023 18:03: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 17D1518193FAB; Mon, 4 Sep 2023 18:03:05 +0200 (CEST) From: Damien Cassou To: Dmitry Gutov , 65704@debbugs.gnu.org Subject: Re: bug#65704: 29.1; Most code of `project-ignores' seems to be dead code In-Reply-To: References: <87sf7wlg07.fsf@cassou.me> Date: Mon, 04 Sep 2023 18:03:04 +0200 Message-ID: <874jkakjt3.fsf@cassou.me> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 65704 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: > much. Maybe just that that code path isn't exercised by any in-tree > function if the backend is Git (with recent enough git installed) My Git repository has several .gitignore files in several directories, something that `project-ignores' (for VC) seems to not support: ;; we only support .gitignore at the root. My project looks like this: . =E2=94=9C=E2=94=80=E2=94=80 client =E2=94=82=C2=A0=C2=A0 =E2=94=9C=E2=94=80=E2=94=80 .gitignore =E2=94=82=C2=A0=C2=A0 =E2=94=9C=E2=94=80=E2=94=80 node_modules =E2=94=82=C2=A0=C2=A0 =E2=94=94=E2=94=80=E2=94=80 .project =E2=94=9C=E2=94=80=E2=94=80 .git =E2=94=94=E2=94=80=E2=94=80 .gitignore Because I spend most of my time in the client/ directory, I want the `project' library to consider client/ to be a project on its own. I use the code below and the client/.project file to do this: (defconst my/project-root-marker ".project" "File indicating the root of a project.") (defun my/project-find-root (path) "Search up the PATH for `my/project-root-marker'." (when-let* ((root (locate-dominating-file path my/project-root-marker= ))) (cons 'transient root))) (add-to-list 'project-find-functions #'my/project-find-root) The client/.gitignore file contains a line "node_modules/" which is a very large directory. The command `project-find-file' doesn't see my client/.gitignore and thus suggests 83k files and make the completion UI very slow. So I'm not using it but this instead: (project-find-file-in (thing-at-point 'filename) (list "/my/project/client") (project-current nil "/my/project")) The function `project-find-file-in' uses `project-files' which in turn uses `project--dir-ignores'. The later uses `project-ignores' which has the bug mentioned in this issue. Am I doing something reasonable? Is there a better way? It looks like a lot of setup to get Emacs to ignore directories listed .gitignore files. --=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 Mon Sep 04 14:30:24 2023 Received: (at 65704) by debbugs.gnu.org; 4 Sep 2023 18:30:24 +0000 Received: from localhost ([127.0.0.1]:52525 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qdEL9-0004ip-Qr for submit@debbugs.gnu.org; Mon, 04 Sep 2023 14:30:24 -0400 Received: from forward500a.mail.yandex.net ([2a02:6b8:c0e:500:1:45:d181:d500]:34270) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qdEL3-0004iU-Sw for 65704@debbugs.gnu.org; Mon, 04 Sep 2023 14:30:22 -0400 Received: from mail-nwsmtp-smtp-production-main-81.vla.yp-c.yandex.net (mail-nwsmtp-smtp-production-main-81.vla.yp-c.yandex.net [IPv6:2a02:6b8:c18:4001:0:640:bc2:0]) by forward500a.mail.yandex.net (Yandex) with ESMTP id 5EFBD5EA66; Mon, 4 Sep 2023 21:30:10 +0300 (MSK) Received: by mail-nwsmtp-smtp-production-main-81.vla.yp-c.yandex.net (smtp/Yandex) with ESMTPSA id 7Ub38bJWmKo0-GBGDom21; Mon, 04 Sep 2023 21:30:09 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1693852209; bh=1B/n6xyTcc3MR1BmLdXQdO7JlbJkiMJ7SFAa32kkOLw=; h=In-Reply-To:From:Subject:Message-ID:References:Date:To; b=ILrk5+UtEUR5aVEWYhcSiR+sTPmZkLCmRWb3z+KcpA3LEczUPJCbA+AjC1+g2gh/+ aQgA7eOxhCBHdEQZDs3B3y2sGg4B0x+l1lCzpYt4odDk6SUCx7SQI48yjilNqj7E6U Aa9r04F/egqzbhngSPbGv304xR0uL28HoT9XykyY= Authentication-Results: mail-nwsmtp-smtp-production-main-81.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 A862327C0054; Mon, 4 Sep 2023 14:30:07 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Mon, 04 Sep 2023 14:30:07 -0400 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrudegkedguddviecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefkffggfgfuvfhfhfgjtgfgsehtkeertddtfeejnecuhfhrohhmpeffmhhi thhrhicuifhuthhovhcuoegughhuthhovheshigrnhguvgigrdhruheqnecuggftrfgrth htvghrnhepkeejfedtudefleelteegleevieefffekfeffheekkefhteegffffvefhfefg udffnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepug hguhhtohhvodhmvghsmhhtphgruhhthhhpvghrshhonhgrlhhithihqddufeeffeelleeh hedvqddvleegjeejjeejiedqughguhhtohhvpeephigrnhguvgigrdhruhesfhgrshhtmh grihhlrdgtohhm X-ME-Proxy: Feedback-ID: ib1d9465d:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 4 Sep 2023 14:30:05 -0400 (EDT) Message-ID: <93d0f377-7acd-ec0d-0e17-f6d09c4dd23a@yandex.ru> Date: Mon, 4 Sep 2023 21:30:01 +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#65704: 29.1; Most code of `project-ignores' seems to be dead code Content-Language: en-US To: Damien Cassou , 65704@debbugs.gnu.org References: <87sf7wlg07.fsf@cassou.me> <874jkakjt3.fsf@cassou.me> From: Dmitry Gutov In-Reply-To: <874jkakjt3.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: 65704 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 04/09/2023 19:03, Damien Cassou wrote: > Dmitry Gutov writes: >> much. Maybe just that that code path isn't exercised by any in-tree >> function if the backend is Git (with recent enough git installed) > > My Git repository has several .gitignore files in several directories, > something that `project-ignores' (for VC) seems to not support: > > ;; we only support .gitignore at the root. Yes. That's not really the fault of project-vc's implementation, but the way vc-default-ignore-completion-table and vc-git-find-ignore-file are implemented. But again, it shouldn't be a problem for most users/uses. > My project looks like this: > > . > ├── client > │   ├── .gitignore > │   ├── node_modules > │   └── .project > ├── .git > └── .gitignore > > Because I spend most of my time in the client/ directory, I want the > `project' library to consider client/ to be a project on its own. I use > the code below and the client/.project file to do this: Also an aside: you could add ".project" or ".gitignore" to project-vc-extra-root-markers if your project.el is recent enough (e.g. from Emacs 29). > (defconst my/project-root-marker ".project" > "File indicating the root of a project.") > > (defun my/project-find-root (path) > "Search up the PATH for `my/project-root-marker'." > (when-let* ((root (locate-dominating-file path my/project-root-marker))) > (cons 'transient root))) > > (add-to-list 'project-find-functions #'my/project-find-root) > > The client/.gitignore file contains a line "node_modules/" which is a > very large directory. The command `project-find-file' doesn't see my > client/.gitignore and thus suggests 83k files and make the completion UI > very slow. The above customization going against the general recommendation in project.el's Commentary and ends up with Emacs detecting an instance of a different backend: 'transient'. Which doesn't have a dedicaded definition for project-ignores and falls back to the default one (lines 292:307). Naturally, it doesn't scan for ignore files in any VC backend. That's the reason I've added project-vc-extra-root-markers: so that honoring files like .gitignore still makes sense, but the user can split the project into pieces using these markers while keeping the same backend in use. > So I'm not using it but this instead: > > (project-find-file-in (thing-at-point 'filename) > (list "/my/project/client") > (project-current nil "/my/project")) > > The function `project-find-file-in' uses `project-files' which in turn > uses `project--dir-ignores'. Just keep in mind that 'project-files' also has two definition in core (and however many outside of it): one default that always calls project--dir-ignores, and one for 'vc' (lines 609:629) that only calls project--dir-ignores in fallback situations (backend is not Git or Hg, or when Git is older than 1.9, or when DIR is not the project root). The last case might still be reconsidered, but it works for 'C-u M-x project-find-regexp' when you want to search inside an ignored dir (fully or partially). > Am I doing something reasonable? Is there a better way? It looks like a > lot of setup to get Emacs to ignore directories listed .gitignore files. To reiterate: use 'project-vc-extra-root-markers'. And the nested .gitignore should also use used automatically without that too by 'C-x p f' if you remove #'my/project-find-root from project-find-functions. Anyway, thank you for the explanation, it's valuable feedback. If anything is unclear, further question welcome. From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 04 14:31:49 2023 Received: (at 65704) by debbugs.gnu.org; 4 Sep 2023 18:31:49 +0000 Received: from localhost ([127.0.0.1]:52529 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qdEMX-0004l3-Dm for submit@debbugs.gnu.org; Mon, 04 Sep 2023 14:31:49 -0400 Received: from forward501c.mail.yandex.net ([178.154.239.209]:49212) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qdEMT-0004kp-Ic for 65704@debbugs.gnu.org; Mon, 04 Sep 2023 14:31:48 -0400 Received: from mail-nwsmtp-smtp-production-main-42.myt.yp-c.yandex.net (mail-nwsmtp-smtp-production-main-42.myt.yp-c.yandex.net [IPv6:2a02:6b8:c12:287:0:640:7dd6:0]) by forward501c.mail.yandex.net (Yandex) with ESMTP id AFB625EB85; Mon, 4 Sep 2023 21:31:43 +0300 (MSK) Received: by mail-nwsmtp-smtp-production-main-42.myt.yp-c.yandex.net (smtp/Yandex) with ESMTPSA id eVbMVhEWqOs0-XKpXGfS3; Mon, 04 Sep 2023 21:31:43 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1693852303; bh=S8+bzcnkEuteCK1ccSkHfx+YBFgaGpcY5Q+MG9C2buQ=; h=In-Reply-To:From:Subject:Message-ID:References:Date:To; b=T9tPuXE0mCS3N6zEKxunGEuVR/YmEJP3EHE1lbXs5B0wDeV+XSyqEg7bqmsmYn4VL DwODSEOU0XePrMfAeXTAzGTYHudmsVNaNw224pjsSSu769VCt2sO8KPgtb5PV+GGZh fe5SjpL9/XO2RCopYuGqnFkwL6K6iId2+eEcNADI= Authentication-Results: mail-nwsmtp-smtp-production-main-42.myt.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 1FFF127C005A; Mon, 4 Sep 2023 14:31:40 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Mon, 04 Sep 2023 14:31:40 -0400 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrudegkedguddviecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefkffggfgfuhffvfhgjtgfgsehtjeertddtfeejnecuhfhrohhmpeffmhhi thhrhicuifhuthhovhcuoegughhuthhovheshigrnhguvgigrdhruheqnecuggftrfgrth htvghrnhepffejhfefudejkeetuedvvdetkedtueeufeeiteeghfdvudeuudehkefhvddv teehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepug hguhhtohhvodhmvghsmhhtphgruhhthhhpvghrshhonhgrlhhithihqddufeeffeelleeh hedvqddvleegjeejjeejiedqughguhhtohhvpeephigrnhguvgigrdhruhesfhgrshhtmh grihhlrdgtohhm X-ME-Proxy: Feedback-ID: ib1d9465d:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 4 Sep 2023 14:31:38 -0400 (EDT) Message-ID: Date: Mon, 4 Sep 2023 21:31:36 +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#65704: 29.1; Most code of `project-ignores' seems to be dead code Content-Language: en-US From: Dmitry Gutov To: 65704@debbugs.gnu.org, Eli Zaretskii , Stefan Kangas , Damien Cassou References: <87sf7wlg07.fsf@cassou.me> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -1.5 (-) X-Debbugs-Envelope-To: 65704 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: -2.5 (--) Eli? Stefan? On 03/09/2023 03:26, Dmitry Gutov wrote: > I'd like to backport it to emacs-29 as well, if Eli/Stefan don't mind. Any objections to the backport? From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 04 14:48:46 2023 Received: (at 65704) by debbugs.gnu.org; 4 Sep 2023 18:48:46 +0000 Received: from localhost ([127.0.0.1]:52556 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qdEcw-0005Fe-4Z for submit@debbugs.gnu.org; Mon, 04 Sep 2023 14:48:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41414) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qdEct-0005FN-Dg for 65704@debbugs.gnu.org; Mon, 04 Sep 2023 14:48:45 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qdEcm-0005ms-12; Mon, 04 Sep 2023 14:48:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=MHoLg2x99XboYBrz+WJJYgPRiM4v4o6vo0l/iHEdLD4=; b=gUwDUlQw9Un6 DEHMLxbqFOHDT2S98EkjjtuKaEXtatHp+Tt4n8XN6XFfmXR8pFz60tRNK7uJ4qpaJYCugG9QJwXTQ GIIKYovWhCtmFP7Gc8o6Y78mwuD7vpIbPzU7ExP3DTSjaaeV+S9Iyswtb040NXBIpP9EsXVrEsWVr a7MxqKyJBQ/OX6EU//bqo8HcRsB0DifmXylouTIQzhM2YYPMBaf8BQjT5gLhCemOSAbqjAuG6mjfv 3aiEpF3xvR0sN9GEltjcLrJ9EcovOrAGhPIj1azgEZm4DqPF4/iuwzV2mL757v0LESk1R/gw37RrR lQqzkcak4/KBwI4h0OnDjg==; Date: Mon, 04 Sep 2023 21:48:17 +0300 Message-Id: <83v8cp4vwu.fsf@gnu.org> From: Eli Zaretskii To: Dmitry Gutov In-Reply-To: (message from Dmitry Gutov on Mon, 4 Sep 2023 21:31:36 +0300) Subject: Re: bug#65704: 29.1; Most code of `project-ignores' seems to be dead code References: <87sf7wlg07.fsf@cassou.me> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 65704 Cc: damien@cassou.me, 65704@debbugs.gnu.org, stefan@marxist.se 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 (---) > Date: Mon, 4 Sep 2023 21:31:36 +0300 > From: Dmitry Gutov > > Eli? Stefan? > > On 03/09/2023 03:26, Dmitry Gutov wrote: > > I'd like to backport it to emacs-29 as well, if Eli/Stefan don't mind. > > Any objections to the backport? Fine by me. From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 04 14:58:13 2023 Received: (at 65704) by debbugs.gnu.org; 4 Sep 2023 18:58:13 +0000 Received: from localhost ([127.0.0.1]:52568 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qdEm4-0005Up-UA for submit@debbugs.gnu.org; Mon, 04 Sep 2023 14:58:13 -0400 Received: from mail-lf1-f50.google.com ([209.85.167.50]:51543) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qdEm2-0005Ua-E2 for 65704@debbugs.gnu.org; Mon, 04 Sep 2023 14:58:11 -0400 Received: by mail-lf1-f50.google.com with SMTP id 2adb3069b0e04-50079d148aeso2909880e87.3 for <65704@debbugs.gnu.org>; Mon, 04 Sep 2023 11:58:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693853884; x=1694458684; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=VkGE7pDezWhMK6r+FhiQRL9qFIVsEAKGz9zvIU5hKPg=; b=IAAx/8OckmrX3v3EvRh2cADcNwxHWxJ+g+0aZaordDHDiVf6HhCTs8++5+IOHyVpVH rTEkQ0hTEcbMGytFjkw0Rl7yw4ILETzilRH7yivOQUo//LaQ71szmnC1b7U14yMbI06k SHX3b/U5ljh/K/bFjK1eYhz14K2ba929eMim6Kq22U609+YZlcqZksv8FXR8s+4RDxS7 dFJnAOh9vCw3ZoeZZDloxvwPPkRNeWUk/Fz3tf8+F6KjykNIhomZiUFrD19QowwMtHj0 KPczdab9BsLZp3JsHrDZ5xfgZxUPmoyZZF8QMKVbPYh5J4LbgFwZuAqh0ENBZc/Wb5RJ fV7Q== X-Gm-Message-State: AOJu0YwZ4lWXfFzFfGNTQnTQEVFg8+f2wfl7JkAHB9mYF+4P3PAQdd8G CU2tIQN9/z6hgG+wBBzBkeLVi//bV/NHBuR5czA= X-Google-Smtp-Source: AGHT+IFiDwYFil4lHLY1SNAEcgTTQmw5FgYVpgRnJSArBXXW/ccyx/c98CUdqQJdZDZwLoONKg/mxoyDdT69gtBwRhs= X-Received: by 2002:ac2:4c45:0:b0:4fe:629:9265 with SMTP id o5-20020ac24c45000000b004fe06299265mr9050285lfk.20.1693853884148; Mon, 04 Sep 2023 11:58:04 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Mon, 4 Sep 2023 11:58:03 -0700 From: Stefan Kangas In-Reply-To: <83v8cp4vwu.fsf@gnu.org> References: <87sf7wlg07.fsf@cassou.me> <83v8cp4vwu.fsf@gnu.org> MIME-Version: 1.0 Date: Mon, 4 Sep 2023 11:58:03 -0700 Message-ID: Subject: Re: bug#65704: 29.1; Most code of `project-ignores' seems to be dead code To: Eli Zaretskii , Dmitry Gutov Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: 65704 Cc: damien@cassou.me, 65704@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: -0.5 (/) Eli Zaretskii writes: >> Date: Mon, 4 Sep 2023 21:31:36 +0300 >> From: Dmitry Gutov >> >> Eli? Stefan? >> >> On 03/09/2023 03:26, Dmitry Gutov wrote: >> > I'd like to backport it to emacs-29 as well, if Eli/Stefan don't mind. >> >> Any objections to the backport? > > Fine by me. No objections from me either. From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 04 16:11:44 2023 Received: (at 65704) by debbugs.gnu.org; 4 Sep 2023 20:11:44 +0000 Received: from localhost ([127.0.0.1]:52699 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qdFvE-0001ji-2F for submit@debbugs.gnu.org; Mon, 04 Sep 2023 16:11:44 -0400 Received: from mail.choca.pics ([2001:910:1410:500::1]:47524) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qdFvC-0001jX-3N for 65704@debbugs.gnu.org; Mon, 04 Sep 2023 16:11:43 -0400 Received: from localhost (localhost.localdomain [IPv6:::1]) by mail.choca.pics (Postfix) with ESMTP id BE78018192DF0; Mon, 4 Sep 2023 22:11:38 +0200 (CEST) Received: from mail.choca.pics ([IPv6:::1]) by localhost (mail.choca.pics [IPv6:::1]) (amavis, port 10032) with ESMTP id S_zNHKXcGclG; Mon, 4 Sep 2023 22:11:38 +0200 (CEST) Received: from localhost (localhost.localdomain [IPv6:::1]) by mail.choca.pics (Postfix) with ESMTP id 25F2118193FA8; Mon, 4 Sep 2023 22:11:38 +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 GT0tMKJVEnMI; Mon, 4 Sep 2023 22:11:37 +0200 (CEST) Received: from localhost (91.60.75.86.rev.sfr.net [86.75.60.91]) by mail.choca.pics (Postfix) with ESMTPSA id 9728018192DF0; Mon, 4 Sep 2023 22:11:37 +0200 (CEST) From: Damien Cassou To: Dmitry Gutov , 65704@debbugs.gnu.org Subject: Re: bug#65704: 29.1; Most code of `project-ignores' seems to be dead code In-Reply-To: <93d0f377-7acd-ec0d-0e17-f6d09c4dd23a@yandex.ru> References: <87sf7wlg07.fsf@cassou.me> <874jkakjt3.fsf@cassou.me> <93d0f377-7acd-ec0d-0e17-f6d09c4dd23a@yandex.ru> Date: Mon, 04 Sep 2023 22:11:36 +0200 Message-ID: <8734zthf5z.fsf@cassou.me> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 65704 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: > That's the reason I've added project-vc-extra-root-markers: so that=20 > honoring files like .gitignore still makes sense, but the user can split= =20 > the project into pieces using these markers while keeping the same=20 > backend in use. thank you very much for your explanation. I simplified my setup as you suggested. That being said, `project-files' for 'vc' seems not to work for me. Inside my client/ folder, (project-current) returns (vc nil "=E2=80=A6/client/") The `project-files' method has this line: (if (and (file-equal-p dir (cdr project)) Because `dir' is a string and (cdr project) is the list (nil "=E2=80=A6/client/), `file-equal-p' always returns nil. If I change `cdr' t= o be `caddr', things seem to work perfectly. Am I doing something wrong again or is it a bug and I should submit a patch? 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 Mon Sep 04 16:18:05 2023 Received: (at 65704) by debbugs.gnu.org; 4 Sep 2023 20:18:05 +0000 Received: from localhost ([127.0.0.1]:52709 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qdG1N-0001tm-8V for submit@debbugs.gnu.org; Mon, 04 Sep 2023 16:18:05 -0400 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]:41705) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qdG1J-0001tD-Ly for 65704@debbugs.gnu.org; Mon, 04 Sep 2023 16:18:04 -0400 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id 5D15C320092B; Mon, 4 Sep 2023 16:17:54 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Mon, 04 Sep 2023 16:17:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm3; t= 1693858673; x=1693945073; bh=4b5W0BHx7Asd9+XoZUuIT24ut0TVCYqRCnX J69kp7SE=; b=k5HJ7kCOJG+raOPCrj0hPwPhsunPUbgrozo/X0f7iyWpqsL4IzH sUzs2GnHdxmCqYsT265RlpxhipYdQzHTHdxGk/bLHMhgBkNzEFYSmq8+BMRPuisV gOWyue5wxXATendWSTlFh36BFkILCckI3kIBtSnLCWvT1ZaoABpn4kuxg1Xhbx6y wRCI66ss2yxJqc62z+Lg3k26Ku80+KvTCmx3tkHhF0w54s1PDzsyPBBfh6FIgSCC XngEWEcqNS6F64ZRXzwrAubMavJUfbRKQ3WpdaKbdDzv9cbXWToG/XbITMR5JuLw PLPrUCWS03XbtzdAhQFftJyjIKR6T3rK0qQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1693858673; x= 1693945073; bh=4b5W0BHx7Asd9+XoZUuIT24ut0TVCYqRCnXJ69kp7SE=; b=r dcnC5NM18FYVgiUXcs2L6wXBafaS4eKuGAuu7HYS13nb3ueuX+U1Trc1JIm55QSN gH7kyTZeIG85SLrgyv+s6uw0ayaEJKIyZ53lAF/b7LQneCv+BDEEzawb4ap3AwZI yq+IxxWeGQNhvrMKJ+HJcbc3pbQ9lhh+/kiq4M0qI5PdrdHMdzYVcifnemi7OfIG ntheIU53h3moatXQah7r9Jjey42TKkjzRd0sI5jr9KGfTqjLoEpZGATGhn5tDo4m 6t/epWElAlcpazKHajn98L4SOCNvSwMS/eTw2HV9sVyuuvEJN+tVaW+LLF4remEb LlRGdrNdml1LqP0ON2ecQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrudegkedgudegkecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefkffggfgfuvfhfhfgjtgfgsehtkeertddtfeejnecuhfhrohhmpeffmhhi thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth htvghrnhepfeejkeevvdefleefudefveegtedvveekledvtdeuteetfedufefgudeikeff ieelnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepug hmihhtrhihsehguhhtohhvrdguvghv X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 4 Sep 2023 16:17:52 -0400 (EDT) Message-ID: Date: Mon, 4 Sep 2023 23:17:49 +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#65704: 29.1; Most code of `project-ignores' seems to be dead code Content-Language: en-US To: Damien Cassou , 65704@debbugs.gnu.org References: <87sf7wlg07.fsf@cassou.me> <874jkakjt3.fsf@cassou.me> <93d0f377-7acd-ec0d-0e17-f6d09c4dd23a@yandex.ru> <8734zthf5z.fsf@cassou.me> From: Dmitry Gutov In-Reply-To: <8734zthf5z.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: 65704 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 04/09/2023 23:11, Damien Cassou wrote: > Dmitry Gutov writes: >> That's the reason I've added project-vc-extra-root-markers: so that >> honoring files like .gitignore still makes sense, but the user can split >> the project into pieces using these markers while keeping the same >> backend in use. > > thank you very much for your explanation. I simplified my setup as you > suggested. Very good. > That being said, `project-files' for 'vc' seems not to work for > me. Inside my client/ folder, (project-current) returns > > (vc nil "…/client/") > > The `project-files' method has this line: > > (if (and (file-equal-p dir (cdr project)) Its current definition (in Emacs 29 and later) looks like this: (if (and (file-equal-p dir (nth 2 project)) Perhaps you have an older version installed somewhere? Though that wouldn't explain why (project-current) would return an incompatible value. > Because `dir' is a string and (cdr project) is the list (nil > "…/client/), `file-equal-p' always returns nil. If I change `cdr' to be > `caddr', things seem to work perfectly. > > Am I doing something wrong again or is it a bug and I should submit a > patch? Some investigation could help. From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 05 03:58:46 2023 Received: (at 65704) by debbugs.gnu.org; 5 Sep 2023 07:58:47 +0000 Received: from localhost ([127.0.0.1]:53332 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qdQxS-00039D-K0 for submit@debbugs.gnu.org; Tue, 05 Sep 2023 03:58:46 -0400 Received: from mail.choca.pics ([2001:910:1410:500::1]:36564) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qdQxQ-000391-2e for 65704@debbugs.gnu.org; Tue, 05 Sep 2023 03:58:45 -0400 Received: from localhost (localhost.localdomain [IPv6:::1]) by mail.choca.pics (Postfix) with ESMTP id 942E218192DF0; Tue, 5 Sep 2023 09:58:41 +0200 (CEST) Received: from mail.choca.pics ([IPv6:::1]) by localhost (mail.choca.pics [IPv6:::1]) (amavis, port 10032) with ESMTP id rdxOYEwVIX5e; Tue, 5 Sep 2023 09:58:41 +0200 (CEST) Received: from localhost (localhost.localdomain [IPv6:::1]) by mail.choca.pics (Postfix) with ESMTP id DF7AE18192DF5; Tue, 5 Sep 2023 09:58:40 +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 j0PJiMGLVLXn; Tue, 5 Sep 2023 09:58:40 +0200 (CEST) Received: from localhost (unknown [IPv6:2001:41d0:fc22:6000:7f35:2bb3:a3e6:d73a]) by mail.choca.pics (Postfix) with ESMTPSA id 2B8F918192DF0; Tue, 5 Sep 2023 09:58:40 +0200 (CEST) From: Damien Cassou To: Dmitry Gutov , 65704@debbugs.gnu.org Subject: Re: bug#65704: 29.1; Most code of `project-ignores' seems to be dead code In-Reply-To: References: <87sf7wlg07.fsf@cassou.me> <874jkakjt3.fsf@cassou.me> <93d0f377-7acd-ec0d-0e17-f6d09c4dd23a@yandex.ru> <8734zthf5z.fsf@cassou.me> Date: Tue, 05 Sep 2023 09:58:39 +0200 Message-ID: <87tts9qceo.fsf@cassou.me> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 65704 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 (-) Hi Dmitry, Dmitry Gutov writes: > Perhaps you have an older version installed somewhere? I think I experimented a bit too much :-), thanks for noticing. I restarted Emacs and am now using project 0.9.8 from elpa. The expression (project-current) now returns (vc nil "=E2=80=A6/client/") in my client/ directory. Notice the nil in the second position. This means that `project-files' for 'vc will set nil as backend. As a result, the optimized `project--vc-list-files' isn't used. This means the files listed in client/.gitignore are not ignored. I'm certainly doing something wrong again. --=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 Tue Sep 05 10:10:01 2023 Received: (at 65704) by debbugs.gnu.org; 5 Sep 2023 14:10:01 +0000 Received: from localhost ([127.0.0.1]:57444 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qdWki-0001rT-I5 for submit@debbugs.gnu.org; Tue, 05 Sep 2023 10:10:00 -0400 Received: from out2-smtp.messagingengine.com ([66.111.4.26]:49387) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qdWkd-0001r9-BG for 65704@debbugs.gnu.org; Tue, 05 Sep 2023 10:09:59 -0400 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 78F2B5C0153; Tue, 5 Sep 2023 10:09:47 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Tue, 05 Sep 2023 10:09:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm3; t= 1693922987; x=1694009387; bh=8zLzGeUSra/MZOHY7BeSwxjX4Az4PO2LHOc XDbsQWFc=; b=LpQrkmCOH3I4dcDOZX9UCAZDQoOi9YKmGFH25Fpm6pJtVD8R2e2 KZc1E8ZeCaW8X+XYC/EuEVmq9FzImhzWfFhL2BL3ErWgi82lQFRntHWcIHSQwK6x rhUDiqdXE6BxD/anUfbRMA1yKzcLxlOy8bDU98xltFGCCbSEx0L/QNqYwRVR8d/P bhiIkpC5cp3jrc2S+14p4K8OVBjNEFD7hjS7ImCv1B8v6eThXR8JKvBuqgaSkdNZ uSQQNL274wmhU7FEMupSSyIl0iO+ai9IoPxISDIBBfH++D7X5zZAK9YzjRziFMFH 78rM2UD5UoIqmzPqVRihhXGV/ZMO931fSdA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1693922987; x= 1694009387; bh=8zLzGeUSra/MZOHY7BeSwxjX4Az4PO2LHOcXDbsQWFc=; b=X /4HFn71FLPgDqJLgx61Ks3lo94jo08l4rEajV8DWTR83QOQluFj4Dvxe73SKYyqg IjUoAbYJbpH1/aZAvavwnkHGxjOa7Bi/3QOn+2hkbhvl1LJOySP+EnoAaPLRcEhu pOi9ie5U4zjMh3kskV1yEdEaNEd+TfwdHNQv/hJyrakog/nFchFerx9lsE2/kQpH KFoM+KVaAryWpVZFJ6ILUm0V+cPn+fcNAeLSwmG4QWz9Pml1/QuhMVmx8JnV1yZF ozGIZ5vxfcuxI5GRej3Ccsr6k9ZrBPEQySIngKNVPU6JlYDummdiSAbfdSl11lWu uBjyg+CmUp3c5dNhC3s6g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrudehuddggeelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvfhfhjggtgfesthekredttdefjeenucfhrhhomhepffhmihht rhihucfiuhhtohhvuceoughmihhtrhihsehguhhtohhvrdguvghvqeenucggtffrrghtth gvrhhnpeefjeekvedvfeelfedufeevgeetvdevkeelvddtueetteefudefgfduieekffei leenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegumh hithhrhiesghhuthhovhdruggvvh X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 5 Sep 2023 10:09:46 -0400 (EDT) Message-ID: <5fb6c7df-3f64-5ed2-0c42-a182c6e1a9c4@gutov.dev> Date: Tue, 5 Sep 2023 17:09:45 +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#65704: 29.1; Most code of `project-ignores' seems to be dead code Content-Language: en-US To: Damien Cassou , 65704@debbugs.gnu.org References: <87sf7wlg07.fsf@cassou.me> <874jkakjt3.fsf@cassou.me> <93d0f377-7acd-ec0d-0e17-f6d09c4dd23a@yandex.ru> <8734zthf5z.fsf@cassou.me> <87tts9qceo.fsf@cassou.me> From: Dmitry Gutov In-Reply-To: <87tts9qceo.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: 65704 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, On 05/09/2023 10:58, Damien Cassou wrote: > Hi Dmitry, > > Dmitry Gutov writes: >> Perhaps you have an older version installed somewhere? > I think I experimented a bit too much 😄, thanks for noticing. I > restarted Emacs and am now using project 0.9.8 from elpa. The expression > (project-current) now returns (vc nil "…/client/") in my client/ > directory. I'm still not sure about the relative path in the 3rd element, but if it doesn't cause problems, let's set it aside for now. > Notice the nil in the second position. This means that > `project-files' for 'vc will set nil as backend. As a result, the > optimized `project--vc-list-files' isn't used. This means the files > listed in client/.gitignore are not ignored. > > I'm certainly doing something wrong again. And that... is a geniune bug. ;-( Or an omission compared to the design I had in my head (mentioned upthread), but at least not a regression compared to the previous behavior or to what people did with adding to project-find-functions. So I'm not 100% sure about changing that in Emacs 29, but here's a patch, please try it out: diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index 29a81c7e151..2eea0ef72e0 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -566,6 +566,12 @@ project-try-vc (project--submodule-p root)) (let* ((parent (file-name-directory (directory-file-name root)))) (setq root (vc-call-backend 'Git 'root parent)))) + (when (not backend) + (let* ((project-vc-extra-root-markers nil) + ;; Avoid submodules scan. + (enable-dir-local-variables nil) + (parent (project-try-vc root))) + (and parent (setq backend (nth 1 parent))))) (when root (setq project (list 'vc backend root)) ;; FIXME: Cache for a shorter time. From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 05 16:22:17 2023 Received: (at 65704) by debbugs.gnu.org; 5 Sep 2023 20:22:17 +0000 Received: from localhost ([127.0.0.1]:59555 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qdcYy-0000G0-Vl for submit@debbugs.gnu.org; Tue, 05 Sep 2023 16:22:17 -0400 Received: from mail.choca.pics ([80.67.172.235]:43412) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qdcYv-0000Fq-GU for 65704@debbugs.gnu.org; Tue, 05 Sep 2023 16:22:15 -0400 Received: from localhost (localhost.localdomain [IPv6:::1]) by mail.choca.pics (Postfix) with ESMTP id EA58B18193F54; Tue, 5 Sep 2023 22:22:10 +0200 (CEST) Received: from mail.choca.pics ([IPv6:::1]) by localhost (mail.choca.pics [IPv6:::1]) (amavis, port 10032) with ESMTP id 41Kv4jkiB1WC; Tue, 5 Sep 2023 22:22:10 +0200 (CEST) Received: from localhost (localhost.localdomain [IPv6:::1]) by mail.choca.pics (Postfix) with ESMTP id 58FC018193F55; Tue, 5 Sep 2023 22:22:10 +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 YqByjJo3VkOP; Tue, 5 Sep 2023 22:22:10 +0200 (CEST) Received: from localhost (91.60.75.86.rev.sfr.net [86.75.60.91]) by mail.choca.pics (Postfix) with ESMTPSA id 0254E18193F54; Tue, 5 Sep 2023 22:22:09 +0200 (CEST) From: Damien Cassou To: Dmitry Gutov , 65704@debbugs.gnu.org Subject: Re: bug#65704: 29.1; Most code of `project-ignores' seems to be dead code In-Reply-To: <5fb6c7df-3f64-5ed2-0c42-a182c6e1a9c4@gutov.dev> References: <87sf7wlg07.fsf@cassou.me> <874jkakjt3.fsf@cassou.me> <93d0f377-7acd-ec0d-0e17-f6d09c4dd23a@yandex.ru> <8734zthf5z.fsf@cassou.me> <87tts9qceo.fsf@cassou.me> <5fb6c7df-3f64-5ed2-0c42-a182c6e1a9c4@gutov.dev> Date: Tue, 05 Sep 2023 22:22:08 +0200 Message-ID: <87o7igbcb3.fsf@cassou.me> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 65704 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 05/09/2023 10:58, Damien Cassou wrote: >> The expression (project-current) now returns (vc nil "=E2=80=A6/client/"= ) in >> my client/ directory. > > I'm still not sure about the relative path in the 3rd element, but if it= =20 > doesn't cause problems, let's set it aside for now. The "..." in the result of (project-current) above is not a sign of a relative path but a sign of me removing the noise in my message. I'm sorry it was more confusing than helpful. The real string starts with "~/Documents/". > So I'm not 100% sure about changing that in Emacs 29, but here's a=20 > patch, please try it out: This is working great for me as far as I can tell. Thank you. Updating Emacs 29 doesn't seem necessary: this is why we have Elpa after all. --=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 Wed Sep 06 15:13:09 2023 Received: (at 65704) by debbugs.gnu.org; 6 Sep 2023 19:13:09 +0000 Received: from localhost ([127.0.0.1]:37744 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qdxxd-0007ym-DY for submit@debbugs.gnu.org; Wed, 06 Sep 2023 15:13:09 -0400 Received: from mail.choca.pics ([2001:910:1410:500::1]:33080) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qdxxa-0007yV-4x for 65704@debbugs.gnu.org; Wed, 06 Sep 2023 15:13:07 -0400 Received: from localhost (localhost.localdomain [IPv6:::1]) by mail.choca.pics (Postfix) with ESMTP id A7A3F18192DDD; Wed, 6 Sep 2023 21:13:01 +0200 (CEST) Received: from mail.choca.pics ([IPv6:::1]) by localhost (mail.choca.pics [IPv6:::1]) (amavis, port 10032) with ESMTP id Us5aH4NKhKgU; Wed, 6 Sep 2023 21:13:01 +0200 (CEST) Received: from localhost (localhost.localdomain [IPv6:::1]) by mail.choca.pics (Postfix) with ESMTP id 2275318192DE4; Wed, 6 Sep 2023 21:13:01 +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 e5KxsTRwp0u7; Wed, 6 Sep 2023 21:13:00 +0200 (CEST) Received: from localhost (91.60.75.86.rev.sfr.net [86.75.60.91]) by mail.choca.pics (Postfix) with ESMTPSA id 6FD6218192DDD; Wed, 6 Sep 2023 21:13:00 +0200 (CEST) From: Damien Cassou To: Dmitry Gutov , 65704@debbugs.gnu.org Subject: Re: bug#65704: 29.1; Most code of `project-ignores' seems to be dead code In-Reply-To: <5fb6c7df-3f64-5ed2-0c42-a182c6e1a9c4@gutov.dev> References: <87sf7wlg07.fsf@cassou.me> <874jkakjt3.fsf@cassou.me> <93d0f377-7acd-ec0d-0e17-f6d09c4dd23a@yandex.ru> <8734zthf5z.fsf@cassou.me> <87tts9qceo.fsf@cassou.me> <5fb6c7df-3f64-5ed2-0c42-a182c6e1a9c4@gutov.dev> Date: Wed, 06 Sep 2023 21:12:59 +0200 Message-ID: <87bkefp138.fsf@cassou.me> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 65704 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: > diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el > index 29a81c7e151..2eea0ef72e0 100644 > --- a/lisp/progmodes/project.el > +++ b/lisp/progmodes/project.el > @@ -566,6 +566,12 @@ project-try-vc > (project--submodule-p root)) > (let* ((parent (file-name-directory (directory-file-name > root)))) > (setq root (vc-call-backend 'Git 'root parent)))) > + (when (not backend) it seems that `root' is sometimes nil at this point so I would change this line to (when (and (not backend) root) I've used this for the day and it seems to work fine. -- 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 Sep 06 17:16:59 2023 Received: (at 65704-done) by debbugs.gnu.org; 6 Sep 2023 21:16:59 +0000 Received: from localhost ([127.0.0.1]:38031 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qdztT-0005AE-3M for submit@debbugs.gnu.org; Wed, 06 Sep 2023 17:16:59 -0400 Received: from out2-smtp.messagingengine.com ([66.111.4.26]:42305) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qdztM-00059v-Fj for 65704-done@debbugs.gnu.org; Wed, 06 Sep 2023 17:16:57 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id A8A1D5C00A4; Wed, 6 Sep 2023 17:16:45 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Wed, 06 Sep 2023 17:16:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm3; t= 1694035005; x=1694121405; bh=yk9u7AU3KPNS34mLAtidxmSLWp/wnR3+xZ+ 5bg3Kc58=; b=Cim1+yhpeZQY+hGED9uOIaANQCEUOSbGCX8RkkvtYl0d75S5aFq oFVk8YyAhmk5HCUz/eaR0tBBZuYuC4Lk2aYOyXJofRfUEFDqWzcDFUKM7p2XtkEn 2JP5YXVYLW22E6Fv8hpo0NcgLu261d/xyqOdr5PFcVVMJQzdNYEGgWCSUwTm4kT9 a7m02XL7WOOWz7tLfJQTizaGKpgWla1oVEH5wZOhYy+dpsTLMLa7tJVC/cqGicDl Hi9wwH7QrfCgRCAwgFdeD4whcXZ7oAGwv1GYlmJQUi19S3/mRveJmmXJSSyfJOOH HDPpv26esGqI7bB4ATIijH6ExB2RromiSkg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1694035005; x= 1694121405; bh=yk9u7AU3KPNS34mLAtidxmSLWp/wnR3+xZ+5bg3Kc58=; b=C UlTCFtrt72EpRBf9bMTBFPlVl18Ydo9FliyCp+tIJJbjTIR/j+d6wrF6HKaqJGR7 0KnGKvX80jhBLSTaOmCNlSpTuoBen/YuNQ6rF8CqAkRaZr6sm/KmFqICBNKHIgK/ ko4q4J4HInSVsi3kRPre3eHCsR8JQuQnuj6sTfyIWG21cBZ028yzuPIyYunZnYlr 4BfnUw6oYV0yEuGQFjZ+kxtPO6kTGU4OI/CC3zaxkPP2GanKzRUN3QxM6cMINYgL 0FBgOLzWywfmdgfkwWoPE06KhPVT1kzhV4v8gqHVI2bNr0HSr6dEKsmK7MAQvdBT APy8Ku1ehDHM4z/A/ogJg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrudehfedgudehkecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefkffggfgfuvfhfhfgjtgfgsehtjeertddtfeejnecuhfhrohhmpeffmhhi thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth htvghrnhepgeehtdehudejieetuedttdejkeehjeetueekheffuddtjeeuvdefveeuveei uddunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepug hmihhtrhihsehguhhtohhvrdguvghv X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 6 Sep 2023 17:16:44 -0400 (EDT) Message-ID: <76be9234-5196-a989-785b-558d4956eb48@gutov.dev> Date: Thu, 7 Sep 2023 00:16:42 +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#65704: 29.1; Most code of `project-ignores' seems to be dead code Content-Language: en-US To: Damien Cassou , 65704-done@debbugs.gnu.org References: <87sf7wlg07.fsf@cassou.me> <874jkakjt3.fsf@cassou.me> <93d0f377-7acd-ec0d-0e17-f6d09c4dd23a@yandex.ru> <8734zthf5z.fsf@cassou.me> <87tts9qceo.fsf@cassou.me> <5fb6c7df-3f64-5ed2-0c42-a182c6e1a9c4@gutov.dev> <87bkefp138.fsf@cassou.me> From: Dmitry Gutov In-Reply-To: <87bkefp138.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: 65704-done 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 06/09/2023 22:12, Damien Cassou wrote: > Dmitry Gutov writes: >> diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el >> index 29a81c7e151..2eea0ef72e0 100644 >> --- a/lisp/progmodes/project.el >> +++ b/lisp/progmodes/project.el >> @@ -566,6 +566,12 @@ project-try-vc >> (project--submodule-p root)) >> (let* ((parent (file-name-directory (directory-file-name >> root)))) >> (setq root (vc-call-backend 'Git 'root parent)))) >> + (when (not backend) > it seems that `root' is sometimes nil at this point so I would change > this line to > > (when (and (not backend) root) > > I've used this for the day and it seems to work fine. Thanks for the extra testing. I just moved the new code a little deeper down inside (when root ...) block, should do the same. Pushed as 62229fb2d11 and bumped project.el version to 0.10.0. Should be out in ELPA shortly along with a few other new features added recently. This seems to resolve the last of the concerns here, so closing the bug as well. Please clarify if something remains. Addendum regarding the chosen solution: I guess there is a downside or two: when working over Tramp, the latency will increase. And if the subproject's dir is in the parent's .gitignore, the behavior will get worse. Let's wait for feedback to see if those are real problems, but worst case, the solution which you had used previously should take care at least of the second usage scenario (ignoring the ignores). From unknown Sun Jul 20 09:47:22 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, 05 Oct 2023 11:24:05 +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