aboutsummaryrefslogtreecommitdiffhomepage
path: root/ide/preferences.ml
diff options
context:
space:
mode:
authorGravatar letouzey <letouzey@85f007b7-540e-0410-9357-904b9bb8a0f7>2011-04-21 16:12:47 +0000
committerGravatar letouzey <letouzey@85f007b7-540e-0410-9357-904b9bb8a0f7>2011-04-21 16:12:47 +0000
commitc9febd2450c40dbc46182662ccdc1567050d0222 (patch)
tree2ff96f95a3f58f15aed292c02a62ec28816c265b /ide/preferences.ml
parenteacf0de87bf18631610f0fae9af192583f27a88b (diff)
Coqide: try to avoid displaying error messages on coqide's console
In Win32, these messages may trigger some Sys_error if we try to turn coqide into a true windows app (no console). To be continued... The best way would be probably to re-route the whole stdout and stderr to something else via dup2, but to what ? A log file ? git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@14043 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'ide/preferences.ml')
-rw-r--r--ide/preferences.ml12
1 files changed, 4 insertions, 8 deletions
diff --git a/ide/preferences.ml b/ide/preferences.ml
index e31a5904a..97b1d00dd 100644
--- a/ide/preferences.ml
+++ b/ide/preferences.ml
@@ -168,7 +168,7 @@ let save_pref () =
(try GtkData.AccelMap.save accel_file
with _ -> ());
let p = !current in
- try
+
let add = Minilib.Stringmap.add in
let (++) x f = f x in
Minilib.Stringmap.empty ++
@@ -219,12 +219,11 @@ let save_pref () =
add "vertical_tabs" [string_of_bool p.vertical_tabs] ++
add "opposite_tabs" [string_of_bool p.opposite_tabs] ++
Config_lexer.print_file pref_file
- with _ -> prerr_endline "Could not save preferences."
let load_pref () =
(try GtkData.AccelMap.load accel_file with _ -> ());
let p = !current in
- try
+
let m = Config_lexer.load_file pref_file in
let np = { p with cmd_coqc = p.cmd_coqc } in
let set k f = try let v = Minilib.Stringmap.find k m in f v with _ -> () in
@@ -271,7 +270,7 @@ let load_pref () =
v <> Coq_config.wwwcoq ^ "doc" &&
v <> Coq_config.wwwcoq ^ "doc/"
then
- prerr_endline ("Warning: Non-standard URL for Coq documentation in preference file: "^v);
+ (*prerr_endline ("Warning: Non-standard URL for Coq documentation in preference file: "^v);*)
np.doc_url <- v);
set_hd "library_url" (fun v -> np.library_url <- v);
set_bool "show_toolbar" (fun v -> np.show_toolbar <- v);
@@ -286,13 +285,10 @@ let load_pref () =
set_bool "lax_syntax" (fun v -> np.lax_syntax <- v);
set_bool "vertical_tabs" (fun v -> np.vertical_tabs <- v);
set_bool "opposite_tabs" (fun v -> np.opposite_tabs <- v);
- current := np;
+ current := np
(*
Format.printf "in load_pref: current.text_font = %s@." (Pango.Font.to_string !current.text_font);
*)
- with e ->
- prerr_endline ("Could not load preferences ("^
- (Printexc.to_string e)^").")
let configure ?(apply=(fun () -> ())) () =
let cmd_coqc =