~/bin, we'll start up the Swank server that runs the Clojure code, start up emacs, and execute some code. Here's how.
In your terminal, do the following three:
Now in emacs, do the following two to play with the ants demo:
C-x C-f path/to/ants.clj
Host: 127.0.0.1with a return-key press; same for port. Now the REPL is running within emacs. Go back to the buffer with the
ants.cljfile open and page down to the very bottom.
To compile the file, do
To interactively execute code, go to the end of the line of code you want to execute from ants.clj, say the line
(send-off animator animation)then do
Not hard at all!
(Edit 2010-04-09: Weird!
C-c C-eto execute the last
sexpdidn't work for a while here. Had to kill the file buffer and reopen the file. Now it works! Odd.
Oh I see, using Clojure Mode, a quick
M-x clojure-enable-slime-on-existing-bufferssolved the problem. Although the keybindings changed somewhat.
C-x C-eto get the above behaviour, while
C-c C-elets you type in a quick one-line to execute.)