anchor.diff:          :test #'data-equal-entry-p))
   
   (export-always 'go-to-child)
  -(defmethod go-to-child (data (history history-tree) &key (child-finder #'find-child)) ; TODO: Should take a node instead?
  +(defmethod go-to-child (data (history history-tree) owner-spec &key (child-finder #'find-child)) ; TODO: Should take a node instead?
     "Go to direct current node's child matching DATA.
  -Return (values HISTORY (current-owner-node HISTORY))."
  -  (let* ((owner (current-owner history))
  -         (match (funcall child-finder data owner)))
  -    (when match
  -      (visit history match))))
  +Return (values HISTORY OWNER)."
  +  (let* ((owner (owner history owner-spec))
  +         (match (when owner (funcall child-finder data owner))))
  +    (if match
  +        (visit history owner match)
  +        (values history owner))))
   
   (export-always 'go-to-owned-child)
  -(defmethod go-to-owned-child (data (history history-tree))
  +(defmethod go-to-owned-child (data (history history-tree) owner-spec)
     "Go to current node's direct owned child matching DATA.
  -A child is owned if it has a binding with current owner.
  +A child is owned if it has a binding with OWNER.
   Return (values OWNER (current OWNER))."
  -  (go-to-child data (current-owner history) :child-finder #'find-owned-child))
  -
  -
  -(defun make-origin-node (history owner-id data)
  -  (let* ((owner (owner history owner-id))
  +  (go-to-child data (owner history owner-spec) :child-finder #'find-owned-child))
  +
  +
  +(defun make-origin-node (history owner-spec data)
  +  (let* ((owner (owner history owner-spec))
            (new-node (make-node :entry (add-entry history data)
                                 :parent (creator-node owner))))
       (when (creator-node owner)
         (push new-node (children (creator-node owner))))
       (setf (origin owner) new-node)
  -    (with-current-owner (history owner-id)
  -      (visit history new-node))))
  +    (visit history owner-spec new-node)))
   
   (export-always 'add-child)
  -(defmethod add-child (data (history history-tree))
  +(defmethod add-child (data (history history-tree) owner-spec)
     "Create or find a node holding DATA and set current node to it.
   Return the (possibly new) current node.
  +Return NIL is OWNER-SPEC does not refer to an existing owner.
   
   If current node matches DATA (which may be non-identical since the
   `history-tree''s `key' and `test' functions may identify two non-identical datum
   as equal), do nothing.
   
  -If DATA is found among the children, the current owner node `forward-child' is
  +If DATA is found among the children, OWNER-SPEC current node `forward-child' is
   set to the matching child, the owner current node is set to this child.
   
  -If there is no current node, this creates the `origin' node of the current owner
  +If there is no current node, this creates the `origin' node of OWNER-SPEC
   and also sets `current' to it.  If the owner has a `creator-id' set,
   the new node is added to the children of the current node of the creator."
  -  (let* ((owner (current-owner history)))
  -    (cond
  -      ((null (current owner))
  -       (make-origin-node history (current-owner-id history) data))
  -
  -      ((not (data-equal-entry-p data (entry (current owner))))
  -       (let ((node (find-child data owner)))
  -         (unless node
  -           (let ((maybe-new-entry (add-entry history data)))
  -             (push (setf node (make-node :entry maybe-new-entry
  -                                         :parent (current owner)))
  -                   (children (current owner)))))
  -         (let ((binding (gethash owner (bindings (current owner)))))
  -           (setf (forward-child binding) node))
  -         (forward history)))
  -
  -      (t
  -       ;; Current node matches data, do nothing.
  -       nil))
  -
  -    (current owner)))
  +  (let* ((owner (owner history owner-spec)))
  +    (when owner
  +      (cond
  +        ((null (current owner))
  +         (make-origin-node history (owner history owner-spec) data))
  +
  +        ((not (data-equal-entry-p data (entry (current owner))))
  +         (let ((node (find-child data owner)))
  +           (unless node
  +             (let ((maybe-new-entry (add-entry history data)))
  +               (push (setf node (make-node :entry maybe-new-entry
  +                                           :parent (current owner)))
  +                     (children (current owner)))))
  +           (let ((binding (gethash owner (bindings (current owner)))))
  +             (setf (forward-child binding) node))
  +           (forward history owner)))
  +
  +        (t
  +         ;; Current node matches data, do nothing.
  +         nil))
  +
  +      (current owner))))
   
   (export 'add-children)
  -(defmethod add-children (children-data (history history-tree))
  -  "Add CHILDREN-DATA to the HISTORY `current-owner''s.
  +(defmethod add-children (children-data (history history-tree) owner-spec)
  +  "Add CHILDREN-DATA to the HISTORY OWNER-SPEC.
   Each child is added with `add-child'.
   Return the (maybe new) current node, which holds the last piece of data in
   `children-data'."
  -  (let ((owner (current-owner history)))
  -    (add-child (first children-data) owner)
  -    (if (rest children-data)
  -        (add-children (rest children-data) (backward owner))
  -        (current owner))))
  +  (let ((owner (owner history owner-spec)))
  +    (when owner
  +      (add-child (first children-data) owner)
  +      (if (rest children-data)
  +          (add-children (rest children-data) (backward owner))
  +          (current owner)))))
   
   (export-always 'map-tree)
  -(defun map-tree (function tree &key flatten include-root
  +(defun map-tree (function tree &key owner flatten include-root
                                    (collect-function #'cons)
                                    (children-function #'children))
     "Map the FUNCTION over the TREE.
  -If TREE is a `htree:history-tree', start from its current branch root.
  +If TREE is a `htree:history-tree', start from its OWNER root.
   If TREE is a `htree:node', start from it.
  +OWNER can be an ID or an `owner' object.
   Include results of applying FUNCTION over ROOT if INCLUDE-ROOT is
   non-nil.
   Return results as cons cells tree if FLATTEN is nil and as a flat
  
positive.code: (deftype non-negative-integer ()
    `(integer 0 ,most-positive-fixnum))
  
  (declaim (ftype (function (history-tree) non-negative-integer) depth))
  (defun depth (history)
    "Return the number of (possibly unowned) parents of the current owner node."
    (length (all-parents history)))
  
  (defmethod size ((owner owner))
    "Return the total number of nodes owned by OWNER."
    (length (nodes owner)))
  
  
negative.code: (export-always 'map-owned-tree)
  (defun map-owned-tree (function tree &key flatten include-root
                                         (collect-function #'cons)
                                         owner)
    "Like `map-tree' but restrict traversal to OWNER's nodes."
    (map-tree function (if (history-tree-p tree)
                           (owned-root owner)
  