From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Chu Maeda Newsgroups: gmane.emacs.bugs Subject: bug#74614: Fwd: bug#74614: Problem of finding the project root when working on submodules of a submodule Date: Tue, 3 Dec 2024 10:25:14 +0800 Message-ID: References: <45fb1453-ca9f-47c2-bd85-d7be860aa840@gutov.dev> <61ff7773-b4f6-4e22-9f36-10adcc13fc29@gutov.dev> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000bb4e9106285460d1" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35451"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 74614@debbugs.gnu.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Dec 03 03:27:23 2024 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 1tIIdF-000956-Va for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 03 Dec 2024 03:27:22 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tIIcx-0003Pm-Na; Mon, 02 Dec 2024 21:27:03 -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 1tIIcw-0003Pa-L5 for bug-gnu-emacs@gnu.org; Mon, 02 Dec 2024 21:27:02 -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 1tIIcw-0005Iw-4y for bug-gnu-emacs@gnu.org; Mon, 02 Dec 2024 21:27:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=Date:From:In-Reply-To:References:MIME-Version:To:Subject; bh=Mj4OZCxwUmO8i8JQRfNJo9ObZlhQlcbyl+6dMHV2vkA=; b=MX0hB9GSg3f8SGX7IEfFq+/wFWJ6AQxJKjAL4lEuGgudsUvlfDrnH5PZyxt3auWSWR+FGvmbSzRgT215n6ITzPKwkobwGS9qt1VKRXekLTYvNz9/nte7CuWfLRh5ZCHxAWIZ30GrpHaChOHib/e53Fp4DJGzr2BnMJAVlAE9LDtHLxb+WgUds+t3zxWwZIDEDKSVZi98LiZATpquMW07yi/GmFK81/DyMZNiJlq6Az7cyWJfM1yMJ/FkvaRVeK+GL9rQPBSp2s2pTNU8W2EyKdpW7a7Q/vH2gIPOHP/YK3XV+jJROdFums47ol5c5rrMPlszNcoU9WIbRo8wO6EOCg==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tIIcw-00073t-0E for bug-gnu-emacs@gnu.org; Mon, 02 Dec 2024 21:27:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Chu Maeda Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 03 Dec 2024 02:27:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74614 X-GNU-PR-Package: emacs Original-Received: via spool by 74614-submit@debbugs.gnu.org id=B74614.173319278827081 (code B ref 74614); Tue, 03 Dec 2024 02:27:01 +0000 Original-Received: (at 74614) by debbugs.gnu.org; 3 Dec 2024 02:26:28 +0000 Original-Received: from localhost ([127.0.0.1]:57294 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tIIcO-00072j-0w for submit@debbugs.gnu.org; Mon, 02 Dec 2024 21:26:28 -0500 Original-Received: from mail-yb1-f177.google.com ([209.85.219.177]:51543) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tIIcM-00072Z-5M for 74614@debbugs.gnu.org; Mon, 02 Dec 2024 21:26:26 -0500 Original-Received: by mail-yb1-f177.google.com with SMTP id 3f1490d57ef6-e3984b1db09so3571074276.3 for <74614@debbugs.gnu.org>; Mon, 02 Dec 2024 18:26:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1733192725; x=1733797525; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=Mj4OZCxwUmO8i8JQRfNJo9ObZlhQlcbyl+6dMHV2vkA=; b=nZsuX5EP1pgWTVzWvkGlAB+yMzLdyIcOZldjn7JLCLlA8s7cEHuWWAAKw9lBAInDtg mxzVmFSfr4qb/cU+KO922H+aMYsc8byOksIHi10nFalt1Uh6/Rf+Pli3USVDBsocUOdL MGCHUPlkb0K0iZVEWlZCiff2WOuG03TjMs4CG69l2S871A7qemCp6YIKdDtQ9aCVUYjk jH/kjpbIhq9dc32/tqCuOdS/qgDG4DHB4Qv6cfuspmKw0WLdRt+iwafngRqQ4mmZt6iE gEdWa+tB18teMaU8NfAK2KT385Ya4FtRVfubwvb62e8WFxrvFJHSZwfX9h6T8b/KNiFF K9Iw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733192725; x=1733797525; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Mj4OZCxwUmO8i8JQRfNJo9ObZlhQlcbyl+6dMHV2vkA=; b=w0RY/3KIDO2fEZCM2GUG8QgVeqRNkHvo6puy59epC7xL8gE5K0PF4Db81y24IDo7I/ Iq6eW1Pw7/5c8cTtFsa1OhL60r5lKLFLyy3uyqV45z1Ar2bjb0s0rhpLISQLgO0kJFQ9 EY3PU2PSnzZzDo0311uivzg+zZYcxmYZXE081UtpUoTZgtsJEs6TVMBYKQ/CE4I4Gxot 53C51xRCdWmfuNpZ0XVEbgaFfQ84aE90F7SeNYHjTzRLWXUDcETEs31fOnwhcMtETYQq ZDp0mrvB0cMll0aLNZuSP08MRPpGwQJIONthkdthrLVRmgmd5jPxPwWYih9Qxnib1dob w/9Q== X-Gm-Message-State: AOJu0YwvxvpPCNxvNaG0R+H/3nKqFDfcpRFkK92Hxt5fd1NWbtY6bO4z ZnFc9jIzXWC5qTxBa3Sg2kw2H+j4VyvDtNmTzf7UjWMTGnlOE1v02L9ydB2988NiIi4vrtf0tWK xGHWJ5XbmaEDrc+72aho9A8iRKm6Te50bAP8= X-Gm-Gg: ASbGnctjiQws6TPHSgxMsLJajGLkT172O5JHgGGzdP+PVtx8qbFcxp5CC54PpzDZLce Rr2uWy8oOe4QTr288lXtZ/140KswRCII= X-Google-Smtp-Source: AGHT+IHl49CXWj2Y4S/UKIAaMk51YWRQH+7CaBz2zbyvUY8etwoFVQi9qvQajpLoD55F7aZEuzn9J2wdns54U9bgPkU= X-Received: by 2002:a05:6902:2512:b0:e39:9c32:2270 with SMTP id 3f1490d57ef6-e39d3d17f4emr933635276.16.1733192725512; Mon, 02 Dec 2024 18:25:25 -0800 (PST) In-Reply-To: <61ff7773-b4f6-4e22-9f36-10adcc13fc29@gutov.dev> 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:296349 Archived-At: --000000000000bb4e9106285460d1 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable It works. Thanks. Dmitry Gutov =E4=BA=8E2024=E5=B9=B412=E6=9C=883=E6=97=A5= =E5=91=A8=E4=BA=8C 10:15=E5=86=99=E9=81=93=EF=BC=9A > On 02/12/2024 07:15, Chu Maeda wrote: > > > > Of course, I created such a project on github, you could clone it by > > command: > > > > git clone --recurse-submodules https://github.com/chu-mirror/A.git > > > > > > The problem is clear when you open the file A/B/C/README.md, and run > > command project-find-file(C-x p f by default) > > Thanks! > > It seems we should switch from checking for modules once to doing it in > a loop. Try this out: > > diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el > index cf1c94a6d20..3cc063a5d99 100644 > --- a/lisp/progmodes/project.el > +++ b/lisp/progmodes/project.el > @@ -591,7 +591,7 @@ project-try-vc--search > last-matches)) > vc-handled-backends)) > project) > - (when (and > + (while (and > (eq backend 'Git) > (project--vc-merge-submodules-p root) > (project--submodule-p root)) > > Note you might need to restart Emacs after applying the patch, because > the directory->project relation is currently cached until restart. > --000000000000bb4e9106285460d1 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
It works. Thanks.

Dmitry Gutov <dmitry@gutov.dev> =E4=BA=8E2024=E5= =B9=B412=E6=9C=883=E6=97=A5=E5=91=A8=E4=BA=8C 10:15=E5=86=99=E9=81=93=EF=BC= =9A
On 02/12/202= 4 07:15, Chu Maeda wrote:
>
> Of course, I created such a project on github, you could clone it by <= br> > command:
>
> git clone --recurse-submodules https://github.com/chu-mirror= /A.git
> <https://github.com/chu-mirror/A.git>
>
> The problem is clear when you open the file A/B/C/README.md, and run <= br> > command project-find-file(C-x p f by default)

Thanks!

It seems we should switch from checking for modules once to doing it in a loop. Try this out:

diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el
index cf1c94a6d20..3cc063a5d99 100644
--- a/lisp/progmodes/project.el
+++ b/lisp/progmodes/project.el
@@ -591,7 +591,7 @@ project-try-vc--search
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0last-matches))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0vc-handled-backends))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0project)
-=C2=A0 =C2=A0 (when (and
+=C2=A0 =C2=A0 (while (and
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(eq backend 'Git)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(project--vc-merge-submodul= es-p root)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(project--submodule-p root)= )

Note you might need to restart Emacs after applying the patch, because
the directory->project relation is currently cached until restart.
--000000000000bb4e9106285460d1--