method load_file filename =
if not (Sys.file_exists filename) then
Ed_misc.file_of_string ~file: filename "";
(* FIXME: handle errors occuring while opening file *)
let text =
try self#mode_to_display
(self#to_utf8 (Ed_misc.string_of_file filename))
with _ -> ""
in
self#buffer#begin_not_undoable_action ();
self#buffer#set_text text;
self#buffer#end_not_undoable_action ();
self#buffer#set_modified false;
self#update_date