Tuesday, November 23, 2010

How to setup SBCL+Emacs+SLIME on Mac OS X

Setting up an IDE.

We are installing the following set:
  • SBCL 1.0.29
  • Emacs (Carbon Emacs Package 2010)
    • Emacs Starter Kit
  • SLIME
Step by step:
  • SBCL
    • Download the latest SBCL for Mac OS X and install it to the user directory as stated in readme.
    • To set up a SBCL: You should have a "Property editor" from Xcode. Create a variable called SBCL_HOME with value /Users/user/lib/sbcl in the file ~/.MacOSX/environment.plist. Yes, "user" should be replaced with your account name.
  • Emacs:
    • download the Emacs, install.
    • install the Emacs Starter Kit in folder ~/.emacs.d/ (for me it was /Users/user/.emacs.d/).
  • SLIME:
    • download and install SLIME to ~/.emacs.d/slime/
    • in folder ~/.emacs.d/ create the file ~/.emacs.d/user.el (for you it would be the name of your account, not "user" as for me).
      The contents of the file starts everything that is necessary for current user:
      ;; SLIME setup:
      (add-to-list ‘load-path "~/.emacs.d/slime")
      (add-to-list ‘load-path "~/.emacs.d/slime/contrib")
      (setq slime-backend "~/.emacs.d/slime/swank-loader.lisp")
      (load "slime-autoloads")
      (require ‘slime)
      (require ‘slime-autoloads)
      (eval-after-load "slime"
      `(progn
      (slime-setup ‘(slime-repl))
      (custom-set-variables
      ‘(inhibit-splash-screen t)
      ‘(slime-complete-symbol*-fancy t)
      ‘(slime-complete-symbol-function ‘slime-fuzzy-complete-symbol)
      ‘(slime-net-coding-system ‘utf-8-unix)
      ‘(slime-startup-animation nil)
      ‘(slime-lisp-implementations ‘((sbcl ("/Users/user/bin/sbcl")))))))

      ;; Stop SLIME’s REPL from grabbing DEL,
      ;; which is annoying when backspacing over a ‘(‘
      (defun override-slime-repl-bindings-with-paredit ()
      (define-key slime-repl-mode-map
      (read-kbd-macro paredit-backward-delete-key) nil))
      (add-hook ‘slime-repl-mode-hook ‘override-slime-repl-bindings-with-paredit)

      ;; User’s stuff:
      (zenburn)
      (slime)

Now Emacs+SLIME+SBCL are installed and set.

No comments:

Post a Comment

My Blog List