Installing emacs and Chez Scheme and Getting Them to Work Together on Windows Machines

Scheme First:

  1. Download self-extracting executable:

  2. http://www.scheme.com/pcsv6.0a/pcsv60a.exe
  3. Run it and it will start the installation of petite scheme.
  4. If at all possible, let it install to the default location. Otherwise, you'll need to change things in the _emacs file given below.
  5. That's it!  To run it you should be able to click Start->Run then type petite and hit OK.

Then emacs:

  1. Create a c:\emacs directory
  2. Download emacs, gunzip, and tar:

  3. You might get a server-busy error or some other extended information error.  Just keep retrying until you get in.
    Put them in your c:\emacs directory and rename them emacs.gz, tar.exe, and gunzip.exe to make your life easier.
    ftp://ftp.gnu.org/gnu/windows/emacs/20.7/emacs-20.7-bin-i386.tar.gz
    ftp://ftp.gnu.org/gnu/windows/emacs/20.7/utilities/i386/tar-1.11.2-i386.exe
    ftp://ftp.gnu.org/gnu/windows/emacs/20.7/utilities/i386/gunzip-1.2.4-i386.exe
  4. Open a dos prompt and browse to c:\emacs. . First, to get the dos prompt in early versions of Windows (e.g., Windows 98), go to start -> programs -> MS-DOS prompt. In Windows ME, go to start -> programs -> accessories -> MS-DOS prompt. In Windows 2000, use the shell cmd.com by going to "start -> run", and then typing "command.com" and pressing carriage return.

    To go to c:\emacs, type "chdir c:\emacs".

    Use "dir" to see the contents of your c:\emacs directory. It should contain the files emacs.gz, gunzip.exe, and tar.exe. However, it is possible that your filenames will be slightly different---e.g., they have extra suffixes. In that case, use the names that appear in your directory in the next step.

  5. Unpack emacs by using gunzip and then tar from dos prompt.
    1. dos prompt> gunzip -d emacs.gz
      Again, check the names of the files with "dir", and use the names on your system in the next step.
      dos prompt> tar -xvf emacs
  6. This should create a directory called c:\emacs\emacs-20.7
  7. Go to the directory c:\emacs\emacs-20.7\bin and run addpm.exe.  This will install emacs for you and should give you a new shortcut in your start menu.

Now to integrate them:

We need to tell emacs where it will find Chez Scheme and what to do with .ss files.

Note: If you installed scheme in some location other than the default folder, you'll need to alter the line beginning with setq scheme-program-name.  Notice that two files (with the same path) are indicated here.  You'll need to change both the paths.  You can find the correct path by looking in petite.bat in your c:\Windows\ folder.  Note the forward slashes.

  1. Run emacs from the start menu (Start->Programs->GNU emacs->emacs)
  2. Create a file called "_emacs" in your root c: directory by:
    1. open a file by typing C-x C-f (ctrl-x followed by ctrl-f)
      then give  c:/_emacs as the file name.  If this file doesn't exist, it will create a new blank one for you.  If it already exists, try adding the lines from Step 3 at the end.
  3. Cut and paste these lines into the blank _emacs file:
  4. (if window-system (setq global-font-lock-mode t))
    (setq auto-mode-alist (cons '("\\.ss$" . scheme-mode) auto-mode-alist))
    (setq scheme-program-name "C:/PROGRA~1/CHEZSC~1/csv6.0a/i3nt/scheme.exe -h C:/PROGRA~1/CHEZSC~1/csv6.0a/i3nt/petite.heap")
    (require 'cmuscheme)
    (add-hook 'scheme-mode-hook (function (lambda () (define-key scheme-mode-map "\r" 'newline-and-indent))))
  5. Save it by pressing C-x C-s
  6. Or, instead of doing steps 1-4, you can just copy this _emacs file to your c: directory.
  7. Or, if you're working in the STCs, you can use this _emacs file.
  8. Check your syntax by loading the _emacs file:
    1. type M-x load-file (Here the "M-" stands for "meta"; on our keyboards this means to press the "esc" key, release, and type x), then <return>
      then enter c:/_emacs as the filename and <return>
  9. If you don't get any errors, you're OK.  Type M-x run-scheme to see if a scheme window will open.  If it does, you're done.  If it doesn't, check your paths and your syntax.
  10. The next time you start emacs, all you need to do is type M-x run-scheme to start Chez Scheme.
Thanks to Brian Keese for the original version of this page. It was last modified on 01/09/02.