|
|
@ -59,41 +59,6 @@ |
|
|
|
BACKEND should be a symbol." |
|
|
|
(add-to-list 'indium-backends backend)) |
|
|
|
|
|
|
|
(defun indium-quit () |
|
|
|
"Close the current connection and kill its REPL buffer if any. |
|
|
|
If a process is attached to the connection, kill it as well. |
|
|
|
When called interactively, prompt for a confirmation first." |
|
|
|
(interactive) |
|
|
|
(unless-indium-connected |
|
|
|
(user-error "No active connection to close")) |
|
|
|
(when (or (not (called-interactively-p 'interactive)) |
|
|
|
(y-or-n-p (format "Do you really want to close the connection to %s ? " |
|
|
|
(indium-current-connection-url)))) |
|
|
|
(let ((process (indium-current-connection-process))) |
|
|
|
(indium-backend-close-connection (indium-current-connection-backend)) |
|
|
|
(indium-backend-cleanup-buffers) |
|
|
|
(when (and process |
|
|
|
(memq (process-status process) |
|
|
|
'(run stop open listen))) |
|
|
|
(kill-process process)) |
|
|
|
(setq indium-current-connection nil)))) |
|
|
|
|
|
|
|
(defun indium-maybe-quit () |
|
|
|
"Close the current connection. |
|
|
|
|
|
|
|
Unlike `indium-quit', do not signal an error when there is no |
|
|
|
active connection." |
|
|
|
(when-indium-connected |
|
|
|
(call-interactively #'indium-quit))) |
|
|
|
|
|
|
|
(defun indium-reconnect () |
|
|
|
"Try to re-establish a connection. |
|
|
|
The new connection is based on the current (usually closed) one." |
|
|
|
(interactive) |
|
|
|
(unless-indium-connected |
|
|
|
(user-error "No Indium connection to reconnect to")) |
|
|
|
(indium-backend-reconnect (indium-current-connection-backend))) |
|
|
|
|
|
|
|
(declare-function indium-repl-get-buffer "indium-repl.el") |
|
|
|
(declare-function indium-debugger-unset-current-buffer "indium-debugger.el") |
|
|
|
|
|
|
|