diff options
author | Jacques Garrigue <garrigue at math.nagoya-u.ac.jp> | 2002-07-26 00:04:05 +0000 |
---|---|---|
committer | Jacques Garrigue <garrigue at math.nagoya-u.ac.jp> | 2002-07-26 00:04:05 +0000 |
commit | efc56d8b1c5b08b2685aac095decc658ed69da16 (patch) | |
tree | 5b46bec0305e5604c7558a12d695ec787169ac47 /otherlibs/labltk/browser/editor.ml | |
parent | 27da263cebf7af11256f3c8f2ad450338d33395b (diff) |
le mieux est l'ennemi du bien?
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@5045 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'otherlibs/labltk/browser/editor.ml')
-rw-r--r-- | otherlibs/labltk/browser/editor.ml | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/otherlibs/labltk/browser/editor.ml b/otherlibs/labltk/browser/editor.ml index ea2ad967e..d754cec70 100644 --- a/otherlibs/labltk/browser/editor.ml +++ b/otherlibs/labltk/browser/editor.ml @@ -409,7 +409,9 @@ class editor ~top ~menus = object (self) end else begin match Jg_message.ask ~master:top ~title:"Save" ("File `" ^ name ^ "' exists. Overwrite it?") - with `Yes -> Sys.remove name | `No | `Cancel -> raise Exit + with `Yes -> Sys.remove name + | `No -> raise (Sys_error "") + | `Cancel -> raise Exit end; let file = open_out name in let text = Text.get txt.tw ~start:tstart ~stop:(tposend 1) in @@ -419,7 +421,10 @@ class editor ~top ~menus = object (self) Checkbutton.deselect label; txt.name <- name with - Sys_error _ | Exit -> () + Sys_error _ -> + Jg_message.info ~master:top ~title:"Error" + ("Could not save `" ^ name ^ "'.") + | Exit -> () method load_text l = if l = [] then () else |