Change EDIT to set up the EDITOR-ABORT continuation correctly when
authorChris Hanson <org/chris-hanson/cph>
Fri, 13 Mar 1992 10:08:11 +0000 (10:08 +0000)
committerChris Hanson <org/chris-hanson/cph>
Fri, 13 Mar 1992 10:08:11 +0000 (10:08 +0000)
reentering the editor after a suspend.  Previously it was returning to
the same initial continuation whenever the editor was stopped.

v7/src/edwin/editor.scm

index e044656a3af73996e2164c1a4326f475e671a57e..12fa8956f87b8d2d4bb738bd937cfbfff281a4dc 100644 (file)
@@ -1,6 +1,6 @@
 ;;; -*-Scheme-*-
 ;;;
-;;;    $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/editor.scm,v 1.217 1992/02/19 00:05:11 cph Exp $
+;;;    $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/editor.scm,v 1.218 1992/03/13 10:08:11 cph Exp $
 ;;;
 ;;;    Copyright (c) 1986, 1989-92 Massachusetts Institute of Technology
 ;;;
 (declare (usual-integrations))
 \f
 (define (edit . args)
-  (cond ((within-editor?)
-        (error "edwin: Editor already running"))
-       ((not edwin-editor)
-        (apply create-editor args))
-       ((not (null? args))
-        (error "edwin: Arguments ignored when re-entering editor" args))
-       (edwin-continuation
-        => (lambda (continuation)
-             (set! edwin-continuation false)
-             (continuation unspecific))))
   (call-with-current-continuation
    (lambda (continuation)
+     (cond ((within-editor?)
+           (error "edwin: Editor already running"))
+          ((not edwin-editor)
+           (apply create-editor args))
+          ((not (null? args))
+           (error "edwin: Arguments ignored when re-entering editor" args))
+          (edwin-continuation
+           => (lambda (restart)
+                (set! edwin-continuation false)
+                (within-continuation restart
+                  (lambda ()
+                    (set! editor-abort continuation)
+                    unspecific)))))
      (fluid-let ((editor-abort continuation)
                 (current-editor edwin-editor)
                 (editor-thread (current-thread))