Some Emacs usage notes
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.
The Meta key
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.
Starting Lisp in Emacs
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
-
a buffer name: accept the default *common-lisp*.
-
a host: accept the default localhost.
-
a process directory: the default is the Allegro directory
(typically c:/acl11.0/ on Windows and
/usr/local/acl11.0/ on UNIX), which is a reasonable choice, but
specify a different existing directory if you wish.
-
a Lisp executable program: unless you uncommented the
(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.
-
a Lisp image (dxl) file: accept the default.
-
Image arguments (separated by spaces): the default on Windows
is +B +cn (no splash screen, create but hide the Lisp
console). Add additional arguments if you wish (see Command
line arguments in startup.htm
for a list of command-line arguments).
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).
Some useful Emacs commands
-
C-x C-c: exit emacs.
-
C-x N: split the Emacs window into N buffers
(N is typically 1 or 2).
-
C-h b: display the keybindings in effect in the current buffer
(C-h brings up help, C-h ? give more information about
available help).
-
C-c C-p: display an earlier command (repeated C-c C-p
goes through a ring of earlier commands).
-
C-c C-r: you are prompted in the minibuffer for text, then the
most recent command containing that text is displayed.
-
C-c C-s: evaluate or compile last S-expression. (This is useful
when editing Lisp source in a file.)
-
C-c C-s: evaluate or compile the current region. (This is
useful when editing Lisp source in a file.)
-
C-c a: display the argument list in the minibuffer (you are
prompted for the function name, with the default the nearest symbol).
-
C-c ?: like apropos (you are prompted for text, then all
symbols whose names contain that text are displayed in a buffer).
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.
Other .emacs file suggestions
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"))
Other notes
Do not start more that one Lisp in a single emacs.
eli.htm is the
documentation file for the Emacs-Lisp interface.