]> git.eshelyaron.com Git - emacs.git/commitdiff
Get rid of eglot--special-buffer-process
authorJoão Távora <joaotavora@gmail.com>
Mon, 7 May 2018 21:15:21 +0000 (22:15 +0100)
committerJoão Távora <joaotavora@gmail.com>
Mon, 7 May 2018 22:46:17 +0000 (23:46 +0100)
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

index ba3b5bee71ec308fca919be04cb9a791d4c68b19..1318feee51156a7191a481f37c52bb3cef3a88ac 100644 (file)
 (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))