Skip to content

Commit

Permalink
Disconnect now actually works.
Browse files Browse the repository at this point in the history
  • Loading branch information
sanel committed Sep 24, 2014
1 parent dbaacf6 commit 9d9e2ca
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions monroe.el
Original file line number Diff line number Diff line change
Expand Up @@ -276,12 +276,15 @@ monroe-repl-buffer."

(defun monroe-disconnect ()
"Disconnect from current nrepl connection."
(when monroe-connection-process
(monroe-clear-request-table)
(delete-process monroe-connection-process)
(setq monroe-connection-process nil)
(delete-process monroe-fake-proc)
(setq monroe-fake-proc nil)))
(monroe-clear-request-table)
(let ((delete-process-safe (lambda (p)
(when (and p (process-live-p p))
(delete-process p))))
(proc1 (get-buffer-process monroe-repl-buffer))
(proc2 (get-buffer-process "*monroe-connection*")))
(funcall delete-process-safe proc1)
(funcall delete-process-safe proc2)
(funcall delete-process-safe monroe-fake-proc)))

;;; keys

Expand Down

0 comments on commit 9d9e2ca

Please sign in to comment.