Created
August 21, 2010 16:04
-
-
Save mrBliss/542493 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun cljr-swank () | |
(interactive) | |
(let ((proc (start-process-shell-command | |
"cljr-swank" "*cljr-swank*" | |
"cljr") "swank" | |
(number-to-string slime-port)))) | |
(when proc | |
(process-put proc :output nil) | |
(set-process-sentinel | |
proc (lambda (proc event) | |
(message "%s%s: `%S'" (process-get proc :output) | |
proc (replace-regexp-in-string "\n" "" event)))) | |
(set-process-filter | |
proc (lambda (proc output) | |
(process-put proc :output | |
(concat (process-get proc :output) output)) | |
(when (string-match "Connection opened on" output) | |
(slime-connect "localhost" slime-port) | |
;; no need to further process output | |
(set-process-filter proc nil)))) | |
(message "Starting cljr swank server...")))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment