From: "João Távora" <joaotavora@gmail.com>
To: 60570@debbugs.gnu.org, Dmitry Gutov <dgutov@yandex.ru>,
aqua0210@foxmail.com
Subject: bug#60570: 29.0.60; Eglot+pyright freeze Emacs when edit a single file in Home director
Date: Thu, 5 Jan 2023 21:38:40 +0000 [thread overview]
Message-ID: <CALDnm53GYu15G4M5HmexnAzMpB4s2XAAooe6NHV1hdoDeb=z9A@mail.gmail.com> (raw)
In-Reply-To: <m2bknd2wb7.fsf@foxmail.com>
[-- Attachment #1: Type: text/plain, Size: 2563 bytes --]
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.
You can also, possibly, "unfreeze" your emacs by using C-g or a killall
find issued from the console.
João
[-- Attachment #2: Type: text/html, Size: 2848 bytes --]
next parent reply other threads:[~2023-01-05 21:38 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <m2bknd2wb7.fsf@foxmail.com>
2023-01-05 21:38 ` João Távora [this message]
2023-01-06 13:36 ` bug#60570: 29.0.60; Eglot+pyright freeze Emacs when edit a single file in Home director Eason Huang
2023-01-06 6:17 ` Yuan Fu
2023-01-06 10:29 ` João Távora
2023-01-07 22:38 ` Yuan Fu
2023-01-05 8:57 Eason Huang
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CALDnm53GYu15G4M5HmexnAzMpB4s2XAAooe6NHV1hdoDeb=z9A@mail.gmail.com' \
--to=joaotavora@gmail.com \
--cc=60570@debbugs.gnu.org \
--cc=aqua0210@foxmail.com \
--cc=dgutov@yandex.ru \
/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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.