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: Yuan Fu <casouri <at> gmail.com>
To: João Távora <joaotavora <at> gmail.com>
Cc: aqua0210 <at> foxmail.com, 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: Thu, 5 Jan 2023 23:17:41 -0700
João Távora <joaotavora <at> gmail.com> 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 
> 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’t auto-start in which files that I don’t 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




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

Previous Next


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