[slime-devel] updating slime during idle time

Helmut Eller heller at common-lisp.net
Sat May 28 07:32:17 UTC 2005


Chris Baker <electro at 1939worldsfair.com> writes:

> Hi Slimers,
>
> I've recently started running slime with clisp on windows.  This works
> great for most things, but now I'm starting to do windows gui
> programming, and windows wants each program to have it's own event
> loop, which interferes with slime, which has its own server update
> loop.  Unfortunately, clisp is single threaded, so I can only update
> windows events or update slime requests at a given time.  Is there a
> function I can call periodically to process slime requests at idle
> time?  Or alternately, can I add a hook to swank so I can pump windows
> events when slime isn't processing anything?

There's little special support for this.

You could call something like 

  (process-available-input (connection.socket-io *connection*)
                           #'read-from-emacs)

at idle time.  process-available-input uses cl:listen to decide
whether there is any remaining input.  Let's hope that listen does
what we want.  CLISP's socket:socket-status might also be handy for
your purposes.

Note that *connection* must be bound before you call read-from-emacs,
so this approach only works if you start SLIME first and your windows
event pump runs inside SLIME.

If you need something more complicated have a look at
swank:install-fd-handler.

Helmut.



More information about the slime-devel mailing list