I compiled clojure and clojure-contrib.jar by cloning the
repositories, checking out tag 1.1.0 and building them with ant. I
then followed these instructions to a t (http://riddell.us/tutorial/
slime_swank/slime_swank.html). I've downloaded swank-clojure/slime/
clojure-mode as the instructions but used the latest code (I did not
checkout a different tag). I have also tried emacs and emacs-snapshot,
both installed via apt-get.
All seems to be well when I M-x slime, but if I enter (+ 1 2) it just
hangs. If I switch to the *inferior-lisp* buffer and type this
expression it returns 3 as expected.
The only other thing that seems strange is my *inferior-lisp* has this
in it:
(require 'swank.swank)
(swank.swank/ignore-protocol-version "2010-02-14")
(swank.swank/start-server "/tmp/slime.26582" :encoding "iso-latin-1-
unix")
Clojure 1.1.0
user=> WARNING: reader macro ^ is deprecated; use meta instead
WARNING: reader macro ^ is deprecated; use meta instead
WARNING: reader macro ^ is deprecated; use meta instead
WARNING: reader macro ^ is deprecated; use meta instead
WARNING: reader macro ^ is deprecated; use meta instead
WARNING: reader macro ^ is deprecated; use meta instead
WARNING: reader macro ^ is deprecated; use meta instead
WARNING: reader macro ^ is deprecated; use meta instead
WARNING: reader macro ^ is deprecated; use meta instead
nil
user=> user=> "2010-02-14"
user=> user=> Connection opened on local port 43926
#<ServerSocket
ServerSocket[addr=0.0.0.0/0.0.0.0,port=0,localport=43926]>
user=> user=> WARNING: reader macro ^ is deprecated; use meta instead
WARNING: reader macro ^ is deprecated; use meta instead
Those instructions are pretty old. Have you tried the official readme?
http://github.com/technomancy/swank-clojure
Be sure to remove all the manual configuration from following the old
instructions.
-Phil
> All seems to be well when I M-x slime, but if I enter (+ 1 2) it just
> hangs. If I switch to the *inferior-lisp* buffer and type this
> expression it returns 3 as expected.
I have the same problem, as documented here:
http://thread.gmane.org/gmane.comp.java.clojure.user/24894/focus=24956
In the *inferior-lisp* buffer, try evaluating the following form:
(.. java.lang.management.ManagementFactory (getRuntimeMXBean) (getName))
Does that cause SLIME's REPL to finally connect to Swank?
--
Steven E. Harris
Do I still have to do manual edits to my .emacs file for swank-
classpath and whatnot? I started with a blank .emacs file
and .emacs.d directory and followed the recommend use of ELPA. When
installing via ELPA I get the following output to my *Compile-Log*
buffer:
****************************************************************************
Compiling file /home/mov/.emacs.d/elpa/clojure-mode-1.6/clojure-mode-
pkg.el at Tue Feb 16 23:22:53 2010
Compiling file /home/mov/.emacs.d/elpa/clojure-mode-1.6/clojure-
mode.el at Tue Feb 16 23:22:53 2010
clojure-mode.el:69:1:Warning: cl package required at runtime
In clojure-mode:
clojure-mode.el:196:34:Warning: reference to free variable `paredit-
mode'
clojure-mode.el:196:51:Warning: reference to free variable `paredit-
version'
In clojure-font-lock-extend-region-def:
clojure-mode.el:232:33:Warning: reference to free variable `font-lock-
beg'
clojure-mode.el:239:30:Warning: assignment to free variable `font-lock-
beg'
clojure-mode.el:240:33:Warning: reference to free variable `font-lock-
end'
clojure-mode.el:242:19:Warning: assignment to free variable `font-lock-
end'
In clojure-font-lock-extend-region-comment:
clojure-mode.el:257:26:Warning: reference to free variable `font-lock-
beg'
clojure-mode.el:254:49:Warning: reference to free variable `font-lock-
end'
clojure-mode.el:258:17:Warning: assignment to free variable `font-lock-
beg'
clojure-mode.el:262:17:Warning: assignment to free variable `font-lock-
end'
In clojure-indent-function:
clojure-mode.el:397:33:Warning: reference to free variable
`calculate-lisp-indent-last-sexp'
In clojure-slime-config:
clojure-mode.el:574:11:Warning: assignment to free variable
`swank-clojure-classpath'
In end of data:
clojure-mode.el:684:1:Warning: the following functions are not known
to be defined:
imenu--generic-function, inferior-lisp-proc, switch-to-lisp,
swank-clojure-slime-mode-hook
Compiling no file at Tue Feb 16 23:22:54 2010
Compiling file /home/mov/.emacs.d/elpa/swank-clojure-1.1.0/swank-
clojure-pkg.el at Tue Feb 16 23:22:54 2010
Compiling file /home/mov/.emacs.d/elpa/swank-clojure-1.1.0/swank-
clojure.el at Tue Feb 16 23:22:55 2010
swank-clojure.el:48:1:Error: Cannot open load file: clojure-mode
****************************************************************************
Then when I M-x slime I get this output to *inferior-lisp* and slime
never loads.
****************************************************************************
(require 'swank.swank)
(swank.swank/ignore-protocol-version nil)
(do (.. java.net.InetAddress getLocalHost getHostAddress) nil)
(swank.swank/start-server "/tmp/slime.28344" :encoding "iso-latin-1-
unix")
Clojure 1.1.0
user=> java.io.FileNotFoundException: Could not locate swank/
swank__init.class or swank/swank.clj on classpath: (NO_SOURCE_FILE:0)
user=> user=> java.lang.ClassNotFoundException: swank.swank
(NO_SOURCE_FILE:0)
user=> user=> nil
java.lang.ClassNotFoundException: swank.swank (NO_SOURCE_FILE:0)
***************************************************************************
On Feb 15, 4:23 pm, Phil Hagelberg <p...@hagelb.org> wrote:
Polling "/tmp/slime/28940".. (Abort with `M-x slime-abort-connection')
On Feb 15, 7:07 pm, "Steven E. Harris" <s...@panix.com> wrote:
What does it say in the *inferior-lisp* buffer? Any messages?
There were some issues with the auto-download of Clojure jars in older
versions Emacs. You can try removing your ~/.swank-clojure directory
and retrying, or you could try upgrading to a recent version of Emacs
(23).
-Phil
The message above where I get FileNotFoundException Could not locate
swank is from my *inferior-lisp* buffer.
I am using emacs 23. I've tried with this and the gtk-snapshot
versions togging using update-alternative --config emacs.
I do not have a ~/.swank-clojure directory. I do have a swank-
clojure-1.1.0 directory from the swank install via elpa in ~/.emacs.d/
swank-clojure-1.1.0 but I have tried deleting that manually several
times and reinstalling it via elpa, no dice. I also had some seemingly
related files in ~/src but I removed all of those to start as fresh as
possible.
I do have CLOJURE_EXT set to ~/.clojure where the clojure.jar and
clojure-contrib.jar files are. Not sure if that affects anything. I
also have the clojure-contrib launcher linked to /usr/bin/clj for
command line REPL which works great.
Thanks again for your help.
On Feb 17, 12:40 am, Phil Hagelberg <p...@hagelb.org> wrote:
When you invoke M-x slime, it should ask you if you want to install
Clojure. If you say yes, it downloads the jars into ~/.swank-clojure.
If it's not doing that, it's hard to say what's going wrong. Maybe you
have an older copy of slime installed via apt-get alongside the elpa
version?
-Phil
http://github.com/technomancy/swank-clojure
(after first wasting a couple of hours trying to follow these instructions linked to by clojure.org http://en.wikibooks.org/wiki/Clojure_Programming/Getting_Started#Installing_a_JAR)
and I seem to be having the same problem.
Below is a manually edited log of what I did. It appears that there is a compilation error in slime-repl.el and that everything after that fails (e.g. m-x slime complains that some swank files cannot be found).
Any suggestions?
thanks
pt
checked for cleanliness:
- find / -name '*slime*' -print
and removed anything that might be on the PATH
- echo $CLASSPATH - it's empty
- edited .emacs and removed ref to elpa
- rm -rf ~/.emacs.d/elpa
run emacs 23.1.1
typed this into *scratch*:
(let ((buffer (url-retrieve-synchronously
"http://tromey.com/elpa/package-install.el")))
(save-excursion
(set-buffer buffer)
(goto-char (point-min))
(re-search-forward "^$" nil 'move)
(eval-region (point) (point-max))
(kill-buffer (current-buffer))))
- positioned cursor at end of this form and hit c-x c-e
- m-x packages-list-packages
- scrolled down to swank-clojure and hit 'i', then hit 'x'
- *Compile-log* shows a bunch of warnings, and these errors:
slime-repl.el:122:39:Error: No setf-method known for slime-connection-output-buffer
Compiling no file at Sat Feb 20 12:21:19 2010
Compiling file /home/tarvydas/.emacs.d/elpa/swank-clojure-1.1.0/swank-clojure-pkg.el at Sat Feb 20 12:21:19 2010
Compiling file /home/tarvydas/.emacs.d/elpa/swank-clojure-1.1.0/swank-clojure.el at Sat Feb 20 12:21:19 2010
swank-clojure.el:47:1:Error: Cannot open load file: slime
From the readme you linked to above:
> Install from ELPA using package.el[1].
>
>When you perform the installation, you will see warnings related to the byte-compilation of the packages. This is normal; the packages will work just fine even if there are problems compiling it upon installation
Since elisp can work in either compiled or interpreted mode,
compilation errors don't mean the package failed to install. It just
means it will run in interpreted mode.
-Phil
[Maybe this is just a problem with my incorrect expectations? I don't expect to see java exceptions at the points a and b below, plus the dead inferior-lisp.]
OK, if I ignore the two errors (not warnings), and continue on
a) If I type m-x slime, this appears (note, no question is asked about loading clojure):
(require 'swank.swank)
(swank.swank/ignore-protocol-version nil)
(do (.. java.net.InetAddress getLocalHost getHostAddress) nil)(swank.swank/start-server "/tmp/slime.27491" :encoding "iso-latin-1-unix")
Clojure
user=> java.io.FileNotFoundException: Could not locate swank/swank__init.class or swank/swank.clj on classpath: (NO_SOURCE_FILE:0)
user=> user=> java.lang.ClassNotFoundException: swank.swank (NO_SOURCE_FILE:3)
user=> user=> nil
java.lang.ClassNotFoundException: swank.swank (NO_SOURCE_FILE:5)
user=> user=>
b) further ignoring that, I type m-x swank-clojure-project and this appears in the *inferior-lisp* buffer (note, no ~/.swank-clojure directory was created ; and, if I create a file containing (+ 2 3), then hit c-x c-e, emacs just beeps):
(require 'swank.swank)
(swank.swank/ignore-protocol-version nil)
(do (.. java.net.InetAddress getLocalHost getHostAddress) nil)(swank.swank/start-server "/tmp/slime.27491" :encoding "iso-latin-1-unix")
Exception in thread "main" java.lang.NoClassDefFoundError: clojure/main
Caused by: java.lang.ClassNotFoundException: clojure.main
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
Could not find the main class: clojure.main. Program will exit.
Process inferior-lisp exited abnormally with code 1
I created ~/.swank-clojure directory, and downloaded there swank-
clojure-1.1.0.jar from http://repo.technomancy.us/. Now M-x slime
works.
On Feb 20, 11:40 am, Paul Tarvydas <tarvy...@visualframeworksinc.com>
wrote:
> > >When you perform the installation, you will see warnings related to the byte-compilation of the packages. This is normal; the packages will work just fine even if there are problems compiling it upon installation
>
> > Since elisp can work in either compiled or interpreted mode,
> > compilation errors don't mean the package failed to install. It just
> > means it will run in interpreted mode.
>
> [Maybe this is just a problem with my incorrect expectations? I don't expect to see java exceptions at the points a and b below, plus the dead inferior-lisp.]
>
> OK, if I ignore the two errors (not warnings), and continue on
>
> a) If I type m-x slime, this appears (note, no question is asked about loading clojure):
>
> (require 'swank.swank)
>
> (swank.swank/ignore-protocol-version nil)
>
> (do (.. java.net.InetAddress getLocalHost getHostAddress) nil)(swank.swank/start-server "/tmp/slime.27491" :encoding "iso-latin-1-unix")
>
> Clojure
> user=> java.io.FileNotFoundException: Could not locate swank/swank__init.class or swank/swank.clj on classpath: (NO_SOURCE_FILE:0)
> user=> user=> java.lang.ClassNotFoundException: swank.swank (NO_SOURCE_FILE:3)
> user=> user=> nil
> java.lang.ClassNotFoundException: swank.swank (NO_SOURCE_FILE:5)
> user=> user=>
>
> b) further ignoring that, I type m-xswank-clojure-project and this appears in the *inferior-lisp* buffer (note, no ~/.swank-clojuredirectory was created ; and, if I create a file containing (+ 2 3), then hit c-x c-e, emacs just beeps):
On Feb 22, 2:39 pm, ajazz <pro.o...@gmail.com> wrote:
> hello,
> I had the same problem.
>
> I created ~/.swank-clojure directory, and downloaded there swank-
> clojure-1.1.0.jar fromhttp://repo.technomancy.us/. Now M-x slime
I'm not sure if you manage the swank-clojure install via elpa but
please let me know if there are any details I can provide regarding my
system where it failed to download the jarfile for me (assuming it was
supposed to). In general it was a 4 day old Ubuntu 9.10 with emacs23
installed.
And thanks for swank clojure man. It's a really great REPL and worth
any trouble I may have had installing it.
On Feb 19, 11:05 am, Phil Hagelberg <p...@hagelb.org> wrote:
Thanks - that seems to have worked.
pt