Skip to content

Instantly share code, notes, and snippets.

@BlameOmar
Last active May 8, 2020 06:45
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save BlameOmar/9477900 to your computer and use it in GitHub Desktop.
Save BlameOmar/9477900 to your computer and use it in GitHub Desktop.

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:add-to-init-file)
(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)
@artforlife
Copy link

I have a working Aquamacs + SBCL + SLIME. I wanted to install Emacs and give that a try. However, I cannot seem to get it working.

My .emacs file looks like this:

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

The init.el file is as follows:

`(require 'package)
(add-to-list 'package-archives
'("melpa" . "http://melpa.milkbox.net/packages/"))

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

When I run M-x: slime, I get

Searching for program: No such file or directory, sbcl

When I run M-x: package install slime, I get

[no match]

Do you have an idea of what I am missing?

@dadetka
Copy link

dadetka commented Nov 3, 2016

@artforlife

I fixed this problem with replacing:

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

in ~/.emacs

@aesyondu
Copy link

@artforlife

I fixed this problem with replacing:

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

in ~/.emacs

Thanks!

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