From 332657f444a14f5b7a7a1ad85c79e3fe27540723 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jo=C3=A3o=20T=C3=A1vora?= Date: Wed, 13 Jun 2018 12:46:36 +0100 Subject: [PATCH] * eglot.el (eglot-shutdown): accept timeout param. --- lisp/progmodes/eglot.el | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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 -- 2.39.2