let eval_file args =
  if Array.length args < 1 then
    match !Ed_gui.active_window with
      None -> ()
    | Some w ->
        let f file =
          Cam_commands.launch_command "eval_file" [| file |]
        in
        let mb = w#minibuffer in
        Ed_misc.select_file
          mb ~title: "eval_file"
          ""
          f
  else
    (
     let buf = Buffer.create 256 in
     let fmt = Format.formatter_of_buffer buf in
     ignore(Toploop.use_file fmt args.(0));
     Cam_commands.launch_command
       "print_ocaml_output" [| (Buffer.contents buf) |]
    )