anchor.diff:  (defgeneric history-reset (history))
   (defgeneric history-newest (history))
   (defgeneric history-oldest (history))
  -(defgeneric history-next (history))
  -(defgeneric history-previous (history))
  +(defgeneric history-next (history entry))
  +(defgeneric history-previous (history entry))
   (defgeneric history-data (history entry))
   (defgeneric history-add (history data))
   
  
positive.code:                                       :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."
  
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))
  
  