When you want to load swank without going through the normal, Emacs based, process just load the swank-loader.lisp file. Just execute
(load "/path/to/swank-loader.lisp") (swank-loader:init)
inside a running lisp image1. Now all we need to do is startup our swank server. The first example assumes we're using the default settings.
(swank:create-server)
Since we're going to be tunneling our connection via ssh2 and we'll only have one port open we want to tell swank to not use an extra connection for output (this is actually the default in current SLIME):
(setf swank:*use-dedicated-output-stream* nil)
If you need to do anything particular
(like be able to reconnect to swank after you're done), look into
swank:create-server
's other arguments. Some of these arguments
are
:PORT
:STYLE
:DONT-CLOSE
NIL
). For “long-running” lisp processes
to which you want to be able to connect from time to time,
specify :dont-close t
:CODING-SYSTEM
So the more complete example will be
(swank:create-server :port 4005 :dont-close t :coding-system "utf-8-unix")
On the emacs side you will use something like
(setq slime-net-coding-system 'utf-8-unix) (slime-connect "127.0.0.1" 4005))
to connect to this lisp image from the same machine.