let chamo_open_file args =
  let args =
    if Array.length args < 1 then
      failwith "chamo_open_file: not enough arguments";
    if Array.length args < 2 then
      [| args.(0) ; "1,0" |]
    else
      [| args.(0) ; Printf.sprintf "%s,0" args.(1) |]
  in
  match !Ed_gui.gui_windows, !Ed_gui.active_window with
    [], _ ->
      Cam_commands.launch_command
        "in_new_window" (Array.append [|"open_file"|] args)
  | (w :: q), None ->
      w#window#misc#grab_focus ();
      Cam_commands.launch_command "open_file" args
  | _, Some _ ->
      Cam_commands.launch_command "open_file" args