;;; Requires C-Scheme release 5 or later
;;; Changes to Control-G handler require runtime version 13.85 or later
-;;; $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/etc/xscheme.el,v 1.2 1987/11/02 20:19:30 cph Exp $
+;;; $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/etc/xscheme.el,v 1.3 1987/11/23 18:32:32 cph Exp $
(require 'scheme)
\f
"This variable, if nil, indicates that the scheme process is
waiting for input. Otherwise, it is busy evaluating something.")
+(defconst xscheme-control-g-synchronization-p (eq system-type 'hpux)
+ "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.")
+
(defvar xscheme-control-g-disabled-p nil
"This variable, if non-nil, indicates that a control-g is being processed
by the scheme process, so additional control-g's are to be ignored.")
Control returns to the top level rep loop."
(interactive)
(let ((inhibit-quit t))
- (if xscheme-control-g-disabled-p
- (message "Relax...")
- (progn
- (setq xscheme-control-g-disabled-p t)
- (message "Sending C-G interrupt to Scheme...")
- (interrupt-process "scheme" t)
- (send-string "scheme" (char-to-string 0))))))
+ (cond ((not xscheme-control-g-synchronization-p)
+ (interrupt-process "scheme" t))
+ (xscheme-control-g-disabled-p
+ (message "Relax..."))
+ (else
+ (setq xscheme-control-g-disabled-p t)
+ (message "Sending C-G interrupt to Scheme...")
+ (interrupt-process "scheme" t)
+ (send-string "scheme" (char-to-string 0))))))
(defun xscheme-send-control-u-interrupt ()
"Cause the Scheme process to halt, returning to previous rep loop."
(substring string (1+ start))))
(progn (xscheme-process-filter:idle-1 string)
(xscheme-process-filter:finish)))))
-
+\f
(defun xscheme-process-filter:idle-1 (string)
(while (string-match "\\(\007\\|\f\\)" string)
(let ((start (match-beginning 0))
(beep))
(setq string (substring string (1+ start)))))
(xscheme-process-filter-output string))
-\f
+
(defun xscheme-process-filter:reading-type (string)
(let ((len (length string)))
(if (= 0 len)