The Common Lisp Cookbook - Setting up an IDE with Emacs on Windows or Mac OS X*

Emacs is the preferred Lisp source code editor for most CL developers; however, it is not easy for an Emacs neophyte to get an Emacs environment set up and configured properly for Lisp development. The problem is compounded if the development platform is Microsoft Windows since Unix (and variants) is the more common platform used by experienced Lisp developers. In order to help a Lisp beginner set up an Emacs Common Lisp development environment on a Microsoft Windows PC, this chapter will lay out step-by-step instructions for installing all the necessary components for each of the most popular Common Lisp implementations on Windows:

By exactly following the installation instructions, the user will wind up with an Emacs setup that:

Contents

The following steps will be covered in this chapter:

  1. Installing Emacs
  2. Installing additional Emacs utilities (optional)
  3. Installing on-line documentation (optional)
  4. Installing CLISP (optional)
  5. Installing ACL (optional)
  6. Installing LispWorks (optional)
  7. Installing Corman CL (optional)
  8. Configuration steps
  9. Testing the environments

There is also a short appendix describing the sample .emacs file and brief Mac OS X setup instructions:
   A.    Sample .emacs file
   B.    Mac OS X Setup Instructions

For each installation, an installation directory is suggested. It is recommended that you install in the suggested directory since, if you use the suggested directory names, the provided Emacs start-up file (.emacs) will work "out-of-the-box". Please note the following:

1. Installing Emacs

2. Installing additional Emacs utilities

set EMACSDIR=c:\bin\emacs-21.3
set ILISPDIR=c:\home\site\ilisp
ren c:\home\site\ilisp-5.12.0 c:\home\site\ilisp
cd c:\home\site\ilisp
icompile.bat

3. Installing on-line documentation (optional)

4. Installing CLISP (optional)

5. Installing ACL (optional)

(progn
  (build-lisp-image "alisp.dxl" :case-mode :case-insensitive-upper
                    :include-ide nil :restart-app-function nil)
  (sys:copy-file "sys:allegro-ansi.exe" "sys:alisp.exe"))
  

6. Installing LispWorks (optional)

(load-all-patches)
(save-image "lw42-console" :console t :environment nil)
(quit)
cd c:\bin\lispworks-4.2
lispworks-4200 -init c:\home\lisp\console.lisp

This will result in the lw42-console.exe file being created in the c:\bin\lispworks-4.2 directory.

7. Installing Corman CL

(setf (current-directory) *cormanlisp-directory*)

8. Configuration steps

9. Testing the environments

You should now have a working Windows/Emacs setup that supports a number of different Lisp implementations.

A. Sample .emacs file

B. Mac OS X Setup Instructions