[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/eglot cac728a 33/62: Kill server's output and events bu
From: |
Stefan Monnier |
Subject: |
[elpa] externals/eglot cac728a 33/62: Kill server's output and events buffers from eglot-shutdown (#66) |
Date: |
Sat, 29 Sep 2018 17:13:33 -0400 (EDT) |
branch: externals/eglot
commit cac728a81ee7642d9938b96af2c4ee34897ba0d5
Author: mkcms <address@hidden>
Commit: João Távora <address@hidden>
Kill server's output and events buffers from eglot-shutdown (#66)
* eglot.el
(Package-Requires): Require jsonrpc 1.0.5
(eglot-shutdown): Kill events and stderr buffers of the
server, unless new PRESERVE-BUFFERS argument is non-nil.
eglot-reconnect): Preserve buffers on shutdown.
* eglot-tests.el (eglot--call-with-dirs-and-files): Call
eglot-shutdown with non-nil PRESERVE-BUFFERS arg.
---
eglot-tests.el | 2 +-
eglot.el | 20 +++++++++++++-------
2 files changed, 14 insertions(+), 8 deletions(-)
diff --git a/eglot-tests.el b/eglot-tests.el
index 510573b..26ddf1f 100644
--- a/eglot-tests.el
+++ b/eglot-tests.el
@@ -65,7 +65,7 @@
(setq cleanup-events-et-cetera-p t))
(unwind-protect
(let ((eglot-autoreconnect nil))
- (mapc #'eglot-shutdown
+ (mapc (lambda (server) (eglot-shutdown server nil nil t))
(cl-remove-if-not #'jsonrpc-running-p new-servers)))
(when cleanup-events-et-cetera-p
(cl-loop for serv in new-servers
diff --git a/eglot.el b/eglot.el
index e37ec94..70a725c 100644
--- a/eglot.el
+++ b/eglot.el
@@ -7,7 +7,7 @@
;; Maintainer: João Távora <address@hidden>
;; URL: https://github.com/joaotavora/eglot
;; Keywords: convenience, languages
-;; Package-Requires: ((emacs "26.1") (jsonrpc "1.0.2"))
+;; Package-Requires: ((emacs "26.1") (jsonrpc "1.0.5"))
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
@@ -237,11 +237,14 @@ lasted more than that many seconds."
(defvar eglot--servers-by-project (make-hash-table :test #'equal)
"Keys are projects. Values are lists of processes.")
-(defun eglot-shutdown (server &optional _interactive timeout)
+(defun eglot-shutdown (server &optional _interactive timeout preserve-buffers)
"Politely ask SERVER to quit.
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))
+If PRESERVE-BUFFERS is non-nil (interactively, when called with a
+prefix argument), do not kill events and output buffers of
+SERVER. Don't leave this function with the server still
+running."
+ (interactive (list (eglot--current-server-or-lose) t nil current-prefix-arg))
(eglot--message "Asking %s politely to terminate" (jsonrpc-name server))
(unwind-protect
(progn
@@ -253,9 +256,12 @@ Don't leave this function with the server still running."
;; Turn off `eglot--managed-mode' where appropriate.
(dolist (buffer (eglot--managed-buffers server))
(eglot--with-live-buffer buffer (eglot--managed-mode-onoff server nil)))
- ;; Now ask jsonrpc.el to shutdown server (which in normal
+ ;; Now ask jsonrpc.el to shut down the server (which under normal
;; conditions should return immediately).
- (jsonrpc-shutdown server)))
+ (jsonrpc-shutdown server (not preserve-buffers))
+ (unless preserve-buffers
+ (mapc #'kill-buffer
+ `(,(jsonrpc-events-buffer server) ,(jsonrpc-stderr-buffer
server))))))
(defun eglot--on-shutdown (server)
"Called by jsonrpc.el when SERVER is already dead."
@@ -408,7 +414,7 @@ managing `%s' buffers in project `%s'."
INTERACTIVE is t if called interactively."
(interactive (list (eglot--current-server-or-lose) t))
(when (jsonrpc-running-p server)
- (ignore-errors (eglot-shutdown server interactive)))
+ (ignore-errors (eglot-shutdown server interactive nil 'preserve-buffers)))
(eglot--connect (eglot--major-mode server)
(eglot--project server)
(eieio-object-class-name server)
- [elpa] externals/eglot e935718 20/62: Fix placement of diagnostics with same start and end positions, (continued)
- [elpa] externals/eglot e935718 20/62: Fix placement of diagnostics with same start and end positions, Stefan Monnier, 2018/09/29
- [elpa] externals/eglot 88ebed6 17/62: Implement TextDocument/rangeFormatting, Stefan Monnier, 2018/09/29
- [elpa] externals/eglot 792dc6b 28/62: * eglot.el (advice-add jsonrpc-request): Add &allow-other-keys, Stefan Monnier, 2018/09/29
- [elpa] externals/eglot 21886be 08/62: Close #44: Robustify in the face of manual mode changes, Stefan Monnier, 2018/09/29
- [elpa] externals/eglot 6b14711 18/62: * eglot.el (eglot-client-capabilities): Fix a typo., Stefan Monnier, 2018/09/29
- [elpa] externals/eglot 4c019bd 24/62: * eglot.el (eglot-initialization-options): Fix spurious typo., Stefan Monnier, 2018/09/29
- [elpa] externals/eglot a62c2da 25/62: Close #60: Notify server of recent changes before save notification, Stefan Monnier, 2018/09/29
- [elpa] externals/eglot c8191b2 32/62: Improve eglot-execute-command API to ease overriding by servers, Stefan Monnier, 2018/09/29
- [elpa] externals/eglot 991d129 34/62: * README.md (Build Status): Show status for master, Stefan Monnier, 2018/09/29
- [elpa] externals/eglot ae37c2a 35/62: Add a test for eglot-ensure. Make, Stefan Monnier, 2018/09/29
- [elpa] externals/eglot cac728a 33/62: Kill server's output and events buffers from eglot-shutdown (#66),
Stefan Monnier <=
- [elpa] externals/eglot 9ae03af 39/62: Close #41: Control the size of the events buffer, Stefan Monnier, 2018/09/29
- [elpa] externals/eglot c25c0e3 40/62: Close #64: handle edits to same position in the correct order, Stefan Monnier, 2018/09/29
- [elpa] externals/eglot 6874895 42/62: Close #73: Prompt for server in interactive eglot-shutdown, Stefan Monnier, 2018/09/29
- [elpa] externals/eglot dc26745 38/62: Update README.md, Stefan Monnier, 2018/09/29
- [elpa] externals/eglot e05360a 50/62: Actually add snippet example gif referenced in README.md, Stefan Monnier, 2018/09/29
- [elpa] externals/eglot c8cccee 52/62: Ignore extra keys in textDocument/publishDiagnostics (#81), Stefan Monnier, 2018/09/29
- [elpa] externals/eglot 6f1d64c 59/62: Close #100: Don't send other notifications before initialized, Stefan Monnier, 2018/09/29
- [elpa] externals/eglot f482c3e 60/62: Close #115: Don't block kill-buffer-hook if server somehow hangs, Stefan Monnier, 2018/09/29
- [elpa] externals/eglot 821b498 62/62: Correctly map DocumentSymbol's :kind to its name (#121), Stefan Monnier, 2018/09/29
- [elpa] externals/eglot bd6304d 57/62: Fix serious breakage introduced by #93, Stefan Monnier, 2018/09/29