source: trunk/abcl/doc/slime.markdown @ 12548

Last change on this file since 12548 was 12548, checked in by Mark Evenson, 13 years ago

Documentation for using SLIME in ABCL.

File size: 3.5 KB
Line 
1SLIME
2=====
3
4  Author:   Mark Evenson
5  Created:  16-MAR-2010
6  Modified: 16-MAR-2010
7
8SLIME is divided conceptually in two parts: the "swank" server process
9which runs in the native Lisp and the "slime" client process running
10in Emacs Lisp.  These instructions were were written to accompany
11ABCL, but there is nothing ABCL specific in the instructions
12
13## Obtaining SLIME
14
15SLIME does not follow a release process in the standard, so you are
16best off with obtaining the [latest version from CVS][1]. [Daily
17snapshots as gzipped tarballs are also available][2].  Your local OS
18packaging system (i.e. MacPorts on OSX) may have a version as well.
19
20[1]: http://common-lisp.net/project/slime/#downloading
21[2]: http://common-lisp.net/project/slime/snapshots/slime-current.tgz
22
23## Starting SLIME
24
25One first locates the SLIME directory on the filesystem.  In the code
26that follows, the SLIME top level directory is assumed to be
27"~/work/slime", so adjust this value to your local value as you see
28fit.
29
30Then one configures Emacs with the proper initialization hooks by
31adding code something like the following to "~/.emacs":
32
33  (add-to-list 'load-path "~/work/slime")
34  (setq slime-lisp-implementations
35    '((abcl ("~/work/abcl/abcl"))
36      (abcl.svn ("~/work/abcl.svn/abcl"))
37      (sbcl ("/opt/local/bin/sbcl"))))
38  (require 'slime)
39  (slime-setup '(slime-fancy slime-asdf slime-banner))
40
41One further need to customize the setting of
42SLIME-LISP-IMPLEMENTATIONS to the location(s) of the Lisp(s) you wish to
43invoke via SLIME.  The value is list of lists of the form
44
45   (SYMBOL ("/path/to/lisp"))
46
47where SYMBOL is a mnemonic for the Lisp implementation, and the string
48"/path/to/lisp" is the absolute path of the Lisp implementation that
49SLIME will associate with this symbol.  In the example above, I have
50defined three implementations, the main abcl implementation, a version
51that corresponds to the latest version from SVN invoked by
52"~/work/abcl.svn/abcl", and a version of SBCL.
53
54To start SLIME one simply issues M-x slime from Emacs.  This will
55start the first entry in the SLIME-LISP-IMPLEMENTATIONS list.  If you
56wish to start a subsequent Lisp, prefix the invocation via M-u
57(i.e. M-u M-x slime).  This will present an interactive chooser over
58all symbols contained in SLIME-LISP-IMPLEMENTATIONS.
59
60After you invoke SLIME, you'll see a buffer open up named
61*inferior-lisp* where the Lisp image is started up, the required swank
62code is complied and then loaded, finally, you'll see the "flying
63letters" resolving itself to a "CL-USER>" prompt with an inspiration
64message in the minibuffer.  Your initiation to SLIME has begun...
65
66
67## Starting swank on its own
68
69In debugging, one may wish to start the swank server by itself without
70connection to Emacs.  The following code will both load and start the swank server
71from a Lisp image.  One merely needs to change *SLIME-DIRECTORY* to
72point to the top directory of the server process.
73
74  (defvar *slime-directory* #p"~/work/slime/") ;; Don't forget trailing slash
75  (load (merge-pathnames "swank-loader.lisp" *slime-directory*) :verbose t)
76  (swank-loader:init)
77  (swank:start-server "/tmp/swank.port") ;; remove if you don't want
78                                         ;; swank to start listening for connections.
79
80When this code finishes executing, an integer representing the port on
81which the server starts will be written to '/tmp/swank.port' and also
82returned as the result of evaluating SWANK:START-SERVER.  One may
83connect to this port via issuing M-x slime-connect in Emacs.
84
85
Note: See TracBrowser for help on using the repository browser.