Closed GChristensen closed 12 years ago
Currently I use the following clumsy workaround, but it works for me (may be it's worth to store a reference to the swank-clojure process in a swank buffer local variable instead of global one):
; clojure-mode.el.patch --- /site/.emacs.d/clojure-mode.el Sun Nov 06 01:01:44 2011 +++ /clojure-mode.el Tue Nov 08 14:18:09 2011 @@ -885,7 +885,7 @@ (insert output)) (when (string-match "proceed to jack in" output) (eval-buffer (process-buffer process)) - (slime-connect "localhost" port) + (setq *swank-clojure-connection* (slime-connect "localhost" port)) (with-current-buffer (slime-output-buffer t) (setq default-directory dir)) (set-process-sentinel process nil)
;.emacs (add-hook 'kill-emacs-hook (lambda () (when (get-process "swank") (let ((slime-dispatching-connection *swank-clojure-connection*)) (slime-eval-async '(swank:quit-lisp))))))
This is actually a Leiningen bug: https://github.com/technomancy/leiningen/issues/322
I suspect, this happens because there are two processes have been created during the jack-in procedure - one belongs to leiningen and another to swank-clojure, but only one of them (leiningen) is associated with an Emacs buffer. As I understand, currently the only graceful solution for this problem is to use (System/exit 0) from the REPL, but is it possible to assotiate the swank-clojure process with another buffer, for example, or is it should a swank-clojure process be associated with a Emacs buffer?