annotate lisp/packages/cmuscheme.el @ 189:489f57a838ef r20-3b21

Import from CVS: tag r20-3b21
author cvs
date Mon, 13 Aug 2007 09:57:07 +0200
parents 0293115a14e9
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1 ;;; cmuscheme.el --- Scheme process in a buffer. Adapted from tea.el.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3 ;; Copyright (C) 1988, 1994 Free Software Foundation, Inc.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5 ;; Author: Olin Shivers <olin.shivers@cs.cmu.edu>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6 ;; Maintainer: FSF
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7 ;; Keywords: processes, lisp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9 ;; This file is part of XEmacs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11 ;; XEmacs is free software; you can redistribute it and/or modify it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12 ;; under the terms of the GNU General Public License as published by
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 ;; the Free Software Foundation; either version 2, or (at your option)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 ;; any later version.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16 ;; XEmacs is distributed in the hope that it will be useful, but
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19 ;; General Public License for more details.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21 ;; You should have received a copy of the GNU General Public License
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
22 ;; along with XEmacs; see the file COPYING. If not, write to the
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
23 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
24 ;; Boston, MA 02111-1307, USA.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
26 ;;; Synched up with: FSF 19.34.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28 ;;; Commentary:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
30 ;; This is a customisation of comint-mode (see comint.el)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
31 ;;
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
32 ;; Written by Olin Shivers (olin.shivers@cs.cmu.edu). With bits and pieces
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
33 ;; lifted from scheme.el, shell.el, clisp.el, newclisp.el, cobol.el, et al..
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
34 ;; 8/88
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
35 ;;
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
36 ;; Please send me bug reports, bug fixes, and extensions, so that I can
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
37 ;; merge them into the master source.
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
38 ;;
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
39 ;; The changelog is at the end of this file.
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
40 ;;
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
41 ;; NOTE: MIT Cscheme, when invoked with the -emacs flag, has a special user
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
42 ;; interface that communicates process state back to the superior emacs by
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
43 ;; outputting special control sequences. The gnumacs package, xscheme.el, has
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
44 ;; lots and lots of special purpose code to read these control sequences, and
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
45 ;; so is very tightly integrated with the cscheme process. The cscheme
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
46 ;; interrupt handler and debugger read single character commands in cbreak
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
47 ;; mode; when this happens, xscheme.el switches to special keymaps that bind
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
48 ;; the single letter command keys to emacs functions that directly send the
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
49 ;; character to the scheme process. Cmuscheme mode does *not* provide this
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
50 ;; functionality. If you are a cscheme user, you may prefer to use the
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
51 ;; xscheme.el/cscheme -emacs interaction.
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
52 ;;
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
53 ;; Here's a summary of the pros and cons, as I see them.
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
54 ;; xscheme: Tightly integrated with inferior cscheme process! A few commands
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
55 ;; not in cmuscheme. But. Integration is a bit of a hack. Input
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
56 ;; history only keeps the immediately prior input. Bizarre
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
57 ;; keybindings.
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
58 ;;
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
59 ;; cmuscheme: Not tightly integrated with inferior cscheme process. But.
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
60 ;; Carefully integrated functionality with the entire suite of
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
61 ;; comint-derived CMU process modes. Keybindings reminiscent of
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
62 ;; Zwei and Hemlock. Good input history. A few commands not in
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
63 ;; xscheme.
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
64 ;;
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
65 ;; It's a tradeoff. Pay your money; take your choice. If you use a Scheme
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
66 ;; that isn't Cscheme, of course, there isn't a choice. Xscheme.el is *very*
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
67 ;; Cscheme-specific; you must use cmuscheme.el. Interested parties are
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
68 ;; invited to port xscheme functionality on top of comint mode...
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70 ;;; Code:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72 (require 'scheme)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73 (require 'comint)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 ;;; INFERIOR SCHEME MODE STUFF
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76 ;;;============================================================================
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78 (defvar inferior-scheme-mode-hook nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79 "*Hook for customising inferior-scheme mode.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80 (defvar inferior-scheme-mode-map nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82 (cond ((not inferior-scheme-mode-map)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83 (setq inferior-scheme-mode-map
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
84 (copy-keymap comint-mode-map))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
85 (define-key inferior-scheme-mode-map "\M-\C-x" ;gnu convention
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
86 'scheme-send-definition)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87 (define-key inferior-scheme-mode-map "\C-x\C-e" 'scheme-send-last-sexp)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88 (define-key inferior-scheme-mode-map "\C-c\C-l" 'scheme-load-file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89 (define-key inferior-scheme-mode-map "\C-c\C-k" 'scheme-compile-file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
90 (scheme-mode-commands inferior-scheme-mode-map)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
91
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
92 ;; Install the process communication commands in the scheme-mode keymap.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
93 (define-key scheme-mode-map "\M-\C-x" 'scheme-send-definition);gnu convention
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
94 (define-key scheme-mode-map "\C-x\C-e" 'scheme-send-last-sexp);gnu convention
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
95 (define-key scheme-mode-map "\C-c\C-e" 'scheme-send-definition)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
96 (define-key scheme-mode-map "\C-c\M-e" 'scheme-send-definition-and-go)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
97 (define-key scheme-mode-map "\C-c\C-r" 'scheme-send-region)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
98 (define-key scheme-mode-map "\C-c\M-r" 'scheme-send-region-and-go)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
99 (define-key scheme-mode-map "\C-c\M-c" 'scheme-compile-definition)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
100 (define-key scheme-mode-map "\C-c\C-c" 'scheme-compile-definition-and-go)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
101 (define-key scheme-mode-map "\C-c\C-z" 'switch-to-scheme)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
102 (define-key scheme-mode-map "\C-c\C-l" 'scheme-load-file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
103 (define-key scheme-mode-map "\C-c\C-k" 'scheme-compile-file) ;k for "kompile"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
104
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
105 (defvar scheme-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
106
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
107 (defun inferior-scheme-mode ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
108 "Major mode for interacting with an inferior Scheme process.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
109
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
110 The following commands are available:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
111 \\{inferior-scheme-mode-map}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
112
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
113 A Scheme process can be fired up with M-x run-scheme.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
114
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
115 Customisation: Entry to this mode runs the hooks on comint-mode-hook and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
116 inferior-scheme-mode-hook (in that order).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
117
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
118 You can send text to the inferior Scheme process from other buffers containing
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
119 Scheme source.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
120 switch-to-scheme switches the current buffer to the Scheme process buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
121 scheme-send-definition sends the current definition to the Scheme process.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
122 scheme-compile-definition compiles the current definition.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
123 scheme-send-region sends the current region to the Scheme process.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
124 scheme-compile-region compiles the current region.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
125
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
126 scheme-send-definition-and-go, scheme-compile-definition-and-go,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
127 scheme-send-region-and-go, and scheme-compile-region-and-go
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
128 switch to the Scheme process buffer after sending their text.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
129 For information on running multiple processes in multiple buffers, see
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
130 documentation for variable scheme-buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
131
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
132 Commands:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
133 Return after the end of the process' output sends the text from the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
134 end of process to point.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
135 Return before the end of the process' output copies the sexp ending at point
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
136 to the end of the process' output, and sends it.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
137 Delete converts tabs to spaces as it moves back.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
138 Tab indents for Scheme; with argument, shifts rest
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
139 of expression rigidly with the current line.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
140 C-M-q does Tab on each line starting within following expression.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
141 Paragraphs are separated only by blank lines. Semicolons start comments.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
142 If you accidentally suspend your process, use \\[comint-continue-subjob]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
143 to continue it."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
144 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
145 (comint-mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
146 ;; Customise in inferior-scheme-mode-hook
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
147 (setq comint-prompt-regexp "^[^>\n]*>+ *") ; OK for cscheme, oaklisp, T,...
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
148 (scheme-mode-variables)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
149 (setq major-mode 'inferior-scheme-mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
150 (setq mode-name "Inferior Scheme")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
151 (setq mode-line-process '(":%s"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
152 (use-local-map inferior-scheme-mode-map)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
153 (setq comint-input-filter (function scheme-input-filter))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
154 (setq comint-get-old-input (function scheme-get-old-input))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
155 (run-hooks 'inferior-scheme-mode-hook))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
156
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
157 (defvar inferior-scheme-filter-regexp "\\`\\s *\\S ?\\S ?\\s *\\'"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
158 "*Input matching this regexp are not saved on the history list.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
159 Defaults to a regexp ignoring all inputs of 0, 1, or 2 letters.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
160
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
161 (defun scheme-input-filter (str)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
162 "Don't save anything matching inferior-scheme-filter-regexp"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
163 (not (string-match inferior-scheme-filter-regexp str)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
164
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
165 (defun scheme-get-old-input ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
166 "Snarf the sexp ending at point"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
167 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
168 (let ((end (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
169 (backward-sexp)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
170 (buffer-substring (point) end))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
171
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
172 (defun scheme-args-to-list (string)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
173 (let ((where (string-match "[ \t]" string)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
174 (cond ((null where) (list string))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
175 ((not (= where 0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
176 (cons (substring string 0 where)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
177 (scheme-args-to-list (substring string (+ 1 where)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
178 (length string)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
179 (t (let ((pos (string-match "[^ \t]" string)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
180 (if (null pos)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
181 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
182 (scheme-args-to-list (substring string pos
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
183 (length string)))))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
184
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
185 (defvar scheme-program-name "scheme"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
186 "*Program invoked by the run-scheme command")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
187
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
188 (defun run-scheme (cmd)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
189 "Run an inferior Scheme process, input and output via buffer *scheme*.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
190 If there is a process already running in `*scheme*', switch to that buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
191 With argument, allows you to edit the command line (default is value
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
192 of `scheme-program-name'). Runs the hooks `inferior-scheme-mode-hook'
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
193 \(after the `comint-mode-hook' is run).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
194 \(Type \\[describe-mode] in the process buffer for a list of commands.)"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
195
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
196 (interactive (list (if current-prefix-arg
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
197 (read-string "Run Scheme: " scheme-program-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
198 scheme-program-name)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
199 (if (not (comint-check-proc "*scheme*"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
200 (let ((cmdlist (scheme-args-to-list cmd)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
201 (set-buffer (apply 'make-comint "scheme" (car cmdlist)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
202 nil (cdr cmdlist)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
203 (inferior-scheme-mode)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
204 (setq scheme-program-name cmd)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
205 (setq scheme-buffer "*scheme*")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
206 (pop-to-buffer "*scheme*"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
207 ;;;###autoload (add-hook 'same-window-buffer-names "*scheme*")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
208
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
209 (defun scheme-send-region (start end)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
210 "Send the current region to the inferior Scheme process."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
211 (interactive "r")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
212 (comint-send-region (scheme-proc) start end)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
213 (comint-send-string (scheme-proc) "\n"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
214
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
215 (defun scheme-send-definition ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
216 "Send the current definition to the inferior Scheme process."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
217 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
218 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
219 (end-of-defun)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
220 (let ((end (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
221 (beginning-of-defun)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
222 (scheme-send-region (point) end))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
223
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
224 (defun scheme-send-last-sexp ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
225 "Send the previous sexp to the inferior Scheme process."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
226 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
227 (scheme-send-region (save-excursion (backward-sexp) (point)) (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
228
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
229 (defvar scheme-compile-exp-command "(compile '%s)"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
230 "*Template for issuing commands to compile arbitrary Scheme expressions.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
231
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
232 (defun scheme-compile-region (start end)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
233 "Compile the current region in the inferior Scheme process.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
234 \(A BEGIN is wrapped around the region: (BEGIN <region>))"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
235 (interactive "r")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
236 (comint-send-string (scheme-proc) (format scheme-compile-exp-command
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
237 (format "(begin %s)"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
238 (buffer-substring start end))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
239 (comint-send-string (scheme-proc) "\n"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
240
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
241 (defun scheme-compile-definition ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
242 "Compile the current definition in the inferior Scheme process."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
243 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
244 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
245 (end-of-defun)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
246 (let ((end (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
247 (beginning-of-defun)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
248 (scheme-compile-region (point) end))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
249
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
250 (defun switch-to-scheme (eob-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
251 "Switch to the scheme process buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
252 With argument, positions cursor at end of buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
253 (interactive "P")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
254 (if (get-buffer scheme-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
255 (pop-to-buffer scheme-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
256 (error "No current process buffer. See variable scheme-buffer."))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
257 (cond (eob-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
258 (push-mark)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
259 (goto-char (point-max)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
260
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
261 (defun scheme-send-region-and-go (start end)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
262 "Send the current region to the inferior Scheme process.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
263 Then switch to the process buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
264 (interactive "r")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
265 (scheme-send-region start end)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
266 (switch-to-scheme t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
267
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
268 (defun scheme-send-definition-and-go ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
269 "Send the current definition to the inferior Scheme.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
270 Then switch to the process buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
271 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
272 (scheme-send-definition)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
273 (switch-to-scheme t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
274
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
275 (defun scheme-compile-definition-and-go ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
276 "Compile the current definition in the inferior Scheme.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
277 Then switch to the process buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
278 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
279 (scheme-compile-definition)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
280 (switch-to-scheme t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
281
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
282 (defun scheme-compile-region-and-go (start end)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
283 "Compile the current region in the inferior Scheme.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
284 Then switch to the process buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
285 (interactive "r")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
286 (scheme-compile-region start end)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
287 (switch-to-scheme t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
288
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
289 (defvar scheme-source-modes '(scheme-mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
290 "*Used to determine if a buffer contains Scheme source code.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
291 If it's loaded into a buffer that is in one of these major modes, it's
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
292 considered a scheme source file by scheme-load-file and scheme-compile-file.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
293 Used by these commands to determine defaults.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
294
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
295 (defvar scheme-prev-l/c-dir/file nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
296 "Caches the last (directory . file) pair.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
297 Caches the last pair used in the last scheme-load-file or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
298 scheme-compile-file command. Used for determining the default in the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
299 next one.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
300
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
301 (defun scheme-load-file (file-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
302 "Load a Scheme file into the inferior Scheme process."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
303 (interactive (comint-get-source "Load Scheme file: " scheme-prev-l/c-dir/file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
304 scheme-source-modes t)) ; T because LOAD
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
305 ; needs an exact name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
306 (comint-check-source file-name) ; Check to see if buffer needs saved.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
307 (setq scheme-prev-l/c-dir/file (cons (file-name-directory file-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
308 (file-name-nondirectory file-name)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
309 (comint-send-string (scheme-proc) (concat "(load \""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
310 file-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
311 "\"\)\n")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
312
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
313 (defun scheme-compile-file (file-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
314 "Compile a Scheme file in the inferior Scheme process."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
315 (interactive (comint-get-source "Compile Scheme file: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
316 scheme-prev-l/c-dir/file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
317 scheme-source-modes
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
318 nil)) ; NIL because COMPILE doesn't
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
319 ; need an exact name.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
320 (comint-check-source file-name) ; Check to see if buffer needs saved.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
321 (setq scheme-prev-l/c-dir/file (cons (file-name-directory file-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
322 (file-name-nondirectory file-name)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
323 (comint-send-string (scheme-proc) (concat "(compile-file \""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
324 file-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
325 "\"\)\n")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
326
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
327
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
328 (defvar scheme-buffer nil "*The current scheme process buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
329
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
330 MULTIPLE PROCESS SUPPORT
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
331 ===========================================================================
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
332 Cmuscheme.el supports, in a fairly simple fashion, running multiple Scheme
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
333 processes. To run multiple Scheme processes, you start the first up with
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
334 \\[run-scheme]. It will be in a buffer named *scheme*. Rename this buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
335 with \\[rename-buffer]. You may now start up a new process with another
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
336 \\[run-scheme]. It will be in a new buffer, named *scheme*. You can
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
337 switch between the different process buffers with \\[switch-to-buffer].
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
338
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
339 Commands that send text from source buffers to Scheme processes --
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
340 like scheme-send-definition or scheme-compile-region -- have to choose a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
341 process to send to, when you have more than one Scheme process around. This
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
342 is determined by the global variable scheme-buffer. Suppose you
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
343 have three inferior Schemes running:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
344 Buffer Process
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
345 foo scheme
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
346 bar scheme<2>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
347 *scheme* scheme<3>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
348 If you do a \\[scheme-send-definition-and-go] command on some Scheme source
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
349 code, what process do you send it to?
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
350
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
351 - If you're in a process buffer (foo, bar, or *scheme*),
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
352 you send it to that process.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
353 - If you're in some other buffer (e.g., a source file), you
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
354 send it to the process attached to buffer scheme-buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
355 This process selection is performed by function scheme-proc.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
356
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
357 Whenever \\[run-scheme] fires up a new process, it resets scheme-buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
358 to be the new process's buffer. If you only run one process, this will
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
359 do the right thing. If you run multiple processes, you can change
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
360 scheme-buffer to another process buffer with \\[set-variable].
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
361
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
362 More sophisticated approaches are, of course, possible. If you find yourself
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
363 needing to switch back and forth between multiple processes frequently,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
364 you may wish to consider ilisp.el, a larger, more sophisticated package
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
365 for running inferior Lisp and Scheme processes. The approach taken here is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
366 for a minimal, simple implementation. Feel free to extend it.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
367
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
368 (defun scheme-proc ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
369 "Returns the current scheme process. See variable scheme-buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
370 (let ((proc (get-buffer-process (if (eq major-mode 'inferior-scheme-mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
371 (current-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
372 scheme-buffer))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
373 (or proc
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
374 (error "No current process. See variable scheme-buffer"))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
375
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
376
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
377 ;;; Do the user's customisation...
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
378
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
379 (defvar cmuscheme-load-hook nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
380 "This hook is run when cmuscheme is loaded in.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
381 This is a good place to put keybindings.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
382
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
383 (run-hooks 'cmuscheme-load-hook)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
384
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
385
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
386 ;;; CHANGE LOG
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
387 ;;; ===========================================================================
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
388 ;;; 8/88 Olin
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
389 ;;; Created.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
390 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
391 ;;; 2/15/89 Olin
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
392 ;;; Removed -emacs flag from process invocation. It's only useful for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
393 ;;; cscheme, and makes cscheme assume it's running under xscheme.el,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
394 ;;; which messes things up royally. A bug.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
395 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
396 ;;; 5/22/90 Olin
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
397 ;;; - Upgraded to use comint-send-string and comint-send-region.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
398 ;;; - run-scheme now offers to let you edit the command line if
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
399 ;;; you invoke it with a prefix-arg. M-x scheme is redundant, and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
400 ;;; has been removed.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
401 ;;; - Explicit references to process "scheme" have been replaced with
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
402 ;;; (scheme-proc). This allows better handling of multiple process bufs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
403 ;;; - Added scheme-send-last-sexp, bound to C-x C-e. A gnu convention.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
404 ;;; - Have not added process query facility a la cmulisp.el's lisp-show-arglist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
405 ;;; and friends, but interested hackers might find a useful application
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
406 ;;; of this facility.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
407 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
408 ;;; 3/12/90 Olin
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
409 ;;; - scheme-load-file and scheme-compile-file no longer switch-to-scheme.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
410 ;;; Tale suggested this.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
411
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
412 (provide 'cmuscheme)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
413
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
414 ;;; cmuscheme.el ends here