Created
June 25, 2009 20:03
-
-
Save shoover/136124 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
;;; Phil H's revised slime-project; can't remember where I found it | |
(defun slime-project (path) | |
"Setup classpaths for a clojure project and starts a new SLIME session. | |
Kills existing SLIME session, if any." | |
(interactive (list | |
(ido-read-directory-name | |
"Project root: " | |
(locate-dominating-file default-directory "pom.xml")))) | |
(when (get-buffer "*inferior-lisp*") | |
(kill-buffer "*inferior-lisp*")) | |
(setq swank-clojure-binary nil | |
swank-clojure-jar-path (expand-file-name "target/dependency/" path) | |
swank-clojure-extra-classpaths | |
(mapcar (lambda (d) (expand-file-name d path)) | |
'("src/" "target/classes/" "test/")) | |
swank-clojure-extra-vm-args | |
(list (format "-Dclojure.compile.path=%s" | |
(expand-file-name "target/classes/" path))) | |
slime-lisp-implementations | |
(cons `(clojure ,(swank-clojure-cmd) :init swank-clojure-init) | |
(remove-if #'(lambda (x) (eq (car x) 'clojure)) | |
slime-lisp-implementations))) | |
(save-window-excursion | |
(slime))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment