From 249aec58fdbfafd31728efdd0d47dde9ef30e3b7 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Wed, 13 Sep 1995 03:57:22 +0000 Subject: [PATCH] Replace Scheme variables *TRANSLATE-FILE-DATA-ON-INPUT?* and *TRANSLATE-FILE-DATA-ON-OUTPUT?* with corresponding editor variables. This allows the variables to be overridden on a per-buffer basis. --- v7/src/edwin/debuge.scm | 7 ++++--- v7/src/edwin/fileio.scm | 17 ++++++++++++----- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/v7/src/edwin/debuge.scm b/v7/src/edwin/debuge.scm index 1b41ff43c..1543fc450 100644 --- a/v7/src/edwin/debuge.scm +++ b/v7/src/edwin/debuge.scm @@ -1,8 +1,8 @@ ;;; -*-Scheme-*- ;;; -;;; $Id: debuge.scm,v 1.50 1993/01/10 10:43:16 cph Exp $ +;;; $Id: debuge.scm,v 1.51 1995/09/13 03:57:22 cph Exp $ ;;; -;;; Copyright (c) 1986, 1989-93 Massachusetts Institute of Technology +;;; Copyright (c) 1986, 1989-95 Massachusetts Institute of Technology ;;; ;;; This material was developed by the Scheme project at the ;;; Massachusetts Institute of Technology, Department of @@ -81,7 +81,8 @@ (write-string "'") (let ((region (buffer-unclipped-region buffer))) (group-write-to-file - (and *translate-file-data-on-output?* + (and (ref-variable translate-file-data-on-output + (region-group region)) (pathname-newline-translation pathname)) (region-group region) (region-start-index region) diff --git a/v7/src/edwin/fileio.scm b/v7/src/edwin/fileio.scm index 694d977cc..551ced68c 100644 --- a/v7/src/edwin/fileio.scm +++ b/v7/src/edwin/fileio.scm @@ -1,6 +1,6 @@ ;;; -*-Scheme-*- ;;; -;;; $Id: fileio.scm,v 1.127 1995/05/02 20:49:06 cph Exp $ +;;; $Id: fileio.scm,v 1.128 1995/09/13 03:57:14 cph Exp $ ;;; ;;; Copyright (c) 1986, 1989-95 Massachusetts Institute of Technology ;;; @@ -110,7 +110,10 @@ Each procedure is called with three arguments: (os/read-file-methods) list?) -(define *translate-file-data-on-input?* #t) +(define-variable translate-file-data-on-input + "If true (the default), end-of-line translation is done on file input." + #t + boolean?) (define (%insert-file mark truename visit?) (let ((do-it @@ -137,7 +140,7 @@ Each procedure is called with three arguments: (let ((channel (file-open-input-channel filename))) (let ((length (channel-file-length channel)) (buffer - (and *translate-file-data-on-input?* + (and (ref-variable translate-file-data-on-input group) (let ((translation (pathname-newline-translation truename))) (and translation (make-input-buffer channel 4096 translation)))))) @@ -420,7 +423,10 @@ Otherwise, a message is written both before and after long file writes." false boolean?) -(define *translate-file-data-on-output?* #t) +(define-variable translate-file-data-on-output + "If true (the default), end-of-line translation is done on file output." + #t + boolean?) (define (write-buffer-interactive buffer backup-mode) (let ((pathname (buffer-pathname buffer))) @@ -520,7 +526,8 @@ Otherwise, a message is written both before and after long file writes." (define (write-region* region pathname message? append?) (let ((translation - (and *translate-file-data-on-output?* + (and (ref-variable translate-file-data-on-output + (region-group region)) (pathname-newline-translation pathname))) (filename (->namestring pathname)) (group (region-group region)) -- 2.25.1