all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "João Távora" <joaotavora@gmail.com>
To: Yuan Fu <casouri@gmail.com>
Cc: Eason Huang <aqua0210@foxmail.com>,
	60570@debbugs.gnu.org, Dmitry Gutov <dgutov@yandex.ru>
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	[thread overview]
Message-ID: <CALDnm52Xh1eN0pwvX95d=78ueLpuuE06LaxwnNnZFiXPb9_hjg@mail.gmail.com> (raw)
In-Reply-To: <4B02B488-70C2-46A5-8817-C6F103EDD6E4@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1408 bytes --]

On Fri, Jan 6, 2023, 06:17 Yuan Fu <casouri@gmail.com> 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’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)))

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 by
Eglot, and the server which supports the buffer’s major-mode is notified
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’ language
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ão

[-- Attachment #2: Type: text/html, Size: 1815 bytes --]

  reply	other threads:[~2023-01-06 10:29 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 ` bug#60570: 29.0.60; Eglot+pyright freeze Emacs when edit a single file in Home director João Távora
2023-01-06 13:36   ` Eason Huang
2023-01-06  6:17 ` Yuan Fu
2023-01-06 10:29   ` João Távora [this message]
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='CALDnm52Xh1eN0pwvX95d=78ueLpuuE06LaxwnNnZFiXPb9_hjg@mail.gmail.com' \
    --to=joaotavora@gmail.com \
    --cc=60570@debbugs.gnu.org \
    --cc=aqua0210@foxmail.com \
    --cc=casouri@gmail.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.