anchor.diff:        (pop (stream-unread-chars pane))
         ;XXX
         (flet ((do-one-event (event)
  -	       (if (and (typep event 'key-press-event)
  -			(keyboard-event-character event))
  -		   (let ((char (char-for-read (keyboard-event-character
  -					       event))))
  -		     (stream-write-char pane char)
  -		     (return-from stream-read-char char))
  -		   (handle-event (event-sheet event) event))))
  -	(let* ((port (port pane))
  -	       (queue (stream-input-buffer pane)))
  -	  (declare (ignorable port))
  -	  (loop
  -	   (let ((event (event-queue-read-no-hang queue)))
  -	     (cond (event
  -		    (do-one-event event))
  -		   (*multiprocessing-p*
  -		    (event-queue-listen-or-wait queue))
  -		   (t (process-next-event port)))))))))
  +               (if (and (typep event 'key-press-event)
  +                        (keyboard-event-character event))
  +                   (let ((char (char-for-read (keyboard-event-character
  +                                               event))))
  +                     (stream-write-char pane char)
  +                     (return-from stream-read-char char))
  +                   (handle-event (event-sheet event) event))))
  +        (let* ((port (port pane))
  +               (queue (stream-input-buffer pane)))
  +          (declare (ignorable port))
  +          (loop
  +           (let ((event (event-queue-read-no-hang queue)))
  +             (cond (event
  +                    (do-one-event event))
  +                   (*multiprocessing-p*
  +                    (event-queue-listen-or-wait queue))
  +                   (t (process-next-event port)))))))))
   
   (defmethod stream-unread-char ((pane standard-input-stream) char)
     (push char (stream-unread-chars pane)))
  
positive.code:   (if (stream-unread-chars pane)
        (pop (stream-unread-chars pane))
      (loop for event = (event-read-no-hang pane)
  	if (null event)
  	   return nil
  	if (and (typep event 'key-press-event)
  		(keyboard-event-character event))
  	  return (char-for-read (keyboard-event-character event))
  	else
  	  do (handle-event (event-sheet event) event))))
  
  (defmethod stream-clear-input ((pane standard-input-stream))
    (setf (stream-unread-chars pane) nil)
    (loop for event = (event-read-no-hang pane)
  	if (null event)
  	   return nil
  	else
  	do (handle-event (event-sheet event) event))
    nil)
  
  (defclass dead-key-merging-mixin ()
  
negative.code:        until (or (characterp char) (eq reason :eof))
         do (stream-read-gesture estream) ; consume pointer gesture
         finally (return (if (eq reason :eof)
                             reason
                             (char-for-read char))))))
  
  (defmethod stream-listen ((stream standard-extended-input-stream))
    (with-encapsulating-stream (estream stream)
      (loop
         with char and reason
           do (setf (values char reason) (stream-read-gesture estream
                                                              :timeout 0
                                                              :peek-p t))
           until (or (characterp char) (eq reason :eof) (eq reason :timeout))
           do (stream-read-gesture estream) ; consume pointer gesture
           finally (return (characterp char)))))
  
  (defmethod stream-clear-input ((stream standard-extended-input-stream))
    (with-encapsulating-stream (estream stream)
      (loop
         with char and reason
           do (setf (values char reason) (stream-read-gesture estream
                                                              :timeout 0
                                                              :peek-p t))
           until (or (eq reason :eof) (eq reason :timeout))
           do (stream-read-gesture estream) ; consume pointer gesture
           ))
    nil)
  
  ;;; stream-read-line returns a second value of t if terminated by eof.
  (defmethod stream-read-line ((stream standard-extended-input-stream))
    (with-encapsulating-stream (estream stream)
      (let ((result (make-array 1
                                :element-type 'character
                                :adjustable t
                                :fill-pointer 0)))
        (loop for char = (stream-read-char estream)
              while (and (characterp char) (not (char= char #\Newline)))
              do (vector-push-extend char result)
              finally (return (values (subseq result 0)
                                      (not (characterp char))))))))
  
  ;;; stream-read-gesture on string strings.  Needed so
  ;;; accept-from-string "just works"
  