Skip to content

Commit

Permalink
Fix #673: declare eglot--cached-server before use
Browse files Browse the repository at this point in the history
Per #670.

Otherwise the dynamic binding of it in in eglot--connect won't work.

* eglot.el (eglot--cached-server): Move up.
  • Loading branch information
joaotavora committed Apr 23, 2021
1 parent a0a6218 commit efac602
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions eglot.el
Original file line number Diff line number Diff line change
Expand Up @@ -907,6 +907,9 @@ Each function is passed the server as an argument")
" "))
contact))

(defvar-local eglot--cached-server nil
"A cached reference to the current EGLOT server.")

(defun eglot--connect (managed-major-mode project class contact)
"Connect to MANAGED-MAJOR-MODE, PROJECT, CLASS and CONTACT.
This docstring appeases checkdoc, that's all."
Expand Down Expand Up @@ -1378,9 +1381,6 @@ For example, to keep your Company customization use
(push (cons ',symbol (symbol-value ',symbol)) eglot--saved-bindings)
(setq-local ,symbol ,binding)))

(defvar-local eglot--cached-server nil
"A cached reference to the current EGLOT server.")

(defun eglot-managed-p ()
"Tell if current buffer is managed by EGLOT."
eglot--managed-mode)
Expand Down

0 comments on commit efac602

Please sign in to comment.