diff --git a/cider-connection.el b/cider-connection.el index 959b78e50..0a9344119 100644 --- a/cider-connection.el +++ b/cider-connection.el @@ -156,7 +156,7 @@ buffer." ;; inform sentinel not to kill the server, if any (thread-first (get-buffer-process repl) (process-plist) - (plist-put :no-server-kill t)))) + (plist-put :keep-server t)))) (let ((proc (get-buffer-process repl))) (when (and (process-live-p proc) (or (not nrepl-server-buffer) @@ -645,8 +645,8 @@ function with the repl buffer set as current." cider-repl-init-function (plist-get params :repl-init-function)) (cider-repl-reset-markers) (add-hook 'nrepl-response-handler-functions #'cider-repl--state-handler nil 'local) - (add-hook 'nrepl-connected-hook 'cider--connected-handler nil 'local) - (add-hook 'nrepl-disconnected-hook 'cider--disconnected-handler nil 'local) + (add-hook 'nrepl-connected-hook #'cider--connected-handler nil 'local) + (add-hook 'nrepl-disconnected-hook #'cider--disconnected-handler nil 'local) (current-buffer)))) diff --git a/nrepl-client.el b/nrepl-client.el index 056a8540a..e7499ba36 100644 --- a/nrepl-client.el +++ b/nrepl-client.el @@ -466,12 +466,15 @@ and kill the process buffer." (substring message 0 -1))) (when (equal (process-status process) 'closed) (when-let* ((client-buffer (process-buffer process))) + (sesman-remove-object 'CIDER nil client-buffer + (not (process-get process :keep-server)) + 'no-error) (nrepl--clear-client-sessions client-buffer) (with-current-buffer client-buffer (run-hooks 'nrepl-disconnected-hook) (let ((server-buffer nrepl-server-buffer)) (when (and (buffer-live-p server-buffer) - (not (plist-get (process-plist process) :no-server-kill))) + (not (process-get process :keep-server))) (setq nrepl-server-buffer nil) (nrepl--maybe-kill-server-buffer server-buffer)))))))