diff options
| author | João Távora | 2023-04-02 23:31:10 +0100 |
|---|---|---|
| committer | João Távora | 2023-04-02 23:40:46 +0100 |
| commit | bdb400912e01b9cfd06d393c14d8ceb08b6838ed (patch) | |
| tree | d6a5b6df29e86d340eb2b7211d00f4f9a2aed954 | |
| parent | ad1efe5e675216e1f1f342fc9d48018fac718b5e (diff) | |
| download | emacs-bdb400912e01b9cfd06d393c14d8ceb08b6838ed.tar.gz emacs-bdb400912e01b9cfd06d393c14d8ceb08b6838ed.zip | |
Eglot: load built-in GNU ELPA dependencies explicitly
Because of outstanding bug#62576, it's way to easy for users to get
confused by the M-x package-install process for Eglot.
Whenever an Eglot release depends on a new version of a GNU ELPA :core
package which is _also_ provided built-in, M-x package-install will
install that dependency, but will not always load it on top of the
built-in one.
The solution is to not use "require" for now. This may potentially
lead to double "loads", but that should in principle be idempotent.
* lisp/progmodes/eglot.el (project, eldoc, seq, flymake, xref, jsonrpc)
(external-completion): Load, don't require.
| -rw-r--r-- | lisp/progmodes/eglot.el | 32 |
1 files changed, 14 insertions, 18 deletions
diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index 7e329d2e26a..ae2ba1351dc 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el | |||
| @@ -97,34 +97,30 @@ | |||
| 97 | 97 | ||
| 98 | (require 'imenu) | 98 | (require 'imenu) |
| 99 | (require 'cl-lib) | 99 | (require 'cl-lib) |
| 100 | (require 'project) | 100 | |
| 101 | (require 'url-parse) | 101 | (require 'url-parse) |
| 102 | (require 'url-util) | 102 | (require 'url-util) |
| 103 | (require 'pcase) | 103 | (require 'pcase) |
| 104 | (require 'compile) ; for some faces | 104 | (require 'compile) ; for some faces |
| 105 | (require 'warnings) | 105 | (require 'warnings) |
| 106 | (require 'flymake) | ||
| 107 | (require 'xref) | ||
| 108 | (eval-when-compile | 106 | (eval-when-compile |
| 109 | (require 'subr-x)) | 107 | (require 'subr-x)) |
| 110 | (require 'jsonrpc) | ||
| 111 | (require 'filenotify) | 108 | (require 'filenotify) |
| 112 | (require 'ert) | 109 | (require 'ert) |
| 113 | (require 'array) | 110 | (require 'array) |
| 114 | (require 'external-completion) | 111 | |
| 115 | 112 | ;; These dependencies are also GNU ELPA core packages. Because of | |
| 116 | ;; ElDoc is preloaded in Emacs, so `require'-ing won't guarantee we are | 113 | ;; bug#62576, since there is a risk that M-x package-install, despite |
| 117 | ;; using the latest version from GNU Elpa when we load eglot.el. Use an | 114 | ;; having installed them, didn't correctly re-load them over the |
| 118 | ;; heuristic to see if we need to `load' it in Emacs < 28. | 115 | ;; built-in versions. |
| 119 | (if (and (< emacs-major-version 28) | 116 | (eval-and-compile |
| 120 | (not (boundp 'eldoc-documentation-strategy))) | 117 | (load "project") |
| 121 | (load "eldoc") | 118 | (load "eldoc") |
| 122 | (require 'eldoc)) | 119 | (load "seq") |
| 123 | 120 | (load "flymake") | |
| 124 | ;; Similar issue as above for Emacs 26.3 and seq.el. | 121 | (load "xref") |
| 125 | (if (< emacs-major-version 27) | 122 | (load "jsonrpc") |
| 126 | (load "seq") | 123 | (load "external-completion")) |
| 127 | (require 'seq)) | ||
| 128 | 124 | ||
| 129 | ;; forward-declare, but don't require (Emacs 28 doesn't seem to care) | 125 | ;; forward-declare, but don't require (Emacs 28 doesn't seem to care) |
| 130 | (defvar markdown-fontify-code-blocks-natively) | 126 | (defvar markdown-fontify-code-blocks-natively) |