Using SLIME/Emacs with Allegro CL on Windows
Wednesday, March 3, 2004
I
recently mentioned that I tried out
SLIME for working with
CLISP Lisp code
using Emacs. I recently also tried it with
Franz's Allegro Common Lisp (ACL) on MS Windows and it worked like a charm. There are some
different setup issues; however, so it is worth outlining what I did
to get things working.
First of all, some background. SLIME normally uses Inferior Lisp Mode
to launch the Lisp executable in Emacs and to manage the communication
between SLIME and the Lisp implementation. With CLISP, this is fine since the
CLISP executable is a WIN32 console application and the lisp
executable needs to be a WIN32 console application in order to be
launched from an Emacs inferior lisp process. However, the ACL Trial edition
executables under MS Windows are WIN32 Windows applications and can not be
launched from an inferior lisp in Emacs. Franz also ships a build.exe
executable with
their regular product (but not the trial edition). This is a WIN32 console
application but there are
issues with multiprocessing support with this
executable and I suspect that it is really only shipped for legacy support reasons.
Therefore, regardless of whether you use the ACL trial or the ACL
commercial product under Windows, it is preferable to use the WIN32 Windows
application version of the executable.
Therefore, instead of trying to launch ACL via Inferior Lisp Mode, I
manually launch alisp.exe and start up swank (the Lisp side of the
Emacs<->Lisp socket communication).
Here are the additions that I made to my .emacs file to manually
launch ACL and start up SLIME by pressing the F5 key:
(global-set-key [(f5)] '(lambda () (interactive) (shell-command "c:/bin/acl-6.2/alisp.exe +B +cm -L ~/.slime.lisp&") (delete-other-windows) (slime-connect "localhost" 4005)))Note that the arguments to alisp.exe indicate no splash screen on startup and startup in a minimized state. The "-L" argument specifies that the ".slime.lisp" file is loaded on startup. This file has the commands necessary to run swank.
Here are the contents of the .slime.lisp file (which I put in my HOME directory):
(load "c:/usr/home/site/slime/swank-loader.lisp") (swank::create-swank-server 4005 :spawn #'swank::simple-announce-function t)That's all that is required!

