New port abstraction is hiding unread characters from the underlying
authorChris Hanson <org/chris-hanson/cph>
Tue, 30 Mar 2004 04:27:52 +0000 (04:27 +0000)
committerChris Hanson <org/chris-hanson/cph>
Tue, 30 Mar 2004 04:27:52 +0000 (04:27 +0000)
port operations; consequently, the buffer-input implementation was
returning the wrong value for the current mark.  This has been kludged
around.

v7/src/edwin/bufinp.scm
v7/src/edwin/edwin.pkg

index 1c63073dc946380d132b79b9a1d8554a746f7d70..783d7dac1ca0aa0c03a9a8470e0a071cf67459ad 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Id: bufinp.scm,v 1.12 2004/02/16 05:42:49 cph Exp $
+$Id: bufinp.scm,v 1.13 2004/03/30 04:27:48 cph Exp $
 
 Copyright 1989,1990,1991,1999,2004 Massachusetts Institute of Technology
 
@@ -71,7 +71,9 @@ USA.
       ,(lambda (port)
        (let ((state (port/state port)))
          (make-mark (bstate-group state)
-                    (bstate-start state)))))
+                    (if (port/unread port)
+                        (- (bstate-start state) 1)
+                        (bstate-start state))))))
      (CHAR-READY?
       ,(lambda (port)
         (let ((state (port/state port)))
index ecb7ac26f61662d5be363eb214684c6315e3c1cf..253d3b450e4b637bbd8a1c6697e0496e5ff23ac7 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Id: edwin.pkg,v 1.287 2004/02/16 05:43:26 cph Exp $
+$Id: edwin.pkg,v 1.288 2004/03/30 04:27:52 cph Exp $
 
 Copyright 1989,1990,1991,1992,1993,1994 Massachusetts Institute of Technology
 Copyright 1995,1996,1997,1998,1999,2000 Massachusetts Institute of Technology
@@ -535,7 +535,9 @@ USA.
   (export (edwin)
          make-buffer-input-port
          with-input-from-mark
-         with-input-from-region))
+         with-input-from-region)
+  (import (runtime port)
+         port/unread))
 
 (define-package (edwin buffer-output-port)
   (files "bufout")