From unknown Mon Aug 11 12:54:49 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#60570 <60570@debbugs.gnu.org> To: bug#60570 <60570@debbugs.gnu.org> Subject: Status: 29.0.60; Eglot+pyright freeze Emacs when edit a single file in Home director Reply-To: bug#60570 <60570@debbugs.gnu.org> Date: Mon, 11 Aug 2025 19:54:49 +0000 retitle 60570 29.0.60; Eglot+pyright freeze Emacs when edit a single file i= n Home director reassign 60570 emacs submitter 60570 Eason Huang severity 60570 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Thu Jan 05 03:58:48 2023 Received: (at submit) by debbugs.gnu.org; 5 Jan 2023 08:58:48 +0000 Received: from localhost ([127.0.0.1]:50250 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pDM5H-0003Ta-FC for submit@debbugs.gnu.org; Thu, 05 Jan 2023 03:58:47 -0500 Received: from lists.gnu.org ([209.51.188.17]:50272) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pDM5C-0003TQ-VM for submit@debbugs.gnu.org; Thu, 05 Jan 2023 03:58:45 -0500 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 1pDM5C-0005Px-Pr for bug-gnu-emacs@gnu.org; Thu, 05 Jan 2023 03:58:42 -0500 Received: from out203-205-221-191.mail.qq.com ([203.205.221.191]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pDM59-00071v-Ul for bug-gnu-emacs@gnu.org; Thu, 05 Jan 2023 03:58:42 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1672909113; bh=FZSPNkIEmHMoM1W8k/MSo+1yDU3chOz0yVCv81QVp8I=; h=Date:From:To:Subject; b=B10ORSceAHeKQJfHeUF+CJB74D2R4j6Gkz7tsM+6lnrhgESTKlyvqmZ0sunmJFCeh 62ZASOvX2UcMeli/q9lgTnse678TlT56bAE/hXwncD+VkEQfnau9fXiNpEFSNg0eNq WinNS4fHUDmFA1zL1ZptGV6RekMN8xN31KgoId5o= Received: from macbook ([114.82.35.56]) by newxmesmtplogicsvrszc5-0.qq.com (NewEsmtp) with SMTP id E549C6EF; Thu, 05 Jan 2023 16:57:20 +0800 X-QQ-mid: xmsmtpt1672909040tbkm4wrzv Message-ID: X-QQ-XMAILINFO: MUSna4nE7xDodrmYUdcsjQH3+W7Xc4zigBnkuO3zRIWZ21moTEfioDWQKp6VIE PmflU72bqXd1+5VzNxBMp7vikcU8rrFwCkGLSdNvjR0MMCbeZEFpYC1sTlYlqAILVEpMGc103czS yiw84mJTBPldOtqWf8tohyFxdsPdTuG+7REjDEqhzSic75oNPJ+m5XOkFPbxytzKRdNDv+b/qKfl WG2uaVFJejkACWjaeqbre7oOgJpYCuwWmdCQtzrn4HnjfL3G08FcitA11Rf1vrsouyHXA9hWIzAC SfvAXs2yJjxARIBCMlcnex6+qNMVTRJ6JDqdzOKekretn7V8EKp/LKgNwsUSj992/wMi1FBN+AyY sZ4gFybccAf90rhl9L4wlXXxMraupqFZLikdaNVvfKxPPDEudjHiUTWBUUH65aVQBs8ncXD3HGj0 Nj0Q4zNV2rHH3nWoZZFamCHrUZSvTi1aZITOKbOgRqdm9E/0lDIIPr1OotidhdUjHoi5YOCfxsXz zpsBN+6FYiJ1F9iViooP+d0PSEx3MEmKEPIkwL7oWQp7k2OCrXVeKGzhZ54vdTAm0mu2MCvc2zPq 9g8Rkqv+8ZqfRnyV9ZOdD6eRvDhOPgaV8Q+wTunPkPKeY7dJr/qpohNFpGggaJikCvW9ZHXGMO4+ tWyUElpet+5JCrIz9YmDhVpUAPI2VoimJPbPRDKZZXSGKeH+RB2Jr18TRYOrq4D4miqwNeallO8v ERMskFsIqf169gb/rb5fFPrRAUqXfBFTLkAVhTLWgDyV2ujJ4wRimAzXm0kYI1Pxx6Hg0pAwuIdZ GPY772HjjaPtG+w/Q16sHw3hBLF8XJEXNuqkgLjFScAXdtjf9Lcwl8CpHiG1fLwwprDOXysbqi3H CzhGlXnzCeS9k09RAlDm+JvoOLaplXBag8Vaj6RhqJWEX6NQOZ+zK72CoghUMlI1Y9yAgShBRVdP lTfqdkJIEHa7IP0GfAgr0GTYLMolhad8x8YC7NPWk= Date: Thu, 05 Jan 2023 16:57:16 +0800 Message-Id: From: Eason Huang To: bug-gnu-emacs@gnu.org Subject: 29.0.60; Eglot+pyright freeze Emacs when edit a single file in Home director MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=203.205.221.191; envelope-from=aqua0210@foxmail.com; helo=out203-205-221-191.mail.qq.com X-Spam_score_int: 11 X-Spam_score: 1.1 X-Spam_bar: + X-Spam_report: (1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, HELO_DYNAMIC_IPADDR=1.951, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_DYNAMIC=0.982, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.1 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.1 (--) Hi Emacs dev team, I use Emacs 29 with eglot + pyright, Eglot will freeze Emacs when editing a single test.py file. Steps to reproduce: On macOS, only pyright is installed on the system 1. install pyright ``` $ sudo npm install -g pyright $ pyright --version pyright 1.1.286 ``` 2. C-x C-f ~/test.py Open a python file and I just want to test some simple code. 3. M-x eglot At this point, Emacs freezes and the find program takes up 99% of the system's resources. Finally, you has to force quit Emacs. I guess this is because Eglot will delegate project.el to search the entire `~/` directory by the program `find`. If I use git to manage my test.py file, the issue is gone. I am using Emacs 29 with commit: https://git.savannah.gnu.org/cgit/emacs.git/commit/?h=emacs-29&id=2569ede9c496bb060e0b88428cb541088aaba1f9 -- Eason Huang In GNU Emacs 29.0.60 (build 1, x86_64-apple-darwin22.2.0, NS appkit-2299.30 Version 13.1 (Build 22C65)) of 2023-01-02 built on macbook Windowing system distributor 'Apple', version 10.3.2299 System Description: macOS 13.1 Configured using: 'configure --with-native-compilation=aot 'CPPFLAGS=-I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk' 'LDFLAGS=-L/opt/local/lib -Wl,-headerpad_max_install_names -Wl,-rpath /opt/local/lib/gcc12 -Wl,-syslibroot,/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -arch x86_64'' Configured features: ACL GIF GLIB GMP GNUTLS JPEG JSON LCMS2 LIBXML2 MODULES NATIVE_COMP NOTIFY KQUEUE NS PDUMPER PNG RSVG SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER WEBP XIM ZLIB Important settings: value of $LC_CTYPE: en_US.UTF-8 value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix Major mode: Python Minor modes in effect: eglot--managed-mode: t flymake-mode: t tooltip-mode: t global-eldoc-mode: t eldoc-mode: t show-paren-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t line-number-mode: t transient-mark-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message mailcap yank-media puny rfc822 mml mml-sec epa derived epg rfc6068 epg-config gnus-util mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils files-x find-dired dired dired-loaddefs grep time-date eglot external-completion array filenotify jsonrpc ert pp ewoc debug backtrace find-func xref flymake-proc flymake thingatpt compile text-property-search url-util url-parse auth-source eieio eieio-core password-cache json map url-vars imenu vc-svn python project byte-opt pcase treesit comint ansi-osc ring cl-loaddefs comp comp-cstr warnings icons subr-x rx cl-seq cl-macs gv cl-extra help-mode bytecomp byte-compile cl-lib ansi-color rmc iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/ns-win ns-win ucs-normalize mule-util term/common-win tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors frame minibuffer nadvice seq simple cl-generic indonesian philippine cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite emoji-zwj charscript charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget keymap hashtable-print-readable backquote threads kqueue cocoa ns lcms2 multi-tty make-network-process native-compile emacs) Memory information: ((conses 16 139166 11475) (symbols 48 11664 0) (strings 32 35088 1771) (string-bytes 1 1137571) (vectors 16 26979) (vector-slots 8 519329 21535) (floats 8 53 23) (intervals 56 269 0) (buffers 984 16)) From debbugs-submit-bounces@debbugs.gnu.org Thu Jan 05 16:38:59 2023 Received: (at 60570) by debbugs.gnu.org; 5 Jan 2023 21:38:59 +0000 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 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 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) MIME-Version: 1.0 From: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= Date: Thu, 5 Jan 2023 21:38:40 +0000 Message-ID: Subject: Re: 29.0.60; Eglot+pyright freeze Emacs when edit a single file in Home director To: 60570@debbugs.gnu.org, Dmitry Gutov , aqua0210@foxmail.com Content-Type: multipart/alternative; boundary="0000000000007bd77405f18b20f0" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 60570 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --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-- From debbugs-submit-bounces@debbugs.gnu.org Fri Jan 06 01:17:52 2023 Received: (at 60570) by debbugs.gnu.org; 6 Jan 2023 06:17:52 +0000 Received: from localhost ([127.0.0.1]:53572 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pDg35-0001Yf-NT for submit@debbugs.gnu.org; Fri, 06 Jan 2023 01:17:51 -0500 Received: from mail-pj1-f52.google.com ([209.85.216.52]:45655) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pDg32-0001YR-V0 for 60570@debbugs.gnu.org; Fri, 06 Jan 2023 01:17:50 -0500 Received: by mail-pj1-f52.google.com with SMTP id v13-20020a17090a6b0d00b00219c3be9830so762675pjj.4 for <60570@debbugs.gnu.org>; Thu, 05 Jan 2023 22:17:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:cc:date:message-id:subject:mime-version :content-transfer-encoding:from:from:to:cc:subject:date:message-id :reply-to; bh=2NxtcVYFFfJ89dkvxAhO+8h7E44ViavZE2kbx2QuZv4=; b=PmIS2WNwtenrkX09keJH5r7O5q9j7/4mdW+NliSM/37UJF7i+u83BU65UtBApSuDBv QnWrdsbtXdf7qUEaDcsenwHBUdbn0Gn59YVWaSOB92tS9fhJ19p56dK6skDueLMkBuej PLo/6XchC+CZLQmxpO5lVuf4tqHiUK3Rgs6DmKv4MaA0aj9jXikOTcTSAZp8ZqCUqy8i z9bM2XQoJH5oyksioKJSoHjmk4Yi4ALjMdphZs8O0uoBBC50YmkbHr/Ldtpe4LA7NMjj p1g8rXItcrTcCFCj1GnUoHmzrmTyyrRdVhgNxrnIbUHLrm9H2+Ya5lAauFUHXtpjyDyt l/FA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:cc:date:message-id:subject:mime-version :content-transfer-encoding:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2NxtcVYFFfJ89dkvxAhO+8h7E44ViavZE2kbx2QuZv4=; b=v9l/jievJ4fYSVOxtB7mSx4sBRvXcja39srdYP2CqyI+qoE9/GE1b4LF5BxLaSj6N9 /5oawiQdiwBcLz1VmtsHgleGEPX7b6692K40XFwY2yez4kA6R/JyzVUOXN+26K2RP8Lo OFfANFyWBiw/6P6e9PBzmjkMLhTqqR45vJNm+evubgugdQ4k+4J8bTuNyg4+mKwuBf7+ lWYEbxyD1CUlF1FIx5fcmI33UfSAqGOXxkJb0n6hhcu+YaRjQgaaiSAoKH0PF07niYW3 0LAxD2bkP9bV0Z+gPZS4pG7SK+Fnz2KYSC2C1NgbJ9PnLdf+TrdRRiKZT8F08I25z4sp Qurw== X-Gm-Message-State: AFqh2koWCD6mVtBBaDM1Pv1+dZdMtSG4owHTruNeBxpjQx1WkHkDxgZW QcCCl0WriVUOFoPtdqB30Lo= X-Google-Smtp-Source: AMrXdXvaVu1aJdB78OxivZl8Ejx+Qk0f2lSFyJNtln/7ilHEwUNSVeK1U0C7Bx9VTl9AjNDgNxIc7A== X-Received: by 2002:a17:90b:4acf:b0:225:cece:c629 with SMTP id mh15-20020a17090b4acf00b00225cecec629mr46988831pjb.46.1672985863077; Thu, 05 Jan 2023 22:17:43 -0800 (PST) Received: from smtpclient.apple (ip68-3-33-122.ph.ph.cox.net. [68.3.33.122]) by smtp.gmail.com with ESMTPSA id n35-20020a17090a2ca600b0021904307a53sm271996pjd.19.2023.01.05.22.17.42 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 Jan 2023 22:17:42 -0800 (PST) From: Yuan Fu Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) Subject: Re: bug#60570: 29.0.60; Eglot+pyright freeze Emacs when edit a single file in Home director Message-Id: <4B02B488-70C2-46A5-8817-C6F103EDD6E4@gmail.com> Date: Thu, 5 Jan 2023 23:17:41 -0700 To: =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= X-Mailer: Apple Mail (2.3696.120.41.1.1) X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 60570 Cc: aqua0210@foxmail.com, 60570@debbugs.gnu.org, Dmitry Gutov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Jo=C3=A3o T=C3=A1vora writes: > 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. [...] > > I recommend restricting your use of eglot-ensure. It's very overrated > functionality. M-x eglot will probably only need to be typed once=20 > or twice in a typical Emacs session. I use a custom function eglot-soft-ensure which only enables eglot if there is already a LSP server running for the current project. This way eglot doesn=E2=80=99t auto-start in which files that I don=E2=80=99t = want it to start. (defun eglot-soft-ensure () "Turn on eglot when there is an exising server for the current = project." (require 'eglot) (when-let* ((project (project-current)) (eglot-server (gethash project = eglot--servers-by-project))) (eglot-ensure))) Yuan From debbugs-submit-bounces@debbugs.gnu.org Fri Jan 06 05:29:37 2023 Received: (at 60570) by debbugs.gnu.org; 6 Jan 2023 10:29:37 +0000 Received: from localhost ([127.0.0.1]:53845 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pDjyi-0001vr-Jj for submit@debbugs.gnu.org; Fri, 06 Jan 2023 05:29:36 -0500 Received: from mail-ot1-f54.google.com ([209.85.210.54]:43937) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pDjyg-0001ve-2j for 60570@debbugs.gnu.org; Fri, 06 Jan 2023 05:29:34 -0500 Received: by mail-ot1-f54.google.com with SMTP id x44-20020a05683040ac00b006707c74330eso678218ott.10 for <60570@debbugs.gnu.org>; Fri, 06 Jan 2023 02:29:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=xbQetxlHSwfCTzrFonNP7LrZ+g9/P1tKjWb6XpxDfsY=; b=kVNFD6N6uDJd88eEDI5E/+2Kz1bnu1/7VoCcPn6DKSelwzaZdgYWhI84bBpk24gm7d o48lTskRDZL/3szMm26ABoFTY4wzaShMuBqOFuV+D+qUeCYmankDFHiVvL+vVnID6NmA 94mIhropQ1Flr6jvqko4v6JmosS8/u6bd2BZNTfoWzh9gYNOJyUlgiqQEW2SpsjeoL6w gDkUmhRAMDxVKGN04jL2saH3I1LZM3cJdrOxbuCE9HisMtlMGQMNcVaa7TYKUA/1XkYB WKG2tHXSODNG3dN13Ly01zdjoRTr5UorcQCSKDZk9fRmT8badw7ln1ZmyZGb/qkRlwGV RTkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=xbQetxlHSwfCTzrFonNP7LrZ+g9/P1tKjWb6XpxDfsY=; b=EIRl+c1ncFNmSXcB01UZ+lY/P6k7RNoyc6ZnYSROh1Wr95UKjy/L19gLgusz0lMxLe 5SmYmrF3GrfOhpg+j3EsSQFPEI+pMBVlHY3dFgP5dpNSGFNZwec1pBzjO73b4cyHDcgi FLRAEFB8cI2G8RJ5+IFzfiuJNjkU1pBtiPBQcYT3yldoYqvJcElH2oefRHgq/0TBhY2f iTnmei6Ugpy3Sbd1glfKVTbeQhtSs/bUy9ipmPsmKHQ2WidmY7LdbndUW+G6bsHcd6km w0Bzv3AnaKrJxMkcfkKJqcqoW1/TyqN3P4dZQd0+RsxTwBZCu/zA9EjUQupzjSgJrf+X GplA== X-Gm-Message-State: AFqh2krSQrlKi0zvvbZhedGTUcpAvO5W3lSZnIYuniUeWFCAyZvrHBHt so7lTidKCwirQirjtsMqE6KtA+86s7ViNuama9Q= X-Google-Smtp-Source: AMrXdXs7C0MZEH/1mrA2LpHK3WtJxMEqC+TLcx3nhr7Vk+ErTOUGBdLZ4pM8104z994lmU+zTISJIG75PtKKi8MbSwU= X-Received: by 2002:a05:6830:1d8:b0:661:cac2:79ca with SMTP id r24-20020a05683001d800b00661cac279camr3487347ota.93.1673000968391; Fri, 06 Jan 2023 02:29:28 -0800 (PST) MIME-Version: 1.0 References: <4B02B488-70C2-46A5-8817-C6F103EDD6E4@gmail.com> In-Reply-To: <4B02B488-70C2-46A5-8817-C6F103EDD6E4@gmail.com> From: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= Date: Fri, 6 Jan 2023 10:29:17 +0000 Message-ID: Subject: Re: bug#60570: 29.0.60; Eglot+pyright freeze Emacs when edit a single file in Home director To: Yuan Fu Content-Type: multipart/alternative; boundary="0000000000006e0ff805f195e42b" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 60570 Cc: Eason Huang , 60570@debbugs.gnu.org, Dmitry Gutov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --0000000000006e0ff805f195e42b Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Jan 6, 2023, 06:17 Yuan Fu wrote: > I use a custom function eglot-soft-ensure which only enables eglot if > there is already a LSP server running for the current project. This way > eglot doesn=E2=80=99t auto-start in which files that I don=E2=80=99t want= it to start. > > (defun eglot-soft-ensure () > "Turn on eglot when there is an exising server for the current project.= " > (require 'eglot) > (when-let* ((project (project-current)) > (eglot-server (gethash project eglot--servers-by-project))) > (eglot-ensure))) Hello Yuan, I must me missing something, because I would say you can just get rid of eglot-soft-ensure. I can't understand what it is adding on top of the normal Eglot behaviour. From the manual: "When you visit a file under the same project, whether an existing or a new file, its buffer is automatically added to the set of buffers managed b= y Eglot, and the server which supports the buffer=E2=80=99s major-mode is not= ified about that. Thus, visiting a non-existent file /home/joe/projects/fooey/lib/y.foo in the above example will notify the server of the *.foo files=E2=80=99 lan= guage that a new file was added to the project, even before the file appears on disk. The special Eglot minor mode is also turned on automatically in the buffer visiting the file." https://joaotavora.github.io/eglot/#Eglot-and-Buffers Jo=C3=A3o --0000000000006e0ff805f195e42b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Fri, Jan 6, 2023, 06:17 Yuan Fu <casouri@gmail.com> wrote:

> I use a cust= om function eglot-soft-ensure which only enables eglot if
> there is = already a LSP server running for the current project. This way
> eglo= t doesn=E2=80=99t auto-start in which files that I don=E2=80=99t want it to= start.
>
> (defun eglot-soft-ensure ()
> =C2=A0 "Tu= rn on eglot when there is an exising server for the current project."<= br>> =C2=A0 (require 'eglot)
> =C2=A0 (when-let* ((project (pr= oject-current))
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (e= glot-server (gethash project eglot--servers-by-project)))
> =C2=A0 = =C2=A0 (eglot-ensure)))

Hello Yuan,

I must me missing so= mething, because I would say you can just=C2=A0
get rid of eglot-= soft-ensure. I can't understand what it is adding=C2=A0
on to= p of the normal Eglot behaviour. From the manual:

"When y= ou visit a file under the same project, whether an existing or a=C2=A0
new file, its buffer is automatically added to the set of buffers man= aged by
Eglot, and the server which supports the buffer=E2=80=99s= major-mode is notified=C2=A0
about that. Thus, visiting a non-ex= istent file /home/joe/projects/fooey/lib/y.foo=C2=A0
in the above= example will notify the server of the *.foo files=E2=80=99 language=C2=A0<= /div>
that a new file was added to the project, even before the file ap= pears=C2=A0
on disk. The special Eglot minor mode is also turned = on automatically=C2=A0
in the buffer visiting the file."

--0000000000006e0ff805f195e42b-- From debbugs-submit-bounces@debbugs.gnu.org Fri Jan 06 08:37:12 2023 Received: (at 60570) by debbugs.gnu.org; 6 Jan 2023 13:37:13 +0000 Received: from localhost ([127.0.0.1]:54090 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pDmuG-0003Fb-HP for submit@debbugs.gnu.org; Fri, 06 Jan 2023 08:37:12 -0500 Received: from out162-62-57-49.mail.qq.com ([162.62.57.49]:46067) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pDmu9-0003Eq-GK for 60570@debbugs.gnu.org; Fri, 06 Jan 2023 08:37:11 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1673012214; bh=In0uDICa6gQ4OnbppyMfEmWPENReMq/b7/KwIIq+W40=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=GfRUPFJMeQHaR7DPTZxMTjA+DcIl2em5oED9lTib3tkybPEapmQf8L8yZmFrq8HJH 8e9QNi+uGjrLlr5gcvKjZPY9Hly25xvsa7edHWc/APHoA50ji050+qyR2ErKI4xxKT V5zDE1oWrrvQ/z3rxHOtJybnAMT46LVFPaApF/FQ= Received: from macbook ([114.82.35.56]) by newxmesmtplogicsvrszc2-1.qq.com (NewEsmtp) with SMTP id 9350D8EB; Fri, 06 Jan 2023 21:36:53 +0800 X-QQ-mid: xmsmtpt1673012213tdqugifff Message-ID: X-QQ-XMAILINFO: Mg/0DM1Zd+nHj3HY/RsyagBiCPXiXJku7fqt3jn817rErn1sjur/Ef5UAhheMN Mg1FC9szbhAod1ykfAJCfYFkjxY9eTNVfP/uqZcxn/T/PoARsGsD3u/hiGsr27kKyBlSB0xv2Cku uXVfo5L2DZqEgh1izjfa+8Az2+N/KsNiEXK/kbvg/aacZ9dd535TXFem7lfQwFaZol0twqCYo0uI jb8T/wKX7gMvyhQtKhbzTUIzdjFOseDI906gjeD7KmeB4YLpvsk28nr6HJC01uCxNaiG//VOpeWY JBMA1zSAPbxDAmeCK3PDgK5ceaYEp//AdNmBhI8LyCal4lTVgmbo6lfaIGo3k+e6oeB21yYLv9pb w23Jwz61iNRGipYGjncmAC+GzOW/AOVwDrkSTvmi5IPfZdQZ3pL4YfzZx3SKRByUXp9vnAiaKzG5 9OEIeb54SbEHdoIcgrdBfgCjNWw3JAV0KyRIKYDyyNnOrdq6uLHpO+4qzj7ZGabZAa67PT4KJUyf RGc7e3Tr6Xywce+z6GEhDLAQ39cibS0Y14gQvhJ9hJInxN/HvpAxJfdIk/OWhl9zVRoB4rI5GO4G Aox/j5GtviLt4ZDWQgw2lWs2zXikoIzhkFP0cTNU3hzIhGEwVR8e6zTsdnIU9Md0LwjNxNiWXezg GI2rVVRF+5Cl/wL+aV7ajb+XyFv5c03VymuYD3eorrvCQAFNZmqnAQqYKzxcm0e0ZJZnVE3W3Es4 zmouRX8Xdgo9KpLB6pg2psd5tqeD2jUVNWAvCZlw4NN+EvW8ip7MXTcu6fZawQq1Rh9vrsp/LmAx 2LhJZFkEGuMQ0BuyyXFYsp0gVHaKgf8o4yHL4LMR7TA0BUqOlCj5kh3/HOXphcwCl3GjnJm807Jr czDP6AXqy89aS6bs/pWF6hncxVHccuDRs/Ti+QGD0JbD6hjva/hPs69W63V9qKDp9KezX5mAGD9L sRE32Da95D/2B51bmfsl9pVMnCsxBP From: Eason Huang To: =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= Subject: Re: bug#60570: 29.0.60; Eglot+pyright freeze Emacs when edit a single file in Home director In-Reply-To: (=?utf-8?Q?=22Jo=C3=A3o_T=C3=A1vora=22's?= message of "Thu, 5 Jan 2023 21:38:40 +0000") References: Date: Fri, 06 Jan 2023 21:36:52 +0800 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 3.9 (+++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: João Távora 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 [...] Content analysis details: (3.9 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (aqua0210[at]foxmail.com) -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [162.62.57.49 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [162.62.57.49 listed in wl.mailspike.net] -0.0 SPF_PASS SPF: sender matches SPF record 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (aqua0210[at]foxmail.com) 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS 3.2 HELO_DYNAMIC_IPADDR Relay HELO'd using suspicious hostname (IP addr 1) X-Debbugs-Envelope-To: 60570 Cc: 60570@debbugs.gnu.org, Dmitry Gutov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 2.9 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: João Távora 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 [...] Content analysis details: (2.9 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [162.62.57.49 listed in wl.mailspike.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [162.62.57.49 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (aqua0210[at]foxmail.com) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (aqua0210[at]foxmail.com) 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS 3.2 HELO_DYNAMIC_IPADDR Relay HELO'd using suspicious hostname (IP addr 1) -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager Jo=C3=A3o T=C3=A1vora 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. --=20 Eason Huang From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 07 17:39:05 2023 Received: (at 60570) by debbugs.gnu.org; 7 Jan 2023 22:39:05 +0000 Received: from localhost ([127.0.0.1]:59130 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pEHqC-00048p-RT for submit@debbugs.gnu.org; Sat, 07 Jan 2023 17:39:05 -0500 Received: from mail-pl1-f170.google.com ([209.85.214.170]:41824) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pEHqB-00048E-8g for 60570@debbugs.gnu.org; Sat, 07 Jan 2023 17:39:03 -0500 Received: by mail-pl1-f170.google.com with SMTP id jl4so5524925plb.8 for <60570@debbugs.gnu.org>; Sat, 07 Jan 2023 14:39:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=hv1t8Zja6Z9/oOdQmmNQsQfppNV8rKes7xbwQyIMu48=; b=M9hbdwefWAc1EENUGaWIt9fZihMYQ+Gxg23CIlsvrWQKDiaqZ5AncppmFFcbQ2lhVi MvYX5nWuLNm2NLnS0hUQZNGVi6qBBpZhijpmneUkdEHDYsXD6zZUCDXL/hmwFLTpZKyc lLHTZN5kj7ddh8C+mAfk8RD9P8xJBKIBCBM7LmXNGnhMkQ6xU80HEt2w5Uh6tVpJFeRV FSefbSkCwI1G+Z7CNQob/eRohkQbzXvwstTARyJP1POImRAcAU5tf4BdgYxbhqhlwqCa //tad7ZucGu38BuK85l4sVr0xhThMe/Y+kglIP69EZAcJdUug9dk+aSH09TI1htXpy2a qDqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=hv1t8Zja6Z9/oOdQmmNQsQfppNV8rKes7xbwQyIMu48=; b=tCn5zn+ytq6wA369ASs2SVG07xJPOUScIWHi9yDos64l1/pgGOLk+gM0l9Alntwsua qb45YaRrRSThmvmQPuBOM9qTOolht8RIp3NFUuVBwMZLXuY+DYs4edS01YN0Rcm1QWa8 iP3jOcPNUO9y6aSCrq0ilS4H7hrzo6Z+QhtyWzifD79ThbWH/yxEY62G5rm3F3nvsO1g /qH6sVdd/QUC89Q5zp67Pfm8rPEd2OzD/Kfj5teNth8nEATPPW7SswbAaB21b3OejZWn 7UWmAWtK7skk+9eEWZovMAYyEfqcN2Ei0xwU4BoA8XNrwuR+dM6Dke57mKJTheaXblZp rGiA== X-Gm-Message-State: AFqh2krGnU/WMWElDDWBLAjtn1KjZMVAXHKsMu835OxJvCZML7U2MP0Y /imTuxwZYFkRC87YIHQpX8k= X-Google-Smtp-Source: AMrXdXseev4t4VIeQ66DQR/YcCM6DpsaJRDmU9hiqQb5cPmV0B0GzEY8FC9JYFpoqEr1EDSlheagQg== X-Received: by 2002:a17:90a:7341:b0:225:f7b3:aebf with SMTP id j1-20020a17090a734100b00225f7b3aebfmr45122480pjs.30.1673131136968; Sat, 07 Jan 2023 14:38:56 -0800 (PST) Received: from smtpclient.apple (cpe-172-117-161-177.socal.res.rr.com. [172.117.161.177]) by smtp.gmail.com with ESMTPSA id ha18-20020a17090af3d200b00219eefe47c7sm2826450pjb.47.2023.01.07.14.38.55 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 07 Jan 2023 14:38:56 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) Subject: Re: bug#60570: 29.0.60; Eglot+pyright freeze Emacs when edit a single file in Home director From: Yuan Fu In-Reply-To: Date: Sat, 7 Jan 2023 14:38:54 -0800 Content-Transfer-Encoding: quoted-printable Message-Id: <65A12BE9-80A8-48ED-B579-30E9D76A2E9A@gmail.com> References: <4B02B488-70C2-46A5-8817-C6F103EDD6E4@gmail.com> To: =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= X-Mailer: Apple Mail (2.3696.120.41.1.1) X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 60570 Cc: Eason Huang , 60570@debbugs.gnu.org, Dmitry Gutov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > On Jan 6, 2023, at 2:29 AM, Jo=C3=A3o T=C3=A1vora = wrote: >=20 > On Fri, Jan 6, 2023, 06:17 Yuan Fu wrote: >=20 > > I use a custom function eglot-soft-ensure which only enables eglot = if > > there is already a LSP server running for the current project. This = way > > eglot doesn=E2=80=99t auto-start in which files that I don=E2=80=99t = want it to start. > > > > (defun eglot-soft-ensure () > > "Turn on eglot when there is an exising server for the current = project." > > (require 'eglot) > > (when-let* ((project (project-current)) > > (eglot-server (gethash project = eglot--servers-by-project))) > > (eglot-ensure))) >=20 > Hello Yuan, >=20 > I must me missing something, because I would say you can just=20 > get rid of eglot-soft-ensure. I can't understand what it is adding=20 > on top of the normal Eglot behaviour. =46rom the manual: >=20 > "When you visit a file under the same project, whether an existing or = a=20 > new file, its buffer is automatically added to the set of buffers = managed by > Eglot, and the server which supports the buffer=E2=80=99s major-mode = is notified=20 > about that. Thus, visiting a non-existent file = /home/joe/projects/fooey/lib/y.foo=20 > in the above example will notify the server of the *.foo files=E2=80=99 = language=20 > that a new file was added to the project, even before the file appears=20= > on disk. The special Eglot minor mode is also turned on automatically=20= > in the buffer visiting the file." >=20 > https://joaotavora.github.io/eglot/#Eglot-and-Buffers Oh! I must have done something wrong that prompted me to write = eglot-soft-ensure. But I don=E2=80=99t remember :-) Sorry for the = misinformation! Yuan=