There is an interface library, called xscheme, distributed with MIT/GNU Scheme and GNU Emacs, which facilitates running Scheme as a subprocess of Emacs. If you are using a recent version of GNU Emacs, say version 22 or later, use the xscheme file that comes with it. Otherwise use the one that is in the Scheme distribution.
This interface works under unix only, because it requires unix signals for its operation. Porting it to Windows would require reimplementing the interface to eliminate the use of signals. We have no plans to do this.
To invoke Scheme from Emacs, load the xscheme library, then use
M-x run-scheme. You may give
run-scheme a prefix argument,
in which case it will allow you to edit the command line that is used to
invoke Scheme. Do not remove the --emacs option!
Note carefully: In Emacs 19 and later, the
command exists, but is different from the one described here! In order
to get this interface, you must load the xscheme library before
Scheme will be started up as a subprocess in a buffer called
‘*scheme*’. This buffer will be in
and all output from the Scheme process will go there. The mode line for
the ‘*scheme*’ buffer will have this form:
--**-*scheme*: 1 [Evaluator] (Scheme Interaction: input)------
The first field, showing ‘1’ in this example, is the level number.
The second field, showing ‘[Evaluator]’ in this example, describes the type of REPL that is running. Other values include:
The mode after ‘Scheme Interaction’ is one of:
Scheme is waiting for input.
Scheme is running an evaluation.
Scheme is garbage collecting.
When xscheme is loaded,
scheme-mode is extended to include
commands for evaluating expressions (do C-h m in any
scheme-mode buffer for the most up-to-date information):
Evaluates the current buffer (
Evaluates the current definition (
is also bound to C-M-x.
Evaluates the current region (
Evaluates the expression to the left of point
xscheme-send-previous-expression). This is also bound to
Selects the ‘*scheme*’ buffer and places you at its end
Yanks the most recently evaluated expression, placing it at point
xscheme-yank-previous-send). This works only in the
The following commands provide interrupt capability:
Like typing C-g when running Scheme without Emacs.
Like typing C-c C-x when running Scheme without Emacs.
Like typing C-c C-u when running Scheme without Emacs.
Like typing C-c C-b when running Scheme without Emacs.
Like evaluating ‘(continue)’. (