anchor.diff:    "Move the start of line."
     (setf (cursor-position stream) 0))
   
  +(defun set-from-history (stream)
  +  (let ((data (history-data (history-table stream) (history-position stream))))
  +    (setf (buffer stream) (make-array (length data)
  +                                      :element-type 'character
  +                                      :initial-contents data
  +                                      :fill-pointer t
  +                                      :adjustable t)
  +          (cursor-position stream) (length data))))
  +
  +(define-command previous-history (stream (#\M-P #\Up-Arrow))
  +  (cond ((history-position stream)
  +         (let ((prev (history-previous (history-table stream) (history-position stream))))
  +           (when prev
  +             (setf (history-position stream) prev)
  +             (set-from-history stream))))
  +        (t (setf (history-position stream) (history-newest (history-table stream)))
  +           (when (history-position stream)
  +             (set-from-history stream)))))
  +
  +(define-command next-history (stream (#\M-N #\Down-Arrow))
  +  (cond ((history-position stream)
  +         (let ((next (history-next (history-table stream) (history-position stream))))
  +           (cond (next
  +                  (setf (history-position stream) next)
  +                  (set-from-history stream))
  +                 (t (setf (history-position stream) nil
  +                          (fill-pointer (buffer stream)) 0
  +                          (cursor-position stream) 0)))))
  +        (t (history-add (history-table stream) (make-array (length (buffer stream))
  +                                                           :element-type 'character
  +                                                           :initial-contents (buffer stream)))
  +           (setf (history-position stream) nil
  +                 (fill-pointer (buffer stream)) 0
  +                 (cursor-position stream) 0))))
  +
   (define-command forward-delete-char (stream (#\Delete #\C-D))
     "Delete one character forward."
     (unless (eql (cursor-position stream) (length (buffer stream)))
  
positive.code:                        (when (not (eql (cursor-position stream) (length (buffer stream))))
                           (setf (cursor-position stream) (length (buffer stream)))
                           (redraw-line stream))
                         (vector-push-extend #\Newline (buffer stream))
                         (write-char #\Newline stream)
                         (setf (output-progress stream) 0)
  
negative.code:                    (cursor-position stream) 0
                     (buffer stream) (make-array 50 :element-type 'character :fill-pointer 0 :adjustable t)
                     (line-start-position stream) (multiple-value-list (sys.int::stream-cursor-pos stream))
                     (line-end-position stream) (multiple-value-list (sys.int::stream-cursor-pos stream))
                     (history-position stream) nil))
             (loop
                (let* ((ch (call-next-method))
                       (fn (gethash ch *line-editor-command-table*)))
  