Skip to content

Commit

Permalink
Fix restart
Browse files Browse the repository at this point in the history
  • Loading branch information
mopemope committed May 18, 2017
1 parent 57d218b commit c64a722
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions meghanada.el
Original file line number Diff line number Diff line change
Expand Up @@ -376,9 +376,13 @@ function."
"TODO: FIX DOC ."
(interactive)
(when (and meghanada--server-process (process-live-p meghanada--server-process))
(kill-process meghanada--server-process)
(setq meghanada--server-process nil)
(kill-buffer meghanada--server-buffer)))
(set-process-sentinel meghanada--server-process 'ignore)
(set-process-filter meghanada--server-process 'ignore)
(kill-buffer (process-buffer meghanada--server-process))
;; (kill-process meghanada--server-process)
(delete-process meghanada--server-process)
(setq meghanada--server-process nil)))


;;
;; meghanada-client process management.
Expand Down Expand Up @@ -543,9 +547,15 @@ function."
(defun meghanada--client-kill ()
"Disconnect and kill meghanada-client."
(when (and meghanada--client-process (process-live-p meghanada--client-process))
(set-process-sentinel meghanada--client-process 'ignore)
(set-process-filter meghanada--client-process 'ignore)
(kill-buffer (process-buffer meghanada--client-process))
(delete-process meghanada--client-process)
(setq meghanada--client-process nil))
(when (and meghanada--task-client-process (process-live-p meghanada--task-client-process))
(set-process-sentinel meghanada--task-client-process 'ignore)
(set-process-filter meghanada--task-client-process 'ignore)
(kill-buffer (process-buffer meghanada--task-client-process))
(delete-process meghanada--task-client-process)
(setq meghanada--task-client-process nil)))

Expand Down Expand Up @@ -704,7 +714,6 @@ function."
(interactive)
(meghanada--client-kill)
(meghanada-server-kill)
(sleep-for 3)
(meghanada--start-server-and-client))

;;
Expand Down

0 comments on commit c64a722

Please sign in to comment.