0
votes

I am still a novice when it comes to working with emacs and slime.

I was wondering if there is a way to start a lisp (say SBCL) on a local port and then connect multiple different slime sessions to it?

For example, if I am using tmux/screen and want to have different emacs sessions between each window, would I be able to connect all the slime instances to the same lisp so that all the emacs sessions were sharing a repl allowing me to compile in any of the emacs sessions and the one running repl will have those changes?

2

2 Answers

2
votes

I am using LispWorks 6.1 32 bit Professional Edition. I prefer to use (Spac)emacs for my editing in multiple tmux sessions, one session for each project that I work on.

These are the steps I follow:

  1. Start LispWorks Listener REPL.

  2. Load swank without going through the emacs route:

    (load "/path/to/swank-loader.lisp")
    (swank-loader:init)
    (setf swank:*use-dedicated-output-stream* nil)
    (swank:create-server :port 4005  :dont-close t)
    
  3. Then in my iTerm tab with tmux session for some project 1, I do M-x slime- connect and connect to host and port as in step 2.

  4. Repeat step 3 for another tmux session with another lisp project code.

With this setup I can load code from multiple projects I am working on in the same lisp image. So far I have not found any major problems while doing so.

0
votes

This depends on the lisp system you're using, on the features it supports, i.e. whether your SBCL has multi-threading enabled (cf. (member :sb-thread *features*) and on the setting of SWANK:*COMMUNICATION-STYLE*, cf. the Slime docs.