Subject: Re: bug#79024: 31.0.50; Multiple working trees support for VC

From: Dmitry Gutov <[email-masked]>
Date: Wed, 6 Aug 2025 05:11:06 +0300

Hi!

On 04/08/2025 23:09, Sean Whitton wrote:

>> They are pretty solid, thanks. Please go ahead.
> 
> I'd previously proposed a variable, project-prompter-predicate, which
> Lisp code would bind around calls to prompter-prompter.
> 
> But I see that the API for project-prompter has already been changed in
> Emacs 31 to add a new optional PROMPT argument.  So I've gone with
> adding two additional optional arguments instead of adding a new
> variable.

Unexpected, but looks reasonable.

>> Also, this way we could miss worktrees previously created outside of Emacs,
>> and not registered in the project history yet. Again, not sure if it's
>> critical.
> 
> This problem is unavoidable for Mercurial.
> 
> For Git I've added a loop to vc--prompt-other-working-tree to call
> project-remember-project on the possibilities.
> 
> This going back and forth between VC and project has become a bit
> convoluted but I think nicely serves the various needs we've identified.

Nice to see we've avoided using the "private" parts of the package, too.