From 28caaee75a76dc2d19a4728e86b8f67907ae12e0 Mon Sep 17 00:00:00 2001
From: ram <ram>
Date: Fri, 26 Feb 1993 18:23:45 +0000
Subject: [PATCH] Add an unread method for region streams which is needed now
 that the in-buffer is gone.

---
 hemlock/streams.lisp | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/hemlock/streams.lisp b/hemlock/streams.lisp
index ca10efedf..9ace6eeb0 100644
--- a/hemlock/streams.lisp
+++ b/hemlock/streams.lisp
@@ -7,7 +7,7 @@
 ;;; Scott Fahlman or slisp-group@cs.cmu.edu.
 ;;;
 (ext:file-comment
-  "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/hemlock/streams.lisp,v 1.1.1.8 1993/02/26 17:32:05 ram Exp $")
+  "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/hemlock/streams.lisp,v 1.1.1.9 1993/02/26 18:23:45 ram Exp $")
 ;;;
 ;;; **********************************************************************
 ;;;
@@ -172,12 +172,21 @@
 	  (t eof-value))))
 
 (defun region-misc (stream operation &optional arg1 arg2)
+  (declare (ignore arg2))
   (case operation
     (:listen (mark< (hemlock-region-stream-mark stream)
 		    (region-end (hemlock-region-stream-region stream))))
     (:clear-input (move-mark
                    (hemlock-region-stream-mark stream)
                    (region-end (hemlock-region-stream-region stream))))
+    (:unread
+     (let ((mark (hemlock-region-stream-mark stream)))
+       (unless (mark> mark
+		      (region-start (hemlock-region-stream-region stream)))
+	 (error "Nothing to unread."))
+       (unless (char= arg1 (previous-character mark))
+	 (error "Unreading something not read: ~S" arg1))
+       (mark-before mark)))
     (:close
      (delete-mark (hemlock-region-stream-mark stream))
      (setf (hemlock-region-stream-region stream) nil))
-- 
GitLab