Hi!
Attention: Question shows again my complete Emacs ignorance.
I've recently begun to use the combination mentioned in the subject. I use a setup as described by Bill Clementson which mainly looks like this:
(global-set-key [(f6)] '(lambda () (interactive) (shell-command "c:/PROGRA~1/acl70/alisp.exe +B +cm -L ~/.slime.lisp&") (slime-connect "localhost" 4005)))
This works fine most of the time but sometimes fails with
Connecting to Swank on port 4005.. open-network-stream: make client process failed: connection refused, :name, SLIME Lisp, :buffer, nil, :host, localhost, :service, 4005
which obviously happens if AllegroCL is not quite ready to accept connections when SLIME tries to connect. I can fix this with adding something like sit-for before the call to slime-connect but either I wait too long which makes the call unnecessary slow or I'm still in a time frame where the error described above can happen.
Question: Can I replace the call to sit-for with something that waits until AllegroCL is ready? Or is there a better solution to start AllegroCL from SLIME under Windows?
Thanks, Edi.
Edi Weitz edi@agharta.de writes:
(global-set-key [(f6)] '(lambda () (interactive) (shell-command "c:/PROGRA~1/acl70/alisp.exe +B +cm -L ~/.slime.lisp&")
(while (not (ignore-erorrs (progn (slime-connect "localhost" 4005) t))) (sit-for 0.2))
.. might do the trick. (sorry, not tested.)
On 22 Feb 2005 08:32:46 +0100, Luke Gorrie luke@synap.se wrote:
(while (not (ignore-erorrs (progn (slime-connect "localhost" 4005) t))) (sit-for 0.2))
.. might do the trick. (sorry, not tested.)
Seems to work. Thanks!
Edi Weitz edi@agharta.de writes:
Hi!
Attention: Question shows again my complete Emacs ignorance.
I've recently begun to use the combination mentioned in the subject. I use a setup as described by Bill Clementson which mainly looks like this:
(global-set-key [(f6)] '(lambda () (interactive) (shell-command "c:/PROGRA~1/acl70/alisp.exe +B +cm -L ~/.slime.lisp&") (slime-connect "localhost" 4005)))
This works fine most of the time but sometimes fails with
Connecting to Swank on port 4005.. open-network-stream: make client process failed: connection refused, :name, SLIME Lisp, :buffer, nil, :host, localhost, :service, 4005
which obviously happens if AllegroCL is not quite ready to accept connections when SLIME tries to connect. I can fix this with adding something like sit-for before the call to slime-connect but either I wait too long which makes the call unnecessary slow or I'm still in a time frame where the error described above can happen.
totally untested idea: try removing the slime-connet from that lambda and add a call to run-command (or whatever allegro uses) which calls emacsclient like so:
emacsclient --no-wait -e '(slime-connect "localhost" 4005)'
"Marco Baringer" mb@bese.it writes:
totally untested idea: try removing the slime-connet from that lambda and add a call to run-command (or whatever allegro uses) which calls emacsclient like so:
emacsclient --no-wait -e '(slime-connect "localhost" 4005)'
p.s. - obviously the run-command form goes in .slime.lisp or whatever lisp startup file you're using.
On Tue, 22 Feb 2005 16:38:36 +0100, "Marco Baringer" mb@bese.it wrote:
totally untested idea: try removing the slime-connet from that lambda and add a call to run-command (or whatever allegro uses) which calls emacsclient like so:
emacsclient --no-wait -e '(slime-connect "localhost" 4005)'
Thanks, that's also an interesting idea which I'll keep in mind. I'm happy with Luke's solution, though.
Cheers, Edi.
Edi Weitz edi@agharta.de writes:
Hi!
Attention: Question shows again my complete Emacs ignorance.
I've recently begun to use the combination mentioned in the subject. I use a setup as described by Bill Clementson which mainly looks like this:
(global-set-key [(f6)] '(lambda () (interactive) (shell-command "c:/PROGRA~1/acl70/alisp.exe +B +cm -L ~/.slime.lisp&") (slime-connect "localhost" 4005)))
This works fine most of the time but sometimes fails with
Connecting to Swank on port 4005.. open-network-stream: make client process failed: connection refused, :name, SLIME Lisp, :buffer, nil, :host, localhost, :service, 4005
which obviously happens if AllegroCL is not quite ready to accept connections when SLIME tries to connect. I can fix this with adding something like sit-for before the call to slime-connect but either I wait too long which makes the call unnecessary slow or I'm still in a time frame where the error described above can happen.
Question: Can I replace the call to sit-for with something that waits until AllegroCL is ready? Or is there a better solution to start AllegroCL from SLIME under Windows?
Not having a Windows box to play with, I haven't gotten around to trying SLIME on Windows. What's the reason it doesn't Just Work? Is it Allegro specific?
-Peter
Peter Seibel peter@gigamonkeys.com writes:
Not having a Windows box to play with, I haven't gotten around to trying SLIME on Windows. What's the reason it doesn't Just Work? Is it Allegro specific?
I don't have Windows either and have generally been happy that people have looked after themselves in this respect :-)
I think it's mostly simple. Here is what SLIME wants to do:
1. Open a lisp in *inferior-lisp* 2. Send Lisp forms directly to the REPL asking it to load/start Swank 3. Poll a /tmp file until swank writes its port number there 4. Read the port number and connect
but some Windows Lisps are GUI beasts and don't want to run under *inferior-lisp* so they won't work this way.
So instead one has to do something like Edi did:
1. Start Lisp as a GUI program with an argument telling it to start Swank 2. Loop doing `slime-connect' on a well-known-port until we manage to connect to the asynchronously-starting server.
and this could perhaps be rolled into SLIME proper as an alternative startup flow and tested/used on Unix.
This is probably not the full story though. There has been VBscript flying around and I haven't understood what it's upto.
-Luke
I've been using SLIME with Allegro 6.2 and 7.0 under Windows for some time. My problem was only a startup delay launching the GUI application, reading the swank code and starting the server. My lisp init file sets the port # to connect so calling slime-connect works fine if I just delay the connect until the server is ready. Your mileage may vary (different systems take different startup time). I always use F5 instead of M-x slime to start up the system.
From slime.el: (global-set-key [(f5)] '(lambda () (interactive) (start-process "acl" nil "c:/Progra~1/acl70/clim.exe" "+B" "+M" "+cn" "-I" "clim.dxl") ;; "-d" "allegro-log.txt") (delete-other-windows) ;; Give time for loading to happen and server to start (sleep-for 5) (slime-connect "localhost" 4005) (slime-set-default-directory "c:/Work/think/trunk/")))
From slime.lisp: (load "c:/Work/Think/trunk/lisp/slime/swank-loader.lisp") (swank::create-swank-server 4005 :spawn #'swank::simple-announce-function t)
Ian
Luke Gorrie wrote:
Peter Seibel peter@gigamonkeys.com writes:
Not having a Windows box to play with, I haven't gotten around to trying SLIME on Windows. What's the reason it doesn't Just Work? Is it Allegro specific?
I don't have Windows either and have generally been happy that people have looked after themselves in this respect :-)
I think it's mostly simple. Here is what SLIME wants to do:
- Open a lisp in *inferior-lisp*
- Send Lisp forms directly to the REPL asking it to load/start Swank
- Poll a /tmp file until swank writes its port number there
- Read the port number and connect
but some Windows Lisps are GUI beasts and don't want to run under *inferior-lisp* so they won't work this way.
So instead one has to do something like Edi did:
- Start Lisp as a GUI program with an argument telling it to start Swank
- Loop doing `slime-connect' on a well-known-port until we manage to connect to the asynchronously-starting server.
and this could perhaps be rolled into SLIME proper as an alternative startup flow and tested/used on Unix.
This is probably not the full story though. There has been VBscript flying around and I haven't understood what it's upto.
-Luke
slime-devel site list slime-devel@common-lisp.net http://common-lisp.net/mailman/listinfo/slime-devel
On Thu, 24 Feb 2005 12:13:12 -0500, Ian Eslick eslick@csail.mit.edu wrote:
(sleep-for 5)
See Luke's email earlier in this thread for a better solution. This was actually the reason I started the whole thread... :)
On 24 Feb 2005 18:04:49 +0100, Luke Gorrie luke@synap.se wrote:
This is probably not the full story though. There has been VBscript flying around and I haven't understood what it's upto.
That is just a workaround for the LW Personal Edition because it doesn't read its init file ~/.lispworks.