annotate lisp/packages/cmuscheme.el @ 10:49a24b4fd526 r19-15b6

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