bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#60956: 27.2; project-try-vc considers every nonempty directory a roo


From: Dmitry Gutov
Subject: bug#60956: 27.2; project-try-vc considers every nonempty directory a root when vc-handled-backends is nil
Date: Fri, 20 Jan 2023 14:14:15 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2

Hi!

On 20/01/2023 00:45, Jason Orendorff wrote:
I observed that `eglot' would happily start dozens of language server
processes, but each one of them only seemed to know about a tiny
fraction of my code. I tracked this down and found a minor bug in
project.el.

In `project-try-vc', when `vc-handled-backends' is nil, the value of
`marker-re' computed here:

https://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/progmodes/project.el?id=207901457c018d94b1ce9e13a897d8241b1f3af2#n516
 
<https://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/progmodes/project.el?id=207901457c018d94b1ce9e13a897d8241b1f3af2#n516>

is the empty string.

If no vc backends are enabled, no directory should be treated as a vc
root. But the empty regexp matches everything, so *all* directories are
treated as vc roots.

Consequently, `eglot' spawned a lot of processes, because it starts one
per project.

The workaround is to set `vc-handled-backends' to any other value. (I
suppose I configured it to nil long ago, when working in a huge
Mercurial repository. Back then, commonplace hg commands in that repo
were unreasonably slow.)

Thank you for this report.

Please try the attached patch.

Attachment: project-marker-wildcard.diff
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]