From 44cdd8062bd1d40caa76e91964a49e7acf3ae56c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jo=C3=A3o=20T=C3=A1vora?= Date: Mon, 7 May 2018 22:15:21 +0100 Subject: [PATCH] Get rid of eglot--special-buffer-process Hasn't really proved useful yet. * eglot.el (eglot--special-buffer-process): Delete. (eglot--current-process): Simplify. (eglot--events-buffer): Simplify. --- lisp/progmodes/eglot.el | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index ba3b5bee71e..1318feee511 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -61,19 +61,11 @@ (defvar eglot--processes-by-project (make-hash-table :test #'equal) "Keys are projects. Values are lists of processes.") -(defvar-local eglot--special-buffer-process nil - "Current buffer's eglot process.") - (defun eglot--current-process () "The current logical EGLOT process." - (or eglot--special-buffer-process - (let* ((cur (project-current)) - (processes - (and cur - (gethash cur eglot--processes-by-project)))) - (cl-find major-mode - processes - :key #'eglot--major-mode)))) + (let* ((cur (project-current)) + (processes (and cur (gethash cur eglot--processes-by-project)))) + (cl-find major-mode processes :key #'eglot--major-mode))) (defun eglot--current-process-or-lose () "Return the current EGLOT process or error." @@ -465,9 +457,7 @@ INTERACTIVE is t if called interactively." (with-current-buffer buffer (buffer-disable-undo) (read-only-mode t) - (setf (eglot--events-buffer process) buffer - eglot--special-buffer-process process) - (eglot-mode)) + (setf (eglot--events-buffer process) buffer)) buffer)))) (when interactive (display-buffer buffer)) buffer)) -- 2.39.2