clojureswankswank-clojure

how to automatically load new dependencies from project.clj in swank


I am working in emacs, swank-clojure. I start my repl using clojure-jack-in. However when I add a new dependency to my project.clj, the dependency is not available in the repl.

1) Is there a way to load new dependencies automatically in swank, when project.clj changes ?

2) Also what is a clean way to terminate the swank server ? Currently I just kill the buffer.

Thanks, Murtaza


Solution

  • When Java VM starts it reads all the included jars there is straight-forward way to include jars later. If you really don't want to restart application you could try something like this. But it may get very tricky as if you don't use same class loader as Clojure does then when loading another Clojure library you may end up with 2 instances of Clojure core.

    To disconnect from swank server use M-x slime-disconnect. To stop publishing on the server you can issue:

    (swank.swank/stop-server)