Emacs (written in a Lisp dialect) has a long standing tradition of being the preferred code editor for many developers. We also recognize that many developers prefer a graphical environment so we provide an IDE for Windows, Mac, and Linux platforms.
Whether you prefer Emacs or our IDE, rest assured that either will expose the full flexibility offered from Common Lisp.
For Emacs, you can either use SLIME or our Emacs-Lisp Interface (ELI). This document deals exclusively with our interface.
Instructions for installation of Emacs for the various platforms are noted below.
The FSF now packages GNU Emacs for installation on Windows. Their installer can be found on ftp.gnu.org/gnu/emacs/windows/.
In order to use the Emacs-Lisp interface, you must load the necessary code into Emacs.
If you did not have a .emacs file created when you installed Emacs, use Emacs to install one or appropriately modify an existing one now. In Emacs, press the keys Control-X Control-F. You are prompted for a file to open. Enter c:\.emacs. A buffer will be opened indicating a new file (or an existing file if one already exists). Copy the contents of the sample .emacs file, noted below, into the buffer.
; This is sample code for starting and specifying defaults to the ; Emacs-Lisp interface. (push "C:/acl11.0express/eli" load-path) (load "fi-site-init.el") ; (setq fi:common-lisp-image-name "C:/acl11.0express/allegro-express.exe") (setq fi:common-lisp-image-file "C:/acl11.0express/allegro-express.dxl") (setq fi:common-lisp-directory "C:/acl11.0express")
Then press the keys Control-X Control-S. The new .emacs file will be created and saved.
Again, the location pushed onto the load-path (which tells Emacs where to look for files to load) is determined by where Allegro CL is found by the Emacs installer, and so it should be correct (modify it if for any reason it is incorrect).
See the Emacs Usages Notes on this page for instructions on how to start Allegro CL.
There are two choices for GNU Emacs on Mac OS X: Aquamacs and the more vanilla Emacs for Mac OS X, both are built from FSF GNU Emacs.
Install Aquamacs as directed, then start it.
In Aquamacs, press the keys Control-X Control-F. You are prompted for a file to open. Enter "~\.emacs". A buffer will be opened indicating a new file (or an existing file if one already exists). Copy the contents of the sample .emacs file, noted below, into the buffer.
; This is sample code for starting and specifying defaults to the ; Emacs-Lisp interface. (push "/Applications/AllegroCL64.app/Contents/Resources/eli" load-path) (load "fi-site-init.el") ; (setq fi:common-lisp-image-name "/Applications/AllegroCL64express.app/Contents/Resources/alisp") (setq fi:common-lisp-image-file "/Applications/AllegroCL64express.app/Contents/Resources/alisp.dxl") (setq fi:common-lisp-directory "/Applications/AllegroCL64express.app/Contents/Resources/")
Then press the keys Control-X Control-S. The new .emacs file will be created and saved.
Again, the location pushed onto the load-path (which tells Emacs where to look for files to load) is determined by where Allegro CL is found by the Emacs installer, and so it should be correct (modify it if for any reason it is incorrect).
See the Emacs Usages Notes on this page for instructions on how to start Allegro CL.
Ubuntu users: run the emacs
command from a terminal and
the installation instructions will be printed by the stub emacs
command.
If you are using another Linux/Unix platform you can download GNU Emacs from http://directory.fsf.org/GNU/emacs.html.
In order to use the Emacs-Lisp interface, you must load the necessary code into Emacs. To load the file, you can evaluate the following form in the Emacs *scratch* buffer:
(load "/usr/local/acl11.0express/eli/fi-site-init.el") Control-J
Pressing Control-J in the *scratch* buffer causes a form to be evaluated by Emacs (a simple carriage-return does not do that).
But rather than evaluating that form each time you run Emacs, it is better to have a .emacs file that includes that form. The .emacs file is loaded into Emacs whenever Emacs is started.
If you did not have a .emacs file created when you installed Emacs, use Emacs to install one or appropriately modify an existing one now. In Emacs, press the keys Control-X Control-F. You are prompted for a file to open. A buffer will be opened indicating a new file (or an existing file if one already exists). Copy the contents of the sample .emacs file, noted below, into the buffer. Then press the keys Control-X Control-S. The new .emacs file will be created and saved.
; This is sample code for starting and specifying defaults to the ; Emacs-Lisp interface. (push "usr/local/acl11.0express/eli" load-path) (load "fi-site-init.el") (setq fi:common-lisp-image-name "usr/local/acl11.0express/alisp") (setq fi:common-lisp-image-file "usr/local/acl11.0express/alisp.dxl") (setq fi:common-lisp-directory "usr/local/acl11.0express")
See the Emacs Usages Notes on this page for instructions on how to start Allegro CL.
If you are new to Emacs, you may want to look at the Emacs Tutorial, accessed with the Help menu on the Emacs menu bar. In this section, we will just provide brief usage notes which are in no way equivalent to a tutorial.
Many Emacs commands require pressing the Meta key. But there is no key labeled `Meta'. On Windows, usually the Alt keys serve as the Meta key. The Alt keys are on typically either side of the space bar. UNIX keyboards are too varied to make a definite suggestion, but often a key next or near the Space bar serves as the Meta key.
In Emacs, try pressing Alt-x. If M-x appears in the minibuffer (the bottom bar of the Emacs window), then the Alt key is serving as the Meta key. If you cannot find a Meta key (one that when you hold it down and press x, M-x appears in the minibuffer), press the Escape key and then the x key. That should always work, although it is less convenient.
The Meta key is typically abbreviated M- in Emacs documentation, just as the Control key is abbreviated C-. Case matters with the Meta key (Meta-Shift-A is different from Meta-A) but does not matter with the Control key.
Once the eli/fi-site-init file is loaded into Emacs, you can start Allegro CL by entering M-x fi:common-lisp (press the Meta key and the x key simultaneously and then enter `fi:common-lisp', or press the Escape key, the `x' key, and then `fi:common-lisp'). You are prompted in the minibuffer for
(setq fi:common-lisp-image-name "C:/acl11.0/mlisp.exe")
line in the suggested .emacs file, the
default will be alisp, which actually does not work on the
Windows (the executable on Windows is alisp.exe); specify one
of the Lisp executables such as c:/acl11.0/alisp.exe, c:/acl11.0/mlisp.exe, or
c:/acl11.0/allegro.exe. If you did uncomment that
line in the .emacs file, accept it or specify a different
executable. Note the directory path must be included. On UNIX, use /usr/local/ and do not use the .exe extension.
After specifying the command-line arguments, Allegro CL is started. If you specified the allegro.exe executable, the IDE will start up as well (the IDE has its own editor and many users use it instead of Emacs, but using Emacs works as well).
Emacs also has a menu bar. Menu commands can be used in place of key chords (a key chord is multiple keys pressed simultaneously, like M-x). The menus typically show the key chords equivalents of menu commands.
An Emacs function like the following will start the indicated Lisp executable without prompting you for details (as fi:common-lisp does). It is useful if you rarely vary the answers to the prompts. If you regularly run several images, you can write several such functions. Replace the values specified with the appropriate/desired values, of course. In particular, on UNIX, replace c:/program files/ with /usr/local/ and do not use the .exe extension (so /usr/local/acl11.0/mlisp).
(defun run-lisp () (interactive) (fi:common-lisp "*common-lisp*" "c:/acl11.0/" "c:/acl11.0/mlisp.exe" '("+B" "+cn") "localhost" "c:/acl11.0/mlisp.dxl"))
Do not start more that one Lisp in a single emacs.
eli.htm is the documentation file for the Emacs-Lisp interface.
You can use sys:update-allegro to get the latest patches for ELI. There were patches after the release of Allegro CL 11.0 that allowed it to run with GNU Emacs versions released after 11.0 came out.
The source code for ELI is on github.
Copyright © Franz Inc., All Rights Reserved | Privacy Statement |