anchor.diff:                         (vector-push-extend ch (buffer stream))
                          (write-char ch stream)
                          (incf (cursor-position stream))
  -                       (setf (line-end-position stream) (multiple-value-list (sys.int::stream-cursor-pos stream))))
  +                       (setf (line-end-position stream) (multiple-value-list (sys.int::stream-cursor-pos stream)))
  +                       (setf (last-command stream) ch))
                         (t ;; Writing into the middle of the line requires a redraw.
                          ;; Ensure space.
                          (vector-push-extend ch (buffer stream))
  
positive.code:                        (when (not (eql (cursor-position stream) (length (buffer stream))))
                           (setf (cursor-position stream) (length (buffer stream)))
                           (redraw-line stream))
                         (history-add (history-table stream) (make-array (length (buffer stream))
                                                                         :element-type 'character
                                                                         :initial-contents (buffer stream)))
                         (vector-push-extend #\Newline (buffer stream))
                         (write-char #\Newline stream)
                         (setf (output-progress stream) 0)
                         (return (sys.gray:stream-read-char stream)))
                        (fn
                         (funcall fn stream)
                         (redraw-line stream))
                        ((not (graphic-char-p ch))) ; ignore non-graphics characters.
                        ((eql (cursor-position stream) (length (buffer stream)))
  
negative.code:    (%line-start-position :accessor line-start-position)
     (%line-end-position :accessor line-end-position)
     (%history-table :initarg :history-table :reader history-table)
     (%history-position :initarg :history-position :accessor history-position)
     (%history-search-fragment :initarg :history-search-fragment :accessor history-search-fragment)
     (%last-command :initarg :last-command :accessor last-command))
    (:default-initargs :history-table *line-editor-history*
                       :history-position nil
                       :history-search-fragment nil
                       :last-command nil))
  
  (defvar *line-editor-command-table* (make-hash-table))
  
  