5.3 Multiple connections

SLIME is able to connect to multiple Lisp processes at the same
time. The M-x slime command, when invoked with a prefix
argument, will offer to create an additional Lisp process if one is
already running. This is often convenient, but it requires some
understanding to make sure that your SLIME commands execute in the
Lisp that you expect them to.

Some buffers are tied to specific Lisp processes. Each Lisp connection
has its own REPL buffer, and all expressions entered or
SLIME commands invoked in that buffer are sent to the associated
connection. Other buffers created by SLIME are similarly tied to
the connections they originate from, including SLDB buffers,
apropos result listings, and so on. These buffers are the result of
some interaction with a Lisp process, so commands in them always go
back to that same process.

Commands executed in other places, such as slime-mode source
buffers, always use the “default” connection. Usually this is the
most recently established connection, but this can be reassigned via
the “connection list” buffer:

C-c C-x c

M-x slime-list-connections

Pop up a buffer listing the established connections. It is also
available by the typing c from the SLIME selector
(slime-selector).

C-c C-x n

M-x slime-cycle-connections

Change current Lisp connection by cycling through all connections. It
is also available by the typing n from the SLIME selector
(slime-selector).

C-c C-x t

M-x slime-list-threads

Pop up a buffer listing the current threads. It is also available by
the typing t from the SLIME selector (slime-selector).

The buffer displayed by slime-list-connections gives a one-line
summary of each connection. The summary shows the connection’s serial
number, the name of the Lisp implementation, and other details of the
Lisp process. The current “default” connection is indicated with an
asterisk.

The commands available in the connection-list buffer are:

RET

M-x slime-goto-connection

Pop to the REPL buffer of the connection at point.

d

M-x slime-connection-list-make-default

Make the connection at point the “default” connection. It will then
be used for commands in slime-mode source buffers.