;ELC   
;;; Compiled by rms@psilocin.gnu.org on Sun Mar  8 18:42:31 1998
;;; from file /gd/gnu/emacs/lisp/cmuscheme.el
;;; in Emacs version 20.2.89.6
;;; with bytecomp version 2.38
;;; with all optimizations.
;;; This file uses opcodes which do not exist in Emacs 18.

(if (and (boundp 'emacs-version)
	 (< (aref emacs-version (1- (length emacs-version))) ?A)
	 (or (and (boundp 'epoch::version) epoch::version)
	     (string-lessp emacs-version "19.29")))
    (error "`cmuscheme.el' was compiled for Emacs 19.29 or later"))


(byte-code "\301\302!\210\301\303!\210\304\305\306\307\310%\207" [:group require scheme comint custom-declare-group cmuscheme nil "Run a scheme process in a buffer." lisp] 6)
#@45 *Hook for customising inferior-scheme mode.
(custom-declare-variable 'inferior-scheme-mode-hook 'nil '(#$ . -709) :type 'hook :group 'cmuscheme)
(byte-code "\305\300!\204 \306\300	B\2040 \307\n!\310\311\312#\210\310\313\314#\210\310\315\316#\210\310\317\320#\210\321!\210\310\311\312#\210\310\313\314#\210\310\322\312#\210\310\323\324#\210\310\325\326#\210\310\327\330#\210\310\331\332#\210\310\333\334#\210\310\335\336#\210\310\315\316#\210\310\317\320#\210\337\340\"\310\f\341\342#\210\310\f\343\344#\210\310\f\345\346#\210\310\f\347\350#\210\310\f\351\352#\210\310\f\353\354#\210\310\f\355\356#\210\310\f\357\360#\210\310\f\361\362#\210\310\f\363\364#\210\310\f\365\366#\210)\367	B\306\207" [inferior-scheme-mode-map current-load-list comint-mode-map scheme-mode-map map boundp nil copy-keymap define-key "\230" scheme-send-definition "" scheme-send-last-sexp "\f" scheme-load-file "" scheme-compile-file scheme-mode-commands "" "\345" scheme-send-definition-and-go "" scheme-send-region "\362" scheme-send-region-and-go "\343" scheme-compile-definition "" scheme-compile-definition-and-go "" switch-to-scheme lookup-key [menu-bar scheme] [separator-eval] ("--") [compile-file] ("Compile Scheme File" . scheme-compile-file) [load-file] ("Load Scheme File" . scheme-load-file) [switch] ("Switch to Scheme" . switch-to-scheme) [com-def-go] ("Compile Definitiion & Go" . scheme-compile-definition-and-go) [com-def] ("Compile Definitiion" . scheme-compile-definition) [send-def-go] ("Evaluate Last Definition & Go" . scheme-send-definition-and-go) [send-def] ("Evaluate Last Definition" . scheme-send-definition) [send-region-go] ("Evaluate Region & Go" . scheme-send-region-and-go) [send-region] ("Evaluate Region" . scheme-send-region) [send-sexp] ("Evaluate Last S-expression" . scheme-send-last-sexp) scheme-buffer] 4)
#@1681 Major mode for interacting with an inferior Scheme process.

The following commands are available:
\{inferior-scheme-mode-map}

A Scheme process can be fired up with M-x run-scheme.

Customisation: Entry to this mode runs the hooks on comint-mode-hook and
inferior-scheme-mode-hook (in that order).

You can send text to the inferior Scheme process from other buffers containing
Scheme source.  
    switch-to-scheme switches the current buffer to the Scheme process buffer.
    scheme-send-definition sends the current definition to the Scheme process.
    scheme-compile-definition compiles the current definition.
    scheme-send-region sends the current region to the Scheme process.
    scheme-compile-region compiles the current region.

    scheme-send-definition-and-go, scheme-compile-definition-and-go,
        scheme-send-region-and-go, and scheme-compile-region-and-go
        switch to the Scheme process buffer after sending their text.
For information on running multiple processes in multiple buffers, see
documentation for variable scheme-buffer.

Commands:
Return after the end of the process' output sends the text from the 
    end of process to point.
Return before the end of the process' output copies the sexp ending at point
    to the end of the process' output, and sends it.
Delete converts tabs to spaces as it moves back.
Tab indents for Scheme; with argument, shifts rest
    of expression rigidly with the current line.
C-M-q does Tab on each line starting within following expression.
Paragraphs are separated only by blank lines.  Semicolons start comments.
If you accidentally suspend your process, use \[comint-continue-subjob]
to continue it.
(defalias 'inferior-scheme-mode #[nil "\306 \210\307\310 \210\311\312\313\314\f!\210\315\316\317\320!\207" [comint-prompt-regexp major-mode mode-name mode-line-process inferior-scheme-mode-map comint-input-filter comint-mode "^[^>\n]*>+ *" scheme-mode-variables inferior-scheme-mode "Inferior Scheme" (":%s") use-local-map scheme-input-filter scheme-get-old-input run-hooks inferior-scheme-mode-hook comint-get-old-input] 2 (#$ . 2579) nil])
#@128 *Input matching this regexp are not saved on the history list.
Defaults to a regexp ignoring all inputs of 0, 1, or 2 letters.
(custom-declare-variable 'inferior-scheme-filter-regexp '"\\`\\s *\\S ?\\S ?\\s *\\'" '(#$ . -4715) :type 'regexp :group 'cmuscheme)
#@60 Don't save anything matching inferior-scheme-filter-regexp
(defalias 'scheme-input-filter #[(str) "\302	\"?\207" [inferior-scheme-filter-regexp str string-match] 3 (#$ . 4981)])
#@32 Snarf the sexp ending at point
(defalias 'scheme-get-old-input #[nil "\212`\301 \210`{*\207" [end backward-sexp] 2 (#$ . 5166)])
(defalias 'scheme-args-to-list #[(string) "\303\304\"\211\204 C\2025 	\305U\204$ \305	O\306	TGO!B\2025 \303\307\"\211\2054 \306\nGO!))\207" [string where pos string-match "[ 	]" 0 scheme-args-to-list "[^ 	]"] 6])
#@44 *Program invoked by the run-scheme command
(custom-declare-variable 'scheme-program-name '"scheme" '(#$ . -5527) :type 'string :group 'cmuscheme)
#@396 Run an inferior Scheme process, input and output via buffer *scheme*.
If there is a process already running in `*scheme*', switch to that buffer.
With argument, allows you to edit the command line (default is value
of `scheme-program-name').  Runs the hooks `inferior-scheme-mode-hook'
(after the `comint-mode-hook' is run).
(Type \[describe-mode] in the process buffer for a list of commands.)
(defalias 'run-scheme #[(cmd) "\304\305!\204 \306!\307\310\311	@\312	A%q\210\313 \210)\305\314\305!\207" [cmd cmdlist scheme-program-name scheme-buffer comint-check-proc "*scheme*" scheme-args-to-list apply make-comint "scheme" nil inferior-scheme-mode pop-to-buffer] 6 (#$ . 5680) (list (if current-prefix-arg (read-string "Run Scheme: " scheme-program-name) scheme-program-name))])
#@57 Send the current region to the inferior Scheme process.
(defalias 'scheme-send-region #[(start end) "\302\303 	#\210\304\303 \305\"\207" [start end comint-send-region scheme-proc comint-send-string "\n"] 4 (#$ . 6471) "r"])
#@61 Send the current definition to the inferior Scheme process.
(defalias 'scheme-send-definition #[nil "\212\301 \210`\302 \210\303`\"*\207" [end end-of-defun beginning-of-defun scheme-send-region] 3 (#$ . 6702) nil])
#@56 Send the previous sexp to the inferior Scheme process.
(defalias 'scheme-send-last-sexp #[nil "\300\212\301 \210`)`\"\207" [scheme-send-region backward-sexp] 3 (#$ . 6925) nil])
#@73 *Template for issuing commands to compile arbitrary Scheme expressions.
(custom-declare-variable 'scheme-compile-exp-command '"(compile '%s)" '(#$ . -7109) :type 'string :group 'cmuscheme)
#@117 Compile the current region in the inferior Scheme process.
(A BEGIN is wrapped around the region: (BEGIN <region>))
(defalias 'scheme-compile-region #[(start end) "\303\304 \305\305\306	\n{\"\"\"\210\303\304 \307\"\207" [scheme-compile-exp-command start end comint-send-string scheme-proc format "(begin %s)" "\n"] 8 (#$ . 7305) "r"])
#@64 Compile the current definition in the inferior Scheme process.
(defalias 'scheme-compile-definition #[nil "\212\301 \210`\302 \210\303`\"*\207" [end end-of-defun beginning-of-defun scheme-compile-region] 3 (#$ . 7647) nil])
#@88 Switch to the scheme process buffer.
With argument, positions cursor at end of buffer.
(defalias 'switch-to-scheme #[(eob-p) "\302!\203 \303!\210\202 \304\305!\210	\205 \306 \210db\207" [scheme-buffer eob-p get-buffer pop-to-buffer error "No current process buffer. See variable scheme-buffer." push-mark] 2 (#$ . 7879) "P"])
#@92 Send the current region to the inferior Scheme process.
Then switch to the process buffer.
(defalias 'scheme-send-region-and-go #[(start end) "\302	\"\210\303\304!\207" [start end scheme-send-region switch-to-scheme t] 3 (#$ . 8216) "r"])
#@89 Send the current definition to the inferior Scheme. 
Then switch to the process buffer.
(defalias 'scheme-send-definition-and-go #[nil "\300 \210\301\302!\207" [scheme-send-definition switch-to-scheme t] 2 (#$ . 8462) nil])
#@92 Compile the current definition in the inferior Scheme. 
Then switch to the process buffer.
(defalias 'scheme-compile-definition-and-go #[nil "\300 \210\301\302!\207" [scheme-compile-definition switch-to-scheme t] 2 (#$ . 8692) nil])
#@88 Compile the current region in the inferior Scheme. 
Then switch to the process buffer.
(defalias 'scheme-compile-region-and-go #[(start end) "\302	\"\210\303\304!\207" [start end scheme-compile-region switch-to-scheme t] 3 (#$ . 8931) "r"])
#@255 *Used to determine if a buffer contains Scheme source code.
If it's loaded into a buffer that is in one of these major modes, it's
considered a scheme source file by scheme-load-file and scheme-compile-file.
Used by these commands to determine defaults.
(custom-declare-variable 'scheme-source-modes ''(scheme-mode) '(#$ . -9180) :type '(repeat function) :group 'cmuscheme)
#@180 Caches the last (directory . file) pair.
Caches the last pair used in the last scheme-load-file or
scheme-compile-file command. Used for determining the default in the 
next one.
(defvar scheme-prev-l/c-dir/file nil (#$ . 9561))
#@54 Load a Scheme file into the inferior Scheme process.
(defalias 'scheme-load-file #[(file-name) "\302!\210\303!\304!B\305\306 \307\310Q\"\207" [file-name scheme-prev-l/c-dir/file comint-check-source file-name-directory file-name-nondirectory comint-send-string scheme-proc "(load \"" "\")\n"] 5 (#$ . 9796) (comint-get-source "Load Scheme file: " scheme-prev-l/c-dir/file scheme-source-modes t)])
#@55 Compile a Scheme file in the inferior Scheme process.
(defalias 'scheme-compile-file #[(file-name) "\302!\210\303!\304!B\305\306 \307\310Q\"\207" [file-name scheme-prev-l/c-dir/file comint-check-source file-name-directory file-name-nondirectory comint-send-string scheme-proc "(compile-file \"" "\")\n"] 5 (#$ . 10203) (comint-get-source "Compile Scheme file: " scheme-prev-l/c-dir/file scheme-source-modes nil)])
#@1980 *The current scheme process buffer.

MULTIPLE PROCESS SUPPORT
===========================================================================
Cmuscheme.el supports, in a fairly simple fashion, running multiple Scheme
processes. To run multiple Scheme processes, you start the first up with
\[run-scheme]. It will be in a buffer named *scheme*. Rename this buffer
with \[rename-buffer]. You may now start up a new process with another
\[run-scheme]. It will be in a new buffer, named *scheme*. You can
switch between the different process buffers with \[switch-to-buffer].

Commands that send text from source buffers to Scheme processes --
like scheme-send-definition or scheme-compile-region -- have to choose a
process to send to, when you have more than one Scheme process around. This
is determined by the global variable scheme-buffer. Suppose you
have three inferior Schemes running:
    Buffer	Process
    foo		scheme
    bar		scheme<2>
    *scheme*    scheme<3>
If you do a \[scheme-send-definition-and-go] command on some Scheme source
code, what process do you send it to?

- If you're in a process buffer (foo, bar, or *scheme*), 
  you send it to that process.
- If you're in some other buffer (e.g., a source file), you
  send it to the process attached to buffer scheme-buffer.
This process selection is performed by function scheme-proc.

Whenever \[run-scheme] fires up a new process, it resets scheme-buffer
to be the new process's buffer. If you only run one process, this will
do the right thing. If you run multiple processes, you can change
scheme-buffer to another process buffer with \[set-variable].

More sophisticated approaches are, of course, possible. If you find yourself
needing to switch back and forth between multiple processes frequently,
you may wish to consider ilisp.el, a larger, more sophisticated package
for running inferior Lisp and Scheme processes. The approach taken here is
for a minimal, simple implementation. Feel free to extend it.
(defvar scheme-buffer nil (#$ . -10630))
#@65 Returns the current scheme process. See variable scheme-buffer.
(defalias 'scheme-proc #[nil "\303\304=\203 p\202\f 	!\211\206 \305\306!)\207" [major-mode scheme-buffer proc get-buffer-process inferior-scheme-mode error "No current process. See variable scheme-buffer"] 4 (#$ . 12656)])
#@88 This hook is run when cmuscheme is loaded in.
This is a good place to put keybindings.
(custom-declare-variable 'cmuscheme-load-hook 'nil '(#$ . 12953) :type 'hook :group 'cmuscheme)
(byte-code "\300\301!\210\302\303!\207" [run-hooks cmuscheme-load-hook provide cmuscheme] 2)
