let factory_open_file ~factory topwin active_view ?attributes file =
  let f o = o#open_file topwin active_view ?attributes file in
  on_factory factory f