Fix #218: Defer eglot-ensure until window-configuration-change#989
Fix #218: Defer eglot-ensure until window-configuration-change#989kimo-k wants to merge 2 commits into
Conversation
Some emacs users can open many buffers at a time. Packages like `desktop.el` and `persp-mode` encourage this. A user may also invoke eglot-ensure when each buffer starts. The effect of this - spawning hundreds of language-server processes - can crash the server and lag the system. Now, `eglot-ensure` waits until window-configuration-change time before starting `eglot--managed-mode`. Window-configuration-change time is when the user interacts with the local buffer's window UI. Used João Távora's idea to apply a pattern from flymake: https://github.com/emacs-straight/flymake/blob/6bc8782d9c05d4c9bbba524542d457e6a3b1734b/flymake.el#L1013 Copyright-paperwork-exempt: Yes
|
This is nice, thanks. Some notes:
|
|
I just realized that indeed I just suggested this 3 years ago #218 (comment) :-) Well, I didn't think of all the consequences (as one usually doesn't :-) ) |
FWIW, after some time with major mode hooks to run |
Some emacs users can open many buffers at a time.
Packages like
desktop.elandpersp-modeencourage this.A user may also invoke eglot-ensure when each buffer starts.
The effect of this - spawning hundreds of language-server processes -
can crash the server and lag the system.
Now,
eglot-ensurewaits until window-configuration-change timebefore starting
eglot--managed-mode. Window-configuration-changetime is when the user interacts with the local buffer's window UI.
Used João Távora's idea to apply a pattern from flymake:
https://github.com/emacs-straight/flymake/blob/6bc8782d9c05d4c9bbba524542d457e6a3b1734b/flymake.el#L1013
Copyright-paperwork-exempt: Yes