Skip to content

Instantly share code, notes, and snippets.

Last active May 8, 2020 06:45
  • Star 7 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?

Setup lisp with slime on OS X

Install your favorite lisp interpreter

If you already have Homebrew, just open a terminal and type

$ brew install clozure-cl

or if you prefer to use sbcl

$ brew install sbcl

If you don't already have Homebrew, you should go get it.

Install slime

Download the quicklisp install script. Open a terminal (or use the same one as before) and type

$ mkdir -p ~/.local/opt

to make a directory for the quicklisp installation files. Next, open your interactive lisp environment and install quicklisp:

$ ccl64 # (or sbcl if you installed that instead).
;Change the following line if it was saved somewhere else or with a different name
(load "~/Downloads/quicklisp.lisp") 
(quicklisp-quickstart:install :path "~/.local/opt/quicklisp")
(ql:quickload "quicklisp-slime-helper")
(quit) ; or (exit) if you installed sbcl

Configure emacs

If you have never used emacs before, or you've never bothered configuring it, you probably don't have a ~/.emacs file yet. Create it by typing

$ touch ~/.emacs

Edit your ~/.emacs file and append the following:

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

Again, use sbcl if you installed that instead.

If you're not used to using a text editor from the command line, you can always type

$ open ~/.emacs

which will open the configuration file in TextEdit. Just copy and paste the above code into it.

Install Aquamacs

You can use emacs from the terminal, but it's not exactly user friendly. Since we have a graphical OS, we might as well take advantage of it. Download Aquamacs.

Activating slime

In Aquamacs

M-x slime (Press ALT+X, type slime, press enter)

In emacs via the terminal

M-x slime (Press ESC, type x slime, press enter)
Copy link


I fixed this problem with replacing:

(setq inferior-lisp-program "sbcl")
(setq inferior-lisp-program "/usr/local/bin/sbcl")

in ~/.emacs


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment