Changeset 672


Ignore:
Timestamp:
Mar 19, 2004, 12:48:15 AM (16 years ago)
Author:
gb
Message:

Bind current-buffer. No real difference in output-buffering stuff.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ccl/hemlock/src/streams.lisp

    r587 r672  
    8282
    8383(defun hemlock-output-unbuffered-out (stream character)
    84   (with-left-inserting-mark (mark (hemlock-output-stream-mark stream))
    85     (insert-character mark character)
    86     (redisplay-windows-from-mark mark)))
     84  (let* ((b (current-buffer))
     85         (stream-mark (hemlock-output-stream-mark stream))
     86         (new-buf (line-buffer (mark-line stream-mark))))
     87    (unwind-protect
     88         (with-left-inserting-mark (mark stream-mark)
     89           (setf (current-buffer) new-buf)
     90           (insert-character mark character))
     91      (setf (current-buffer) b))))
    8792
    8893(defun hemlock-output-unbuffered-sout (stream string start end)
    89   (with-left-inserting-mark (mark (hemlock-output-stream-mark stream))
    90     (insert-string mark string start end)
    91     (redisplay-windows-from-mark mark)))
     94  (let* ((b (current-buffer))
     95         (stream-mark (hemlock-output-stream-mark stream))
     96         (new-buf (line-buffer (mark-line stream-mark))))
     97    (unwind-protect
     98         (with-left-inserting-mark (mark stream-mark)
     99           (setf (current-buffer) new-buf)
     100           (insert-string mark string start end))
     101      (setf (current-buffer) b))))
     102   
    92103
    93104(defun hemlock-output-buffered-out (stream character)
    94   (with-left-inserting-mark (mark (hemlock-output-stream-mark stream))
    95     (insert-character mark character)))
     105  (hemlock-output-unbuffered-out stream character))
     106
    96107
    97108(defun hemlock-output-buffered-sout (stream string start end)
    98   (with-left-inserting-mark (mark (hemlock-output-stream-mark stream))
    99     (insert-string mark string start end)))
     109  (hemlock-output-unbuffered-sout stream string start end))
    100110
    101111(defun hemlock-output-line-buffered-out (stream character)
    102   (with-left-inserting-mark (mark (hemlock-output-stream-mark stream))
    103     (insert-character mark character)
    104     (when (char= character #\newline)
    105       (redisplay-windows-from-mark mark))))
     112  (hemlock-output-unbuffered-out stream character))
    106113
    107114(defun hemlock-output-line-buffered-sout (stream string start end)
    108   (declare (simple-string string))
    109   (with-left-inserting-mark (mark (hemlock-output-stream-mark stream))
    110     (insert-string mark string start end)
    111     (when (find #\newline string :start start :end end)
    112       (redisplay-windows-from-mark mark))))
     115  (hemlock-output-unbuffered-sout stream string start end))
    113116
    114117#+NIL
     
    121124              (if (/= min most-positive-fixnum) min))))))
    122125
    123 (defmethod stream-finish-output ((stream hemlock-output-stream))
    124   (redisplay-windows-from-mark (hemlock-output-stream-mark stream)))
    125 
    126 (defmethod stream-force-output ((stream hemlock-output-stream))
    127   (redisplay-windows-from-mark (hemlock-output-stream-mark stream)))
     126(defmethod stream-finish-output ((stream hemlock-output-stream)))
     127
     128(defmethod stream-force-output ((stream hemlock-output-stream)))
    128129
    129130(defmethod close ((stream hemlock-output-stream) &key abort)
Note: See TracChangeset for help on using the changeset viewer.