From: João Távora Date: Mon, 13 Aug 2018 00:29:41 +0000 (+0100) Subject: Control the size of the events buffer X-Git-Tag: emacs-29.0.90~1616^2~524^2~4^2~448 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=cc2044834e2e15d76db630446af88ffe45fd50bf;p=emacs.git Control the size of the events buffer * eglot.el (eglot-events-buffer-size): New defcustom. (eglot--connect): Use it. GitHub-reference: close https://github.com/joaotavora/eglot/issues/41 --- diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index ac529dc8d2f..eeea104e04c 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -154,6 +154,14 @@ as 0, i.e. don't block at all." :type '(choice (boolean :tag "Whether to inhibit autoreconnection") (integer :tag "Number of seconds"))) +(defcustom eglot-events-buffer-size 2000000 + "Control the size of the Eglot events buffer. +If a number, don't let the buffer grow larger than that many +characters. If 0, don't use an event's buffer at all. If nil, +let the buffer grow forever." + :type '(choice (const :tag "No limit" nil) + (integer :tag "Number of characters"))) + ;;; API (WORK-IN-PROGRESS!) ;;; (cl-defmacro eglot--with-live-buffer (buf &rest body) @@ -502,6 +510,7 @@ This docstring appeases checkdoc, that's all." (apply #'make-instance class :name readable-name + :events-buffer-scrollback-size eglot-events-buffer-size :notification-dispatcher (funcall spread #'eglot-handle-notification) :request-dispatcher (funcall spread #'eglot-handle-request) :on-shutdown #'eglot--on-shutdown