From: Chris Hanson Date: Wed, 15 May 1991 21:19:11 +0000 (+0000) Subject: Add CLOSE operation that deallocates the port's output mark. X-Git-Tag: 20090517-FFI~10574 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=0f53c9f67e9118e04447cdcc95126c289d3be422;p=mit-scheme.git Add CLOSE operation that deallocates the port's output mark. --- diff --git a/v7/src/edwin/bufout.scm b/v7/src/edwin/bufout.scm index 14f7ec4fb..e6b6e9757 100644 --- a/v7/src/edwin/bufout.scm +++ b/v7/src/edwin/bufout.scm @@ -1,8 +1,8 @@ ;;; -*-Scheme-*- ;;; -;;; $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/bufout.scm,v 1.3 1989/08/09 13:16:53 cph Rel $ +;;; $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/bufout.scm,v 1.4 1991/05/15 21:19:11 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 @@ -53,7 +53,7 @@ (define (mark->output-port mark #!optional buffer) (output-port/copy mark-output-port-template - (cons (mark-left-inserting mark) + (cons (mark-left-inserting-copy mark) (if (default-object? buffer) false buffer)))) @@ -112,8 +112,12 @@ (define (operation/write-string port string) (region-insert-string! (output-port/mark port) string)) +(define (operation/close port) + (mark-temporary! (output-port/mark port))) + (define mark-output-port-template - (make-output-port `((FLUSH-OUTPUT ,operation/flush-output) + (make-output-port `((CLOSE ,operation/close) + (FLUSH-OUTPUT ,operation/flush-output) (FRESH-LINE ,operation/fresh-line) (FRESH-LINES ,operation/fresh-lines) (PRINT-SELF ,operation/print-self)