From a97e34fc4a77c9dbec1b467eef1dfca8e2410656 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Mon, 21 Jun 1999 03:47:29 +0000 Subject: [PATCH] Fix bug: scheme-under-emacs stopped working due to port-encapsulation changes. This isn't a general fix -- it only handles the one kind of encapsulation that occurs in this place. If other kinds of encapsulation are used, this will have to be generalized. --- v7/src/runtime/emacs.scm | 15 ++++++++++----- v7/src/runtime/runtime.pkg | 5 ++++- v7/src/runtime/tscript.scm | 8 ++++---- v8/src/runtime/runtime.pkg | 5 ++++- 4 files changed, 22 insertions(+), 11 deletions(-) diff --git a/v7/src/runtime/emacs.scm b/v7/src/runtime/emacs.scm index 556d86541..1151ebd62 100644 --- a/v7/src/runtime/emacs.scm +++ b/v7/src/runtime/emacs.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: emacs.scm,v 14.26 1999/02/24 21:36:13 cph Exp $ +$Id: emacs.scm,v 14.27 1999/06/21 03:46:54 cph Exp $ Copyright (c) 1988-1999 Massachusetts Institute of Technology @@ -247,10 +247,15 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ((cdar pairs) new-port))) (do ((cmdl (nearest-cmdl) (cmdl/parent cmdl))) ((not cmdl)) - (if (let ((port (cmdl/port cmdl))) - (or (eq? port the-console-port) - (eq? port emacs-console-port))) - (set-cmdl/port! cmdl new-port))))) + (let ((port (cmdl/port cmdl))) + (cond ((or (eq? port the-console-port) + (eq? port emacs-console-port)) + (set-cmdl/port! cmdl new-port)) + ((and (transcriptable-port? port) + (let ((port (encapsulated-port/port port))) + (or (eq? port the-console-port) + (eq? port emacs-console-port)))) + (set-cmdl/port! cmdl (make-transcriptable-port new-port)))))))) (define (select-console-port) (set! console-output-channel (port/output-channel the-console-port)) diff --git a/v7/src/runtime/runtime.pkg b/v7/src/runtime/runtime.pkg index 30a658de0..afb5f1b84 100644 --- a/v7/src/runtime/runtime.pkg +++ b/v7/src/runtime/runtime.pkg @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: runtime.pkg,v 14.328 1999/05/13 03:04:25 cph Exp $ +$Id: runtime.pkg,v 14.329 1999/06/21 03:47:29 cph Exp $ Copyright (c) 1988-1999 Massachusetts Institute of Technology @@ -850,6 +850,9 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. transcript-on) (export (runtime rep) make-transcriptable-port) + (export (runtime emacs-interface) + make-transcriptable-port + transcriptable-port?) (initialization (initialize-package!))) (define-package (runtime format) diff --git a/v7/src/runtime/tscript.scm b/v7/src/runtime/tscript.scm index f8701fe01..372db036e 100644 --- a/v7/src/runtime/tscript.scm +++ b/v7/src/runtime/tscript.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: tscript.scm,v 1.3 1999/02/18 03:54:26 cph Exp $ +$Id: tscript.scm,v 1.4 1999/06/21 03:46:49 cph Exp $ Copyright (c) 1990, 1999 Massachusetts Institute of Technology @@ -29,7 +29,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. (constructor make-encap-state ())) (transcript-port #f)) -(define (encap? object) +(define (transcriptable-port? object) (and (encapsulated-port? object) (encap-state? (encapsulated-port/state object)))) @@ -50,7 +50,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. (define (transcript-on filename) (let ((encap (nearest-cmdl/port))) - (if (not (encap? encap)) + (if (not (transcriptable-port? encap)) (error "Transcript not supported for this REPL.")) (if (encap/tport encap) (error "transcript already turned on")) @@ -58,7 +58,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. (define (transcript-off) (let ((encap (nearest-cmdl/port))) - (if (not (encap? encap)) + (if (not (transcriptable-port? encap)) (error "Transcript not supported for this REPL.")) (let ((tport (encap/tport encap))) (if tport diff --git a/v8/src/runtime/runtime.pkg b/v8/src/runtime/runtime.pkg index 578e667cc..f41b92352 100644 --- a/v8/src/runtime/runtime.pkg +++ b/v8/src/runtime/runtime.pkg @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: runtime.pkg,v 14.333 1999/05/13 03:04:10 cph Exp $ +$Id: runtime.pkg,v 14.334 1999/06/21 03:47:25 cph Exp $ Copyright (c) 1988-1999 Massachusetts Institute of Technology @@ -854,6 +854,9 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. transcript-on) (export (runtime rep) make-transcriptable-port) + (export (runtime emacs-interface) + make-transcriptable-port + transcriptable-port?) (initialization (initialize-package!))) (define-package (runtime format) -- 2.25.1