|
|
|
These instructions assume you have already installed the [dependencies](installation/dependencies). Follow these additional steps to configure your Linux computer for Babel development:
|
|
|
|
|
|
|
|
* Install a Common Lisp implementation. Babel supports LispWorks, Clozure Common Lisp (CCL) and Steel Bank Common Lisp (SBCL). Both CCL and SBCL are freely available and can be easily installed. When you are a novel Lisp user, we recommend installing CCL. To install CCL, please follow the instructions [here](https://ccl.clozure.com/install.html). SBCL is available through apt-get:
|
|
|
|
```
|
|
|
|
sudo apt-get install sbcl
|
|
|
|
```
|
|
|
|
|
|
|
|
* Install Emacs using apt-get:
|
|
|
|
```
|
|
|
|
sudo apt-get install emacs
|
|
|
|
```
|
|
|
|
|
|
|
|
* Use `git clone` to get the latest version of Slime. We will assume Slime is placed in your home directory, but you can place this anywhere you want.
|
|
|
|
```
|
|
|
|
git clone https://github.com/slime/slime.git
|
|
|
|
```
|
|
|
|
|
|
|
|
* For configuring your Emacs, use a text editor to create a plain text file called `.emacs` (without extension) in your home directory. This file should have the following content. Replace `<SLIME>` by the path to the Slime directory on your machine and `<LISP>` by the path to the Lisp implementation on your machine (you can find this by running `which sbcl` or `which ccl` in the Terminal, depending on the Common Lisp implementation you installed).
|
|
|
|
```common-lisp
|
|
|
|
;;; -*- emacs-lisp -*-
|
|
|
|
(custom-set-variables
|
|
|
|
'(show-paren-mode t)
|
|
|
|
'(size-indication-mode t)
|
|
|
|
'(tool-bar-mode nil)
|
|
|
|
'(transient-mark-mode t)
|
|
|
|
'(column-number-mode t)
|
|
|
|
'(indent-tabs-mode nil)
|
|
|
|
'(make-backup-files nil))
|
|
|
|
|
|
|
|
(set-face-foreground 'font-lock-string-face "navy")
|
|
|
|
|
|
|
|
(setq mouse-wheel-scroll-amount '(1 ((shift) .1)))
|
|
|
|
(setq mac-allow-anti-aliasing t)
|
|
|
|
|
|
|
|
;; Make sure gnuplot and dot are found. Add /usr/local/bin to the path
|
|
|
|
(setenv "LANG" "en_US.UTF-8")
|
|
|
|
(setenv "PATH" (concat (getenv "PATH") ":/usr/local/bin"))
|
|
|
|
(setq exec-path (append exec-path '("/usr/local/bin")))
|
|
|
|
|
|
|
|
;; path to slime (ADAPT <SLIME>)
|
|
|
|
(add-to-list 'load-path "<SLIME>")
|
|
|
|
|
|
|
|
(require 'slime)
|
|
|
|
(slime-setup '(slime-repl slime-autodoc slime-fancy-inspector))
|
|
|
|
|
|
|
|
;; path to lisp implementations (ADAPT <LISP>)
|
|
|
|
(setq inferior-lisp-program "<LISP>")
|
|
|
|
|
|
|
|
(command-execute 'slime)
|
|
|
|
```
|
|
|
|
|
|
|
|
* Install Quicklisp by executing the following commands from your home directory:
|
|
|
|
```
|
|
|
|
wget http://beta.quicklisp.org/quicklisp.lisp
|
|
|
|
|
|
|
|
;; using ccl
|
|
|
|
ccl -n -l quicklisp.lisp -e '(quicklisp-quickstart:install)(ccl:quit)' -b
|
|
|
|
|
|
|
|
;; using sbcl
|
|
|
|
sbcl --no-sysinit --no-userinit --load quicklisp.lisp \
|
|
|
|
--eval '(quicklisp-quickstart:install)' \
|
|
|
|
--quit
|
|
|
|
```
|
|
|
|
|
|
|
|
* [**SBCL only**] If you want Quicklisp and Babel to be loaded whenever you start SBCL, you can create or edit a file called `.sbclrc` in your home directory. Add the following code to this file and fill in the correct path to your Babel folder:
|
|
|
|
```common-lisp
|
|
|
|
;;; loading quicklisp
|
|
|
|
(load "~/quicklisp/setup.lisp")
|
|
|
|
|
|
|
|
;;; loading Babel
|
|
|
|
(load "/path/to/Babel/init-babel")
|
|
|
|
```
|
|
|
|
|
|
|
|
* [**CCL only**] If you want Quicklisp and Babel to be loaded whenever you start CCL, you can create or edit a file called `.ccl-init.lisp` in your home directory. Add the following code to this file and fill in the correct path to your Babel folder:
|
|
|
|
```common-lisp
|
|
|
|
;;; loading Quicklisp
|
|
|
|
#-quicklisp
|
|
|
|
(let ((quicklisp-init (merge-pathnames "quicklisp/setup.lisp" (user-homedir-pathname))))
|
|
|
|
(when (probe-file quicklisp-init)
|
|
|
|
(load quicklisp-init)))
|
|
|
|
|
|
|
|
;;; loading Babel
|
|
|
|
(load "/path/to/Babel/init-babel")
|
|
|
|
```
|
|
|
|
|
|
|
|
* Now, when you open Emacs, it should automatically start up a Lisp session, load Babel and print the following message:
|
|
|
|
|
|
|
|
```
|
|
|
|
* Initializing BABEL.
|
|
|
|
The BABEL path is: /path/to/Babel
|
|
|
|
```
|
|
|
|
|
|
|
|
* To test your Babel installation, run the following command:
|
|
|
|
```
|
|
|
|
;;; for ccl
|
|
|
|
ccl -l /path/to/Babel/test-babel-installation.lisp -e '(ccl:quit)' -b
|
|
|
|
|
|
|
|
;;; for sbcl
|
|
|
|
sbcl --load "/path/to/Babel/test-babel-installation.lisp" --quit
|
|
|
|
```
|
|
|
|
The test consists in opening a PDF file with a diagram and displaying a window with a sinus function. |
|
|
|
\ No newline at end of file |