help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Understanding slime and swank


From: Tim X
Subject: Re: Understanding slime and swank
Date: Tue, 04 May 2010 15:41:45 -0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.93 (gnu/linux)

Andrea Crotti <andrea.crotti.0@gmail.com> writes:

> Eric Abrahamsen <girzel@gmail.com> writes:
>
>> On Mar 2, 2010, at 9:40 PM, Andrea Crotti wrote:
>> Are you looking for slime-lisp-implementations? The example from the
>> docs looks like this:
>>
>> (setq slime-lisp-implementations
>>            '((cmucl ("cmucl" "-quiet"))
>>              (sbcl ("/opt/sbcl/bin/sbcl") :coding-system utf-8-unix)))
>>
>> The one at top will be default, I think you run slime with a prefix
>> arg to autocomplete choose from different implementations.
>>
>
> mm no I didn't mean that...
> I would like to use this:
> http://github.com/jochu/swank-clojure
>
> And also switch to other lisp implementations.
> It's not very clear how I should do, they also say to add this
> (add-to-list 'slime-lisp-implementations '(sbcl ("sbcl")))
>
> But now again is only sbcl working, also prefixing M-x slime.
>
> Before only loading "swank-clojure" was enough to make it working...
>
> I just would like to understand more or less how swank-slime work and
> which variables I should set up..
> Now the conf is
> (add-to-list 'Info-default-directory-list "~/.emacs.d/slime/doc/")
>
> ;; the path should be already set up correctly
> (setq inferior-lisp-program "sbcl")
> (require 'slime)
> (require 'slime-fuzzy)
> (slime-setup)
> (setq slime-complete-symbol*-fancy t)
> (setq slime-complete-symbol-function 'slime-fuzzy-complete-symbol)
>
> (require 'swank-clojure)
>
> (add-to-list 'slime-lisp-implementations '(sbcl ("sbcl")))
>
>
> And I also have the slime.info now but still I can't see the
> documentation..
>
> Anyway using auto-complete with slime maybe?
> Also another problem is that not requiring 'slime-fuzzy didn't find me
> the completing function, isn't there any autoloading then?
> Thanks
>
>
>

First of all, I think its very important to be working with the latest
versions of slime. It appears that the slime developers are rather slow
when it comes to releasing new stable versions and the current
development head has moved on a long way since the last 'stable'
release. 

Secondly, subscribe to the slime dev list. This is the best place to get
assistance and advice. 

Now for my, probably wrong, understanding of how it all works. 

Essentially, there is an emacs part i.e. slime and a remote 'server'
component, swank. The two ends communicate over a socket layer using an
agreed protocol. 

There are two ways of getting things started. The first and most common
approach is to start it all from the emacs side. When you do M-x slime,
emacs starts an inferior process to run the 'server' implementation i.e.
sbcl, cmucl, clojure etc. As part of that process, it tells the server
implementation to run the swank package/code, which sets up all the
necessary listeners and other bits to allow the slime<->swank
communication. 

This is the bit where I"m not clear on how to get slime to work with
both CL and clojure as the way they will be started and the code that
needs to be loaded will be different. For all CL implementations, its
just load and run swank.lisp. However, once you add in a java based lang
or even scheme, thenn somehow slime will ned to be told what the
commands are that it needs to send to the inferior lisp/java process to
load the necessary packatge/class and start the top level loop. 

There is an alternative approach, which may be easier. 

Slime has the ability to connect and start working with an already
running system. This is useful, for example, when you have a CL server
app and you want to connect to it without stopping and re-starting it. 
The basic idea is that you start the swank process when you start your
app and have it just listening on the socket. At some later point, you
can then start slime and say connect to the swank process running on
server x listening on socket y. 

Maybe this wold be something that could work for you. Just start your
clojur or lisp processes independently of emacs and slime. Ensure they
load their swank implementation and that all necessary config stuff is
set, such as the port and any network/access controls. You should then
be able to conect to whatever implementation you want using the
slime-connect command.

Tim

-- 
tcross (at) rapttech dot com dot au


reply via email to

[Prev in Thread] Current Thread [Next in Thread]