GNU bug report logs - #60570
29.0.60; Eglot+pyright freeze Emacs when edit a single file in Home director

Previous Next

Package: emacs;

Reported by: Eason Huang <aqua0210 <at> foxmail.com>

Date: Thu, 5 Jan 2023 08:59:02 UTC

Severity: normal

Found in version 29.0.60

Full log


View this message in rfc822 format

From: Eason Huang <aqua0210 <at> foxmail.com>
To: João Távora <joaotavora <at> gmail.com>
Cc: 60570 <at> debbugs.gnu.org, Dmitry Gutov <dgutov <at> yandex.ru>
Subject: bug#60570: 29.0.60; Eglot+pyright freeze Emacs when edit a single file in Home director
Date: Fri, 06 Jan 2023 21:36:52 +0800
João Távora <joaotavora <at> gmail.com> writes:

> Eason,
>
> Eglot is asking project.el to tell it which files belong to a
> project. I believe project.el uses find as a last-ditch effort, if
> finds no other method to answer.
>
> I'm afraid there can be no good solution to your problem, because by
> invoking any project-aware operation on ~/test.py (and Eglot counts as
> project-aware functionality) and in the absence of, say, a ~/.git you
> are effectively telling `project.el` that your whole home directory is a
> gigantic project, and there is no good way to determine the files in
> that project but to use find.

> You could:
>
> 1. configure your language server to not request project-wide file
>    watching from the LSP client in certain directories (including the
>    $HOME directory).  See your language server's documentation for this
>    effect

> 2. Tell project.el via its interfaces (project-find-functions) that the
>    "project" you store in your $HOME is composed of a relatively small and
>    manageable set of files.

> 3. A very simple means -- but not the only means -- to do the above is to
>    type `git init` in your $HOME directory.
>
> 4. Read project.el's documentation (and ask its maintainers) for other
>    means to use project-find-functions to declare that a project exists
>    in $HOME but does not include the full contents of your home
>    directory as its files.
>
> 5. Stop opening Python scripts in your $HOME *and* auto-activating Eglot
>    in them.  You may be auto-activating Eglot with eglot-ensure, but this
>    is not recommended precisely because it carries with risks like this.
>
> 6. Request to project.el's maintainer that project.el interrupt up its
>    very slow `find`-based search and returns only subset of results.
>
> 7. Request that Eglot honour the keyword didChangeWatchFiles when it is
>    included in eglot-ignored-server-capabilities.  If you then also
>    change your configuration to do this _only_ in certain directories
>    (for example by utilizing directory-local variables or writing a
>    slightly complicated whook), this would mitigate your problem. We
>    can probably do this in eglot.el, but I don't see this as priority
>    because of the burden on the user and it only solves the problem for
>    Eglot, not all other project.el-using functionality.
>
> I recommend restricting your use of eglot-ensure. It's very overrated
> functionality. M-x eglot will probably only need to be typed once
> or twice in a typical Emacs session.

Thanks for your detailed explanation and solutions.

I will aviod opening Python scripts in $HOME directory and use git to
manage my python project. For the single file, just put it in an empty
directory aslo works as expected.

I enjoy using M-x eglot and never use eglot-ensure.


> You can also, possibly, "unfreeze" your emacs by using C-g or a killall
> find issued from the console.
C-g sometimes can "unfreeze" Eamcs and stop the find program.


-- 
Eason Huang





This bug report was last modified 2 years and 215 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.