diff options
| author | Dave Love | 2000-11-14 14:41:24 +0000 |
|---|---|---|
| committer | Dave Love | 2000-11-14 14:41:24 +0000 |
| commit | 80e0fd4c983296f4c86654218feb6b7332a2dd20 (patch) | |
| tree | d186c4841a2687667685e376b929c6c61edc563b | |
| parent | 208fd08e2640e7fa3cb6225b4c8c5130804335e6 (diff) | |
| download | emacs-80e0fd4c983296f4c86654218feb6b7332a2dd20.tar.gz emacs-80e0fd4c983296f4c86654218feb6b7332a2dd20.zip | |
Doc fixes.
(cmuscheme) <defgroup>: Use `scheme' as parent.
(cmuscheme-program-name): Remove. Change uses to
scheme-program-name.
| -rw-r--r-- | lisp/cmuscheme.el | 85 |
1 files changed, 40 insertions, 45 deletions
diff --git a/lisp/cmuscheme.el b/lisp/cmuscheme.el index 3c280306323..c0539d465a0 100644 --- a/lisp/cmuscheme.el +++ b/lisp/cmuscheme.el | |||
| @@ -68,7 +68,7 @@ | |||
| 68 | ;;; CHANGE LOG | 68 | ;;; CHANGE LOG |
| 69 | ;;; =========================================================================== | 69 | ;;; =========================================================================== |
| 70 | ;;; 8/88 Olin | 70 | ;;; 8/88 Olin |
| 71 | ;;; Created. | 71 | ;;; Created. |
| 72 | ;;; | 72 | ;;; |
| 73 | ;;; 2/15/89 Olin | 73 | ;;; 2/15/89 Olin |
| 74 | ;;; Removed -emacs flag from process invocation. It's only useful for | 74 | ;;; Removed -emacs flag from process invocation. It's only useful for |
| @@ -99,7 +99,7 @@ | |||
| 99 | 99 | ||
| 100 | (defgroup cmuscheme nil | 100 | (defgroup cmuscheme nil |
| 101 | "Run a scheme process in a buffer." | 101 | "Run a scheme process in a buffer." |
| 102 | :group 'lisp) | 102 | :group 'scheme) |
| 103 | 103 | ||
| 104 | ;;; INFERIOR SCHEME MODE STUFF | 104 | ;;; INFERIOR SCHEME MODE STUFF |
| 105 | ;;;============================================================================ | 105 | ;;;============================================================================ |
| @@ -169,7 +169,7 @@ Customisation: Entry to this mode runs the hooks on comint-mode-hook and | |||
| 169 | inferior-scheme-mode-hook (in that order). | 169 | inferior-scheme-mode-hook (in that order). |
| 170 | 170 | ||
| 171 | You can send text to the inferior Scheme process from other buffers containing | 171 | You can send text to the inferior Scheme process from other buffers containing |
| 172 | Scheme source. | 172 | Scheme source. |
| 173 | switch-to-scheme switches the current buffer to the Scheme process buffer. | 173 | switch-to-scheme switches the current buffer to the Scheme process buffer. |
| 174 | scheme-send-definition sends the current definition to the Scheme process. | 174 | scheme-send-definition sends the current definition to the Scheme process. |
| 175 | scheme-compile-definition compiles the current definition. | 175 | scheme-compile-definition compiles the current definition. |
| @@ -183,7 +183,7 @@ For information on running multiple processes in multiple buffers, see | |||
| 183 | documentation for variable scheme-buffer. | 183 | documentation for variable scheme-buffer. |
| 184 | 184 | ||
| 185 | Commands: | 185 | Commands: |
| 186 | Return after the end of the process' output sends the text from the | 186 | Return after the end of the process' output sends the text from the |
| 187 | end of process to point. | 187 | end of process to point. |
| 188 | Return before the end of the process' output copies the sexp ending at point | 188 | Return before the end of the process' output copies the sexp ending at point |
| 189 | to the end of the process' output, and sends it. | 189 | to the end of the process' output, and sends it. |
| @@ -208,11 +208,11 @@ Defaults to a regexp ignoring all inputs of 0, 1, or 2 letters." | |||
| 208 | :group 'cmuscheme) | 208 | :group 'cmuscheme) |
| 209 | 209 | ||
| 210 | (defun scheme-input-filter (str) | 210 | (defun scheme-input-filter (str) |
| 211 | "Don't save anything matching inferior-scheme-filter-regexp" | 211 | "Don't save anything matching `inferior-scheme-filter-regexp'." |
| 212 | (not (string-match inferior-scheme-filter-regexp str))) | 212 | (not (string-match inferior-scheme-filter-regexp str))) |
| 213 | 213 | ||
| 214 | (defun scheme-get-old-input () | 214 | (defun scheme-get-old-input () |
| 215 | "Snarf the sexp ending at point" | 215 | "Snarf the sexp ending at point." |
| 216 | (save-excursion | 216 | (save-excursion |
| 217 | (let ((end (point))) | 217 | (let ((end (point))) |
| 218 | (backward-sexp) | 218 | (backward-sexp) |
| @@ -231,29 +231,24 @@ Defaults to a regexp ignoring all inputs of 0, 1, or 2 letters." | |||
| 231 | (scheme-args-to-list (substring string pos | 231 | (scheme-args-to-list (substring string pos |
| 232 | (length string))))))))) | 232 | (length string))))))))) |
| 233 | 233 | ||
| 234 | (defcustom cmuscheme-program-name "scheme" | ||
| 235 | "*Program invoked by the run-scheme command" | ||
| 236 | :type 'string | ||
| 237 | :group 'cmuscheme) | ||
| 238 | |||
| 239 | ;;;###autoload | 234 | ;;;###autoload |
| 240 | (defun run-scheme (cmd) | 235 | (defun run-scheme (cmd) |
| 241 | "Run an inferior Scheme process, input and output via buffer *scheme*. | 236 | "Run an inferior Scheme process, input and output via buffer *scheme*. |
| 242 | If there is a process already running in `*scheme*', switch to that buffer. | 237 | If there is a process already running in `*scheme*', switch to that buffer. |
| 243 | With argument, allows you to edit the command line (default is value | 238 | With argument, allows you to edit the command line (default is value |
| 244 | of `cmuscheme-program-name'). Runs the hooks `inferior-scheme-mode-hook' | 239 | of `scheme-program-name'). Runs the hooks `inferior-scheme-mode-hook' |
| 245 | \(after the `comint-mode-hook' is run). | 240 | \(after the `comint-mode-hook' is run). |
| 246 | \(Type \\[describe-mode] in the process buffer for a list of commands.)" | 241 | \(Type \\[describe-mode] in the process buffer for a list of commands.)" |
| 247 | 242 | ||
| 248 | (interactive (list (if current-prefix-arg | 243 | (interactive (list (if current-prefix-arg |
| 249 | (read-string "Run Scheme: " cmuscheme-program-name) | 244 | (read-string "Run Scheme: " scheme-program-name) |
| 250 | cmuscheme-program-name))) | 245 | scheme-program-name))) |
| 251 | (if (not (comint-check-proc "*scheme*")) | 246 | (if (not (comint-check-proc "*scheme*")) |
| 252 | (let ((cmdlist (scheme-args-to-list cmd))) | 247 | (let ((cmdlist (scheme-args-to-list cmd))) |
| 253 | (set-buffer (apply 'make-comint "scheme" (car cmdlist) | 248 | (set-buffer (apply 'make-comint "scheme" (car cmdlist) |
| 254 | nil (cdr cmdlist))) | 249 | nil (cdr cmdlist))) |
| 255 | (inferior-scheme-mode))) | 250 | (inferior-scheme-mode))) |
| 256 | (setq cmuscheme-program-name cmd) | 251 | (setq scheme-program-name cmd) |
| 257 | (setq scheme-buffer "*scheme*") | 252 | (setq scheme-buffer "*scheme*") |
| 258 | (pop-to-buffer "*scheme*")) | 253 | (pop-to-buffer "*scheme*")) |
| 259 | ;;;###autoload (add-hook 'same-window-buffer-names "*scheme*") | 254 | ;;;###autoload (add-hook 'same-window-buffer-names "*scheme*") |
| @@ -303,11 +298,11 @@ of `cmuscheme-program-name'). Runs the hooks `inferior-scheme-mode-hook' | |||
| 303 | 298 | ||
| 304 | (defun switch-to-scheme (eob-p) | 299 | (defun switch-to-scheme (eob-p) |
| 305 | "Switch to the scheme process buffer. | 300 | "Switch to the scheme process buffer. |
| 306 | With argument, positions cursor at end of buffer." | 301 | With argument, position cursor at end of buffer." |
| 307 | (interactive "P") | 302 | (interactive "P") |
| 308 | (if (get-buffer scheme-buffer) | 303 | (if (get-buffer scheme-buffer) |
| 309 | (pop-to-buffer scheme-buffer) | 304 | (pop-to-buffer scheme-buffer) |
| 310 | (error "No current process buffer. See variable scheme-buffer.")) | 305 | (error "No current process buffer. See variable `scheme-buffer'")) |
| 311 | (cond (eob-p | 306 | (cond (eob-p |
| 312 | (push-mark) | 307 | (push-mark) |
| 313 | (goto-char (point-max))))) | 308 | (goto-char (point-max))))) |
| @@ -320,21 +315,21 @@ Then switch to the process buffer." | |||
| 320 | (switch-to-scheme t)) | 315 | (switch-to-scheme t)) |
| 321 | 316 | ||
| 322 | (defun scheme-send-definition-and-go () | 317 | (defun scheme-send-definition-and-go () |
| 323 | "Send the current definition to the inferior Scheme. | 318 | "Send the current definition to the inferior Scheme. |
| 324 | Then switch to the process buffer." | 319 | Then switch to the process buffer." |
| 325 | (interactive) | 320 | (interactive) |
| 326 | (scheme-send-definition) | 321 | (scheme-send-definition) |
| 327 | (switch-to-scheme t)) | 322 | (switch-to-scheme t)) |
| 328 | 323 | ||
| 329 | (defun scheme-compile-definition-and-go () | 324 | (defun scheme-compile-definition-and-go () |
| 330 | "Compile the current definition in the inferior Scheme. | 325 | "Compile the current definition in the inferior Scheme. |
| 331 | Then switch to the process buffer." | 326 | Then switch to the process buffer." |
| 332 | (interactive) | 327 | (interactive) |
| 333 | (scheme-compile-definition) | 328 | (scheme-compile-definition) |
| 334 | (switch-to-scheme t)) | 329 | (switch-to-scheme t)) |
| 335 | 330 | ||
| 336 | (defun scheme-compile-region-and-go (start end) | 331 | (defun scheme-compile-region-and-go (start end) |
| 337 | "Compile the current region in the inferior Scheme. | 332 | "Compile the current region in the inferior Scheme. |
| 338 | Then switch to the process buffer." | 333 | Then switch to the process buffer." |
| 339 | (interactive "r") | 334 | (interactive "r") |
| 340 | (scheme-compile-region start end) | 335 | (scheme-compile-region start end) |
| @@ -343,21 +338,21 @@ Then switch to the process buffer." | |||
| 343 | (defcustom scheme-source-modes '(scheme-mode) | 338 | (defcustom scheme-source-modes '(scheme-mode) |
| 344 | "*Used to determine if a buffer contains Scheme source code. | 339 | "*Used to determine if a buffer contains Scheme source code. |
| 345 | If it's loaded into a buffer that is in one of these major modes, it's | 340 | If it's loaded into a buffer that is in one of these major modes, it's |
| 346 | considered a scheme source file by scheme-load-file and scheme-compile-file. | 341 | considered a scheme source file by `scheme-load-file' and `scheme-compile-file'. |
| 347 | Used by these commands to determine defaults." | 342 | Used by these commands to determine defaults." |
| 348 | :type '(repeat function) | 343 | :type '(repeat function) |
| 349 | :group 'cmuscheme) | 344 | :group 'cmuscheme) |
| 350 | 345 | ||
| 351 | (defvar scheme-prev-l/c-dir/file nil | 346 | (defvar scheme-prev-l/c-dir/file nil |
| 352 | "Caches the last (directory . file) pair. | 347 | "Caches the last (directory . file) pair. |
| 353 | Caches the last pair used in the last scheme-load-file or | 348 | Caches the last pair used in the last `scheme-load-file' or |
| 354 | scheme-compile-file command. Used for determining the default in the | 349 | `scheme-compile-file' command. Used for determining the default in the |
| 355 | next one.") | 350 | next one.") |
| 356 | 351 | ||
| 357 | (defun scheme-load-file (file-name) | 352 | (defun scheme-load-file (file-name) |
| 358 | "Load a Scheme file into the inferior Scheme process." | 353 | "Load a Scheme file FILE-NAME into the inferior Scheme process." |
| 359 | (interactive (comint-get-source "Load Scheme file: " scheme-prev-l/c-dir/file | 354 | (interactive (comint-get-source "Load Scheme file: " scheme-prev-l/c-dir/file |
| 360 | scheme-source-modes t)) ; T because LOAD | 355 | scheme-source-modes t)) ; T because LOAD |
| 361 | ; needs an exact name | 356 | ; needs an exact name |
| 362 | (comint-check-source file-name) ; Check to see if buffer needs saved. | 357 | (comint-check-source file-name) ; Check to see if buffer needs saved. |
| 363 | (setq scheme-prev-l/c-dir/file (cons (file-name-directory file-name) | 358 | (setq scheme-prev-l/c-dir/file (cons (file-name-directory file-name) |
| @@ -367,7 +362,7 @@ next one.") | |||
| 367 | "\"\)\n"))) | 362 | "\"\)\n"))) |
| 368 | 363 | ||
| 369 | (defun scheme-compile-file (file-name) | 364 | (defun scheme-compile-file (file-name) |
| 370 | "Compile a Scheme file in the inferior Scheme process." | 365 | "Compile a Scheme file FILE-NAME in the inferior Scheme process." |
| 371 | (interactive (comint-get-source "Compile Scheme file: " | 366 | (interactive (comint-get-source "Compile Scheme file: " |
| 372 | scheme-prev-l/c-dir/file | 367 | scheme-prev-l/c-dir/file |
| 373 | scheme-source-modes | 368 | scheme-source-modes |
| @@ -386,16 +381,16 @@ next one.") | |||
| 386 | MULTIPLE PROCESS SUPPORT | 381 | MULTIPLE PROCESS SUPPORT |
| 387 | =========================================================================== | 382 | =========================================================================== |
| 388 | Cmuscheme.el supports, in a fairly simple fashion, running multiple Scheme | 383 | Cmuscheme.el supports, in a fairly simple fashion, running multiple Scheme |
| 389 | processes. To run multiple Scheme processes, you start the first up with | 384 | processes. To run multiple Scheme processes, you start the first up with |
| 390 | \\[run-scheme]. It will be in a buffer named *scheme*. Rename this buffer | 385 | \\[run-scheme]. It will be in a buffer named *scheme*. Rename this buffer |
| 391 | with \\[rename-buffer]. You may now start up a new process with another | 386 | with \\[rename-buffer]. You may now start up a new process with another |
| 392 | \\[run-scheme]. It will be in a new buffer, named *scheme*. You can | 387 | \\[run-scheme]. It will be in a new buffer, named *scheme*. You can |
| 393 | switch between the different process buffers with \\[switch-to-buffer]. | 388 | switch between the different process buffers with \\[switch-to-buffer]. |
| 394 | 389 | ||
| 395 | Commands that send text from source buffers to Scheme processes -- | 390 | Commands that send text from source buffers to Scheme processes -- |
| 396 | like scheme-send-definition or scheme-compile-region -- have to choose a | 391 | like `scheme-send-definition' or `scheme-compile-region' -- have to choose a |
| 397 | process to send to, when you have more than one Scheme process around. This | 392 | process to send to, when you have more than one Scheme process around. This |
| 398 | is determined by the global variable scheme-buffer. Suppose you | 393 | is determined by the global variable `scheme-buffer'. Suppose you |
| 399 | have three inferior Schemes running: | 394 | have three inferior Schemes running: |
| 400 | Buffer Process | 395 | Buffer Process |
| 401 | foo scheme | 396 | foo scheme |
| @@ -404,30 +399,30 @@ have three inferior Schemes running: | |||
| 404 | If you do a \\[scheme-send-definition-and-go] command on some Scheme source | 399 | If you do a \\[scheme-send-definition-and-go] command on some Scheme source |
| 405 | code, what process do you send it to? | 400 | code, what process do you send it to? |
| 406 | 401 | ||
| 407 | - If you're in a process buffer (foo, bar, or *scheme*), | 402 | - If you're in a process buffer (foo, bar, or *scheme*), |
| 408 | you send it to that process. | 403 | you send it to that process. |
| 409 | - If you're in some other buffer (e.g., a source file), you | 404 | - If you're in some other buffer (e.g., a source file), you |
| 410 | send it to the process attached to buffer scheme-buffer. | 405 | send it to the process attached to buffer `scheme-buffer'. |
| 411 | This process selection is performed by function scheme-proc. | 406 | This process selection is performed by function `scheme-proc'. |
| 412 | 407 | ||
| 413 | Whenever \\[run-scheme] fires up a new process, it resets scheme-buffer | 408 | Whenever \\[run-scheme] fires up a new process, it resets `scheme-buffer' |
| 414 | to be the new process's buffer. If you only run one process, this will | 409 | to be the new process's buffer. If you only run one process, this will |
| 415 | do the right thing. If you run multiple processes, you can change | 410 | do the right thing. If you run multiple processes, you can change |
| 416 | scheme-buffer to another process buffer with \\[set-variable]. | 411 | `scheme-buffer' to another process buffer with \\[set-variable]. |
| 417 | 412 | ||
| 418 | More sophisticated approaches are, of course, possible. If you find yourself | 413 | More sophisticated approaches are, of course, possible. If you find yourself |
| 419 | needing to switch back and forth between multiple processes frequently, | 414 | needing to switch back and forth between multiple processes frequently, |
| 420 | you may wish to consider ilisp.el, a larger, more sophisticated package | 415 | you may wish to consider ilisp.el, a larger, more sophisticated package |
| 421 | for running inferior Lisp and Scheme processes. The approach taken here is | 416 | for running inferior Lisp and Scheme processes. The approach taken here is |
| 422 | for a minimal, simple implementation. Feel free to extend it.") | 417 | for a minimal, simple implementation. Feel free to extend it.") |
| 423 | 418 | ||
| 424 | (defun scheme-proc () | 419 | (defun scheme-proc () |
| 425 | "Returns the current scheme process. See variable scheme-buffer." | 420 | "Return the current scheme process. See variable `scheme-buffer'." |
| 426 | (let ((proc (get-buffer-process (if (eq major-mode 'inferior-scheme-mode) | 421 | (let ((proc (get-buffer-process (if (eq major-mode 'inferior-scheme-mode) |
| 427 | (current-buffer) | 422 | (current-buffer) |
| 428 | scheme-buffer)))) | 423 | scheme-buffer)))) |
| 429 | (or proc | 424 | (or proc |
| 430 | (error "No current process. See variable scheme-buffer")))) | 425 | (error "No current process. See variable `scheme-buffer'")))) |
| 431 | 426 | ||
| 432 | 427 | ||
| 433 | ;;; Do the user's customisation... | 428 | ;;; Do the user's customisation... |