- Install a LISP compiler. We’ll use Steel Bank Common Lisp. Extract the downloaded archive and run install.sh. If the binary location is not /opt/sbcl/bin/sbcl note it.
- Install emacs sudo apt-get install emacs
- Set up the MELPA repository adding this to your ~/.emacs file
(require 'package) ;; You might already have this line
(add-to-list ‘package-archives ‘(“melpa” . “https://melpa.org/packages/")) (when (< emacs-major-version 24) ;; For important compatibility libraries like cl-lib (add-to-list ‘package-archives ‘(“gnu” . “http://elpa.gnu.org/packages/"))) (package-initialize) ;; You might already have this line
- Install SLIME with <code> M-x package-install RET slime RET </code>
- Set up SLIME and the LISP compiler location in the <code>~/.emacs</code> file
```emacs-lisp
;; Set your lisp system and, optionally, some contribs
(setq inferior-lisp-program "/opt/sbcl/bin/sbcl")
(slime-setup '(slime-fancy))
- Additionaly, this adds an hook that starts SLIME when you open a lisp file
(add-hook 'slime-mode-hook (lambda () (unless (slime-connected-p) (defun my-slime-setup () (require 'slime) (slime-setup '(slime-fancy))) (defvar my--slime-setup-done nil) (defun my-slime-setup-once () (unless my--slime-setup-done (my-slime-setup) (setq my--slime-setup-done t))) (defadvice lisp-mode (before my-slime-setup-once activate) (my-slime-setup-once)) (my-slime-setup)
- Finally, run M-x slime. It will compile the backend and finally give you the prompt.