Using LispWorks Personal with Emacs/SLIME on Windows
Monday, March 15, 2004
In an
earlier post, I outlined how to configure Emacs to use
SLIME with either
Allegro CL,
LispWorks, or
CLISP on Windows. However, my configuration instructions for LispWorks assumed
the commercial versions of the product, not the free Personal
version. As I mentioned in the posting: "the LispWorks Personal
version doesn't have support for init files. Therefore, it is
necessary to manually enter (load "c:/usr/home/.slime.lisp") into
LispWorks after it has started". This is inconvenient for people who
are trying out LispWorks and want to use Emacs and SLIME. To get around this
problem, I've created a basic
WSH script that feeds the necessary key
strokes to LispWorks to get it to load the ".slime.lisp" startup
file. This is a bit of a
kludge; however, I couldn't think of a more elegant way to get
around the limitations in the LispWorks Personal edition on Windows.
Here are the steps you would need to follow to replicate what
I've done:
- Follow the steps I outlined in my earlier post to make the required changes to the .emacs file and to create the ".slime.lisp" startup file.
- Add the following to your .emacs file for LispWorks Personal (you may need to change the directory location for ".lw-slime.vbs"):
- If you are using Windows2000 or Windows XP, you will already have the Windows Scripting Host (WSH) on your machine. If you are using a different Windows OS (or don't have WSH on your PC for some reason), you can download WSH from here.
- Create a file called ".lw-slime.vbs" (put it in "c:/usr/home/" or whatever directory you specified in step 2 above) with the following contents (you may need to change the dirctory locations and the "WScript.Sleep" values in this script):
(defun lwp-start () (interactive) (shell-command "c:/usr/home/.lw-slime.vbs&"))
Dim Wsh
Set Wsh = Wscript.CreateObject("Wscript.Shell")
rem Start up LispWorks
wsh.Run("C:\bin\lispworks-4.3\lispworks-personal-4300")
rem Wait for a few seconds for it to start
WScript.Sleep(5000)
rem Press the OK button on the splash screen
Wsh.AppActivate "Upgrade LispWorks"
Wsh.SendKeys "{ENTER}"
rem Load the SLIME startup code
Wsh.AppActivate "LispWorks Personal Edition 4.3.6"
str = "load " & """c:/usr/home/.slime.lisp"""
WScript.Sleep(100)
Wsh.SendKeys (str)
Wsh.SendKeys "{ENTER}"
WScript.Sleep(100)
rem Toggle back to Emacs
Wsh.SendKeys "%{TAB}"
- Start LispWorks first with "M-x lwp-start" from Emacs
- Start the SLIME connection with "M-x slime-connect RET RET RET" from Emacs

