emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master a5cd6cb 1/2: Revert "Make jsonrpc-shutdown a noop i


From: João Távora
Subject: [Emacs-diffs] master a5cd6cb 1/2: Revert "Make jsonrpc-shutdown a noop if process isn't running"
Date: Sun, 12 Aug 2018 08:27:05 -0400 (EDT)

branch: master
commit a5cd6cb2b55a40e3f72e5354d87b3290708f60bf
Author: João Távora <address@hidden>
Commit: João Távora <address@hidden>

    Revert "Make jsonrpc-shutdown a noop if process isn't running"
    
    This reverts commit c580443325a3d071625185876a8f28e04793c625.  It
    leads to situations where the sentinel hasn't run yet, which brings
    problems if the normal process isn't running, but the stderr
    pseudo-process still is.
    
    * lisp/jsonrpc.el (jsonrpc-shutdown): Always enter loop.
---
 lisp/jsonrpc.el | 26 ++++++++++++--------------
 1 file changed, 12 insertions(+), 14 deletions(-)

diff --git a/lisp/jsonrpc.el b/lisp/jsonrpc.el
index 43b570c..3d88bbf 100644
--- a/lisp/jsonrpc.el
+++ b/lisp/jsonrpc.el
@@ -417,21 +417,19 @@ connection object, called when the process dies .")
 
 (cl-defmethod jsonrpc-shutdown ((conn jsonrpc-process-connection)
                                 &optional cleanup)
-  "Wait for JSONRPC connection CONN to shutdown and return t.
-If the server wasn't running, do nothing and return nil.  With
-optional CLEANUP, kill any associated buffers. "
+  "Wait for JSONRPC connection CONN to shutdown.
+With optional CLEANUP, kill any associated buffers. "
   (unwind-protect
-      (when (jsonrpc-running-p conn)
-        (cl-loop
-         with proc = (jsonrpc--process conn)
-         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)
-         finally return t))
-    (when cleanup (kill-buffer (process-buffer (jsonrpc--process conn))))))
+      (cl-loop
+       with proc = (jsonrpc--process conn)
+       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))
+    (when cleanup
+      (kill-buffer (process-buffer (jsonrpc--process conn))))))
 
 (defun jsonrpc-stderr-buffer (conn)
   "Get CONN's standard error buffer, if any."



reply via email to

[Prev in Thread] Current Thread [Next in Thread]