Running Scheme inside of emacs is a conventient and efficient way to use the language. You get all the goodies that come with emacs as well as a nice interface to the Scheme interpreter.
The first thing you want to do is start emacs. See this page for more info on using emacs.
If you don't already have a .emacs file, create one. It should live in your home directory. You home directory is probably mapped to the Z: drives on the Windows machines in the lab. If you don't have one, create a file called ~/.emacs (yes, it starts with a ".", the ~ tells emacs to place it in your home directory) and put the following two lines in there (if you're using emacs on Windows in the lab):
(global-font-lock-mode) ; syntax coloring (setq scheme-program-name "d:/app/PLT/MzScheme.exe") ; which scheme
Or if you're using emacs on one of the departmental unix boxes, the file should contain these lines (might be slightly different for different offerings of CSE341..):
(global-font-lock-mode) (setq scheme-program-name "/cse/courses/cse341/02wi/plt/bin/mzscheme")
(If you think the above stuff looks like Scheme, you're almost right. Emacs can be customized and extended via a language known as Emacs-Lisp, which is part of the Lisp family of languages.)
When you've done the above, quit and restart emacs. (Or just hit "eval-buffer" from the Emacs-Lisp menu.)
Now open a scheme file. If the file is named with the
.scm
extension, emacs should immediately enter scheme
mode for that buffer. If it doesn't do this automatically, try M-x
scheme-mode.
Now you can start the scheme interpreter by typing M-x
run-scheme
. This should start the scheme interpreter in a
separate window. Use C-x 2 to split the window, and switch one of the
buffers to your scheme file. You now have an edit pane and an
interpreter pane.
There are really only two commands you need to learn to send information from the edit buffer to the interpreter: