;ELC ;;; compiled by kwzh@hal.gnu.ai.mit.edu on Tue May 2 20:18:48 1995 ;;; from file /gd/gnu/emacs/19.0/lisp/cmuscheme.el ;;; emacs version 19.28.90.69. ;;; bytecomp version FSF 2.10 ;;; optimization is on. ;;; this file uses opcodes which do not exist in Emacs 18. (if (and (boundp 'emacs-version) (or (and (boundp 'epoch::version) epoch::version) (string-lessp emacs-version "19"))) (error "`/gd/gnu/emacs/19.0/lisp/cmuscheme.el' was compiled for Emacs 19")) (byte-code "ÀÁ!ˆÀÂ!‡" [require scheme comint] 2) #@45 *Hook for customising inferior-scheme mode. (defvar inferior-scheme-mode-hook nil (#$ . -536)) (byte-code "ÀÁ!„ÂÁ B „0Ä !Æ ÇÈ#ˆÆ ÉÊ#ˆÆ ËÌ#ˆÆ ÍÎ#ˆÏ !ˆÆÇÈ#ˆÆÉÊ#ˆÆÑÈ#ˆÆÒÓ#ˆÆÔÕ#ˆÆÖ×#ˆÆØÙ#ˆÆÚÛ#ˆÆÜÝ#ˆÆËÌ#ˆÆÍÎ#ˆÞ B‡" [boundp inferior-scheme-mode-map nil current-load-list copy-keymap comint-mode-map define-key "˜" scheme-send-definition "" scheme-send-last-sexp "\f" scheme-load-file " " scheme-compile-file scheme-mode-commands scheme-mode-map "" "å" scheme-send-definition-and-go "" scheme-send-region "ò" scheme-send-region-and-go "ã" scheme-compile-definition "" scheme-compile-definition-and-go "" switch-to-scheme 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 "À ˆÁà ˆÄÆÈ Ê !ˆÌ ÎÐÑ!‡" [comint-mode "^[^>\n]*>+ *" comint-prompt-regexp scheme-mode-variables inferior-scheme-mode major-mode "Inferior Scheme" mode-name (":%s") mode-line-process use-local-map inferior-scheme-mode-map scheme-input-filter comint-input-filter scheme-get-old-input comint-get-old-input run-hooks inferior-scheme-mode-hook] 2 (#$ . 1221) 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. (defvar inferior-scheme-filter-regexp "\\`\\s *\\S ?\\S ?\\s *\\'" (#$ . -3315)) #@60 Don't save anything matching inferior-scheme-filter-regexp (defalias 'scheme-input-filter #[(str) "À \n\"?‡" [string-match inferior-scheme-filter-regexp str] 3 (#$ . 3529)]) #@32 Snarf the sexp ending at point (defalias 'scheme-get-old-input #[nil "Š`Á ˆ`{*‡" [end backward-sexp] 2 (#$ . 3709)]) (defalias 'scheme-args-to-list #[(string) "ÀÁ\n\"‰„\nC‚: ÄU„%\nÄ OÅ\n Æ\\\nGO!B‚:ÀÇ\n\"‰??…9Å\n\nGO!))‡" [string-match "[ ]" string where 0 scheme-args-to-list 1 "[^ ]" pos] 6]) #@44 *Program invoked by the run-scheme command (defvar scheme-program-name "scheme" (#$ . -4025)) #@398 Run an inferior Scheme process, input and output via buffer *scheme*. If there is a process already running in *scheme*, just switch to that buffer. With argument, allows you to edit the command line (default is value of scheme-program-name). Runs the hooks from 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) "ÀÁ!„ !ÅÆÇ\f@È\fA%qˆÉ ˆ) \nÁ ÌÁ!‡" [comint-check-proc "*scheme*" scheme-args-to-list cmd cmdlist apply make-comint "scheme" nil inferior-scheme-mode scheme-program-name scheme-buffer switch-to-buffer] 6 (#$ . 4126) (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) "ÀÁ \n #ˆÄÁ Å\"‡" [comint-send-region scheme-proc start end comint-send-string "\n"] 4 (#$ . 4882) "r"]) #@61 Send the current definition to the inferior Scheme process. (defalias 'scheme-send-definition #[nil "ŠÀ ˆ` ˆÃ` \"*‡" [end-of-defun end beginning-of-defun scheme-send-region] 3 (#$ . 5093) nil]) #@56 Send the previous sexp to the inferior Scheme process. (defalias 'scheme-send-last-sexp #[nil "ÀŠÁ ˆ`)`\"‡" [scheme-send-region backward-sexp] 3 (#$ . 5295) nil]) #@73 *Template for issuing commands to compile arbitrary Scheme expressions. (defvar scheme-compile-exp-command "(compile '%s)" (#$ . -5464)) #@117 Compile the current region in the inferior Scheme process. (A BEGIN is wrapped around the region: (BEGIN )) (defalias 'scheme-compile-region #[(start end) "ÀÁ  ÂÄ {\"\"\"ˆÀÁ Ç\"‡" [comint-send-string scheme-proc format scheme-compile-exp-command "(begin %s)" start end "\n"] 8 (#$ . 5608) "r"]) #@64 Compile the current definition in the inferior Scheme process. (defalias 'scheme-compile-definition #[nil "ŠÀ ˆ` ˆÃ` \"*‡" [end-of-defun end beginning-of-defun scheme-compile-region] 3 (#$ . 5920) nil]) #@88 Switch to the scheme process buffer. With argument, positions cursor at end of buffer. (defalias 'switch-to-scheme #[(eob-p) "À !ƒ  !ˆ‚ÃÄ!ˆ …Æ ˆdb‡" [get-buffer scheme-buffer pop-to-buffer error "No current process buffer. See variable scheme-buffer." eob-p push-mark] 2 (#$ . 6131) "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) "À \n\"ˆÃÄ!‡" [scheme-send-region start end switch-to-scheme t] 3 (#$ . 6432) "r"]) #@89 Send the current definition to the inferior Scheme. Then switch to the process buffer. (defalias 'scheme-send-definition-and-go #[nil "À ˆÁÂ!‡" [scheme-send-definition switch-to-scheme t] 2 (#$ . 6664) nil]) #@92 Compile the current definition in the inferior Scheme. Then switch to the process buffer. (defalias 'scheme-compile-definition-and-go #[nil "À ˆÁÂ!‡" [scheme-compile-definition switch-to-scheme t] 2 (#$ . 6879) nil]) #@88 Compile the current region in the inferior Scheme. Then switch to the process buffer. (defalias 'scheme-compile-region-and-go #[(start end) "À \n\"ˆÃÄ!‡" [scheme-compile-region start end switch-to-scheme t] 3 (#$ . 7103) "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. (defvar scheme-source-modes (quote (scheme-mode)) (#$ . -7338)) #@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 (#$ . 7663)) #@54 Load a Scheme file into the inferior Scheme process. (defalias 'scheme-load-file #[(file-name) "À !ˆÂ !à !BÅÆ Ç ÈQ\"‡" [comint-check-source file-name file-name-directory file-name-nondirectory scheme-prev-l/c-dir/file comint-send-string scheme-proc "(load \"" "\")\n"] 5 (#$ . 7898) (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) "À !ˆÂ !à !BÅÆ Ç ÈQ\"‡" [comint-check-source file-name file-name-directory file-name-nondirectory scheme-prev-l/c-dir/file comint-send-string scheme-proc "(compile-file \"" "\")\n"] 5 (#$ . 8278) (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 (#$ . -8677)) #@65 Returns the current scheme process. See variable scheme-buffer. (defalias 'scheme-proc #[nil "À Â=ƒ p‚\f !‰†ÅÆ!)‡" [get-buffer-process major-mode inferior-scheme-mode scheme-buffer proc error "No current process. See variable scheme-buffer"] 4 (#$ . 10702)]) #@88 This hook is run when cmuscheme is loaded in. This is a good place to put keybindings. (defvar cmuscheme-load-hook nil (#$ . 10972)) (byte-code "ÀÁ!ˆÂÃ!‡" [run-hooks cmuscheme-load-hook provide cmuscheme] 2)