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: Fri, 6 Jan 2023 10:29:17 +0000 Message-ID: References: <4B02B488-70C2-46A5-8817-C6F103EDD6E4@gmail.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000006e0ff805f195e42b" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34620"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eason Huang , 60570@debbugs.gnu.org, Dmitry Gutov To: Yuan Fu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jan 06 11:30:23 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 1pDjzT-0008po-AN for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 06 Jan 2023 11:30:23 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pDjzB-0007NT-MR; Fri, 06 Jan 2023 05:30:05 -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 1pDjz9-0007N5-Gs for bug-gnu-emacs@gnu.org; Fri, 06 Jan 2023 05:30:03 -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 1pDjz9-0002r7-7r for bug-gnu-emacs@gnu.org; Fri, 06 Jan 2023 05:30:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pDjz8-0001wy-QK for bug-gnu-emacs@gnu.org; Fri, 06 Jan 2023 05:30:02 -0500 X-Loop: help-debbugs@gnu.org 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: Fri, 06 Jan 2023 10:30:02 +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.16730009777436 (code B ref 60570); Fri, 06 Jan 2023 10:30:02 +0000 Original-Received: (at 60570) by debbugs.gnu.org; 6 Jan 2023 10:29:37 +0000 Original-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 Original-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 Original-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) In-Reply-To: <4B02B488-70C2-46A5-8817-C6F103EDD6E4@gmail.com> 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:252687 Archived-At: --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--