anchor.diff:      (multiple-value-bind (cx cy) (stream-cursor-position stream)
         (declare (ignore cx))
         (draw-rectangle* (sheet-medium stream) margin cy (+ margin 4)
  -		       (+ cy (slot-value stream 'height))
  -		       :ink +foreground-ink+
  -		       :filled t)))
  +                       (+ cy (slot-value stream 'height))
  +                       :ink +foreground-ink+
  +                       :filled t)))
     (stream-write-char stream #\newline))
   
   (defun seos-write-string (stream string &optional (start 0) end)
     (let* ((medium       (sheet-medium stream))
  -	 (text-style   (medium-text-style medium))
  -	 (new-baseline (text-style-ascent text-style medium))
  -	 (new-height   (text-style-height text-style medium))
  -	 (margin       (stream-text-margin stream))
  -	 (end          (or end (length string))))
  +         (text-style   (medium-text-style medium))
  +         (new-baseline (text-style-ascent text-style medium))
  +         (new-height   (text-style-height text-style medium))
  +         (margin       (stream-text-margin stream))
  +         (end          (or end (length string))))
       (flet ((find-split (delta)  ;; FIXME: This can be done smarter.
  -	     (loop for i from (1+ start) upto end
  -		   as sub-width = (stream-string-width stream string
  -						       :start start :end i
  -						       :text-style text-style)
  -		   while (<= sub-width delta)
  -		   finally (return (1- i)))))
  +             (loop for i from (1+ start) upto end
  +                   as sub-width = (stream-string-width stream string
  +                                                       :start start :end i
  +                                                       :text-style text-style)
  +                   while (<= sub-width delta)
  +                   finally (return (1- i)))))
         (when (eql end 0)
           (return-from seos-write-string))
         (with-slots (baseline height vspace) stream
  -	(multiple-value-bind (cx cy) (stream-cursor-position stream)
  -	  (when (> new-baseline baseline)
  -	    (setq baseline new-baseline))
  -	  (if (> new-height height)
  -	      (setq height new-height))
  -	  (let ((width (stream-string-width stream string
  -					    :start start :end end
  -					    :text-style text-style))
  -		(split end))
  -	    (when (>= (+ cx width) margin)
  -	      (ecase (stream-end-of-line-action stream)
  -		(:wrap
  +        (multiple-value-bind (cx cy) (stream-cursor-position stream)
  +          (when (> new-baseline baseline)
  +            (setq baseline new-baseline))
  +          (if (> new-height height)
  +              (setq height new-height))
  +          (let ((width (stream-string-width stream string
  +                                            :start start :end end
  +                                            :text-style text-style))
  +                (split end))
  +            (when (>= (+ cx width) margin)
  +              (ecase (stream-end-of-line-action stream)
  +                (:wrap
                    ;; Let's prevent infinite recursion if there isn't
                    ;; room for even a single character.
  -		 (setq split (max (find-split (- margin cx))
  +                 (setq split (max (find-split (- margin cx))
                                     (1+ start))))
  -		(:scroll
  -		 (scroll-horizontal stream width))
  -		(:allow)))
  -	    (unless (= start split)
  -	      (stream-write-output stream
  -				   string
  +                (:scroll
  +                 (scroll-horizontal stream width))
  +                (:allow)))
  +            (unless (= start split)
  +              (stream-write-output stream
  +                                   string
                                      nil
  -				   start split)
  -	      (setq cx (+ cx width))
  +                                   start split)
  +              (setq cx (+ cx width))
             (with-slots (x y) (stream-text-cursor stream)
                   (setf x cx y cy)))
  -	    (when (/= split end)
  -	      (let ((current-baseline baseline))
  -		(setf baseline current-baseline))		
  -	      (stream-wrap-line stream)
  -	      (seos-write-string stream string split end))))))))
  +            (when (/= split end)
  +              (let ((current-baseline baseline))
  +                (setf baseline current-baseline))               
  +              (stream-wrap-line stream)
  +              (seos-write-string stream string split end))))))))
   
   (defun seos-write-newline (stream)
     (let ((medium       (sheet-medium stream))
  -	(%view-height (bounding-rectangle-height
  -		       (or (pane-viewport stream)
  -			   stream)))
  -	(view-height  (bounding-rectangle-height stream)))
  +        (%view-height (bounding-rectangle-height
  +                       (or (pane-viewport stream)
  +                           stream)))
  +        (view-height  (bounding-rectangle-height stream)))
       (with-slots (baseline height vspace) stream
         (multiple-value-bind (cx cy) (stream-cursor-position stream)
  -	(setf height (max height (text-style-height (medium-text-style medium) medium)))
  -	(setf cx 0
  -	      cy (+ cy height vspace))
  -	(when (> cy view-height)
  -	  (ecase (stream-end-of-page-action stream)
  -	    ((:scroll :allow)
  +        (setf height (max height (text-style-height (medium-text-style medium) medium)))
  +        (setf cx 0
  +              cy (+ cy height vspace))
  +        (when (> cy view-height)
  +          (ecase (stream-end-of-page-action stream)
  +            ((:scroll :allow)
                (change-space-requirements stream
                                           :width  (bounding-rectangle-width stream)
                                           :height cy))
  -	    (:wrap
  -	     (setq cy 0))))
  -	(unless (eq :allow (stream-end-of-page-action stream))
  -	  (scroll-extent stream 0 (max 0 (-  cy  %view-height))))
  -	;; mikemac says that this "erase the new line" behavior is
  -	;; required by the stream text protocol, but I don't see
  -	;; it.  I'm happy to put this back in again, but in the
  -	;; meantime it makes debugging of updating-output a bit easier
  -	;; not to have "extra" records laying around.  If/When it goes
  -	;; back in... the draw-rectangle has to happen on the stream,
  -	;; not the medium. -- moore
  -	#+nil(draw-rectangle* medium cx cy (+ margin 4) (+ cy height)
  -			      :ink +background-ink+
  -			      :filled t)
  -	(setq baseline 0
  -	      height   0)
  -	(setf (stream-cursor-position stream) (values cx cy))))))
  +            (:wrap
  +             (setq cy 0))))
  +        (unless (eq :allow (stream-end-of-page-action stream))
  +          (scroll-extent stream 0 (max 0 (-  cy  %view-height))))
  +        ;; mikemac says that this "erase the new line" behavior is
  +        ;; required by the stream text protocol, but I don't see
  +        ;; it.  I'm happy to put this back in again, but in the
  +        ;; meantime it makes debugging of updating-output a bit easier
  +        ;; not to have "extra" records laying around.  If/When it goes
  +        ;; back in... the draw-rectangle has to happen on the stream,
  +        ;; not the medium. -- moore
  +        #+nil(draw-rectangle* medium cx cy (+ margin 4) (+ cy height)
  +                              :ink +background-ink+
  +                              :filled t)
  +        (setq baseline 0
  +              height   0)
  +        (setf (stream-cursor-position stream) (values cx cy))))))
   
   
   
  
positive.code: ;;; down. Using SUBSEQ does fix this interaction that's been here
  ;;; since 4/16/03 - Mikemac 12/6/2003
  (defmethod stream-write-string ((stream standard-extended-output-stream) string
  				&optional (start 0) end)
    (let ((seg-start start)
  	(end (or end (length string))))
      (with-cursor-off stream
       (loop for i from start below end do
         (when (char= #\Newline
  		    (char string i))
  	 (seos-write-string stream (subseq string seg-start i))
  	 (seos-write-newline stream)
  	 (setq seg-start (1+ i))))
       (seos-write-string stream (subseq string seg-start end)))))
  
  (defmethod stream-character-width ((stream standard-extended-output-stream) char
  				   &key (text-style nil))
    (with-sheet-medium (medium stream)
      (text-style-character-width (or text-style (medium-text-style medium))
                                  medium
                                  char)))
  
  (defmethod stream-string-width ((stream standard-extended-output-stream) string
  				&key (start 0) (end nil) (text-style nil))
    (with-sheet-medium (medium stream)
      (if (null text-style)
          (setq text-style (medium-text-style (sheet-medium stream))))
  
negative.code:   (with-slots (x y sheet width) cursor
      (let ((height (cursor-height cursor)))
        (case state
          (:draw
           (draw-rectangle* (sheet-medium (cursor-sheet cursor))
                            x y
                            (+ x width) (+ y height)
                            :filled (ecase (cursor-appearance cursor)
                                      (:solid t) (:hollow nil))
                            :ink +foreground-ink+))
          (:erase
           ;; This is how I'd like this to work, as painting over with
           ;; the background ink is repugnant. I leave this disabled
           ;; because I'm concerned about infinite recursion if
           ;; replay-output-record calls here. --Hefner
           #+nil (repaint-sheet (cursor-sheet cursor)
                                (make-bounding-rectangle x y (+ 1 x width)
                                                         (+ 1 y height)))
           (draw-rectangle* (sheet-medium (cursor-sheet cursor))
                            x y
                            (+ x width) (+ y height)
                            :filled (ecase (cursor-appearance cursor)
                                      (:solid t) (:hollow nil))
                            :ink +background-ink+))))))
  
  ;;; Standard-Text-Cursor class
  
  