From: João Távora Date: Thu, 10 May 2018 12:52:21 +0000 (+0100) Subject: Only call deferred actions after a full message has been received X-Git-Tag: emacs-29.0.90~1616^2~524^2~4^2~594 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=68892622c9da9f16dbd12b11486680b0e8038844;p=emacs.git Only call deferred actions after a full message has been received Otherwise it can be quite wasteful. * eglot.el (eglot--process-filter): Don't eglot--call-deferred here. (eglot--process-receive): Do it here. --- diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index d49367b5fef..8b8d7122444 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -380,6 +380,7 @@ INTERACTIVE is t if called interactively." "(sentinel) Not auto-reconnecting, last one didn't last long." change))) (delete-process proc)))) + (defun eglot--process-filter (proc string) "Called when new data STRING has arrived for PROC." (when (buffer-live-p (process-buffer proc)) @@ -441,8 +442,7 @@ INTERACTIVE is t if called interactively." (throw done :waiting-for-more-bytes-in-this-message)))))))) ;; Saved parsing state for next visit to this filter ;; - (setf (eglot--expected-bytes proc) expected-bytes)))) - (eglot--call-deferred proc))) + (setf (eglot--expected-bytes proc) expected-bytes)))))) (defun eglot-events-buffer (process &optional interactive) "Display events buffer for current LSP connection PROCESS. @@ -522,6 +522,7 @@ is a symbol saying if this is a client or server originated." (funcall (cl-first continuations) res))))) (id (eglot--warn "Ooops no continuation for id %s" id))) + (eglot--call-deferred proc) (force-mode-line-update t))) (defvar eglot--expect-carriage-return nil)