anchor.diff:                               :width (display-width)
                                :height (display-height)
                                :id/frame-table id/frame-table
  -                             :current %frame)))
  +                             :current frame)))
         vf)))
   
   (defun find-unused-frame-id (virtual-frame)
     (position-if #'null (virtual-frame-id/frame-table virtual-frame)))
   
  +(defun find-frame-id (virtual-frame frame)
  +  (position frame (virtual-frame-id/frame-table virtual-frame)))
  +
   (defun num-frames (virtual-frame)
     (count-if-not #'null (virtual-frame-id/frame-table virtual-frame)))
   
   (defun allocate-frame (virtual-frame frame)
  -  (declare (type %frame frame))
  -  (setf (aref (virtual-frame-id/frame-table virtual-frame) (%frame-id frame))
  -        frame))
  +  (declare (type frame frame))
  +  (let ((id (find-unused-frame-id virtual-frame)))
  +    (setf (aref (virtual-frame-id/frame-table virtual-frame) id)
  +          frame)))
   
   (defun free-frame (virtual-frame frame)
  -  (declare (type %frame frame))
  -  (setf (aref (virtual-frame-id/frame-table virtual-frame) (%frame-id frame))
  -        nil))
  +  (declare (type frame frame))
  +  (let ((id (find-frame-id virtual-frame frame)))
  +    (setf (aref (virtual-frame-id/frame-table virtual-frame) id)
  +          nil)))
   
   (defun get-frame-from-id (virtual-frame id)
     (aref (virtual-frame-id/frame-table virtual-frame) id))
   
   (defun liner-search-frame (virtual-frame frame dir wrap)
  -  (let ((id (%frame-id frame)))
  +  (let ((id (find-frame-id virtual-frame frame)))
       (loop :for n := (funcall wrap (+ id dir)) :then (funcall wrap (+ n dir))
             :until (= n id)
             :do (unless (null (get-frame-from-id virtual-frame n))
                   (return-from liner-search-frame (get-frame-from-id virtual-frame n))))))
   
   (defun search-previous-frame (virtual-frame frame)
  -  (declare (type %frame frame))
  +  (declare (type frame frame))
     (let ((len (length (virtual-frame-id/frame-table virtual-frame))))
       (liner-search-frame virtual-frame
                           frame
  
positive.code:                               n)))))
  
  (defun search-next-frame (virtual-frame frame)
    (declare (type %frame frame))
    (let ((len (length (virtual-frame-id/frame-table virtual-frame))))
      (liner-search-frame virtual-frame
                          frame
  
negative.code: (defun make-virtual-frame (impl frame)
    (declare (type frame frame))
    (let* ((buffer (make-buffer "*fm*" :enable-undo-p nil :temporary t))
           (id/frame-table (make-array +fm-max-number-of-frames+ :initial-element nil)))
      (setf (aref id/frame-table 0) frame)
      (setf (lem:variable-value 'truncate-lines :buffer buffer) nil)
      (let ((vf (make-instance 'virtual-frame
                               :impl impl
  