From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#72300: project.el: detect newly created project contained within another Date: Sun, 04 Aug 2024 11:15:58 +0300 Message-ID: <86mslssny9.fsf@gnu.org> References: <87r0bh8cy7.fsf@gmx.de> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24564"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 72300@debbugs.gnu.org To: Federico Tedin , Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Aug 04 10:16:54 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 1saWQ9-0006FD-IM for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 04 Aug 2024 10:16:53 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1saWPz-0002Db-MP; Sun, 04 Aug 2024 04:16:43 -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 1saWPx-0002DJ-Pt for bug-gnu-emacs@gnu.org; Sun, 04 Aug 2024 04:16:42 -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 1saWPx-00082O-0F for bug-gnu-emacs@gnu.org; Sun, 04 Aug 2024 04:16:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=References:In-Reply-To:From:Date:To:Subject; bh=79Ys0tD3MJsgtW5gw6HL+WB4e09jAq/bpGMl9egdSd0=; b=R5PGFFlVMFVCcbIW6Dw8VpN0IeP637oNB2kkeasaT1YPov2mR3n/SM8FO0Wvdzp89CcbJvc2kRFhoatqbtuiIA+ZEBbPHyYMLN/ib7T1b61mJ3K5DFtvZAZ0Csa7mVu3wWMK3d4WL+0+blSl+5UY6sOxHDW7nE00UzD++3m/e1WSPNeAcM8CCfny8MGCENu3WEvJuqcTFtZDnYrm2tJfrivtdbbeTS090arMoSlVam2OdTFv6rC6GTQdJaQOqy3O47j2l0wjKHnLXib1Z49Z2/6PzhvQuwjQ7fvl0VIp9pcv9zVcKKBryJAcuUGRGd1Z7TcXLk/J3t5tc/7EjejXQQ==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1saWQH-0006A8-Mc for bug-gnu-emacs@gnu.org; Sun, 04 Aug 2024 04:17:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 04 Aug 2024 08:17:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 72300 X-GNU-PR-Package: emacs Original-Received: via spool by 72300-submit@debbugs.gnu.org id=B72300.172275938923560 (code B ref 72300); Sun, 04 Aug 2024 08:17:01 +0000 Original-Received: (at 72300) by debbugs.gnu.org; 4 Aug 2024 08:16:29 +0000 Original-Received: from localhost ([127.0.0.1]:55423 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1saWPl-00067t-7q for submit@debbugs.gnu.org; Sun, 04 Aug 2024 04:16:29 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:36518) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1saWPj-00067T-Fu for 72300@debbugs.gnu.org; Sun, 04 Aug 2024 04:16:28 -0400 Original-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 1saWPI-0007ZK-Kr; Sun, 04 Aug 2024 04:16:00 -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=79Ys0tD3MJsgtW5gw6HL+WB4e09jAq/bpGMl9egdSd0=; b=F/SJb7P2viM2 w1um3Pnl5bHWv2MyfjHPwdw3HzXgu7Ui/ro6SYriUeOzIcevsFkRfhwC5lNwdHdZaJdr5q0SbdKvb MK5BaPmiOyXEK3G8/V9XnNrh13z2Z9e4ktTyuuMyu3mCOnRlLA8+YgxXG3N7GpHC7uCje39d8roos HsVAFJC2vSLcsZTZUq/QNgpI61QRAdgtCEjScavyxdctGFhG4YSFPdJJj8C8QTKHw/l7gqrXix20T kcLt2M/pEUN13kKakp6BpHJbxc5sWc06vdx9r/CrZuOn5pSxOgcarcijEbmkd+OAvo1hY6KiHs8H4 HS2gdg88O42A+NgGGmn08g==; In-Reply-To: <87r0bh8cy7.fsf@gmx.de> (bug-gnu-emacs@gnu.org) 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:289726 Archived-At: > Date: Thu, 25 Jul 2024 21:54:24 +0200 > From: Federico Tedin via "Bug reports for GNU Emacs, > the Swiss army knife of text editors" > > In Emacs master e56e4b345a2, `emacs -q`: > > I'm having problems trying to make project.el detect a new project that > is contained in the directory of another project. > > I have a directory called 'scratch' which contains a '.git' directory, a > file 'test.py' and a directory 'foo'. The 'foo' directory contains a > file called 'foo.py'. > > > ~/scratch/ > .git/ > main.py > foo/ > foo.py > > > If I open 'main.py', `(project-current)' evals to the expected: `(vc Git > "~/scratch")'. > > If I open 'foo.py', `(project-current)' also evals to `(vc Git > "~/scratch")', which is expected. > > However if now I cd into 'foo/' and run `git init`, then I would expect > project.el to now consider 'foo.py' to be in another project - `(vc Git > "~/scratch/foo")'. However, if I evaluate `(project-current)' when > visiting 'foo.py', I still get `(vc Git "~/scratch")'. > > If I kill the buffer visiting 'foo.py' and open the file again, I get > the same result. > > Interestingly, if I run 'M-x project-remember-projects-under' with > '~/scratch/foo' as path, it does inform me that the new project has been > found. However visiting 'foo.py` still results in `(vc Git "~/scratch")' > as the current project. > > If I restart Emacs then the problem is solved; 'foo.py' is correctly > filed under project `(vc Git "~/scratch/foo")'. > > The fact that this works correctly after restarting makes me think > that there must be some runtime state set up that is preventing the > desired behaviour to happen. Dmitry, any comments or suggestions?