unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Federico Tedin <federicotedin@gmx.de>, Dmitry Gutov <dmitry@gutov.dev>
Cc: 72300@debbugs.gnu.org
Subject: bug#72300: project.el: detect newly created project contained within another
Date: Sun, 04 Aug 2024 11:15:58 +0300	[thread overview]
Message-ID: <86mslssny9.fsf@gnu.org> (raw)
In-Reply-To: <87r0bh8cy7.fsf@gmx.de> (bug-gnu-emacs@gnu.org)

> 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" <bug-gnu-emacs@gnu.org>
> 
> 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?





  reply	other threads:[~2024-08-04  8:15 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-25 19:54 bug#72300: project.el: detect newly created project contained within another Federico Tedin via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-08-04  8:15 ` Eli Zaretskii [this message]
2024-08-05 17:18   ` Ship Mints
2024-08-05 19:56     ` Federico Tedin via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-08-13  1:43     ` Dmitry Gutov
2024-08-13 13:31       ` Ship Mints
2024-08-13 14:50         ` Ship Mints
2024-09-30  1:50           ` Dmitry Gutov
2024-09-30 14:31             ` Ship Mints
2024-09-30 23:10               ` Dmitry Gutov
2024-10-01 20:20                 ` Ship Mints
2024-10-01 21:45                   ` Dmitry Gutov
2024-09-30  1:35         ` Dmitry Gutov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86mslssny9.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=72300@debbugs.gnu.org \
    --cc=dmitry@gutov.dev \
    --cc=federicotedin@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).