Difference between revisions of "Slime"

From ArchWiki
Jump to: navigation, search
(use https for links to archlinux.org)
(31 intermediate revisions by 15 users not shown)
Line 1: Line 1:
Here is one way to get a lisp programming environment using emacs and slime and sbcl.
+
{{Out of date}}
 +
[[Category:Development]]
 +
== Introduction ==
  
emacs - editor
+
[http://www.common-lisp.net/project/slime/ SLIME] (Superior Lisp Interaction Mode for [[Emacs]]) provides a development environment for [http://www.sbcl.org SBCL] (detailed in this article), [http://www.cons.org/cmucl/ CMUCL], [http://clisp.cons.org/ CLISP] and other [http://en.wikipedia.org/wiki/Lisp_(programming_language) Lisp] implementations.
  
slime  - lisp mode for emacs
+
The components required are:
  
sbcl   - a common lisp implementation
+
* '''emacs'''
 +
* '''sbcl'''
 +
* '''slime'''
  
To get excited about lisp and programming: www.paulgraham.com is reccomended.
+
== Installation ==
 +
[[Pacman|Install]] {{Pkg|emacs}} and {{Pkg|sbcl}} from the [[official repositories]] and {{AUR|slime-cvs}} from the [[AUR]].
  
www.cliki.org is a great lisp site
+
== Configuration ==
  
pacman has emacs and sbcl packages:
+
''From the [https://repos.archlinux.org/wsvn/community/slime-cvs/repos/community-any/slime.install .INSTALL] file.''
#  pacman -Sy emacs sbcl  (say yes)
+
 
*as root get slime http://aur.archlinux.org/packages.php?do_Details=1&ID=6191 (see the tarball link)
+
To make use of slime, add the following lines to your [[Emacs#Customization|init file]]:
download the tarball into /home/userX, then untar
+
 
# tar xzvf slim--.tar.gz
+
  (setq inferior-lisp-program "/path/to/lisp-executable")
#cd slime
+
(add-to-list 'load-path "/usr/share/emacs/site-lisp/slime/")
#makepkg
+
(require 'slime)
#pacman -U slime-XX.tar.gz
+
(slime-setup)
+
 
Now to setup emacs to use slime by creating a .emacs file:
+
Then run {{Ic|M-x slime}} from within emacs.
change user to userX and in /home/userX to create your .emacs file, vi .emacs; mine is:  
+
 
# vi .emacs (now paste the below into this file, changing g to whatever you userX is, then ESC, :wq to save, apologies if you are a vi whiz!)
+
Alternatively, for a fancier slime setup, you can change the above lines to:
  (setq inferior-lisp-program "/usr/bin/sbcl")
+
 
  (add-to-list 'load-path "/home/g/slime/pkg/usr/share/emacs/site-lisp/slime/")
+
(setq inferior-lisp-program "/path/to/lisp-executable")
  (require 'slime)
+
(add-to-list 'load-path "/usr/share/emacs/site-lisp/slime/")
  (slime-setup)
+
  (require 'slime)
+
(slime-setup '(slime-fancy))
--my userX is g, and /usr/bin/sbcl is path to steel bank common lisp (switch to clisp or CMU lisp if you like, which are other great common lisp implementations)
+
 
   
+
== Resources ==
--then save [:wq], and [emacs & enter] to launch emacs, [ALT-x slime -return-] to enter slime mode, which takes like 10s to load, enjoy the fancy text show, and get coding the next super lisp app!!!
+
 
 +
* [http://www.cliki.net/ The Common Lisp wiki]
 +
* [http://www.gigamonkeys.com/book/ Practical Common Lisp]
 +
* [http://mitpress.mit.edu/sicp/full-text/book/book.html Structure and Interpretation of Computer Programs]
 +
* [http://www.paulgraham.com/lisp.html Paul Graham's Lisp resources].

Revision as of 00:38, 6 December 2012

Tango-view-refresh-red.pngThis article or section is out of date.Tango-view-refresh-red.png

Reason: please use the first argument of the template to provide a brief explanation. (Discuss in Talk:Slime#)

Introduction

SLIME (Superior Lisp Interaction Mode for Emacs) provides a development environment for SBCL (detailed in this article), CMUCL, CLISP and other Lisp implementations.

The components required are:

  • emacs
  • sbcl
  • slime

Installation

Install emacs and sbcl from the official repositories and slime-cvsAUR from the AUR.

Configuration

From the .INSTALL file.

To make use of slime, add the following lines to your init file:

(setq inferior-lisp-program "/path/to/lisp-executable")
(add-to-list 'load-path "/usr/share/emacs/site-lisp/slime/")
(require 'slime)
(slime-setup)

Then run M-x slime from within emacs.

Alternatively, for a fancier slime setup, you can change the above lines to:

(setq inferior-lisp-program "/path/to/lisp-executable")
(add-to-list 'load-path "/usr/share/emacs/site-lisp/slime/")
(require 'slime)
(slime-setup '(slime-fancy))

Resources