> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clo...@googlegroups.com
> Note that posts from new members are moderated - please be patient with your first post.
> To unsubscribe from this group, send email to
> clojure+u...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
I made this video for hacking Overtone with Emacs:
However, Overtone can just be viewed as an example project - it's really just a description of how to get a working Clojure/Emacs setup.
Sam
I don't know why an error message doesn't show, but the swank clojure readme explains a fallback method (lein swank + M-x slime-connect) that you could try.
-Phil
In Overtone we have threads coming out of our ears. However, I don't really have a problem with monitoring output. I use Emacs + cake, and all output for the current REPL process end up in the REPL within Emacs and the output for all other threads ends up in .cake/cake.log which I just simply tail in a separate (tiled) terminal. I'm pretty sure lein has a similarly sensible approach for dealing with output from the non-REPL threads.
Sam
I think it's consistent. It should always go to the stdout of the lein
swank process if it's from a thread other than the one hooked into the
slime repl. If you started it with M-x clojure-jack-in, that will be
the *swank* buffer.
It sounds like this isn't really what you want though. Would it be
better if every time a new connection opened from Emacs it caused the
root value of *out* to change?
-Phil
Used from within Emacs, cake places all output from the REPL thread into the Slime REPL buffer and output from all other threads into .cake/cake.log
So perhaps this isn't exactly what you want…
Sam
Everything in there is output from lein jack-in. Much of it is elisp,
since Leiningen spits out the elisp that's needed to bootstrap a
connection. But it is consistent. (In 1.3.3 it will need a lot less
elisp.) On top of the root value of *out* (which is always stdout of
lein), each swank thread necessarily must bind *out* to a writer
connected to the slime socket, otherwise the repl wouldn't get hooked
up.
> My issues with this is related to running servers and catching debug
> output from it while it is running (yeah, I really should use a log
> file, but that's another topic). When I tried doing this from within
> Emacs, it became a detective hunt trying to figure it all out (and I
> probably never did). When I run it in a normal shell (lein repl),
> everything works as expected, and all threads output to the console
> they way I would expect.
>
> I wrote more details about it in the following post to this list:
>
> http://groups.google.com/group/clojure/browse_thread/thread/55849f0296530de8/9f2ca18530a4e28c?lnk=gst&q=kjeldahl#9f2ca18530a4e28c
>
> I'm no expert, but if I had to choose between getting all output in a
> file, or some output in the repl buffer and some in *swank*, I would
> prefer the former (which is what I believe cake actually does).
Putting *all* output in a file (so nothing is visible in the repl) is
never going to be the default behaviour. The question is whether swank
should use alter-var-root instead of binding to change the value of
*out*. I don't personally work with any multithreaded programs that
don't use a logging framework, so I haven't run into this myself, but
it seems like as long as you're not relying on the stdout of the
process it might be better to use the alter-var-root approach, at
least when swank is launched via lein. Does that sound helpful?
-Phil
> I would greatly appreciate any guidance on where to find a working and
> complete set of instructions for how to set up Emacs with swank-
> clojure. I am in Ubuntu.
>
> I have followed exactly every step of the instructions on this page
> http://dev.clojure.org/display/doc/Getting+Started+with+Emacs, and
> also (with a fresh install of Emacs) the version using Git in the
> comment on that page by Martin Blais. With both methods, when I
> execute "M-x clojure-jack-in", the message "Starting swank server"
> appears and hangs. Swank never starts, the message never changes, and
> I don't see any error messages anywhere (not sure where to look, maybe
> I'm missing them?).
I do believe that is the same error I recently hit. To use
`clojure-jack-in` you need a quite recent version of the `lein-swank`
plugin. You *also* need to make sure that nothing else on the load
path has an older version. That means anything in your current
project, *and* any either leinengein plugins. (I got bitten be the
later.)
You need to see ";;; proceed to jack in" output from `lein jack-in
1234` for that all to work together.
This was tricky to diagnose, and the bundled version in the other
plugin stumped me for quite some time.
Daniel
--
♲ Made with 100 percent post-consumer electrons
Also, if I can't get Emacs going, would anyone suggest an alternative
development tool? (I know there are lots, but I don't know which to
try first).
Those instructions are badly out of date. Please try the official documentation:
https://github.com/technomancy/swank-clojure
-Phil
Do you find the clojure-mode readme sufficient?
https://github.com/technomancy/clojure-mode/blob/master/README.md
Maybe Clojure wiki should just point to that so it's all in one place.
-Phil