How to connect clojure source file to running clojure repl on Emacs?

I am currently adding the functionality of an existing J2EE webapp to the Tomcat container and I am writing my add-ons using Clojure. My setup is simple: I just add calls to the static methods generated with clojure and encode all the hard work from clojure. The build process consists in compiling the clojure ( lein uberjar) code , and then compiling the java code with this bank in the classpath.

In webapp init, I have a call to the generated class that starts the swank server with (swank/start-repl). I would like to be able to connect Aquamacs slime to this server and work interactively from there (to some extent, I will not try anything that requires recompilation in Java). But I have a situation that I do not quite understand. If I do a \M-x slime-connect, I get a REPL prompt (after you have been notified that there is no lower lisp process, which I think is fine, since the lower lisp process runs outside the emacs control). I can appreciate forms well and I can even check things like my.own.namespace/my-var. However, if I visit a file with already compiled clojure code, I cannot get the slime to recognize it as a source. Consider a simple clojure file:

(ns my.namespace
  (:gen-class
   :name my.namespace
   :methods [#^{:static true} [testFunc [] void]]))

(def *secret* "shhhh")

(defn -testFunc []
  (println (str "our secret is: " secret)))

, uberjar, webapp, eval/inspect my.namespace/*secret*. , , user ( !). - - , ! \C-c \C-l ( ) - , nil . , , - ​​, , , . \C-~ ( sync ), Common lisp, , , clojure REPL .

REPL, (in-ns 'my.namespace), . , clojure ( !)

, , /, .

+5
3

, : slime-redirect-inferior-output, slime-repl.el, , . , lisp - (, swake-, emacs).

, - error , this. , . . , - !

+1

, , ( emacs), C-c C-k, Clojure ( Slime)?

Slime (in-ns 'my.namespace). , .

+5

swank- clojure, slime, Clojure. C-c M-p repl , , - .

clojure -mode slime-repl? swank- clojure.el? ( .) , - elisp libs. , Aquamacs; swank- clojure GNU Emacs. ​​, , elpa.

+2

All Articles