Next: CMU Scheme Mode, Up: Scheme on Emacs [Contents][Index]
scheme-mode is a major mode for editing Scheme code; it is distributed with
Emacs and is a modified form of lisp-mode (whose parent mode is prog-mode)
and uses the same source-code editing commands as lisp-mode.
scheme-mode is started with the command ‘M-x scheme-mode’; it runs the
scheme-mode-hook during initialization.
Using the command ‘M-x run-scheme’ will start an inferior Scheme process in
inferior-scheme-mode in a dedicated buffer (usually called ‘*scheme*’) using
the general cmuscheme package. When an inferior Scheme process is running,
some additional commands will be defined, for evaluating expressions and
controlling the interpreter, and the state of the process will be displayed in
the mode line of all Scheme buffers.
scheme-mode provides the following functionality:
scheme-mode is enabled automatically for all files with standard extensions
of Scheme source code:
.scm
.ss
To enable scheme-mode for other file extensions:
(add-to-list 'auto-mode-alist '("\\.<ext>$" . scheme-mode))
.emacs file:
(autoload 'scheme-mode "cmuscheme" "Major mode for Scheme." t) (autoload 'run-scheme "cmuscheme" "Switch to interactive Scheme buffer." t) (setq scheme-program-name "name-of-your-scheme-program") (add-hook 'scheme-mode-hook 'turn-on-font-lock)
The major mode does syntax-highlighting and indentation. The minor mode, invoked with ‘M-x run-scheme’, executes a Scheme interpreter in an Emacs buffer. You can evaluate sections of a program in the buffer or type into it directly.