From 371bf999aa43525d3f739d5767e272af497d1c87 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Tue, 17 Feb 2004 04:59:29 +0000 Subject: [PATCH] Add NEWLINE line-ending. --- v7/src/edwin/fileio.scm | 8 ++++---- v7/src/runtime/genio.scm | 12 +++++++----- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/v7/src/edwin/fileio.scm b/v7/src/edwin/fileio.scm index 9ca43932f..b3a5af258 100644 --- a/v7/src/edwin/fileio.scm +++ b/v7/src/edwin/fileio.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: fileio.scm,v 1.164 2004/02/16 05:43:33 cph Exp $ +$Id: fileio.scm,v 1.165 2004/02/17 04:59:29 cph Exp $ Copyright 1986,1989,1991,1992,1993,1994 Massachusetts Institute of Technology Copyright 1995,1997,1999,2000,2001,2002 Massachusetts Institute of Technology @@ -216,7 +216,7 @@ of the predicates is satisfied, the file is written in the usual way." (call-with-input-file truename (lambda (port) (if (not (ref-variable translate-file-data-on-input group)) - (port/set-line-ending port 'BINARY)) + (port/set-line-ending port 'NEWLINE)) (let ((length ((port/operation port 'LENGTH) port))) (bind-condition-handler (list condition-type:allocation-failure) (lambda (condition) @@ -683,14 +683,14 @@ Otherwise, a message is written both before and after long file writes." (call-with-output-file filename (lambda (port) (if (not translate?) - (port/set-line-ending port 'BINARY)) + (port/set-line-ending port 'NEWLINE)) (group-write-to-port group start end port)))) (define (group-append-to-file translate? group start end filename) (call-with-append-file filename (lambda (port) (if (not translate?) - (port/set-line-ending port 'BINARY)) + (port/set-line-ending port 'NEWLINE)) (group-write-to-port group start end port)))) (define (group-write-to-port group start end port) diff --git a/v7/src/runtime/genio.scm b/v7/src/runtime/genio.scm index bb4c1c20a..392ecbc5d 100644 --- a/v7/src/runtime/genio.scm +++ b/v7/src/runtime/genio.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: genio.scm,v 1.22 2004/02/16 05:36:36 cph Exp $ +$Id: genio.scm,v 1.23 2004/02/17 04:59:29 cph Exp $ Copyright 1991,1993,1995,1996,1999,2002 Massachusetts Institute of Technology Copyright 2003,2004 Massachusetts Institute of Technology @@ -1269,16 +1269,18 @@ USA. ;;;; Normalizers -(define-normalizer 'BINARY +(define-normalizer 'NEWLINE (lambda (ib) (decode-char ib))) -(define-denormalizer 'BINARY +(define-denormalizer 'NEWLINE (lambda (ob char) (encode-char ob char))) -(define-normalizer 'LF 'BINARY) -(define-denormalizer 'LF 'BINARY) +(define-normalizer 'LF 'NEWLINE) +(define-denormalizer 'LF 'NEWLINE) +(define-normalizer 'BINARY 'NEWLINE) +(define-denormalizer 'BINARY 'NEWLINE) (define-normalizer 'CR (lambda (ib) -- 2.25.1