;;; -*-Scheme-*-
;;;
-;;; $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/editor.scm,v 1.221 1992/04/22 21:03:05 mhwu Exp $
+;;; $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/editor.scm,v 1.222 1992/08/18 03:27:22 cph Exp $
;;;
;;; Copyright (c) 1986, 1989-92 Massachusetts Institute of Technology
;;;
(add-gc-daemon! editor-gc-daemon)
\f
(define (internal-error-handler condition)
- (cond (debug-internal-errors?
+ (cond ((and (eq? condition-type:primitive-procedure-error
+ (condition/type condition))
+ (let ((operator (access-condition condition 'OPERATOR)))
+ (or (eq? operator (ucode-primitive x-display-process-events 2))
+ (eq? operator (ucode-primitive x-display-flush 1)))))
+ ;; This error indicates that the connection to the X server
+ ;; has been broken. The safest thing to do is to kill the
+ ;; editor.
+ (exit-editor))
+ (debug-internal-errors?
(error condition))
((ref-variable debug-on-internal-error)
(debug-scheme-error condition "internal"))
(define (%editor-error)
(editor-beep)
(abort-current-command))
-
+\f
(define (quit-editor-and-signal-error condition)
(quit-editor-and (lambda () (error condition))))
(define (exit-scheme)
(within-continuation editor-abort %exit))
-\f
+
(define (^G-signal)
(let ((handler *^G-interrupt-handler*))
(if handler