[slime-devel] Re: Problems with swank connection

Helmut Eller heller at common-lisp.net
Tue Jun 13 19:41:41 UTC 2006


* Henda Carvalho [2006-06-13 19:35+0200] writes:

> I changed the code to:
>
> (save-current-buffer
>   (slime-disconnect)
>   (if (get-buffer "*inferior-lisp*")
>       (kill-buffer "*inferior-lisp*"))
>   (slime)
>   (while (not (slime-connected-p))
>     (sleep-for 1)))

I could be wrong, but I think sleep-for doesn't do what you think it
does.  In particular, sleep-for doesn't call timer functions, which is
needed to toggle the connected-p flag.  Try sit-for instead.

Consider something like:

(lexical-let ((hook nil) (done nil))
  (setq hook (lambda ()
                (remove-hook 'slime-connected-hook hook)
                (setq done t)))
  (add-hook 'slime-connected-hook hook)
  (slime)
  (while (not done)
    (sit-for 1)))

>
> and it stays in the 'while' loop for more than 5 minutes (i "only" waited 5
> minutes), meaning that 'slime-connected-p' is returning 'nil'...
>
> Can you tell why i can't make the connection?
>

Again I could be wrong, but apparently you are trying to restart the
Lisp process and connecting to it.  Have a look at
slime-restart-inferior-lisp(-aux) to see how to properly kill the
process.

Helmut.



More information about the slime-devel mailing list