Robert Brown writes:
Recently, I've been running a Lisp-based server on a batch scheduling system. The scheduler starts up my server on an available machine and then I'd like to connect to it with Slime. I've noticed two things:
- The code in swank.lisp listens on port 127.0.0.1 http://127.0.0.1,
which means I cannot connect to my Lisp server from a remote machine. I must log in to the host it's running on and then specify "localhost" when I execute slime-connect in Emacs. If swank is running on host "foo", why doesn't it bind its listening socket with foo's address?
To prevent any random machine on the internet from being able to connect to and control your running Lisp. This is a feature, not a shortcomming; some people use slime to control lisp-based webservers.
- I modified swank.lisp so the server code binds its listening connection
socket with foo's address. Now I can connect from a remote machine. Is there any convenient way to send whole files across the Slime connection? The Lisp running the swank server has no NFS access to the machine I'm running Emacs on. I'd like to be able to edit files on the Emacs side and send then whole to the Lisp running swank.
The normal way to do this is to run the lisp on a remote machine, and ssh to it, tunneling the swank comminications port. You can use a local emacs to edit remote files by using tramp (an emacs package). If you create appropriate functions for slime-translate-from-lisp-filename-function and slime-translate-to-lisp-filename-function, you can use C-c C-k and M-. and all the other slime commands as you normally would.