Setting SLIME in emacs
Asked Answered
H

2

12

I was trying to install SLIME. I downloaded the zipped package and according to the README file, I have to put this piece of code in my Emacs configuration file:

(add-to-list 'load-path "~/hacking/lisp/slime/")  ; your SLIME directory
(setq inferior-lisp-program "/opt/sbcl/bin/sbcl") ; your Lisp system
(require 'slime)
(slime-setup)

Setting the SLIME directory is straightforward, but what about the Lisp "system"? How do I find it?

Hail answered 26/9, 2012 at 18:2 Comment(0)
J
22

Some Linuxes come with CMUCL preinstalled, but since you seem to want to use SBCL, you would need to install it.

In terminal, or in Emacs M-xshell. If you are using Debian-like distro, you can use apt-get or aptitude with the following:

$ sudo apt-get install sbcl

or

$ sudo aptitude install sbcl

on RHEL-like distro:

$ sudo yum install sbcl

After SBCL is installed, you can set inferior-lisp-program to "sbcl".

Also, I'd advise to install SLIME through quicklisp-slime-helper

You would need to install some Lisp you like (let it be SBCL for this purpose, as described above), then, in the same shell do this:

(Suppose you are on a Debian-like Linux)

$ sudo apt-get install wget
$ cd ~/Downloads
$ wget http://beta.quicklisp.org/quicklisp.lisp
$ sbcl --load ./quicklisp.lisp

wait until you see Lisp shell prompt,

* (quicklisp-quickstart:install)
* (ql:add-to-init-file)
* (ql:quickload "quicklisp-slime-helper")
* (quit)

now you are back in the regular shell. Launch Emacs, if not open yet. C-f x~/.emacs. Add the lines below to it (instead of what you posted above):

(load (expand-file-name "~/quicklisp/slime-helper.el"))
(setq inferior-lisp-program "sbcl")

Or replace "sbcl" with the Lisp implementation you installed.

Look into Quicklisp documentation for more information. You will find that you will be using Quicklisp later anyway, so it's useful you get it all in one place from the start.

Jeggar answered 26/9, 2012 at 19:33 Comment(1)
Thanks, that's a good description. Just one thing, I suppose SBCL and clisp are compilers for lisp, which of them is better? SBCL is definitely much faster. Which one should i use?Hail
C
7

Top answer is a little bit old.

Nowadays emacs has an official package manager. You can install slime via MELPA repository. First setup MELPA, then M-x package-install RET slime RET.

After that you can set your inferior-lisp-program like the top answer explained.

Camillacamille answered 23/4, 2019 at 6:28 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.