;; Maintainer: João Távora <joaotavora@gmail.com>
;; Keywords: processes, languages, extensions
;; Package-Requires: ((emacs "25.2"))
-;; Version: 1.0.6
+;; Version: 1.0.7
;; This is an Elpa :core package. Don't use functionality that is not
;; compatible with Emacs 25.2.
With optional CLEANUP, kill any associated buffers. "
(unwind-protect
(cl-loop
- with proc = (jsonrpc--process conn)
+ with proc = (jsonrpc--process conn) for i from 0
+ while (not (process-get proc 'jsonrpc-sentinel-cleanup-started))
+ unless (zerop i) do
+ (jsonrpc--warn "Sentinel for %s still hasn't run, deleting it!" proc)
do
(delete-process proc)
- (accept-process-output nil 0.1)
- while (not (process-get proc 'jsonrpc-sentinel-done))
- do (jsonrpc--warn
- "Sentinel for %s still hasn't run, deleting it!" proc))
+ (accept-process-output nil 0.1))
(when cleanup
(kill-buffer (process-buffer (jsonrpc--process conn)))
(kill-buffer (jsonrpc-stderr-buffer conn)))))
(pcase-let ((`(,_success ,_error ,timeout) triplet))
(when timeout (cancel-timer timeout))))
(jsonrpc--request-continuations connection))
+ (process-put proc 'jsonrpc-sentinel-cleanup-started t)
(unwind-protect
;; Call all outstanding error handlers
(maphash (lambda (_id triplet)
(funcall error '(:code -1 :message "Server died"))))
(jsonrpc--request-continuations connection))
(jsonrpc--message "Server exited with status %s" (process-exit-status proc))
- (process-put proc 'jsonrpc-sentinel-done t)
(delete-process proc)
(funcall (jsonrpc--on-shutdown connection) connection)))))