X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/6251ee24afa4f74a3e094ba12493ab2dc9315886..cd30a521aa838f6bcf08ee6ffb62986cd2bf8daa:/lisp/xscheme.el diff --git a/lisp/xscheme.el b/lisp/xscheme.el index 61c46a3393..32b402103d 100644 --- a/lisp/xscheme.el +++ b/lisp/xscheme.el @@ -1,13 +1,10 @@ ;;; xscheme.el --- run Scheme under Emacs -;; Maintainer: FSF -;; Last-Modified: 21 Jan 1987 -;; Keywords: languages - -;;; $Header: xscheme.el,v 1.26 90/09/11 01:51:20 GMT cph Exp $ - ;; Copyright (C) 1986, 1987, 1989, 1990 Free Software Foundation, Inc. +;; Maintainer: FSF +;; Keywords: languages, lisp + ;; This file is part of GNU Emacs. ;; GNU Emacs is free software; you can redistribute it and/or modify @@ -21,33 +18,48 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with GNU Emacs; see the file COPYING. If not, write to -;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. +;; along with GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, +;; Boston, MA 02111-1307, USA. ;;; Commentary: -;;; Requires C-Scheme release 5 or later -;;; Changes to Control-G handler require runtime version 13.85 or later +;; A major mode for editing Scheme and interacting with MIT's C-Scheme. +;; +;; Requires C-Scheme release 5 or later +;; Changes to Control-G handler require runtime version 13.85 or later ;;; Code: (require 'scheme) -(defvar scheme-program-name "scheme" - "*Program invoked by the `run-scheme' command.") - -(defvar scheme-band-name nil - "*Band loaded by the `run-scheme' command.") - -(defvar scheme-program-arguments nil - "*Arguments passed to the Scheme program by the `run-scheme' command.") - -(defvar xscheme-allow-pipelined-evaluation t +(defgroup xscheme nil + "Major mode for editing Scheme and interacting with MIT's C-Scheme." + :group 'lisp) + +(defcustom scheme-program-name "scheme" + "*Program invoked by the `run-scheme' command." + :type 'string + :group 'xscheme) + +(defcustom scheme-band-name nil + "*Band loaded by the `run-scheme' command." + :type '(choice (const nil) string) + :group 'xscheme) + +(defcustom scheme-program-arguments nil + "*Arguments passed to the Scheme program by the `run-scheme' command." + :type '(choice (const nil) string) + :group 'xscheme) + +(defcustom xscheme-allow-pipelined-evaluation t "If non-nil, an expression may be transmitted while another is evaluating. Otherwise, attempting to evaluate an expression before the previous expression -has finished evaluating will signal an error.") +has finished evaluating will signal an error." + :type 'boolean + :group 'xscheme) -(defvar xscheme-startup-message +(defcustom xscheme-startup-message "This is the Scheme process buffer. Type \\[advertised-xscheme-send-previous-expression] to evaluate the expression before point. Type \\[xscheme-send-control-g-interrupt] to abort evaluation. @@ -55,10 +67,14 @@ Type \\[describe-mode] for more information. " "String to insert into Scheme process buffer first time it is started. -Is processed with `substitute-command-keys' first.") +Is processed with `substitute-command-keys' first." + :type 'string + :group 'xscheme) -(defvar xscheme-signal-death-message nil - "If non-nil, causes a message to be generated when the Scheme process dies.") +(defcustom xscheme-signal-death-message nil + "If non-nil, causes a message to be generated when the Scheme process dies." + :type 'boolean + :group 'xscheme) (defun xscheme-evaluation-commands (keymap) (define-key keymap "\e\C-x" 'xscheme-send-definition) @@ -78,9 +94,8 @@ Is processed with `substitute-command-keys' first.") (xscheme-evaluation-commands scheme-mode-map) (xscheme-interrupt-commands scheme-mode-map) -;;;###autoload (defun run-scheme (command-line) - "Run an inferior Scheme process. + "Run MIT Scheme in an inferior process. Output goes to the buffer `*scheme*'. With argument, asks for a command line." (interactive @@ -91,7 +106,7 @@ With argument, asks for a command line." (read-string "Run Scheme: " default) default)))) (setq xscheme-process-command-line command-line) - (switch-to-buffer (xscheme-start-process command-line))) + (pop-to-buffer (xscheme-start-process command-line))) (defun reset-scheme () "Reset the Scheme process." @@ -458,8 +473,8 @@ waiting for input. Otherwise, it is busy evaluating something.") (defconst xscheme-control-g-synchronization-p t "If non-nil, insert markers in the scheme input stream to indicate when -control-g interrupts were signalled. Do not allow more control-g's to be -signalled until the scheme process acknowledges receipt.") +control-g interrupts were signaled. Do not allow more control-g's to be +signaled until the scheme process acknowledges receipt.") (defvar xscheme-control-g-disabled-p nil "This variable, if non-nil, indicates that a control-g is being processed @@ -478,9 +493,11 @@ from being inserted into the process-buffer.") (defvar xscheme-string-receiver nil "Procedure to send the string argument from the scheme process.") -(defvar xscheme-start-hook nil +(defcustom xscheme-start-hook nil "If non-nil, a procedure to call when the Scheme process is started. -When called, the current buffer will be the Scheme process-buffer.") +When called, the current buffer will be the Scheme process-buffer." + :type 'hook + :group 'xscheme) (defvar xscheme-runlight-string nil) (defvar xscheme-mode-string nil) @@ -676,12 +693,7 @@ When called, the current buffer will be the Scheme process-buffer.") (defun xscheme-set-runlight (runlight) (setq xscheme-runlight-string runlight) - (xscheme-modeline-redisplay)) - -(defun xscheme-modeline-redisplay () - (save-excursion (set-buffer (other-buffer))) - (set-buffer-modified-p (buffer-modified-p)) - (sit-for 0)) + (force-mode-line-update t)) ;;;; Process Filter Operations @@ -813,7 +825,7 @@ the remaining input.") (setq xscheme-prompt string) (xscheme-guarantee-newlines 2) (setq xscheme-mode-string (xscheme-coerce-prompt string)) - (xscheme-modeline-redisplay)) + (force-mode-line-update t)) (defun xscheme-output-goto () (xscheme-goto-output-point) @@ -879,4 +891,6 @@ the remaining input.") (if (nth 2 state) 'many 'one))))) (set-syntax-table old-syntax-table))))) +(provide 'xscheme) + ;;; xscheme.el ends here