From: João Távora Date: Wed, 13 Jun 2018 11:46:36 +0000 (+0100) Subject: * eglot.el (eglot-shutdown): accept timeout param. X-Git-Tag: emacs-29.0.90~1616^2~524^2~4^2~504 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=332657f444a14f5b7a7a1ad85c79e3fe27540723;p=emacs.git * eglot.el (eglot-shutdown): accept timeout param. --- diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index d9fbd331c1d..e438c492dd9 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -1039,14 +1039,14 @@ Uses THING, FACE, DEFS and PREPEND." ;;; Protocol implementation (Requests, notifications, etc) ;;; -(defun eglot-shutdown (server &optional _interactive) +(defun eglot-shutdown (server &optional _interactive timeout) "Politely ask SERVER to quit. -Forcefully quit it if it doesn't respond. Don't leave this -function with the server still running." +Forcefully quit it if it doesn't respond within TIMEOUT seconds. +Don't leave this function with the server still running." (interactive (list (eglot--current-server-or-lose) t)) (eglot--message "Asking %s politely to terminate" (eglot--name server)) (unwind-protect - (let ((eglot-request-timeout 3)) + (let ((eglot-request-timeout (or timeout 1.5))) (setf (eglot--shutdown-requested server) t) (eglot--request server :shutdown nil) ;; this one is supposed to always fail, hence ignore-errors