Changes for new error system in runtime 14.106.
authorChris Hanson <org/chris-hanson/cph>
Fri, 15 Feb 1991 18:17:14 +0000 (18:17 +0000)
committerChris Hanson <org/chris-hanson/cph>
Fri, 15 Feb 1991 18:17:14 +0000 (18:17 +0000)
27 files changed:
v7/src/compiler/base/toplev.scm
v7/src/compiler/etc/stackp.scm
v7/src/compiler/etc/xcbfdir.scm
v7/src/compiler/machines/bobcat/make.scm-68040
v7/src/compiler/machines/mips/make.scm-big
v7/src/compiler/machines/mips/make.scm-little
v7/src/compiler/machines/spectrum/make.scm
v7/src/edwin/artdebug.scm
v7/src/edwin/autold.scm
v7/src/edwin/basic.scm
v7/src/edwin/bufwin.scm
v7/src/edwin/comman.scm
v7/src/edwin/comred.scm
v7/src/edwin/comwin.scm
v7/src/edwin/editor.scm
v7/src/edwin/edwin.pkg
v7/src/edwin/evlcom.scm
v7/src/edwin/filcom.scm
v7/src/edwin/fileio.scm
v7/src/edwin/info.scm
v7/src/edwin/iserch.scm
v7/src/edwin/make.scm
v7/src/edwin/paths.scm
v7/src/edwin/utils.scm
v7/src/runtime/rgxcmp.scm
v8/src/compiler/etc/stackp.scm
v8/src/compiler/etc/xcbfdir.scm

index 7a30750e4ff4f85667735d2a0f6676550c5da832..aea45f1bdf9d199a99a867ce304be715d0b1f405 100644 (file)
@@ -1,8 +1,8 @@
 #| -*-Scheme-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/compiler/base/toplev.scm,v 4.30 1990/09/12 00:39:42 cph Rel $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/compiler/base/toplev.scm,v 4.31 1991/02/15 18:15:01 cph Exp $
 
-Copyright (c) 1988, 1989, 1990 Massachusetts Institute of Technology
+Copyright (c) 1988-91 Massachusetts Institute of Technology
 
 This material was developed by the Scheme project at the Massachusetts
 Institute of Technology, Department of Electrical Engineering and
@@ -136,18 +136,16 @@ MIT in each case. |#
 
 (define (compiler:batch-compile input #!optional output)
   (fluid-let ((compiler:batch-mode? true))
-    (bind-condition-handler '() compiler:batch-error-handler
+    (bind-condition-handler (list condition-type:error)
+       compiler:batch-error-handler
       (lambda ()
        (if (default-object? output)
            (compile-bin-file input)
            (compile-bin-file input output))))))
 
 (define (compiler:batch-error-handler condition)
-  (and (not (condition/internal? condition))
-       (condition/error? condition)
-       (begin
-        (warn (condition/report-string condition))
-        (compiler:abort false))))
+  (warn (condition/report-string condition))
+  (compiler:abort false))
 
 (define (compiler:abort value)
   (if (not compiler:abort-handled?)
index 82dd9766036623026b0f5466f28b81a93d310744..643fe18eef6accd16289b2ae8bce70a08ef8ca32 100644 (file)
@@ -1,8 +1,8 @@
 #| -*-Scheme-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/compiler/etc/stackp.scm,v 1.5 1988/12/31 06:41:50 cph Rel $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/compiler/etc/stackp.scm,v 1.6 1991/02/15 18:14:31 cph Exp $
 
-Copyright (c) 1987, 1988 Massachusetts Institute of Technology
+Copyright (c) 1987-8, 1991 Massachusetts Institute of Technology
 
 This material was developed by the Scheme project at the Massachusetts
 Institute of Technology, Department of Electrical Engineering and
@@ -41,8 +41,7 @@ MIT in each case. |#
         (lambda ()
           (write-continuation
            (if (default-object? continuation)
-               (or (error-continuation)
-                   (current-proceed-continuation))
+               (error-continuation)
                continuation)))))
     (if (or (default-object? filename) (not filename))
        (do-it)
@@ -54,6 +53,12 @@ MIT in each case. |#
                        continuation)
                    n))
 
+(define (error-continuation)
+  (let ((condition (nearest-repl/condition)))
+    (if (not condition)
+       (error "no error continuation"))
+    (condition/continuation condition)))
+
 (define (write-continuation continuation)
   (let write-stack-stream
       ((stream (continuation->stream continuation)) (n 0))
index 3fc574c35dc6f61b286e72476f05b2ac746f29fc..14a2d9b74282b2c14f52e8a4e289e61ac871d188 100644 (file)
@@ -1,8 +1,8 @@
 #| -*-Scheme-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/compiler/etc/xcbfdir.scm,v 1.5 1991/02/06 02:53:28 jinx Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/compiler/etc/xcbfdir.scm,v 1.6 1991/02/15 18:14:48 cph Exp $
 
-Copyright (c) 1989, 1990 Massachusetts Institute of Technology
+Copyright (c) 1989-91 Massachusetts Institute of Technology
 
 This material was developed by the Scheme project at the Massachusetts
 Institute of Technology, Department of Electrical Engineering and
@@ -43,36 +43,36 @@ MIT in each case. |#
           (two (pathname-new-type pathname "tch")))
        (call-with-current-continuation
        (lambda (here)
-         (bind-condition-handler
-          '()
-          (lambda (condition)
-            (newline)
-            (display ";; *** Aborting ")
-            (display pathname)
-            (display " ***")
-            (newline)
-            (condition/write-report condition)
-            (newline)
-            (here 'next))
-          (lambda ()
-            (let ((touch-created-file?))
-              (dynamic-wind
-               (lambda ()
-                 ;; file-touch returns #T if the file did not exist,
-                 ;; it returns #F if it did.
-                 (set! touch-created-file?
-                       (file-touch two)))
-               (lambda ()
-                 (if (and touch-created-file?
-                          (let ((one-time (file-modification-time one)))
-                            (or (not one-time)
-                                (< one-time
-                                   (file-modification-time pathname)))))
-                     (processor pathname
-                                (pathname-new-type pathname extension))))
-               (lambda ()
-                 (if touch-created-file?
-                     (delete-file two)))))))))))
+         (bind-condition-handler (list condition-type:error)
+             (lambda (condition)
+               (let ((port (current-output-port)))
+                 (newline port)
+                 (write-string ";; *** Aborting " port)
+                 (display pathname port)
+                 (write-string " ***" port)
+                 (newline port)
+                 (write-condition-report condition port)
+                 (newline port))
+               (here 'next))
+           (lambda ()
+             (let ((touch-created-file?))
+               (dynamic-wind
+                (lambda ()
+                  ;; file-touch returns #T if the file did not exist,
+                  ;; #F if it did.
+                  (set! touch-created-file? (file-touch two))
+                  unspecific)
+                (lambda ()
+                  (if (and touch-created-file?
+                           (let ((one-time (file-modification-time one)))
+                             (or (not one-time)
+                                 (< one-time
+                                    (file-modification-time pathname)))))
+                      (processor pathname
+                                 (pathname-new-type pathname extension))))
+                (lambda ()
+                  (if touch-created-file?
+                      (delete-file two)))))))))))
    (directory-read
     (merge-pathnames (pathname-as-directory (->pathname directory))
                     (->pathname "*.bin")))))
index 374f9c4211347cd3bc353968b675eac68385f567..9dec1d1b13469316a435707e41940a119a5750a2 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/compiler/machines/bobcat/make.scm-68040,v 4.78 1991/02/15 00:19:58 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/compiler/machines/bobcat/make.scm-68040,v 4.79 1991/02/15 18:15:32 cph Exp $
 
 Copyright (c) 1988-91 Massachusetts Institute of Technology
 
@@ -41,4 +41,4 @@ MIT in each case. |#
            ((package/reference (find-package name) 'INITIALIZE-PACKAGE!)))
          '((COMPILER MACROS)
            (COMPILER DECLARATIONS)))
-(add-system! (make-system "Liar (Motorola MC68020)" 4 78 '()))
\ No newline at end of file
+(add-system! (make-system "Liar (Motorola MC68020)" 4 79 '()))
\ No newline at end of file
index 1db73d970d9df7c60c276c6939f5f83565322ce9..d90a8520ec0f97e0d7dbad4e4ebcdd85283f30a8 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/compiler/machines/mips/make.scm-big,v 4.75 1991/02/15 00:19:40 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/compiler/machines/mips/make.scm-big,v 4.79 1991/02/15 18:16:32 cph Exp $
 $MC68020-Header: make.scm,v 4.73 90/05/03 15:17:24 GMT jinx Exp $
 
 Copyright (c) 1988-91 Massachusetts Institute of Technology
@@ -42,4 +42,4 @@ MIT in each case. |#
            ((package/reference (find-package name) 'INITIALIZE-PACKAGE!)))
          '((COMPILER MACROS)
            (COMPILER DECLARATIONS)))
-(add-system! (make-system "Liar (MIPS)" 4 78 '()))
\ No newline at end of file
+(add-system! (make-system "Liar (MIPS)" 4 79 '()))
\ No newline at end of file
index c0ddad3c9f3dec6a7112b300c6e56b3f1d0eadaf..6a0347f672e8dadeb82fa9f631a88d54eae29a51 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/compiler/machines/mips/make.scm-little,v 4.75 1991/02/15 00:19:40 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/compiler/machines/mips/make.scm-little,v 4.79 1991/02/15 18:16:32 cph Exp $
 $MC68020-Header: make.scm,v 4.73 90/05/03 15:17:24 GMT jinx Exp $
 
 Copyright (c) 1988-91 Massachusetts Institute of Technology
@@ -42,4 +42,4 @@ MIT in each case. |#
            ((package/reference (find-package name) 'INITIALIZE-PACKAGE!)))
          '((COMPILER MACROS)
            (COMPILER DECLARATIONS)))
-(add-system! (make-system "Liar (MIPS)" 4 78 '()))
\ No newline at end of file
+(add-system! (make-system "Liar (MIPS)" 4 79 '()))
\ No newline at end of file
index 3fde391af3cf030ca3d022665c11b71088c52d06..4727d42ef0a86753bb8481d3369f388599697d69 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/compiler/machines/spectrum/make.scm,v 4.77 1991/02/15 00:19:27 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/compiler/machines/spectrum/make.scm,v 4.79 1991/02/15 18:17:14 cph Exp $
 $MC68020-Header: make.scm,v 4.76 90/08/21 02:20:43 GMT jinx Exp $
 
 Copyright (c) 1988-91 Massachusetts Institute of Technology
@@ -42,4 +42,4 @@ MIT in each case. |#
            ((package/reference (find-package name) 'INITIALIZE-PACKAGE!)))
          '((COMPILER MACROS)
            (COMPILER DECLARATIONS)))
-(add-system! (make-system "Liar (HP PA)" 4 78 '()))
\ No newline at end of file
+(add-system! (make-system "Liar (HP PA)" 4 79 '()))
\ No newline at end of file
index 547498a5da640c3d0934f264a20b28fafa0842d7..440c0b15b65987e00a08f29f3dd456c84dbf3312 100644 (file)
@@ -1,8 +1,8 @@
 ;;; -*-Scheme-*-
 ;;;
-;;;    $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/artdebug.scm,v 1.3 1990/09/12 07:53:39 cph Rel $
+;;;    $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/artdebug.scm,v 1.4 1991/02/15 18:13:01 cph Exp $
 ;;;
-;;;    Copyright (c) 1989, 1990 Massachusetts Institute of Technology
+;;;    Copyright (c) 1989-91 Massachusetts Institute of Technology
 ;;;
 ;;;    This material was developed by the Scheme project at the
 ;;;    Massachusetts Institute of Technology, Department of
@@ -52,9 +52,7 @@
   (if in-debugger?
       (exit-editor-and-signal-error condition)
       (fluid-let ((in-debugger? true))
-       (let* ((continuation (condition/continuation condition))
-              (buffer (continuation-browser continuation)))
-         (buffer-put! buffer 'DEBUG-CONDITION condition)
+       (let ((buffer (continuation-browser condition)))
          (select-buffer buffer)
          (standard-output buffer
            (lambda ()
@@ -67,8 +65,7 @@ Type \\[describe-mode] for more information.
 
 The error that started the debugger is:
 "))
-             ((condition/reporter condition) condition
-                                             (current-output-port))))))))
+             (write-condition-report condition (current-output-port))))))))
 
 (define-command browse-continuation
   "Invoke the continuation-browser on CONTINUATION."
@@ -79,11 +76,10 @@ The error that started the debugger is:
       (invoke-debugger-command command/print-subproblem-or-reduction buffer)
       (select-buffer buffer))))
 
-(define (continuation-browser continuation)
+(define (continuation-browser object)
   (let ((buffer (new-buffer "*debug*")))
     (set-buffer-major-mode! buffer (ref-mode-object continuation-browser))
-    (buffer-put! buffer 'DEBUG-CONTINUATION continuation)
-    (buffer-put! buffer 'DEBUG-STATE (make-initial-dstate continuation))
+    (buffer-put! buffer 'DEBUG-STATE (make-initial-dstate object))
     (with-selected-buffer buffer
       (lambda ()
        (setup-buffer-environment! buffer)))
@@ -230,14 +226,15 @@ Prompts for a value to give the continuation as an argument."
   (lambda ()
     (kill-buffer-interactive (current-buffer))))
 
-(define-command continuation-browser-error-info
-  "Show the error message associated with this continuation."
+(define-command continuation-browser-condition-report
+  "Show the error message that started the continuation browser, if any."
   ()
-  (lambda ()
-    (let ((buffer (current-buffer)))
-      (with-debugger-hooks buffer
-       (lambda ()
-         (show-error-info (buffer-get buffer 'DEBUG-CONDITION)))))))
+  (debugger-command-invocation command/condition-report))
+
+(define-command continuation-browser-condition-restart
+  "Continue the program using a standard restart option."
+  ()
+  (debugger-command-invocation command/condition-restart))
 
 (define-major-mode continuation-browser fundamental "Debug"
   "You are in the Scheme debugger, where you can do the following:
@@ -249,7 +246,7 @@ Prompts for a value to give the continuation as an argument."
 \\[continuation-browser-later-reduction] moves Forward to the previous reduction (later in time).
 \\[continuation-browser-goto] Goes to an arbitrary subproblem.
 \\[continuation-browser-summarize-subproblems] prints a summary (History) of all subproblems.
-\\[continuation-browser-error-info] prints the error message Info.
+\\[continuation-browser-condition-report] prints the error message Info.
 \\[continuation-browser-print-expression] pretty prints the current expression.
 \\[continuation-browser-print-environment-procedure] pretty prints the procedure that created the current environment.
 \\[continuation-browser-move-to-parent-environment] moves to the environment that is the Parent of the current environment.
@@ -270,7 +267,7 @@ Prompts for a value to give the continuation as an argument."
 (define-key 'continuation-browser #\g 'continuation-browser-goto)
 (define-key 'continuation-browser #\h
   'continuation-browser-summarize-subproblems)
-(define-key 'continuation-browser #\i 'continuation-browser-error-info)
+(define-key 'continuation-browser #\i 'continuation-browser-condition-report)
 (define-key 'continuation-browser #\l 'continuation-browser-print-expression)
 (define-key 'continuation-browser #\o
   'continuation-browser-print-environment-procedure)
index 15c7cdc0f92d2552d47bb6f7d1f2721a77b4bf7c..d2e21c68ba133a3d562efb21671f548503639d3f 100644 (file)
@@ -1,8 +1,8 @@
 ;;; -*-Scheme-*-
 ;;;
-;;;    $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/autold.scm,v 1.48 1990/09/07 18:39:34 cph Rel $
+;;;    $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/autold.scm,v 1.49 1991/02/15 18:12:16 cph Exp $
 ;;;
-;;;    Copyright (c) 1986, 1989 Massachusetts Institute of Technology
+;;;    Copyright (c) 1986, 1989-91 Massachusetts Institute of Technology
 ;;;
 ;;;    This material was developed by the Scheme project at the
 ;;;    Massachusetts Institute of Technology, Department of
@@ -235,7 +235,8 @@ Second arg PURIFY? means purify the file's contents after loading;
 (define (load-edwin-file filename environment purify?)
   (with-output-to-transcript-buffer
    (lambda ()
-     (bind-condition-handler '() evaluation-error-handler
+     (bind-condition-handler (list condition-type:error)
+        evaluation-error-handler
        (lambda ()
         (fluid-let ((load/suppress-loading-message? true))
           (load filename environment edwin-syntax-table purify?)))))))
\ No newline at end of file
index 0b6a7c06aa7a860d92b07b2c4bccd407c9b165c1..c174fd3d26a97378b4518904a77540e4d212fb59 100644 (file)
@@ -1,8 +1,8 @@
 ;;; -*-Scheme-*-
 ;;;
-;;;    $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/basic.scm,v 1.105 1990/10/03 04:53:58 cph Rel $
+;;;    $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/basic.scm,v 1.106 1991/02/15 18:12:24 cph Exp $
 ;;;
-;;;    Copyright (c) 1986, 1989, 1990 Massachusetts Institute of Technology
+;;;    Copyright (c) 1986, 1989-91 Massachusetts Institute of Technology
 ;;;
 ;;;    This material was developed by the Scheme project at the
 ;;;    Massachusetts Institute of Technology, Department of
@@ -214,34 +214,6 @@ procedure when it fails to find a command."
 (define (barf-if-read-only)
   (editor-error "Trying to modify read only text."))
 
-(define-variable debug-on-editor-error
-  "True means signal Scheme error when an editor error occurs."
-  false)
-
-(define condition-type:editor-error
-  (make-error-type '()
-    (lambda (condition port)
-      (write-string "Editor error: " port)
-      (write-string (message-args->string (condition/irritants condition))
-                   port))))
-
-(define (editor-error . strings)
-  (if (ref-variable debug-on-editor-error)
-      (call-with-current-continuation
-       (lambda (continuation)
-        (debug-scheme-error
-         (make-condition condition-type:editor-error
-                         strings
-                         continuation))
-        (%editor-error)))
-      (begin
-       (if (not (null? strings)) (apply temporary-message strings))
-       (%editor-error))))
-
-(define (%editor-error)
-  (editor-beep)
-  (abort-current-command))
-
 (define (editor-failure . strings)
   (cond ((not (null? strings)) (apply temporary-message strings))
        (*defining-keyboard-macro?* (clear-message)))
index d039ca2a2f9f833facdbaa868a937ad1ce5b6ac2..21b271cecd262e567310206de355e294a2a6b3dd 100644 (file)
@@ -1,8 +1,8 @@
 ;;; -*-Scheme-*-
 ;;;
-;;;    $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/bufwin.scm,v 1.286 1990/11/02 03:22:50 cph Rel $
+;;;    $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/bufwin.scm,v 1.287 1991/02/15 18:12:31 cph Exp $
 ;;;
-;;;    Copyright (c) 1986, 1989, 1990 Massachusetts Institute of Technology
+;;;    Copyright (c) 1986, 1989-91 Massachusetts Institute of Technology
 ;;;
 ;;;    This material was developed by the Scheme project at the
 ;;;    Massachusetts Institute of Technology, Department of
 
 (define (clip-mark-to-display window mark)
   (if (not (mark? mark))
-      (error:illegal-datum mark 'CLIP-MARK-TO-DISPLAY))
+      (error:wrong-type-argument mark "mark" 'CLIP-MARK-TO-DISPLAY))
   (if (and (%window-point window)
           (not (mark~ (%window-point window) mark)))
-      (error:datum-out-of-range mark 'CLIP-MARK-TO-DISPLAY))
+      (error:bad-range-argument mark 'CLIP-MARK-TO-DISPLAY))
   (cond ((group-display-start-index? (mark-group mark) (mark-index mark))
         (group-display-start (mark-group mark)))
        ((group-display-end-index? (mark-group mark) (mark-index mark))
   (if (%window-debug-trace window)
       ((%window-debug-trace window) 'window window 'set-buffer! new-buffer))
   (if (not (buffer? new-buffer))
-      (error:illegal-datum new-buffer 'set-window-buffer!))
+      (error:wrong-type-argument new-buffer "buffer" 'SET-WINDOW-BUFFER!))
   (if (%window-buffer window)
       (%unset-window-buffer! window))
   (%set-window-buffer! window new-buffer)
                                    y-point))
   (if (not (and (fix:<= 0 y-point)
                (fix:< y-point (window-y-size window))))
-      (error:datum-out-of-range y-point 'window-scroll-y-absolute!))
+      (error:bad-range-argument y-point 'WINDOW-SCROLL-Y-ABSOLUTE!))
   (with-values
       (lambda ()
        (predict-start-line window (%window-point-index window) y-point))
index 6999c42755bad3c22d1d44fa2f423e161771f695..d5d29dd72080e793e05bbd40e474747547dda169 100644 (file)
@@ -1,8 +1,8 @@
 ;;; -*-Scheme-*-
 ;;;
-;;;    $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/comman.scm,v 1.63 1990/11/02 03:23:13 cph Rel $
+;;;    $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/comman.scm,v 1.64 1991/02/15 18:12:40 cph Exp $
 ;;;
-;;;    Copyright (c) 1986, 1989, 1990 Massachusetts Institute of Technology
+;;;    Copyright (c) 1986, 1989-91 Massachusetts Institute of Technology
 ;;;
 ;;;    This material was developed by the Scheme project at the
 ;;;    Massachusetts Institute of Technology, Department of
 
 (define (check-variable-value-validity! variable value)
   (if (not (variable-value-valid? variable value))
-      (error:illegal-datum value 'CHECK-VARIABLE-VALUE-VALIDITY)))
+      (error:datum-out-of-range value)))
 
 (define (variable-value-valid? variable value)
   (or (not (variable-value-validity-test variable))
index be5e0ec6d69231b2bd999f03232b6cac1b88e76c..2c2f34fe4cce353c4e78c12da86703498f8292ac 100644 (file)
@@ -1,8 +1,8 @@
 ;;; -*-Scheme-*-
 ;;;
-;;;    $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/comred.scm,v 1.83 1990/10/03 04:54:25 cph Rel $
+;;;    $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/comred.scm,v 1.84 1991/02/15 18:12:46 cph Exp $
 ;;;
-;;;    Copyright (c) 1986, 1989, 1990 Massachusetts Institute of Technology
+;;;    Copyright (c) 1986, 1989-91 Massachusetts Institute of Technology
 ;;;
 ;;;    This material was developed by the Scheme project at the
 ;;;    Massachusetts Institute of Technology, Department of
                   (*command-char*)
                   (*command*)
                   (*next-message* false))
-        (start-next-command)))))
+        (bind-condition-handler (list condition-type:editor-error)
+            editor-error-handler
+          start-next-command)))))
 
   (define (start-next-command)
     (reset-command-state!)
index 044bc9ec8c06b6e7a81bd7cc75cea8d9d00f7f9e..99a95ccdf23a7640f1c6d19a29e83480a290198e 100644 (file)
@@ -1,8 +1,8 @@
 ;;; -*-Scheme-*-
 ;;;
-;;;    $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/comwin.scm,v 1.139 1990/11/02 03:23:19 cph Rel $
+;;;    $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/comwin.scm,v 1.140 1991/02/15 18:12:54 cph Exp $
 ;;;
-;;;    Copyright (c) 1985, 1989, 1990 Massachusetts Institute of Technology
+;;;    Copyright (c) 1985, 1989-91 Massachusetts Institute of Technology
 ;;;
 ;;;    This material was developed by the Scheme project at the
 ;;;    Massachusetts Institute of Technology, Department of
 
 (define-integrable (check-leaf-window window name)
   (if (not (leaf? window))
-      (error:illegal-datum window name)))
+      (error:wrong-type-argument window "window" name)))
 \f
 ;;;; Leaf Ordering
 
 (define (window0 window)
   (if (not (and (object? window)
                (subclass? (object-class window) combination-leaf-window)))
-      (error:illegal-datum window 'WINDOW0))
+      (error:wrong-type-argument window "window" 'WINDOW0))
   (window-leftmost-leaf (window-root window)))
 \f
 (define (%window1+ leaf)
index 39f866ee0346ec5a65939111561c5ca196d721d4..cd40845639cf56cadc0bcf1a0b145a078e5d01ec 100644 (file)
@@ -1,8 +1,8 @@
 ;;; -*-Scheme-*-
 ;;;
-;;;    $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/editor.scm,v 1.199 1990/11/14 15:10:51 cph Rel $
+;;;    $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/editor.scm,v 1.200 1991/02/15 18:13:08 cph Exp $
 ;;;
-;;;    Copyright (c) 1986, 1989, 1990 Massachusetts Institute of Technology
+;;;    Copyright (c) 1986, 1989-91 Massachusetts Institute of Technology
 ;;;
 ;;;    This material was developed by the Scheme project at the
 ;;;    Massachusetts Institute of Technology, Department of
                 (current-editor edwin-editor)
                 (recursive-edit-continuation false)
                 (recursive-edit-level 0))
-       (editor-grab-display edwin-editor
-        (lambda (with-editor-ungrabbed)
-          (let ((message (cmdl-message/null)))
-            (push-cmdl (lambda (cmdl)
-                         cmdl ;ignore
-                         (top-level-command-reader edwin-initialization)
-                         message)
-                       false
-                       message
-                       (editor-spawn-child-cmdl with-editor-ungrabbed))))))))
+       (bind-condition-handler (list condition-type:error)
+          internal-error-handler
+        (lambda ()
+          (editor-grab-display edwin-editor
+            (lambda (with-editor-ungrabbed)
+              (let ((message (cmdl-message/null)))
+                (push-cmdl
+                 (lambda (cmdl)
+                   cmdl                ;ignore
+                   (top-level-command-reader edwin-initialization)
+                   message)
+                 false
+                 message
+                 (editor-spawn-child-cmdl with-editor-ungrabbed))))))))))
   (if edwin-finalization (edwin-finalization))
   unspecific)
 
@@ -257,16 +261,14 @@ with the contents of the startup message."
 (define recursive-edit-level)
 \f
 (define (internal-error-handler condition)
-  (and (not (condition/internal? condition))
-       (error? condition)
-       (cond ((ref-variable debug-on-internal-error)
-             (debug-scheme-error condition)
-             (message "Scheme error")
-             (%editor-error))
-            (debug-internal-errors?
-             (signal-error condition))
-            (else
-             (exit-editor-and-signal-error condition)))))
+  (cond ((ref-variable debug-on-internal-error)
+        (debug-scheme-error condition)
+        (message "Scheme error")
+        (%editor-error))
+       (debug-internal-errors?
+        (error condition))
+       (else
+        (exit-editor-and-signal-error condition))))
 
 (define-variable debug-on-internal-error
   "True means enter debugger if error is signalled while the editor is running.
@@ -279,7 +281,39 @@ This does not affect editor errors or evaluation errors."
 (define (exit-editor-and-signal-error condition)
   (within-continuation editor-abort
     (lambda ()
-      (signal-error condition))))
+      (error condition))))
+
+(define condition-type:editor-error
+  (make-condition-type 'EDITOR-ERROR condition-type:error '(STRINGS)
+    (lambda (condition port)
+      (write-string "Editor error: " port)
+      (write-string
+       (message-args->string (access-condition condition 'STRINGS))
+       port))))
+
+(define editor-error
+  (let ((signaller
+        (condition-signaller condition-type:editor-error
+                             '(STRINGS)
+                             standard-error-handler)))
+    (lambda strings
+      (signaller strings))))
+
+(define (editor-error-handler condition)
+  (if (ref-variable debug-on-editor-error)
+      (debug-scheme-error condition)
+      (let ((strings (access-condition condition 'STRINGS)))
+       (if (not (null? strings))
+           (apply temporary-message strings))))
+  (%editor-error))
+
+(define-variable debug-on-editor-error
+  "True means signal Scheme error when an editor error occurs."
+  false)
+
+(define (%editor-error)
+  (editor-beep)
+  (abort-current-command))
 
 (define (^G-signal)
   (let ((continuations *^G-interrupt-continuations*))
index 73b8cd97bd4d8d5f5e4294648577960ad701dd32..46252206e36e53f14fa7e2b3815715d1474943c5 100644 (file)
@@ -1,8 +1,8 @@
 #| -*-Scheme-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/edwin.pkg,v 1.22 1990/11/14 15:11:14 cph Rel $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/edwin.pkg,v 1.23 1991/02/15 18:13:15 cph Exp $
 
-Copyright (c) 1989, 1990 Massachusetts Institute of Technology
+Copyright (c) 1989-91 Massachusetts Institute of Technology
 
 This material was developed by the Scheme project at the Massachusetts
 Institute of Technology, Department of Electrical Engineering and
@@ -511,7 +511,7 @@ MIT in each case. |#
   (files "rgxcmp")
   (parent (edwin))
   (export (edwin)
-         error-type:re-compile-pattern
+         condition-type:re-compile-pattern
          re-compile-char
          re-compile-char-set
          re-compile-pattern
@@ -587,6 +587,8 @@ MIT in each case. |#
   (export (edwin)
          debug-scheme-error)
   (import (runtime debugger)
+         command/condition-report
+         command/condition-restart
          command/earlier-reduction
          command/earlier-subproblem
          command/frame
@@ -604,8 +606,7 @@ MIT in each case. |#
          command/show-current-frame
          command/summarize-subproblems
          dstate/environment-list
-         make-initial-dstate
-         show-error-info)
+         make-initial-dstate)
   (import (runtime debugger-utilities)
          hook/debugger-failure
          hook/debugger-message
index a63bd8d61d82440897e02768b90f595f922c00e8..9fdd0ccb9363ff9ce2dc78d79402e2e8ecc2653c 100644 (file)
@@ -1,8 +1,8 @@
 ;;; -*-Scheme-*-
 ;;;
-;;;    $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/evlcom.scm,v 1.18 1989/08/29 20:04:00 cph Rel $
+;;;    $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/evlcom.scm,v 1.19 1991/02/15 18:13:22 cph Exp $
 ;;;
-;;;    Copyright (c) 1986, 1989 Massachusetts Institute of Technology
+;;;    Copyright (c) 1986, 1989-91 Massachusetts Institute of Technology
 ;;;
 ;;;    This material was developed by the Scheme project at the
 ;;;    Massachusetts Institute of Technology, Department of
@@ -204,7 +204,7 @@ With an argument, prompts for the evaluation environment."
                      (ref-mode-object prompt-for-expression))))
 
 (define (read-from-string string)
-  (bind-condition-handler '() evaluation-error-handler
+  (bind-condition-handler (list condition-type:error) evaluation-error-handler
     (lambda ()
       (with-input-from-string string read))))
 
@@ -241,11 +241,10 @@ may be available.  The following commands are special to this mode:
 (define (evaluation-environment argument)
   (let ((->environment
         (lambda (object)
-          (bind-condition-handler '()
+          (bind-condition-handler (list condition-type:error)
               (lambda (condition)
-                (and (not (condition/internal? condition))
-                     (error? condition)
-                     (editor-error "Illegal environment: " object)))
+                condition
+                (editor-error "Illegal environment: " object))
             (lambda ()
               (->environment object))))))
     (if argument
@@ -289,31 +288,26 @@ may be available.  The following commands are special to this mode:
                           environment))
 
 (define (scode-eval-with-history scode environment)
-  (bind-condition-handler '() evaluation-error-handler
+  (bind-condition-handler (list condition-type:error) evaluation-error-handler
     (lambda ()
       (with-new-history
        (lambda ()
         (extended-scode-eval scode environment))))))
 
 (define (evaluation-error-handler condition)
-  (and (not (condition/internal? condition))
-       (error? condition)
-       (begin
-        (if (ref-variable debug-on-evaluation-error)
-            (debug-scheme-error condition)
-            (let ((string
-                   (with-output-to-string
-                     (lambda ()
-                       ((condition/reporter condition)
-                        condition
-                        (current-output-port))))))
-              (if (and (not (string-find-next-char string #\newline))
-                       (< (string-column-length string 18) 80))
-                  (message "Evaluation error: " string)
-                  (begin
-                    (string->temporary-buffer string "*Error*")
-                    (message "Evaluation error")))))
-        (%editor-error))))
+  (if (ref-variable debug-on-evaluation-error)
+      (debug-scheme-error condition)
+      (let ((string
+            (with-string-output-port
+              (lambda (port)
+                (write-condition-report condition port)))))
+       (if (and (not (string-find-next-char string #\newline))
+                (< (string-column-length string 18) 80))
+           (message "Evaluation error: " string)
+           (begin
+             (string->temporary-buffer string "*Error*")
+             (message "Evaluation error")))))
+  (%editor-error))
 \f
 ;;;; Transcript Buffer
 
index 49f72c7c8395e3eca896fc98633d77811b3ab1e3..66dcb1edac748021d7d6158260ec7c99f413dfad 100644 (file)
@@ -1,8 +1,8 @@
 ;;; -*-Scheme-*-
 ;;;
-;;;    $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/filcom.scm,v 1.143 1990/11/21 23:17:35 cph Rel $
+;;;    $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/filcom.scm,v 1.144 1991/02/15 18:13:29 cph Exp $
 ;;;
-;;;    Copyright (c) 1986, 1989, 1990 Massachusetts Institute of Technology
+;;;    Copyright (c) 1986, 1989-91 Massachusetts Institute of Technology
 ;;;
 ;;;    This material was developed by the Scheme project at the
 ;;;    Massachusetts Institute of Technology, Department of
@@ -187,7 +187,8 @@ Argument means don't offer to use auto-save file."
        (let ((database
               (with-output-to-transcript-buffer
                (lambda ()
-                 (bind-condition-handler '() evaluation-error-handler
+                 (bind-condition-handler (list condition-type:error)
+                     evaluation-error-handler
                    (lambda ()
                      (catch-file-errors (lambda () false)
                        (lambda ()
index 9f76d0b89977fff17fb559c35628fc8ec44aa8a5..b538ceca1bf1631562ffb20d21a7c2024e22da45 100644 (file)
@@ -1,8 +1,8 @@
 ;;; -*-Scheme-*-
 ;;;
-;;;    $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/fileio.scm,v 1.91 1989/04/28 22:49:50 cph Rel $
+;;;    $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/fileio.scm,v 1.92 1991/02/15 18:13:37 cph Exp $
 ;;;
-;;;    Copyright (c) 1986, 1989 Massachusetts Institute of Technology
+;;;    Copyright (c) 1986, 1989-91 Massachusetts Institute of Technology
 ;;;
 ;;;    This material was developed by the Scheme project at the
 ;;;    Massachusetts Institute of Technology, Department of
@@ -230,15 +230,15 @@ at the end of a file."
                                 buffer mode)))
                          (call-with-current-continuation
                           (lambda (continuation)
-                            (bind-condition-handler '()
+                            (bind-condition-handler
+                                (list condition-type:error)
                                 (lambda (condition)
-                                  (and (not (condition/internal? condition))
-                                       (error? condition)
-                                       (begin
-                                         (editor-beep)
-                                         (message "Error while processing local variable: "
-                                                  var)
-                                         (continuation false))))
+                                  condition
+                                  (editor-beep)
+                                  (message
+                                   "Error while processing local variable: "
+                                   var)
+                                  (continuation false))
                               (lambda ()
                                 (if (string-ci=? var "Eval")
                                     (evaluate val)
@@ -304,28 +304,29 @@ Otherwise asks confirmation."
              (editor-error
               "Attempt to save to a file which you aren't allowed to write"))
          (begin
-          (if (not (or (verify-visited-file-modification-time? buffer)
-                       (not (file-exists? truename))
-                       (prompt-for-yes-or-no?
-                        "Disk file has changed since visited or saved.  Save anyway")))
-              (editor-error "Save not confirmed"))
-          (let ((modes
-                 (and (not (buffer-backed-up? buffer))
-                      (backup-buffer! buffer truename))))
-            (require-newline buffer)
-            (if (not (or writable? modes))
-                (begin
-                  (set! modes (file-modes truename))
-                  (set-file-modes! truename #o777)))
-            (write-buffer buffer)
-            (if modes
-                (bind-condition-handler '()
-                    (lambda (condition)
-                      (and (not (condition/internal? condition))
-                           (error? condition)
-                           ((condition/continuation condition) unspecific)))
-                  (lambda ()
-                    (set-file-modes! truename modes))))))))))
+           (if (not (or (verify-visited-file-modification-time? buffer)
+                        (not (file-exists? truename))
+                        (prompt-for-yes-or-no?
+                         "Disk file has changed since visited or saved.  Save anyway")))
+               (editor-error "Save not confirmed"))
+           (let ((modes
+                  (and (not (buffer-backed-up? buffer))
+                       (backup-buffer! buffer truename))))
+             (require-newline buffer)
+             (if (not (or writable? modes))
+                 (begin
+                   (set! modes (file-modes truename))
+                   (set-file-modes! truename #o777)))
+             (write-buffer buffer)
+             (if modes
+                 (call-with-current-continuation
+                  (lambda (continuation)
+                    (bind-condition-handler (list condition-type:error)
+                        (lambda (condition)
+                          condition
+                          (continuation unspecific))
+                      (lambda ()
+                        (set-file-modes! truename modes))))))))))))
 
 (define (verify-visited-file-modification-time? buffer)
   (let ((truename (buffer-truename buffer))
index e510794b6107326b1e9724b3642de3d75241de6b..c844ad9ecdf65ef33480f430924791237e899c4c 100644 (file)
@@ -1,8 +1,8 @@
 ;;; -*-Scheme-*-
 ;;;
-;;;    $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/info.scm,v 1.95 1990/10/03 04:55:12 cph Rel $
+;;;    $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/info.scm,v 1.96 1991/02/15 18:13:44 cph Exp $
 ;;;
-;;;    Copyright (c) 1986, 1989, 1990 Massachusetts Institute of Technology
+;;;    Copyright (c) 1986, 1989-91 Massachusetts Institute of Technology
 ;;;
 ;;;    This material was developed by the Scheme project at the
 ;;;    Massachusetts Institute of Technology, Department of
@@ -886,11 +886,10 @@ The name may be an abbreviation of the reference name."
   (let ((lose
         (lambda ()
           (editor-error "Malformed index in Info file"))))
-    (bind-condition-handler '()
+    (bind-condition-handler (list condition-type:error)
        (lambda (condition)
-         (and (not (condition/internal? condition))
-              (error? condition)
-              (lose)))
+         condition
+         (lose))
       (lambda ()
        (let ((index (with-input-from-mark mark read)))
          (if (and (integer? index)
index 10b5a6fe4e5a87c503879063cb1cba3660dc6c93..9f5787a853af792781c716e1c0b00002c2a057dc 100644 (file)
@@ -1,8 +1,8 @@
 ;;; -*-Scheme-*-
 ;;;
-;;;    $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/iserch.scm,v 1.8 1990/10/03 04:55:22 cph Rel $
+;;;    $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/iserch.scm,v 1.9 1991/02/15 18:13:52 cph Exp $
 ;;;
-;;;    Copyright (c) 1986, 1989, 1990 Massachusetts Institute of Technology
+;;;    Copyright (c) 1986, 1989-91 Massachusetts Institute of Technology
 ;;;
 ;;;    This material was developed by the Scheme project at the
 ;;;    Massachusetts Institute of Technology, Department of
 (define (perform-search forward? regexp? text start)
   (call-with-current-continuation
    (lambda (continuation)
-     (bind-condition-handler
-        (list error-type:re-compile-pattern)
+     (bind-condition-handler (list condition-type:re-compile-pattern)
         (lambda (condition)
-          (continuation (car (condition/irritants condition))))
+          (continuation (access-condition condition 'MESSAGE)))
        (lambda ()
         (intercept-^G-interrupts (lambda () 'ABORT)
           (lambda ()
index a805564b7a47965f5fdfd8df77508be1a32c6e43..37d22a428c13641edd9f0579c0cbbd27b4cb3e8c 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/make.scm,v 3.24 1990/11/15 23:32:46 cph Rel $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/make.scm,v 3.25 1991/02/15 18:13:58 cph Exp $
 
 Copyright (c) 1989, 1990 Massachusetts Institute of Technology
 
@@ -37,4 +37,4 @@ MIT in each case. |#
 (declare (usual-integrations))
 
 (package/system-loader "edwin" '() 'QUERY)
-(add-system! (make-system "Edwin" 3 24 '()))
\ No newline at end of file
+(add-system! (make-system "Edwin" 3 25 '()))
\ No newline at end of file
index f747e55837cbc9365fa82397fa5be9c1a20a704c..13a37ef2d4018e0337c1e80084e426eed7b8a50d 100644 (file)
@@ -1,8 +1,8 @@
 #| -*-Scheme-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/paths.scm,v 1.7 1990/11/16 01:11:44 cph Rel $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/paths.scm,v 1.8 1991/02/15 18:14:03 cph Exp $
 
-Copyright (c) 1989, 1990 Massachusetts Institute of Technology
+Copyright (c) 1989-91 Massachusetts Institute of Technology
 
 This material was developed by the Scheme project at the Massachusetts
 Institute of Technology, Department of Electrical Engineering and
@@ -47,7 +47,7 @@ MIT in each case. |#
                    (pathname-as-directory (string->pathname "edwin")))))
 
 (define (edwin-tutorial-pathname)
-  (bind-condition-handler (list error-type:open-file)
+  (bind-condition-handler (list condition-type:open-file-error)
       (lambda (condition)
        condition
        (editor-error "Unable to find TUTORIAL file"))
index e9467cb9f20b6dbfe993dbcbc60180572890b56b..1748bb3826256ca64dc2b71d9c2052e1b996ffbb 100644 (file)
@@ -1,8 +1,8 @@
 ;;; -*-Scheme-*-
 ;;;
-;;;    $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/utils.scm,v 1.20 1989/08/29 20:04:08 cph Rel $
+;;;    $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/utils.scm,v 1.21 1991/02/15 18:14:14 cph Exp $
 ;;;
-;;;    Copyright (c) 1986, 1989 Massachusetts Institute of Technology
+;;;    Copyright (c) 1986, 1989-91 Massachusetts Institute of Technology
 ;;;
 ;;;    This material was developed by the Scheme project at the
 ;;;    Massachusetts Institute of Technology, Department of
 (define (catch-file-errors if-error thunk)
   (call-with-current-continuation
    (lambda (continuation)
-     (bind-condition-handler
-        (list error-type:file)
+     (bind-condition-handler (list condition-type:file-error
+                                  condition-type:port-error)
         (lambda (condition)
           condition
           (continuation (if-error)))
index 65b1306da6b40b88007a5926ea08fd729c1b3993..518ca5ea914f74e8a4669fd642024c2c8ef8dd10 100644 (file)
@@ -1,8 +1,8 @@
 ;;; -*-Scheme-*-
 ;;;
-;;;    $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/rgxcmp.scm,v 1.103 1990/10/05 23:54:51 cph Rel $
+;;;    $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/rgxcmp.scm,v 1.104 1991/02/15 18:14:08 cph Exp $
 ;;;
-;;;    Copyright (c) 1986, 1989, 1990 Massachusetts Institute of Technology
+;;;    Copyright (c) 1986, 1989-91 Massachusetts Institute of Technology
 ;;;
 ;;;    This material was developed by the Scheme project at the
 ;;;    Massachusetts Institute of Technology, Department of
 (define-integrable stack-maximum-length
   re-number-of-registers)
 
-(define error-type:re-compile-pattern
-  (make-error-type '() "Error compiling regular expression:"))
+(define condition-type:re-compile-pattern
+  (make-condition-type 'RE-COMPILE-PATTERN condition-type:error
+      '(MESSAGE)
+    (lambda (condition port)
+      (write-string "Error compiling regular expression: " port)
+      (write-string (access-condition condition 'MESSAGE) port))))
+
+(define compilation-error
+  (condition-signaller condition-type:re-compile-pattern
+                      '(MESSAGE)
+                      standard-error-handler))
 
 (define input-list)
 (define current-byte)
              (if fixup-jump
                  (store-jump! fixup-jump re-code:jump (output-position)))
              (if (not (stack-empty?))
-                 (error error-type:re-compile-pattern "Unmatched \\("))
+                 (compilation-error "Unmatched \\("))
              (list->string (map ascii->char (cdr output-head))))
            (begin
              (compile-pattern-char)
   ((vector-ref pattern-chars (input-peek-1))))
 
 (define (premature-end)
-  (error error-type:re-compile-pattern "Premature end of regular expression"))
+  (compilation-error "Premature end of regular expression"))
 
 (define (normal-char)
   (if (if (input-end?)
 (define-backslash-char #\(
   (lambda ()
     (if (stack-full?)
-       (error error-type:re-compile-pattern "Nesting too deep"))
+       (compilation-error "Nesting too deep"))
     (if (fix:< register-number re-number-of-registers)
        (begin
          (output-re-code! re-code:start-memory)
 (define-backslash-char #\)
   (lambda ()
     (if (stack-empty?)
-       (error error-type:re-compile-pattern "Unmatched close paren"))
+       (compilation-error "Unmatched close paren"))
     (if fixup-jump
        (store-jump! fixup-jump re-code:jump (output-position)))
     (stack-pop!
index 3a0cda8d0faba273cc0f4abfce94147a053275e5..a6a56fae287551ebddb75e0370d89ff13c416d69 100644 (file)
@@ -1,8 +1,8 @@
 #| -*-Scheme-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/compiler/etc/stackp.scm,v 1.5 1988/12/31 06:41:50 cph Rel $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/compiler/etc/stackp.scm,v 1.6 1991/02/15 18:14:31 cph Exp $
 
-Copyright (c) 1987, 1988 Massachusetts Institute of Technology
+Copyright (c) 1987-8, 1991 Massachusetts Institute of Technology
 
 This material was developed by the Scheme project at the Massachusetts
 Institute of Technology, Department of Electrical Engineering and
@@ -41,8 +41,7 @@ MIT in each case. |#
         (lambda ()
           (write-continuation
            (if (default-object? continuation)
-               (or (error-continuation)
-                   (current-proceed-continuation))
+               (error-continuation)
                continuation)))))
     (if (or (default-object? filename) (not filename))
        (do-it)
@@ -54,6 +53,12 @@ MIT in each case. |#
                        continuation)
                    n))
 
+(define (error-continuation)
+  (let ((condition (nearest-repl/condition)))
+    (if (not condition)
+       (error "no error continuation"))
+    (condition/continuation condition)))
+
 (define (write-continuation continuation)
   (let write-stack-stream
       ((stream (continuation->stream continuation)) (n 0))
index 6313a01f0b734414eede0db82faa238d797a7ad1..44e8dc2f77f41068d3bda791b79af90abe2b5547 100644 (file)
@@ -1,8 +1,8 @@
 #| -*-Scheme-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/compiler/etc/xcbfdir.scm,v 1.5 1991/02/06 02:53:28 jinx Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/compiler/etc/xcbfdir.scm,v 1.6 1991/02/15 18:14:48 cph Exp $
 
-Copyright (c) 1989, 1990 Massachusetts Institute of Technology
+Copyright (c) 1989-91 Massachusetts Institute of Technology
 
 This material was developed by the Scheme project at the Massachusetts
 Institute of Technology, Department of Electrical Engineering and
@@ -43,36 +43,36 @@ MIT in each case. |#
           (two (pathname-new-type pathname "tch")))
        (call-with-current-continuation
        (lambda (here)
-         (bind-condition-handler
-          '()
-          (lambda (condition)
-            (newline)
-            (display ";; *** Aborting ")
-            (display pathname)
-            (display " ***")
-            (newline)
-            (condition/write-report condition)
-            (newline)
-            (here 'next))
-          (lambda ()
-            (let ((touch-created-file?))
-              (dynamic-wind
-               (lambda ()
-                 ;; file-touch returns #T if the file did not exist,
-                 ;; it returns #F if it did.
-                 (set! touch-created-file?
-                       (file-touch two)))
-               (lambda ()
-                 (if (and touch-created-file?
-                          (let ((one-time (file-modification-time one)))
-                            (or (not one-time)
-                                (< one-time
-                                   (file-modification-time pathname)))))
-                     (processor pathname
-                                (pathname-new-type pathname extension))))
-               (lambda ()
-                 (if touch-created-file?
-                     (delete-file two)))))))))))
+         (bind-condition-handler (list condition-type:error)
+             (lambda (condition)
+               (let ((port (current-output-port)))
+                 (newline port)
+                 (write-string ";; *** Aborting " port)
+                 (display pathname port)
+                 (write-string " ***" port)
+                 (newline port)
+                 (write-condition-report condition port)
+                 (newline port))
+               (here 'next))
+           (lambda ()
+             (let ((touch-created-file?))
+               (dynamic-wind
+                (lambda ()
+                  ;; file-touch returns #T if the file did not exist,
+                  ;; #F if it did.
+                  (set! touch-created-file? (file-touch two))
+                  unspecific)
+                (lambda ()
+                  (if (and touch-created-file?
+                           (let ((one-time (file-modification-time one)))
+                             (or (not one-time)
+                                 (< one-time
+                                    (file-modification-time pathname)))))
+                      (processor pathname
+                                 (pathname-new-type pathname extension))))
+                (lambda ()
+                  (if touch-created-file?
+                      (delete-file two)))))))))))
    (directory-read
     (merge-pathnames (pathname-as-directory (->pathname directory))
                     (->pathname "*.bin")))))