[slime-devel] Problems with slime using sbcl on winXP (emacsW32)

Thomas Karolski thomas.karolski at googlemail.com
Fri Dec 5 21:04:15 UTC 2008

Helmut Eller schrieb:
> Does READ-CHAR-NO-HANG work properly on socket streams?
> There is a comment in HANDLE-LISTEN (in win32.lisp)
Not sure - how could I test that? I think it should work on gray 
streams, but I'm not sure what slime is using.
> I suspect that WAIT-FOR-EVENT/EVENT-LOOP (in swank.lisp) blocks even
> though the timeout argument is t.  To see if that's actually the case,
> you could generate some debug output in WAIT-FOR-EVENT/EVENT-LOOP.  It's
> the easiest if you use LOG-EVENT for that.
Changed wait-for-event/event-loop into:
(defun wait-for-event/event-loop (pattern timeout)
  (assert (or (not timeout) (eq timeout t)))
  (log-event "wait-for-event/event-loop: ~s ~s~%" pattern timeout)
  (let ((r (loop 
            (let ((event (poll-for-event pattern)))
              (when event (return (car event))))
            (log-event "pre wait-for-input~%")
            (let ((events-enqueued *events-enqueued*)
                  (ready (wait-for-input (list (current-socket-io)) 
              (log-event "after wait-for-input~%")
              (cond ((and timeout (not ready))
                     (return (values nil t)))
                    ((or (/= events-enqueued *events-enqueued*)
                         (eq ready :interrupt))
                     ;; rescan event queue, interrupts may enqueue new 
                     (assert (equal ready (list (current-socket-io))))
                     (dispatch-event (decode-message 
    (log-event "-wait-for-event/event-loop: ~s~%" r)
I attached the new *inferior-lisp* buffer.
The last message is "pre wait-for-input", which indicates that its 
hanging inside wait-for-input. I also tried putting a log-event before 
read-char-no-hang inside wait-for-input, but that didn't seem to get 
logged for some reason.
Seeing this I guess you're right. Is there any way to work around this 
issue? - it does work for earlier calls to wait-for-input after all 
(though those all don't have a timeout).

Thomas K.

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: sbcl-repl-not-coming-back-inferior-lisp-log2.txt
URL: <https://mailman.common-lisp.net/pipermail/slime-devel/attachments/20081205/6df3e5e4/attachment.txt>

More information about the slime-devel mailing list