From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Newsgroups: gmane.emacs.bugs 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 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000007bd77405f18b20f0" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2583"; mail-complaints-to="usenet@ciao.gmane.io" To: 60570@debbugs.gnu.org, Dmitry Gutov , aqua0210@foxmail.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jan 05 22:39:14 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pDXxC-0000PB-0Z for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 05 Jan 2023 22:39:14 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pDXx1-0000wN-PW; Thu, 05 Jan 2023 16:39:03 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pDXx0-0000w7-Bd for bug-gnu-emacs@gnu.org; Thu, 05 Jan 2023 16:39:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pDXwz-0007JD-Nu for bug-gnu-emacs@gnu.org; Thu, 05 Jan 2023 16:39:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pDXwz-00023G-Jg for bug-gnu-emacs@gnu.org; Thu, 05 Jan 2023 16:39:01 -0500 X-Loop: help-debbugs@gnu.org In-Reply-To: Resent-From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 05 Jan 2023 21:39:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60570 X-GNU-PR-Package: emacs Original-Received: via spool by 60570-submit@debbugs.gnu.org id=B60570.16729547397878 (code B ref 60570); Thu, 05 Jan 2023 21:39:01 +0000 Original-Received: (at 60570) by debbugs.gnu.org; 5 Jan 2023 21:38:59 +0000 Original-Received: from localhost ([127.0.0.1]:53157 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pDXww-000230-Vp for submit@debbugs.gnu.org; Thu, 05 Jan 2023 16:38:59 -0500 Original-Received: from mail-oa1-f44.google.com ([209.85.160.44]:40958) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pDXwv-00022l-Ei for 60570@debbugs.gnu.org; Thu, 05 Jan 2023 16:38:57 -0500 Original-Received: by mail-oa1-f44.google.com with SMTP id 586e51a60fabf-14455716674so44387763fac.7 for <60570@debbugs.gnu.org>; Thu, 05 Jan 2023 13:38:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=We7XCC/VZ+ycVpz6hAeTfzcM+iQgBIkgEzC0tNjNR+U=; b=iGgpVvharYXJLkrJidn75BxqgRiHNs6xGePOeWM8Sn8hXlO4Zhtjqdsy7cRGkNkeUu QWJdKpt/1o3Zqfkis2GcOItXQDQlIhO2xq5QSDx338zj7U3/A2KtGJSIq+G4n4TNJTUQ hIZlomo5NVZW8akwRXZEUCB1YRFXgxrTsMri6Vw1lyq/8FFF4luhQe1y7q6O7PG8cLA1 Qb/WD9iyCI/PfqRFdPkLcyjGjPTMbuAaAMZzunNqmdHUi6wDSN4c+mFods1oyEzeIhqd /ho+ATNfrC1iEzQHASwKjzajVc+2Ni5syuyeIEBmvAbh+3/xWFPThcZB5kmWKda/2N7N CIPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=We7XCC/VZ+ycVpz6hAeTfzcM+iQgBIkgEzC0tNjNR+U=; b=NeK4apmLUKo1NZfXBRZlU/VNJ7tRCXzgTJ4sphAY/45qZitLT8FJt7DXj0RcjJ5m8Q iDNIpHxDvHs46fmn1YFu/COre6oCW/u6zJ9toA9SLlQaeXOVBH146CwjyucuJyKSEQS4 ajLkqzbavC2XZ3iLcEUW4fFIZvUo7HynhOoI4z/lb1wKSyUa4i2Txg6N+jG9Y00v4FEy L9vo0B/G6vwsL5kAJS156HV4Syjw1rGNH6yRAO9fGi/ccNRIvvQNqRY5VuKKbKS+7mhm dtZdaxVsyWvDEqwMilcBtNmflu6AL6dbbxBr6XdePeWp9SIo+8bU4PhvZvFQwQiLaVef PtGQ== X-Gm-Message-State: AFqh2koXo3wSr50JnnYzAK5p+jrnQlGXzdkij1gxqTveFMdiFBGbRM1j l6p7HyJQuIMin3GjPei4/bYSBXSZt3AJ3cZqh+xfTwXk0vQ= X-Google-Smtp-Source: AMrXdXtiMJ+2M592+oUAqfLsMIcZHPgwKQS3s4D1478jvhaiVbJpqFrYzm0f8YrCPNqBRHflkMmUkha6z2pL3+uKu8M= X-Received: by 2002:a05:6870:d99a:b0:143:7889:c525 with SMTP id gn26-20020a056870d99a00b001437889c525mr3031893oab.171.1672954731286; Thu, 05 Jan 2023 13:38:51 -0800 (PST) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:252645 Archived-At: --0000000000007bd77405f18b20f0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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=C3=A3o --0000000000007bd77405f18b20f0 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Eason,

Eglot is asking project.el to tell it which = files belong to a
project. I believe project.el uses find as a last-ditc= h effort, if=C2=A0
finds no other method to answer.

<= div>I'm afraid there can be no good solution to your problem, because b= y
invoking any project-aware operation on ~/test.py (and Eglot counts as=
project-aware functionality) and in the absence of, say, a ~/.git youare effectively telling `project.el` that your whole home directory is a<= br>gigantic project, and there is no good way to determine the files in
= that project but to use find.

You could:

1. configure your la= nguage server to not request project-wide file
=C2=A0 =C2=A0watching fro= m the LSP client in certain directories (including the
=C2=A0 =C2=A0$HOM= E directory).=C2=A0 See your language server's documentation for this=C2=A0 =C2=A0effect

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

3. A very simple means -- but not the only means -- t= o do the above is to
=C2=A0 =C2=A0type `git init` in your $HOME director= y.

4. Read project.el's documentation (and ask its maintainers) = for other
=C2=A0 =C2=A0means to use project-find-functions to declare th= at a project exists
=C2=A0 =C2=A0in $HOME but does not include the full = contents of your home
=C2=A0 =C2=A0directory as its files.

5. Sto= p opening Python scripts in your $HOME *and* auto-activating Eglot
=C2= =A0 =C2=A0in them.=C2=A0 You may be auto-activating Eglot with eglot-ensure= , but this
=C2=A0 =C2=A0is not recommended precisely because it carries = with risks like this.

6. Request to project.el's maintainer that= project.el interrupt up its
=C2=A0 =C2=A0very slow `find`-based search = and returns only subset of results.

7. Request that Eglot honour the= keyword didChangeWatchFiles when it is
=C2=A0 =C2=A0included in eglot-i= gnored-server-capabilities.=C2=A0 If you then also
=C2=A0 =C2=A0change y= our configuration to do this _only_ in certain directories
=C2=A0 =C2=A0= (for example by utilizing directory-local variables or writing a
=C2=A0 = =C2=A0slightly complicated whook), this would mitigate your problem. We
= =C2=A0 =C2=A0can probably do this in eglot.el, but I don't see this as = priority
=C2=A0 =C2=A0because of the burden on the user and it only solv= es the problem for
=C2=A0 =C2=A0Eglot, not all other project.el-using fu= nctionality.

I recommend restricting your use of eglot-ensure. It= 9;s very overrated
functionality. M-x eglot will probably only ne= ed to be typed once=C2=A0
or twice in a typical Emacs session.
You can also, possibly, "unfreeze" your emacs by using C-g o= r a killall
find issued from the console.

=
Jo=C3=A3o
--0000000000007bd77405f18b20f0--