Define new variable EDITOR-THREAD-ROOT-CONTINUATION, which is the
authorChris Hanson <org/chris-hanson/cph>
Mon, 17 Feb 1992 22:01:47 +0000 (22:01 +0000)
committerChris Hanson <org/chris-hanson/cph>
Mon, 17 Feb 1992 22:01:47 +0000 (22:01 +0000)
continuation for use when spawning threads in the editor.  Also change
the environment and syntax-table that the initial *repl* uses to be
inherited from the REPL that Edwin is invoked from.

v7/src/edwin/editor.scm
v7/src/edwin/intmod.scm

index 067807156ddc96dedfa959fa85f53dfa6d1cb1ae..5784af755748f580166f5b8e0328c6899548260a 100644 (file)
@@ -1,6 +1,6 @@
 ;;; -*-Scheme-*-
 ;;;
-;;;    $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/editor.scm,v 1.214 1992/02/10 15:48:53 cph Exp $
+;;;    $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/editor.scm,v 1.215 1992/02/17 22:00:58 cph Exp $
 ;;;
 ;;;    Copyright (c) 1986, 1989-92 Massachusetts Institute of Technology
 ;;;
@@ -62,6 +62,7 @@
      (fluid-let ((editor-abort continuation)
                 (current-editor edwin-editor)
                 (editor-thread (current-thread))
+                (editor-thread-root-continuation)
                 (editor-initial-threads '())
                 (inferior-thread-changes? false)
                 (recursive-edit-continuation false)
@@ -78,6 +79,8 @@
                   (lambda ()
                     (call-with-current-continuation
                      (lambda (root-continuation)
+                       (set! editor-thread-root-continuation
+                             root-continuation)
                        (do ((thunks (let ((thunks editor-initial-threads))
                                       (set! editor-initial-threads '())
                                       thunks)
 (define edwin-editor false)
 (define current-editor)
 (define editor-thread)
+(define editor-thread-root-continuation)
 (define editor-initial-threads)
 (define edwin-continuation)
 
 (define (standard-editor-initialization)
   (start-inferior-repl!
    (current-buffer)
-   user-initial-environment
-   user-initial-syntax-table
+   (nearest-repl/environment)
+   (nearest-repl/syntax-table)
    (and (not (ref-variable inhibit-startup-message))
        (cmdl-message/append
         (cmdl-message/active
@@ -215,15 +219,9 @@ with the contents of the startup message."
              (send (screen-root-window screen) ':salvage!))
            (editor-screens edwin-editor)))
 
-;;; There is a problem with recursive edits and multiple screens.
-;;; When you switch screens the recursive edit aborts. The problem
-;;; is that a top level ^G in a recursive edit aborts the recursive
-;;; edit and a ^G is signalled when you switch screens. I think that
-;;; ^G should not abort a recursive edit.
-
 (define (enter-recursive-edit)
   (let ((value
-        (call-with-protected-continuation
+        (call-with-current-continuation
           (lambda (continuation)
             (fluid-let ((recursive-edit-continuation continuation)
                         (recursive-edit-level (1+ recursive-edit-level)))
@@ -233,12 +231,9 @@ with the contents of the startup message."
                                    (window-modeline-event! window
                                                            'RECURSIVE-EDIT))
                                  (window-list)))))
-                (dynamic-wind
-                 (lambda () unspecific)
-                 (lambda ()
-                   (recursive-edit-event!)
-                   (command-reader))
-                 recursive-edit-event!)))))))
+                (dynamic-wind recursive-edit-event!
+                              command-reader
+                              recursive-edit-event!)))))))
     (if (eq? value 'ABORT)
        (abort-current-command)
        (begin
@@ -337,7 +332,7 @@ This does not affect editor errors or evaluation errors."
 (define (intercept-^G-interrupts interceptor thunk)
   (let ((signal-tag "signal-tag"))
     (let ((value
-          (call-with-protected-continuation
+          (call-with-current-continuation
             (lambda (continuation)
               (fluid-let ((*^G-interrupt-handler*
                            (lambda () (continuation signal-tag))))
index 26b9531ad49716608ff8641dc91e16face56e9dc..0864c2f569eca7d1813ebbd694f4e77ecc8b2277 100644 (file)
@@ -1,6 +1,6 @@
 ;;; -*-Scheme-*-
 ;;;
-;;;    $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/intmod.scm,v 1.42 1992/02/08 15:23:37 cph Exp $
+;;;    $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/intmod.scm,v 1.43 1992/02/17 22:01:47 cph Exp $
 ;;;
 ;;;    Copyright (c) 1986, 1989-92 Massachusetts Institute of Technology
 ;;;
@@ -71,7 +71,7 @@ but prefix argument means prompt for different environment."
    buffer
    (lambda ()
      (create-thread
-      command-reader-reset-continuation
+      editor-thread-root-continuation
       (lambda ()
        (let ((thread (current-thread)))
          (detach-thread thread)