[slime-devel] Re: New listener

Helmut Eller heller at common-lisp.net
Mon Jan 29 23:39:08 UTC 2007

* Liam Healy [2007-01-28 19:33+0100] writes:

> Missing the old Symblics Select-L and Select-Control-L, I put together
> the following which will create a new listener and cycle through
> (forward or backward) the existing listeners.
> Comments welcome; I'm curious to know how to get slime-new-listener to
> work when the current listener is busy, because my main usage of a
> second listener is to do something while the first listener is busy,
> and unless I remember to open the second listener in advance, I'm
> still stuck.

Opening a new connection to create a new listener works (modulo bugs
in swank.lisp), but it is a rather heavy-weight approach. 

Alternatively you could spawn a second repl thread and set
slime-current-thread appropriately.  This approach requires some
changes on the Lisp side and likely to the protocol (probably some way
to output streams to different buffers).  But it would be more in line
with the rest of the design and it would be useful if we ever want to
implement something like a "listener for the currently debugged
thread" or a "listener for the currently inspected object".

As for busy listeners: for a single threaded Lisp that's obviously a
hard to solve problem, but it doesn't seem so difficult for multi
threaded Lisps.  (Well, if we ignore the usual problems of concurrent
CL programs.)

[For a multi-threaded Lisp, Emacs doesn't talk to the listener thread
directly.  We have a "control thread" which dispatches the messages to
the appropriate thread.  The control thread is supposed to answer
quickly, i.e. it never executes arbitrary user code.]

BTW, for multi threaded lisp, C-c : and C-x e always creates a new
thread and can also be used if the listener is busy.


More information about the slime-devel mailing list