Subject: bug#41821: 28.0.50; read-directory-name in vc commands should provide defaults from projects

From: Dmitry Gutov <[email-masked]>
Date: Thu, 2 Jul 2020 17:43:29 +0300

On 02.07.2020 16:36, Eli Zaretskii wrote:

>>> Why isn't that a better approach?  I don't think it's wise to blur the
>>> difference between using project.el features and the VC back-end
>>> features that support them.  If someone wants to use project.el in VC
>>> commands, let them use project.el commands, not VC commands.  That
>>> way, Emacs will know that some kind of project is being worked on, and
>>> could offer more targeted support for such users.
>>
>> Not sure that's going to result in optimal user experience. After all,
>> simply having a copy of every command, but acting on a project, would
>> make it 2x the number of commands.
>>
>> And project-rgrep, on the other hand, would probably search the current
>> project root without prompting. Unlike the proposed change to rgrep,
>> which only makes it a suggestion.
> 
> I just fear that this is a slippery slope: we will eventually need to
> inject this into many GP commands, "for consistency".

The notion of current project is very common in most editors, so I 
imagine this will be TRT, sooner or later. Not that I'm in a hurry for that.

>> Another long-term violation of your idea is the default definition of
>> xref-backend-references. It uses the current project. You could say that
>> mixes up abstractions as well, but it's just too handy to implement this
>> way.
> 
> I don't think I understand the issue and the use case, sorry.

The use case is 'M-x xref-find-refereces' and xref backends which don't 
override xref-backend-references. In which case this command searches 
the current project using general purpose tools (one of semantic symref 
tools, or Grep).

But xref backend != current project. They're technically and 
theoretically independent.