> Correction:
>
> (defun reset-swank ()
>
> (defun run-slime (dir)
Here's what I use: (plagiarized from Tim Dysinger)
(defun slime-project (path)
"Setup classpaths for a maven/clojure project & refresh slime"
(interactive "GPath: ")
(let ((original-dir default-dir))
(cd path)
(setq swank-clojure-binary nil)
(setq swank-clojure-jar-path "target/dependency")
(setq swank-clojure-extra-classpaths '("src" "target/classes" "target/dependency"))
(setq swank-clojure-extra-vm-args '("-Dclojure.compile.path=target/classes"))
(setq slime-lisp-implementations
(cons `(clojure ,(swank-clojure-cmd) :init swank-clojure-init)
(remove-if #'(lambda (x) (eq (car x) 'clojure))
slime-lisp-implementations)))
(cd original-dir)))
This uses maven's bytecode target directory conventions. It assumes
clojure, contrib, etc are unpacked in target/dependency. This has the
additional benefit of not requiring you to restart SLIME when you add a
new dependency, just unpack it in the right place and your classpath
stays the same. Very handy.
-Phil