- In his screencasts, Sean Devlin moves the mouse over an item in his REPL history and it becomes highlighted (and he can paste it to the current prompt with one click)
- Also in his screencasts, Lau Jensen types something like g-i-v, then hits some key combination and gets an expansion like get-integer-value
I can't seem to find out how to get these to work, any hint would be appreciated.
Thanks,
Stefan
--
Stefan Tilkov, http://www.innoq.com/blog/st/
Stefan
> --
> 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
This one is called fuzzy-completion, which for some unknown reasons
doesn't work with SLIME + Clojure.
It used to work perfectly with Common Lisp. I would appreciate a
solution to this too.
Regards,
BG
--
Baishampayan Ghose <b.g...@ocricket.com>
oCricket.com
When the fuzzy completion extension *is* available, then the following should work to enable it:
(eval-after-load "slime"
'(progn
(require 'slime-fuzzy)
(setq slime-complete-symbol*-fancy t)
(setq slime-complete-symbol-function 'slime-fuzzy-complete-symbol)))
-Steve
Works for me, but you must have slime-fuzzy or slime-fancy enabled. So
you need something like this in your emacs config:
(slime-setup
'(slime-fancy ;; turns on fancy inspector, autodoc and other useful
stuff
slime-highlight-edits))
This binds (slime-fuzzy-complete-symbol) to C-c M-i
You can also use hippie-expand, which does the same sort of
completion, but doesn't query the running lisp.
Joost.
Sean
> Stefan,
> I run OSX, so I use command-click to bring the item to my REPL. I
> imagine a right click would do the job in other platforms.
>
Thanks Sean, but I am on OS X too – the line simply doesn't get highlighted, so I assumed there must be some difference in our setup.
Best,
Stefan
> Sean
>
> On Dec 31, 6:15 am, Stefan Tilkov <stefan.til...@innoq.com> wrote:
>> Two quick Emacs/Clojure questions I can't seem to find the answer to:
>>
>> - In his screencasts, Sean Devlin moves the mouse over an item in his REPL history and it becomes highlighted (and he can paste it to the current prompt with one click)
>> - Also in his screencasts, Lau Jensen types something like g-i-v, then hits some key combination and gets an expansion like get-integer-value
>>
>> I can't seem to find out how to get these to work, any hint would be appreciated.
>>
>> Thanks,
>> Stefan
>>
>> --
>> Stefan Tilkov,http://www.innoq.com/blog/st/
>
Right now the ELPA slime package does not include contrib (which
contains slime-fuzzy and a number of other things). I am attempting
to add just the required pieces to ELPA to get slime-fuzzy working.
If you would like fuzzy complete to work before this, you will want to
grab slime from technomancy's github repo and then add something like
the following to your .emacs:
(add-to-list 'load-path "~/slime/contrib/")
(eval-after-load "slime"
'(progn
(require 'slime-fuzzy)
(setq slime-complete-symbol*-fancy t)
(setq slime-complete-symbol-function 'slime-fuzzy-complete-symbol)))
Note that if you are using slime-connect the fuzzy complete might not
work though the following patch may fix that for you if you are using
lein swank to launch your swank session (patch from Takeshi Banse,
tak...@laafc.net):
diff --git a/src/leiningen/core.clj b/src/leiningen/core.clj
index a5261f4..685aab1 100644
--- a/src/leiningen/core.clj
+++ b/src/leiningen/core.clj
@@ -81,4 +81,5 @@ (defn -main [& [task & args]]
(abort (format "Wrong number of arguments to task %s."
task)))))
;; In case tests or some other task started any:
- (shutdown-agents)))
+ ;;(shutdown-agents)
+ ))
> Two quick Emacs/Clojure questions I can't seem to find the answer to:
>
> - In his screencasts, Sean Devlin moves the mouse over an item in his
> REPL history and it becomes highlighted (and he can paste it to the
> current prompt with one click)
> - Also in his screencasts, Lau Jensen types something like g-i-v, then hits some key combination and gets an expansion like get-integer-value
>
> I can't seem to find out how to get these to work, any hint would be appreciated.
I did it like this (I assume that clojure-mode.el has been installed):
1. downloaded slime and swank-clojure
$ pwd
/home/rw/opt/slime
$ head -n 1 .git/remotes/origin
URL: git://git.boinkor.net/slime.git
$ git pull
Already up-to-date.
$ pwd
/home/rw/opt/swank-clojure
$ head -n 1 .git/remotes/origin
URL: git://github.com/jochu/swank-clojure.git
$ git pull
Already up-to-date.
2. configured Emacs
(version: GNU Emacs 23.1.50.2 (i686-pc-linux-gnu, GTK+ Version 2.12.11))
<.emacs>
(add-to-list 'load-path "~/opt/slime/")
(add-to-list 'load-path "~/opt/slime/contrib/")
(add-to-list 'load-path "~/opt/swank-clojure/src/emacs")
(require 'clojure-mode)
(setq auto-mode-alist
(cons '("\\.clj$" . clojure-mode) auto-mode-alist))
(require 'swank-clojure-autoload)
(swank-clojure-config
(setq swank-clojure-jar-path "~/opt/clojure/clojure-git.jar")
(setq swank-clojure-extra-classpaths (list
"~/opt/clojure/jline.jar"
"~/src/clojure/gnu/clojure/clojure/src/jvm"))
(setq swank-clojure-extra-vm-args
'("-agentlib:jdwp=transport=dt_socket,address=8888,server=y,suspend=n")))
(require 'slime)
(slime-setup '(slime-repl))
(add-hook 'clojure-mode-hook
'(lambda ()
(define-key clojure-mode-map "\C-cc" 'comment-region)
(define-key clojure-mode-map "\C-cu" 'uncomment-region)))
(eval-after-load "slime"
'(progn
(require 'slime-fuzzy)
(setq slime-complete-symbol*-fancy t)
(setq slime-complete-symbol-function 'slime-fuzzy-complete-symbol)))
(defun run-clojure ()
"Starts clojure in Slime"
(interactive)
(slime 'clojure))
</.emacs>
And now "M-x run-clojure" starts slime with working completion.
For example after writing "w-o" and hitting TAB key I can see this:
user> (w-o
Completion: Flags: Score:
------------------------------ -------- --------
with-open -f---m-- 20,43
with-out-str -f---m-- 20,00
[...]
HTH,
Rob
I downloaded slime-fuzzy.el from here:
http://elder-gods.org/~larry/repos/slime-tracker/contrib/slime-fuzzy.el
, put it into ~/.emacs.d/misc and then added this to my ~/.emacs:
(setq load-path (cons "~/.emacs.d/misc" load-path))
(eval-after-load "slime"
'(progn
(require 'slime-fuzzy)
(setq slime-complete-symbol*-fancy t)
(setq slime-complete-symbol-function 'slime-fuzzy-complete-symbol)))
… and everything works perfectly.
Stefan
> I did it like this (I assume that clojure-mode.el has been installed):
Thanks, Rob. I followed your instructions after not being able to get
Clojure to cooperate with my normal Swank/SLIME installation, and it
works, but only to a point: The SLIME REPL buffer (invoked via the
function `slime-repl') falls out of step with the *inferior-lisp*
buffer.
This never happens to me when using SLIME with a Common Lisp, such as
CLISP. Here, Clojure starts up just fine in the *inferior-lisp* buffer,
but the SLIME REPL doesn't seem to connect properly. Maybe it connects
at the network level, but each form entered in the SLIME REPL yields
messages like this in the minibuffer:
,----
| ; pipelined request... (swank:listener-eval "
`----
That's a sign that the REPL is sending commands to the SWANK back-end,
but it's not receiving a timely response. Meanwhile, the Clojure REPL in
the *inferior-lisp* buffer remains responsive.
Trying to evaluate Clojure forms from a buffer other than the REPL (via,
say, `C-x e', usually doesn't work. There's no error reported, but none
of the resulting values display in the minibuffer, and any definitions
evaluated there have no apparent side effect on the Clojure REPL
available in the *inferior-lisp* buffer.
I've also noticed that the SLIME "presentations" feature doesn't work
with Clojure. That may be a symptom of the SLIME REPL not meeting up
properly with the Clojure REPL.
--
Steven E. Harris
do you use a rather recent checkout of SLIME? If so, you may want to
read the thread http://groups.google.com/group/clojure/browse_frm/thread/3e5f416e3f2a1884/337057edae5dcdc3
Can't say whether that's related to your problem, though.
Cheers,
Stefan
-Steve
The only part that feels tricky is compiling swank for which I needed
a Maven setup, IIRC.
Regards,
Stefan
http://learnclojure.blogspot.com/2009/11/installing-clojure-on-ubuntu-910-karmic.html
but on OSX.
> --
> 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
Edmund
"The future is here. It's just not widely distributed yet"
-- Gibson
I just run swank from source code, uncompiled. No Maven, no worry :-)
Konrad.
I had some errors before compiling and putting the resulting JAR on
the CP. But I'm not much of a Java-hero. What is your classpath? I
have swank-clojure/target/swank-clojure-1.0-SNAPSHOT.jar on it.
Cheers,
Stefan
> I had some errors before compiling and putting the resulting JAR on
> the CP. But I'm not much of a Java-hero. What is your classpath? I
> have swank-clojure/target/swank-clojure-1.0-SNAPSHOT.jar on it.
I always work with the latest Clojure ("new" branch from github).
Here's my swank setup in .emacs:
(setq swank-clojure-classpath
(list "~/Development/clojure/clojure.jar"
"~/Development/clojure-contrib/clojure-contrib.jar"
"~Development/clojure-dev-utilities"))
The last entry is a directory which contains among other stuff the
directory "swank" that contains swank.clj and the rest of the swank
source code.
Konrad.
> you may want to read the thread
> http://groups.google.com/group/clojure/browse_frm/thread/3e5f416e3f2a1884/337057edae5dcdc3
I had read that thread /twice/ before, as well as the thread on the
SLIME mailing list, but I had neglected to try disabling
autodoc-mode. This morning, doing so makes things work much better.
However, I still notice that when I first run SLIME, the *inferior-lisp*
buffer comes up with a responsive REPL, but the SLIME REPL connection is
flaky. It takes a long time to finally come through, if it ever
does. Perhaps there's some race condition there.
Sometimes taking focus away from the Emacs window, doing something,
else, and returning to Emacs will cause the SLIME REPL to finally wake
up and finish its connection sequence. At that point the animated REPL
banner flies out and I have a working REPL.
But presentations still don't work.
--
Steven E. Harris
> This morning, doing so makes things work much better.
Still I see this in the *inferior-lisp* buffer when starting slime:
,----
| (require 'swank.swank)
|
| (swank.swank/ignore-protocol-version "2009-12-23")
|
| (swank.swank/start-server "c:/DOCUME~1/seh/LOCALS~1/Temp/slime.3420" :encoding "iso-latin-1-unix")
|
| Listening for transport dt_socket at address: 8888
| 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=> "2009-12-23"
| user=> user=> Connection opened on local port 3464
| #<ServerSocket ServerSocket[addr=0.0.0.0/0.0.0.0,port=0,localport=3464]>
| user=> user=> user=>
`----
Note that I'm using Clojure 1.1.0. Could that be the problem?
This is within GNU Emacs 23.1.1 on Windows XP.
Once that *inferior-lisp* buffer is up, if I run `slime-repl', the REPL
may take an arbitrarily long time to finally connect to Swank. And if it
does ever connect, and I shut it down via the "sayoonara" command, I
can't get it to start again successfully.
--
Steven E. Harris
> Rob Wolfe <r...@smsnet.pl> writes:
>
>> I did it like this (I assume that clojure-mode.el has been installed):
>
> Thanks, Rob. I followed your instructions after not being able to get
> Clojure to cooperate with my normal Swank/SLIME installation, and it
> works, but only to a point: The SLIME REPL buffer (invoked via the
> function `slime-repl') falls out of step with the *inferior-lisp*
> buffer.
So how do you exactly start SLIME for Clojure?
These settings:
(require 'slime)
(slime-setup '(slime-repl))
(defun run-clojure ()
"Starts clojure in Slime"
(interactive)
(slime 'clojure))
should cause automatic start of *inferior-lisp* and *slime-repl clojure*
after typing "M-x run-clojure"
>
> This never happens to me when using SLIME with a Common Lisp, such as
> CLISP. Here, Clojure starts up just fine in the *inferior-lisp* buffer,
> but the SLIME REPL doesn't seem to connect properly. Maybe it connects
> at the network level, but each form entered in the SLIME REPL yields
> messages like this in the minibuffer:
>
> ,----
> | ; pipelined request... (swank:listener-eval "
> `----
What do you see in *messages* buffer? Maybe there are some helpful
messages. I can see this:
"""
Polling "/tmp/slime.6251".. (Abort with `M-x slime-abort-connection'.) [31 times]
Connecting to Swank on port 40585.. [2 times]
Connected. Hacks and glory await!
"""
What version of Clojure do you use? I use clojure.jar built from sources
taken from GIT repository (I tried Clojure 1.0 and it worked too).
I agree with Stefan Kamphausen that "connection-serve" in swank.clj
should not fail silently. Now we don't know what is the problem.
If I were you I would change this function as Stefan suggested
and see what is going on:
<code>
(defn- connection-serve [conn]
(let [control
(dothread-swank
(thread-set-name "Swank Control Thread")
(try
(control-loop conn)
(catch Exception e
;; fail silently
(.printStackTrace e)
(.printStackTrace (.getCause e))
nil)))
read
(dothread-swank
(thread-set-name "Read Loop Thread")
(try
(read-loop conn control)
(catch Exception e
;; This could be put somewhere better
(.interrupt control)
(dosync (alter *connections* (partial remove #{conn}))))))]
(dosync
(ref-set (conn :control-thread) control)
(ref-set (conn :read-thread) read))))
</code>
>
> That's a sign that the REPL is sending commands to the SWANK back-end,
> but it's not receiving a timely response. Meanwhile, the Clojure REPL in
> the *inferior-lisp* buffer remains responsive.
>
> Trying to evaluate Clojure forms from a buffer other than the REPL (via,
> say, `C-x e', usually doesn't work. There's no error reported, but none
> of the resulting values display in the minibuffer, and any definitions
> evaluated there have no apparent side effect on the Clojure REPL
> available in the *inferior-lisp* buffer.
>
> I've also noticed that the SLIME "presentations" feature doesn't work
> with Clojure. That may be a symptom of the SLIME REPL not meeting up
> properly with the Clojure REPL.
Yes, apparently connection with *slime-repl clojure* failed
and it does not work properly now.
HTH,
Rob
> So how do you exactly start SLIME for Clojure?
I've tried both `C-u - M-x slime RET clojure' and `run-clojure', which
both amount to the same thing eventually
> These settings:
[...]
> should cause automatic start of *inferior-lisp* and *slime-repl clojure*
> after typing "M-x run-clojure"
They do -- sometimes -- /eventually/. There is a very long gap between
the *inferior-lisp* process starting and the SLIME-Swank connection
completing, and the REPL appears only after that connection succeeds.
> What do you see in *messages* buffer?
The same as yours:
,----[ *Messages* buffer ]
| Polling "c:/DOCUME~1/seh/LOCALS~1/Temp/slime.5844"..
| (Abort with `M-x slime-abort-connection'.) [22 times]
| Connecting to Swank on port 3681.. [2 times]
| Connected. Let the hacking commence!
`----
But note that the connection attempt message repeated 22 times. And in
between the "connecting" and "connected" messages, there was a lag of
maybe a minute, during which I went in and interacted with the Clojure
REPL in the *inferior-lisp* buffer, trying to kick the connection to
completion.
If I just start SLIME and /don't/ interact with the *inferior-lisp*
buffer, the connection "never" completes, or at least not within the
five minutes I let it sit undisturbed.
This is the only content in the *slime-events* buffer while I'm waiting
for the connection to complete:
,----[ *slime-events* buffer ]
| (:emacs-rex
| (swank:connection-info)
| "COMMON-LISP-USER" t 1)
`----
> What version of Clojure do you use?
The Clojure 1.1.0 Jar that I downloaded from code.google.com.
> I use clojure.jar built from sources taken from GIT repository (I
> tried Clojure 1.0 and it worked too).
That's a good sign that something more recent than Clojure 1.0 should
work.
> I agree with Stefan Kamphausen that "connection-serve" in swank.clj
> should not fail silently. Now we don't know what is the problem.
I changed `connection-serve' per your suggestion.
The Swank back-end didn't dump any exception traces to the
*inferior-lisp* buffer.
The behavior looks like it suffers a race, or maybe the socket
connection request isn't noticed as intended.
--
Steven E. Harris
> This is the only content in the *slime-events* buffer while I'm waiting
> for the connection to complete:
>
> ,----[ *slime-events* buffer ]
> | (:emacs-rex
> | (swank:connection-info)
> | "COMMON-LISP-USER" t 1)
> `----
I also confirmed that `slime-set-connection-info' isn't being called
until after the long lag, which means that the REX above is part of
what's hanging. Either the Swank side isn't receiving the request or
it's not responding from the SLIME function `connection-info' in
file basic.clj.
The hang can be well /before/ this point too, but I've at least
established that it's not after `slime-set-connection-info'.
My next step will be to instrument the Swank side to see when
`connection-info' is being called.
--
Steven E. Harris
> Stefan Tilkov <stefan...@innoq.com> writes:
>
>> Two quick Emacs/Clojure questions I can't seem to find the answer to:
>>
>> - In his screencasts, Sean Devlin moves the mouse over an item in his
>> REPL history and it becomes highlighted (and he can paste it to the
>> current prompt with one click)
>> - Also in his screencasts, Lau Jensen types something like g-i-v, then hits some key combination and gets an expansion like get-integer-value
>>
>> I can't seem to find out how to get these to work, any hint would be appreciated.
>
> I did it like this (I assume that clojure-mode.el has been installed):
>
> 1. downloaded slime and swank-clojure
You can get this to work, but as you can see it's very manual and
error-prone. The basic slime REPL is working using automated
installation from ELPA, and William Douglas is working on adding fuzzy
completion to that. It's highly recommended that you follow this
approach rather than copying and pasting several pages of one-off
configuration. For instance, adding jline to your classpath is redundant
if you're using slime.
-Phil
> My next step will be to instrument the Swank side to see when
> `connection-info' is being called.
I found the problem: swank.util.sys/get-pid.
It looks like the JMX call to get the PID hangs. If I visit the
*inferior-lisp* buffer's REPL and evaluate the following form, the REPL
finishes connecting immediately:
,----[ Fragment of `get-pid' function ]
| (.. java.lang.management.ManagementFactory
| (getRuntimeMXBean) (getName) (split "@"))
`----
Apparently forcing more than one call through that path kicks it out of
some wait, and the thread blocked on the Swank-side function
`swank.commands.basic/connection-info' finally finishes its call to
get-pid.
Note that calling
java.lang.management.ManagementFactory#getRuntimeMXBean()
is not sufficient to unblock the thread in `connection-info'. It takes
the following call to
RuntimeMXBean#getName()
to unblock the wait.
Is there a separate mailing list to which I should report this problem?
--
Steven E. Harris
> Is there a separate mailing list to which I should report this problem?
There's http://groups.google.com/group/swank-clojure, though for this
particular issue you can just continue in this thread.
But I'm not quite following on the exact problem and specific repro
case; could you clarify? Does it occur with the latest version of
swank-clojure?
-Phil
> Rob Wolfe <r...@smsnet.pl> writes:
>
>> Stefan Tilkov <stefan...@innoq.com> writes:
>>
>>> Two quick Emacs/Clojure questions I can't seem to find the answer to:
>>>
>>> - In his screencasts, Sean Devlin moves the mouse over an item in his
>>> REPL history and it becomes highlighted (and he can paste it to the
>>> current prompt with one click)
>>> - Also in his screencasts, Lau Jensen types something like g-i-v, then hits some key combination and gets an expansion like get-integer-value
>>>
>>> I can't seem to find out how to get these to work, any hint would be appreciated.
>>
>> I did it like this (I assume that clojure-mode.el has been installed):
>>
>> 1. downloaded slime and swank-clojure
>
> You can get this to work, but as you can see it's very manual and
> error-prone. The basic slime REPL is working using automated
The question was not about "basic" slime REPL.
> installation from ELPA, and William Douglas is working on adding fuzzy
> completion to that. It's highly recommended that you follow this
I will, if it will work.
> approach rather than copying and pasting several pages of one-off
> configuration. For instance, adding jline to your classpath is redundant
> if you're using slime.
Where do you see "several pages"? I don't like this error-prone manual
work, but so far only this work for me, that's why I showed this.
Sorry if it is a pain for you to read.
Rob
> But I'm not quite following on the exact problem and specific repro
> case; could you clarify?
Yes. When I start SLIME, the Swank back-end starts and presents the
Clojure REPL in the *inferior-lisp* buffer. Right after that, the SLIME
front-end sends an "Emacs REX" command to the Swank back-end, asking it
to invoke the `connection-info' function.
At this point, the SLIME front-end has reported that it's trying to
connect. The Swank back-end receives the REX request, invokes the
`connection-info' method on some thread separate from the thread
servicing the Clojure REPL, and hangs in its call to `get-pid'.
Because the Swank back-end thread servicing the call to
`connection-info' hasn't responded, the SLIME front-end is hung waiting
for its REX to complete to gather the `connection-info' result. Not
until the SLIME front-end has received that result will it finally
announce that it succeeded connecting and present the SLIME REPL.
It's not just the SLIME REPL that won't work until that
`connection-info' REX completes. Any buffers that attempt to submit
forms to Clojure for evaluation will not receive a result; the requests
are merely queued because the SLIME front-end has not completed its
connection and initial handshake.
The call to `get-pid' hangs on its call to
RuntimeMXBean#getName()
which is part of the first path taken by `get-pid':
,----
| (.. java.lang.management.ManagementFactory
| (getRuntimeMXBean)
| (getName)
| (split "@"))
`----
Now, I found a way to unblock that hung call to RuntimeMXBean#getName():
In the Clojure REPL available in the *inferior-lisp* buffer, I can
evaluate the following form:
,----
| (.. java.lang.management.ManagementFactory (getRuntimeMXBean) (getName)
`----
That evaluation takes place in the thread servicing the Clojure REPL,
which is a different thread from the one blocked in the REX call to
`connection-info' and, transitively, `get-pid'.
The above form evaluates immediately in he Clojure REPL and, as a
side-effect I don't yet understand, /also/ causes the call blocked in
the Swank REX-servicing thread to complete as well. Hence, `get-pid'
completes, the `connection-info' completes, then the SLIME front-end
receives its reply and finally sets up the SLIME REPL. From then on, all
is well.
I've been searching the Web looking for similar complaints about such a
call hanging, and so far I've come up blank. Again, note that calling
ManagementFactory#getRuntimeMXBean() from the Clojure REPL is not
sufficient to unblock the other thread hung in `get-pid'; it takes
calling RuntimeMXBean#get() -- actually using the RuntimeMXBean
instance -- to unblock the other thread. Perhaps there's some lazy
initialization going on in Sun's RuntimeMXBean implementation.
> Does it occur with the latest version of swank-clojure?
Yes. I'm tracking the tip of the "master" branch via Git.
Here's the stack:
o swank-clojure
Git head.
o SLIME
Both CVS head and git://git.boinkor.net/slime.git head behave the same
way, as the offending calls are in swank-clojure.
o Clojure 1.1.0
Downloaded Jar from code.google.com.
o GNU Emacs 23.1.1
o Windows XP 32-bit
--
Steven E. Harris
> it takes calling RuntimeMXBean#get() -- actually using the
> RuntimeMXBean instance -- to unblock the other thread.
I meant RuntimeMXBean#getName() there.
My typing is poor this morning.
--
Steven E. Harris
[...]
> Here's the stack:
>
> o swank-clojure
> Git head.
>
> o SLIME
> Both CVS head and git://git.boinkor.net/slime.git head behave the same
> way, as the offending calls are in swank-clojure.
>
> o Clojure 1.1.0
> Downloaded Jar from code.google.com.
>
> o GNU Emacs 23.1.1
>
> o Windows XP 32-bit
Unfortunately I have no idea what is the reason of this problem,
but I'm curious what Java version are you using?
Have you tried by any chance two different Java versions with the same
result?
user> (map #(System/getProperty %) ["java.version" "java.vendor" "java.vm.version"])
("1.5.0_17" "Sun Microsystems Inc." "1.5.0_17-b04")
user> (map #(System/getProperty %) ["os.name" "os.version" "os.arch"])
("Linux" "2.6.26-1-486" "i386")
Br,
Rob
> Unfortunately I have no idea what is the reason of this problem,
That makes two of us.
> but I'm curious what Java version are you using?
user=> (map #(System/getProperty %)
["java.version" "java.vendor" "java.vm.version"])
("1.6.0_17" "Sun Microsystems Inc." "14.3-b01")
user=> (map #(System/getProperty %)
["os.name" "os.version" "os.arch"])
("Windows XP" "5.1" "x86")
> Have you tried by any chance two different Java versions with the same
> result?
No, that's the only one I have installed. In a few days when I return to
the office, I can try it against version 1.6.0_14 as well.
In the meantime, I'll continue the investigation.
--
Steven E. Harris
> In the meantime, I'll continue the investigation.
Here are two thread dumps of the Java process running Clojure and Swank,
which, at this time, has a live Clojure REPL, but the Swank call to
`connection-info' hasn't completed yet.
This first one comes via jvisualvm:
==========
2010-01-02 10:55:39
Full thread dump Java HotSpot(TM) Client VM (14.3-b01 mixed mode, sharing):
"RMI TCP Connection(4)-192.168.1.35" daemon prio=6 tid=0x02e43000 nid=0x15f8 runnable [0x0377f000]
java.lang.Thread.State: RUNNABLE
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(Unknown Source)
at java.io.BufferedInputStream.fill(Unknown Source)
at java.io.BufferedInputStream.read(Unknown Source)
- locked <0x23215700> (a java.io.BufferedInputStream)
at java.io.FilterInputStream.read(Unknown Source)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(Unknown Source)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Locked ownable synchronizers:
- <0x2321c928> (a java.util.concurrent.locks.ReentrantLock$NonfairSync)
"RMI TCP Connection(idle)" daemon prio=6 tid=0x02f74c00 nid=0x121c waiting on condition [0x0372f000]
java.lang.Thread.State: TIMED_WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x231df420> (a java.util.concurrent.SynchronousQueue$TransferStack)
at java.util.concurrent.locks.LockSupport.parkNanos(Unknown Source)
at java.util.concurrent.SynchronousQueue$TransferStack.awaitFulfill(Unknown Source)
at java.util.concurrent.SynchronousQueue$TransferStack.transfer(Unknown Source)
at java.util.concurrent.SynchronousQueue.poll(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.getTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Locked ownable synchronizers:
- None
"JMX server connection timeout 22" daemon prio=6 tid=0x02f70400 nid=0x324 in Object.wait() [0x036df000]
java.lang.Thread.State: TIMED_WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x231e31d8> (a [I)
at com.sun.jmx.remote.internal.ServerCommunicatorAdmin$Timeout.run(Unknown Source)
- locked <0x231e31d8> (a [I)
at java.lang.Thread.run(Unknown Source)
Locked ownable synchronizers:
- None
"RMI Scheduler(0)" daemon prio=6 tid=0x02b4e000 nid=0x1430 waiting on condition [0x0368f000]
java.lang.Thread.State: TIMED_WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x231b9ae0> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
at java.util.concurrent.locks.LockSupport.parkNanos(Unknown Source)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(Unknown Source)
at java.util.concurrent.DelayQueue.take(Unknown Source)
at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(Unknown Source)
at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.getTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Locked ownable synchronizers:
- None
"RMI TCP Connection(idle)" daemon prio=6 tid=0x02e4b400 nid=0x1608 waiting on condition [0x0363f000]
java.lang.Thread.State: TIMED_WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x231df420> (a java.util.concurrent.SynchronousQueue$TransferStack)
at java.util.concurrent.locks.LockSupport.parkNanos(Unknown Source)
at java.util.concurrent.SynchronousQueue$TransferStack.awaitFulfill(Unknown Source)
at java.util.concurrent.SynchronousQueue$TransferStack.transfer(Unknown Source)
at java.util.concurrent.SynchronousQueue.poll(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.getTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Locked ownable synchronizers:
- None
"RMI TCP Accept-0" daemon prio=6 tid=0x02b2e800 nid=0x128c runnable [0x035cf000]
java.lang.Thread.State: RUNNABLE
at java.net.PlainSocketImpl.socketAccept(Native Method)
at java.net.PlainSocketImpl.accept(Unknown Source)
- locked <0x231cf4e0> (a java.net.SocksSocketImpl)
at java.net.ServerSocket.implAccept(Unknown Source)
at java.net.ServerSocket.accept(Unknown Source)
at sun.management.jmxremote.LocalRMIServerSocketFactory$1.accept(Unknown Source)
at sun.rmi.transport.tcp.TCPTransport$AcceptLoop.executeAcceptLoop(Unknown Source)
at sun.rmi.transport.tcp.TCPTransport$AcceptLoop.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Locked ownable synchronizers:
- None
"Read Loop Thread" prio=6 tid=0x02f0f000 nid=0x964 runnable [0x0357e000]
java.lang.Thread.State: RUNNABLE
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(Unknown Source)
at sun.nio.cs.StreamDecoder.readBytes(Unknown Source)
at sun.nio.cs.StreamDecoder.implRead(Unknown Source)
at sun.nio.cs.StreamDecoder.read(Unknown Source)
- locked <0x230ef858> (a java.io.InputStreamReader)
at sun.nio.cs.StreamDecoder.read0(Unknown Source)
- locked <0x230ef858> (a java.io.InputStreamReader)
at sun.nio.cs.StreamDecoder.read(Unknown Source)
at java.io.InputStreamReader.read(Unknown Source)
at swank.util.io$read_chars__264.invoke(io.clj:10)
at swank.core.protocol$read_swank_message__298.invoke(protocol.clj:65)
at swank.core.connection$read_from_connection__315.invoke(connection.clj:59)
at swank.core$read_loop__654.invoke(core.clj:207)
at swank.swank$connection_serve__3088$fn__3156$fn__3158.invoke(swank.clj:39)
at clojure.lang.AFn.applyToHelper(AFn.java:171)
at clojure.lang.AFn.applyTo(AFn.java:164)
at clojure.core$apply__4370.invoke(core.clj:436)
at swank.swank$connection_serve__3088$fn__3156.doInvoke(swank.clj:36)
at clojure.lang.RestFn.invoke(RestFn.java:402)
at clojure.lang.AFn.run(AFn.java:37)
at java.lang.Thread.run(Unknown Source)
Locked ownable synchronizers:
- None
"Swank Control Thread" prio=6 tid=0x02f0b800 nid=0x4e8 waiting on condition [0x0352f000]
java.lang.Thread.State: WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x230ef968> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
at java.util.concurrent.locks.LockSupport.park(Unknown Source)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown Source)
at java.util.concurrent.LinkedBlockingQueue.take(Unknown Source)
at swank.util.concurrent.mbox$receive__408.invoke(mbox.clj:28)
at swank.core$control_loop__683.invoke(core.clj:258)
at swank.swank$connection_serve__3088$fn__3120$fn__3122.invoke(swank.clj:29)
at clojure.lang.AFn.applyToHelper(AFn.java:171)
at clojure.lang.AFn.applyTo(AFn.java:164)
at clojure.core$apply__4370.invoke(core.clj:436)
at swank.swank$connection_serve__3088$fn__3120.doInvoke(swank.clj:26)
at clojure.lang.RestFn.invoke(RestFn.java:402)
at clojure.lang.AFn.run(AFn.java:37)
at java.lang.Thread.run(Unknown Source)
Locked ownable synchronizers:
- None
"Call-on-write Stream" prio=6 tid=0x02f0fc00 nid=0x1584 waiting on condition [0x0309f000]
java.lang.Thread.State: TIMED_WAITING (sleeping)
at java.lang.Thread.sleep(Native Method)
at swank.util.io$call_on_flush_stream__269$fn__280.invoke(io.clj:35)
at clojure.lang.AFn.run(AFn.java:37)
at java.lang.Thread.run(Unknown Source)
Locked ownable synchronizers:
- None
"Low Memory Detector" daemon prio=6 tid=0x02aba400 nid=0x11c8 runnable [0x00000000]
java.lang.Thread.State: RUNNABLE
Locked ownable synchronizers:
- None
"CompilerThread0" daemon prio=10 tid=0x02ab4000 nid=0xca8 waiting on condition [0x00000000]
java.lang.Thread.State: RUNNABLE
Locked ownable synchronizers:
- None
"Attach Listener" daemon prio=10 tid=0x02ab2800 nid=0xe40 waiting on condition [0x00000000]
java.lang.Thread.State: RUNNABLE
Locked ownable synchronizers:
- None
"Signal Dispatcher" daemon prio=10 tid=0x02ab1400 nid=0x68c runnable [0x00000000]
java.lang.Thread.State: RUNNABLE
Locked ownable synchronizers:
- None
"Finalizer" daemon prio=8 tid=0x02a72800 nid=0x13c4 in Object.wait() [0x02c3f000]
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x22e803c0> (a java.lang.ref.ReferenceQueue$Lock)
at java.lang.ref.ReferenceQueue.remove(Unknown Source)
- locked <0x22e803c0> (a java.lang.ref.ReferenceQueue$Lock)
at java.lang.ref.ReferenceQueue.remove(Unknown Source)
at java.lang.ref.Finalizer$FinalizerThread.run(Unknown Source)
Locked ownable synchronizers:
- None
"Reference Handler" daemon prio=10 tid=0x02a6dc00 nid=0x1024 in Object.wait() [0x02bef000]
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x22e80448> (a java.lang.ref.Reference$Lock)
at java.lang.Object.wait(Object.java:485)
at java.lang.ref.Reference$ReferenceHandler.run(Unknown Source)
- locked <0x22e80448> (a java.lang.ref.Reference$Lock)
Locked ownable synchronizers:
- None
"main" prio=6 tid=0x002b7800 nid=0x155c runnable [0x0090f000]
java.lang.Thread.State: RUNNABLE
at java.io.FileInputStream.readBytes(Native Method)
at java.io.FileInputStream.read(Unknown Source)
at java.io.BufferedInputStream.read1(Unknown Source)
at java.io.BufferedInputStream.read(Unknown Source)
- locked <0x22e827c8> (a java.io.BufferedInputStream)
at sun.nio.cs.StreamDecoder.readBytes(Unknown Source)
at sun.nio.cs.StreamDecoder.implRead(Unknown Source)
at sun.nio.cs.StreamDecoder.read(Unknown Source)
- locked <0x22eb0cd8> (a java.io.InputStreamReader)
at java.io.InputStreamReader.read(Unknown Source)
at java.io.BufferedReader.fill(Unknown Source)
at java.io.BufferedReader.read(Unknown Source)
- locked <0x22eb0cd8> (a java.io.InputStreamReader)
at java.io.LineNumberReader.read(Unknown Source)
- locked <0x22eb0cd8> (a java.io.InputStreamReader)
at java.io.FilterReader.read(Unknown Source)
at java.io.PushbackReader.read(Unknown Source)
- locked <0x22eb0040> (a java.io.LineNumberReader)
at clojure.lang.LineNumberingPushbackReader.read(LineNumberingPushbackReader.java:40)
at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at clojure.lang.Reflector.invokeMatchingMethod(Reflector.java:90)
at clojure.lang.Reflector.invokeNoArgInstanceMember(Reflector.java:265)
at clojure.main$skip_whitespace__7367.invoke(main.clj:70)
at clojure.main$repl_read__7371.invoke(main.clj:91)
at clojure.main$repl__7385$read_eval_print__7397.invoke(main.clj:181)
at clojure.main$repl__7385.doInvoke(main.clj:200)
at clojure.lang.RestFn.invoke(RestFn.java:426)
at clojure.main$repl_opt__7431.invoke(main.clj:254)
at clojure.main$main__7466.doInvoke(main.clj:346)
at clojure.lang.RestFn.invoke(RestFn.java:413)
at clojure.lang.Var.invoke(Var.java:359)
at clojure.lang.AFn.applyToHelper(AFn.java:173)
at clojure.lang.Var.applyTo(Var.java:476)
at clojure.main.main(main.java:37)
Locked ownable synchronizers:
- None
"VM Thread" prio=10 tid=0x02a6c400 nid=0x134c runnable
"VM Periodic Task Thread" prio=10 tid=0x02abbc00 nid=0x1748 waiting on condition
JNI global references: 631
==========
Here's another thread dump of the same process, after shutting down
jvisualvm, using jstack:
==========
2010-01-02 11:00:12
Full thread dump Java HotSpot(TM) Client VM (14.3-b01 mixed mode, sharing):
"RMI TCP Connection(idle)" daemon prio=6 tid=0x02f74c00 nid=0x121c waiting on condition [0x0372f000]
java.lang.Thread.State: TIMED_WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x231df420> (a java.util.concurrent.SynchronousQueue$TransferStack)
at java.util.concurrent.locks.LockSupport.parkNanos(Unknown Source)
at java.util.concurrent.SynchronousQueue$TransferStack.awaitFulfill(Unknown Source)
at java.util.concurrent.SynchronousQueue$TransferStack.transfer(Unknown Source)
at java.util.concurrent.SynchronousQueue.poll(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.getTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
"JMX server connection timeout 22" daemon prio=6 tid=0x02f70400 nid=0x324 in Object.wait() [0x036df000]
java.lang.Thread.State: TIMED_WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x231e31d8> (a [I)
at com.sun.jmx.remote.internal.ServerCommunicatorAdmin$Timeout.run(Unknown Source)
- locked <0x231e31d8> (a [I)
at java.lang.Thread.run(Unknown Source)
"RMI Scheduler(0)" daemon prio=6 tid=0x02b4e000 nid=0x1430 waiting on condition [0x0368f000]
java.lang.Thread.State: TIMED_WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x231b9ae0> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
at java.util.concurrent.locks.LockSupport.parkNanos(Unknown Source)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(Unknown Source)
at java.util.concurrent.DelayQueue.take(Unknown Source)
at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(Unknown Source)
at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.getTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
"RMI TCP Accept-0" daemon prio=6 tid=0x02b2e800 nid=0x128c runnable [0x035cf000]
java.lang.Thread.State: RUNNABLE
at java.net.PlainSocketImpl.socketAccept(Native Method)
at java.net.PlainSocketImpl.accept(Unknown Source)
- locked <0x231cf4e0> (a java.net.SocksSocketImpl)
at java.net.ServerSocket.implAccept(Unknown Source)
at java.net.ServerSocket.accept(Unknown Source)
at sun.management.jmxremote.LocalRMIServerSocketFactory$1.accept(Unknown Source)
at sun.rmi.transport.tcp.TCPTransport$AcceptLoop.executeAcceptLoop(Unknown Source)
at sun.rmi.transport.tcp.TCPTransport$AcceptLoop.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
"Read Loop Thread" prio=6 tid=0x02f0f000 nid=0x964 runnable [0x0357e000]
java.lang.Thread.State: RUNNABLE
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(Unknown Source)
at sun.nio.cs.StreamDecoder.readBytes(Unknown Source)
at sun.nio.cs.StreamDecoder.implRead(Unknown Source)
at sun.nio.cs.StreamDecoder.read(Unknown Source)
- locked <0x230ef858> (a java.io.InputStreamReader)
at sun.nio.cs.StreamDecoder.read0(Unknown Source)
- locked <0x230ef858> (a java.io.InputStreamReader)
at sun.nio.cs.StreamDecoder.read(Unknown Source)
at java.io.InputStreamReader.read(Unknown Source)
at swank.util.io$read_chars__264.invoke(io.clj:10)
at swank.core.protocol$read_swank_message__298.invoke(protocol.clj:65)
at swank.core.connection$read_from_connection__315.invoke(connection.clj:59)
at swank.core$read_loop__654.invoke(core.clj:207)
at swank.swank$connection_serve__3088$fn__3156$fn__3158.invoke(swank.clj:39)
at clojure.lang.AFn.applyToHelper(AFn.java:171)
at clojure.lang.AFn.applyTo(AFn.java:164)
at clojure.core$apply__4370.invoke(core.clj:436)
at swank.swank$connection_serve__3088$fn__3156.doInvoke(swank.clj:36)
at clojure.lang.RestFn.invoke(RestFn.java:402)
at clojure.lang.AFn.run(AFn.java:37)
at java.lang.Thread.run(Unknown Source)
"Swank Control Thread" prio=6 tid=0x02f0b800 nid=0x4e8 waiting on condition [0x0352f000]
java.lang.Thread.State: WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x230ef968> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
at java.util.concurrent.locks.LockSupport.park(Unknown Source)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown Source)
at java.util.concurrent.LinkedBlockingQueue.take(Unknown Source)
at swank.util.concurrent.mbox$receive__408.invoke(mbox.clj:28)
at swank.core$control_loop__683.invoke(core.clj:258)
at swank.swank$connection_serve__3088$fn__3120$fn__3122.invoke(swank.clj:29)
at clojure.lang.AFn.applyToHelper(AFn.java:171)
at clojure.lang.AFn.applyTo(AFn.java:164)
at clojure.core$apply__4370.invoke(core.clj:436)
at swank.swank$connection_serve__3088$fn__3120.doInvoke(swank.clj:26)
at clojure.lang.RestFn.invoke(RestFn.java:402)
at clojure.lang.AFn.run(AFn.java:37)
at java.lang.Thread.run(Unknown Source)
"Call-on-write Stream" prio=6 tid=0x02f0fc00 nid=0x1584 waiting on condition [0x0309f000]
java.lang.Thread.State: TIMED_WAITING (sleeping)
at java.lang.Thread.sleep(Native Method)
at swank.util.io$call_on_flush_stream__269$fn__280.invoke(io.clj:35)
at clojure.lang.AFn.run(AFn.java:37)
at java.lang.Thread.run(Unknown Source)
"Low Memory Detector" daemon prio=6 tid=0x02aba400 nid=0x11c8 runnable [0x00000000]
java.lang.Thread.State: RUNNABLE
"CompilerThread0" daemon prio=10 tid=0x02ab4000 nid=0xca8 waiting on condition [0x00000000]
java.lang.Thread.State: RUNNABLE
"Attach Listener" daemon prio=10 tid=0x02ab2800 nid=0xe40 waiting on condition [0x00000000]
java.lang.Thread.State: RUNNABLE
"Signal Dispatcher" daemon prio=10 tid=0x02ab1400 nid=0x68c runnable [0x00000000]
java.lang.Thread.State: RUNNABLE
"Finalizer" daemon prio=8 tid=0x02a72800 nid=0x13c4 in Object.wait() [0x02c3f000]
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x22e803c0> (a java.lang.ref.ReferenceQueue$Lock)
at java.lang.ref.ReferenceQueue.remove(Unknown Source)
- locked <0x22e803c0> (a java.lang.ref.ReferenceQueue$Lock)
at java.lang.ref.ReferenceQueue.remove(Unknown Source)
at java.lang.ref.Finalizer$FinalizerThread.run(Unknown Source)
"Reference Handler" daemon prio=10 tid=0x02a6dc00 nid=0x1024 in Object.wait() [0x02bef000]
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x22e80448> (a java.lang.ref.Reference$Lock)
at java.lang.Object.wait(Object.java:485)
at java.lang.ref.Reference$ReferenceHandler.run(Unknown Source)
- locked <0x22e80448> (a java.lang.ref.Reference$Lock)
"main" prio=6 tid=0x002b7800 nid=0x155c runnable [0x0090f000]
java.lang.Thread.State: RUNNABLE
at java.io.FileInputStream.readBytes(Native Method)
at java.io.FileInputStream.read(Unknown Source)
at java.io.BufferedInputStream.read1(Unknown Source)
at java.io.BufferedInputStream.read(Unknown Source)
- locked <0x22e827c8> (a java.io.BufferedInputStream)
at sun.nio.cs.StreamDecoder.readBytes(Unknown Source)
at sun.nio.cs.StreamDecoder.implRead(Unknown Source)
at sun.nio.cs.StreamDecoder.read(Unknown Source)
- locked <0x22eb0cd8> (a java.io.InputStreamReader)
at java.io.InputStreamReader.read(Unknown Source)
at java.io.BufferedReader.fill(Unknown Source)
at java.io.BufferedReader.read(Unknown Source)
- locked <0x22eb0cd8> (a java.io.InputStreamReader)
at java.io.LineNumberReader.read(Unknown Source)
- locked <0x22eb0cd8> (a java.io.InputStreamReader)
at java.io.FilterReader.read(Unknown Source)
at java.io.PushbackReader.read(Unknown Source)
- locked <0x22eb0040> (a java.io.LineNumberReader)
at clojure.lang.LineNumberingPushbackReader.read(LineNumberingPushbackReader.java:40)
at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at clojure.lang.Reflector.invokeMatchingMethod(Reflector.java:90)
at clojure.lang.Reflector.invokeNoArgInstanceMember(Reflector.java:265)
at clojure.main$skip_whitespace__7367.invoke(main.clj:70)
at clojure.main$repl_read__7371.invoke(main.clj:91)
at clojure.main$repl__7385$read_eval_print__7397.invoke(main.clj:181)
at clojure.main$repl__7385.doInvoke(main.clj:200)
at clojure.lang.RestFn.invoke(RestFn.java:426)
at clojure.main$repl_opt__7431.invoke(main.clj:254)
at clojure.main$main__7466.doInvoke(main.clj:346)
at clojure.lang.RestFn.invoke(RestFn.java:413)
at clojure.lang.Var.invoke(Var.java:359)
at clojure.lang.AFn.applyToHelper(AFn.java:173)
at clojure.lang.Var.applyTo(Var.java:476)
at clojure.main.main(main.java:37)
"VM Thread" prio=10 tid=0x02a6c400 nid=0x134c runnable
"VM Periodic Task Thread" prio=10 tid=0x02abbc00 nid=0x1748 waiting on condition
JNI global references: 675
==========
--
Steven E. Harris
>> installation from ELPA, and William Douglas is working on adding fuzzy
>> completion to that. It's highly recommended that you follow this
>
> I will, if it will work.
>
>> approach rather than copying and pasting several pages of one-off
>> configuration. For instance, adding jline to your classpath is redundant
>> if you're using slime.
>
> Where do you see "several pages"? I don't like this error-prone manual
> work, but so far only this work for me, that's why I showed this.
Sorry, I didn't mean to be dismissive, just to suggest that you try to
communicate with him to solve this problem as I believe the solution
he's working on is the cleanest for moving forward.
-Phil
> In the meantime, I'll continue the investigation.
And yet more information: Apparently it's not critical to call on the
RuntimeMXBean#getName() method specifically to kick the Swank thread out
of its blocking call; just about /any call on a Java method/ from the
Clojure REPL will unblock the Swank thread and make the connection
complete.
For example, I've tried calling
java.util.concurrent.Executors#newSingleThreadExecutor()
java.util.Collections#emptySet()
java.lang.Math#max()
and both work to unblock the Swank thread, but this one does not:
java.lang.Integer#parseInt()
Now get this: Right before the SLIME-Swank connection completes, Emacs
beeps and prints the following two lines in the *Messages* buffer:
,----
| error in process filter: cond: etypecase failed: defun, (number cons string)
| error in process filter: etypecase failed: defun, (number cons string)
`----
Those errors messages come from the ELisp evaluator. Strangely, I can't
find any etypecase or typecase form in file slime.el that tolerates all
three of those types (number, cons, and string), so it's hard to figure
out where the error is arising.
--
Steven E. Harris
Perhaps it would be best to paste such dumps somewhere, rather than
mail to the entire list?
Thanks,
Rich
Might I suggest
?
> Perhaps it would be best to paste such dumps somewhere, rather than
> mail to the entire list?
I'll do that next time. Sorry for the noise.
--
Steven E. Harris
> Now get this: Right before the SLIME-Swank connection completes, Emacs
> beeps and prints the following two lines in the *Messages* buffer:
>
> ,----
> | error in process filter: cond: etypecase failed: defun, (number cons string)
> | error in process filter: etypecase failed: defun, (number cons string)
> `----
I caught the Emacs debugger trace here:
http://paste.lisp.org/display/92936
It looks to be a problem parsing the indentation recommendations sent
from Swank.
--
Steven E. Harris
Do you use "slime-indentation.el" in your configuration?
I can see in this trace "define-cl-indent" function, which is not
defined in my configuration.
I added this line to my configuration:
(require 'slime-indentation)
and now I have almost the same problem as you:
"""
Polling "/tmp/slime.5593".. (Abort with `M-x slime-abort-connection'.) [32 times]
Connecting to Swank on port 57580.. [2 times]
error in process filter: cond: etypecase failed: defun, (number cons string)
error in process filter: etypecase failed: defun, (number cons string)
"""
As a matter of fact *slime repl* still works for me, but I have
different environment.
HTH,
Rob
> Do you use "slime-indentation.el" in your configuration?
Yes. It turns out that I have another Lisp-related initialization file
that contained the following form:
,----
| (slime-setup '(slime-fancy
| slime-asdf
| slime-fontifying-fu
| slime-indentation
| slime-indentation-fu
| slime-banner))
`----
Removing the indentation-related entries fixed the `etypecase' Elisp
error. Unfortunately, the SLIME-Swank handshake still doesn't complete
(and hence the SLIME REPL doesn't start up) without the aforementioned
prodding.
--
Steven E. Harris
> Here's the stack:
>
> o swank-clojure
> Git head.
>
> o SLIME
> Both CVS head and git://git.boinkor.net/slime.git head behave the same
> way, as the offending calls are in swank-clojure.
Could you try installing SLIME via ELPA as recommended in the
swank-clojure readme? CVS head is known to have introduced
incompatibilities with Clojure.
-Phil
> Could you try installing SLIME via ELPA as recommended in the
> swank-clojure readme?
That will be a project I'll have to defer until the weekend, as I've
never used ELPA. I use the CVS SLIME almost daily for Common Lisp work,
so I'm reluctant to give it up. Also, it's not a tenable situation to
fork SLIME for Clojure support.
> CVS head is known to have introduced incompatibilities with Clojure.
Is the git repository at git://git.boinkor.net/slime.git just tracking
the CVS repository, or is that the same as the ELPA-hosted one? I did
try all of this with the git version and found the exact same behavior
as with the CVS version.
--
Steven E. Harris
>> Could you try installing SLIME via ELPA as recommended in the
>> swank-clojure readme?
>
> That will be a project I'll have to defer until the weekend, as I've
> never used ELPA. I use the CVS SLIME almost daily for Common Lisp work,
> so I'm reluctant to give it up. Also, it's not a tenable situation to
> fork SLIME for Clojure support.
If someone would volunteer to fix it, I'd be thrilled. Nobody who is
interested in using CL and Clojure at the same time has stepped forward
so far, which is why it's currently broken.
>> CVS head is known to have introduced incompatibilities with Clojure.
>
> Is the git repository at git://git.boinkor.net/slime.git just tracking
> the CVS repository, or is that the same as the ELPA-hosted one? I did
> try all of this with the git version and found the exact same behavior
> as with the CVS version.
Yes, that git repo is just a mirror of CVS.
-Phil
I don't want to have to use ELPA, or maven, or some other configuration management thing to get basic tools like an editing environment for the language up and running. Perhaps I should just bite the bullet and use the crazy configuration/package management things that the clojure community seems so enamored of (ELPA, maven, leiningen, etc...), but in the way I'm used to doing things, nothing more than the source code and a fairly simple system definition tool (like ASDF) are enough to get things done. It's not too say that there's room for improvement, but I like it when simple tools get the job done and I don't need to rely on a bunch of shell scripts, to have to modify classpaths, restart JVMs, etc... to get the code I want loaded. Perhaps I'm just ignorant of the proper clojure-y way to do things, so I'll hop off my soapbox now.
cyrus
> --
> 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 think I'm pretty familiar with the Clojure-y way to do things, and I
also close the tab when I see "... using Maven".
My setup is:
* Installing some trivial Emacs stuff through ELPA (but not all: e.g.,
some packages fail to build). I'm a recent Emacs convert, so this
seemed easy.
* Building swank-clojure myself.
* Installing the Emacs side myself the old-fashioned way.
* Storing my stuff in git.
* Building jars using ant.
* Launching the appropriate swank server with the right classpath
using a generic 'swank-clj' script that understands the same .clojure
files as my 'clj' script.
No Maven, little ELPA, no Clojure project-building scripts, nothing
swank-related configured through emacs. I don't like libraries which
want to download their own dependency jars: most projects on which I
work integrate at least a dozen libraries, many of which share
dependencies (Commons Logging, for example), and I inevitably need to
manage those myself. Neither do I want a tool to download a Clojure
jar for me: I manage that myself, because I want to keep up-to-date,
and I need to maintain patches against contrib.
Every time I've tried to use Maven I've given up in disgust as it
downloaded hundreds of megs of jars I already had, and didn't want to
have to manually re-package for my company's existing deployment
infrastructure.
Ah, Java.
> If someone would volunteer to fix it, I'd be thrilled. Nobody who is
> interested in using CL and Clojure at the same time has stepped
> forward so far, which is why it's currently broken.
Can you characterize what needs to be fixed?
--
Steven E. Harris
I am alien to the Java world and haven't still embrased ELPA, lein and
other tools. Here is my setup which works fine for me:
o. slime
git://git.boinkor.net/slime.git
o. swank-clojure
git://github.com/jochu/swank-clojure.git
o. clojure-mode
git://github.com/jochu/clojure-mode.git
It has worked quite nicely for me until now. I also discovered the
other branch of swank-clojure, which seem to be what people are using
more. I see that it does things like downloading jars etc etc. I would
rather like it to leave them for other tools to do. I have no problem
installing emacs scripts by hand. If so, I wouldn't be using it
anyway, so I just don't see why ELPA and the other swank-clojure
branch is trying to do things that other tools are supposed to do.
--
Ramakrishnan
I would agree that it would be nice to have the option of installing
packages oneself, since if an automatic package management system is
relied on, and it fails, it can be very difficult to figure out how to
fix things.
On Jan 8, 1:03 am, Ramakrishnan Muthukrishnan <vu3...@gmail.com>
wrote:
There was some discussion about it a couple months ago:
http://groups.google.com/group/clojure/browse_thread/thread/3e5f416e3f2a1884
Unfortunately I don't have the resources to pursue it myself.
-Phil
> There was some discussion about it a couple months ago:
I picked up the torch today, in hope that others will try again for a
better resolution:
http://thread.gmane.org/gmane.lisp.slime.devel/9178/focus=9383
--
Steven E. Harris
>> There was some discussion about it a couple months ago:
>
> I picked up the torch today, in hope that others will try again for a
> better resolution:
>
> http://thread.gmane.org/gmane.lisp.slime.devel/9178/focus=9383
Thanks for digging. I'll keep this around to show to anyone else in the
future who might be inclined to go further with it.
-Phil
I am using the ELPA installation method, it's working well via the
automatic install. Thank you for providing this.
The installed packages:
clojure-mode-1.6
slime-20091016
slime-repl-20091016
swank-clojure-1.1.0
include snapshots of slime and slime/contrib/slime-repl.el. Will these
be merged with upstream slime soon?
I would like to track the repository versions of clojure, clojure-
contrib, clojure-mode, slime(-repl) and swank-clojure, using the ELPA
configuration as a guide.
Thanks
Jeff
I spoke with the slime maintainers about merging my changes, but they
weren't interested. The changes were pretty minor though.
> I would like to track the repository versions of clojure, clojure-
> contrib, clojure-mode, slime(-repl) and swank-clojure, using the ELPA
> configuration as a guide.
Upstream slime is not compatible with swank-clojure, so unless you do
a lot of CL work I would strongly recommend against this. There have
been a number of threads discussing this in the past; if you're
interested in fixing this I could provide further information.
-Phil
> Upstream slime is not compatible with swank-clojure
I find this not to be true at present, the stilted SLIME/Swank
connection problem¹ and disabling autodoc mode notwithstanding.
Footnotes:
¹ http://thread.gmane.org/gmane.comp.java.clojure.user/24894/focus=24956
--
Steven E. Harris
Yes, I too use slime upstream and avoid elpa. I can't seem to get auto
completion to work with Java functions which some folks on the irc
said they could. Otherwise it works fine for me.
--
Ramakrishnan