From 27e9777aaadca805dd331bc5f4f6ce40d41fbd70 Mon Sep 17 00:00:00 2001 From: letouzey Date: Fri, 25 Mar 2011 17:35:47 +0000 Subject: Ide: more reorganisation and cleanup - Avoid using Util which depends on Compat and hence Camlp4 - Instead, a small Minilib module specific to coqide, which duplicate 5 functions from Util (50 lines) - some dead code removal - the coqlib variable is asked to coqtop - remove obsolete Util.check_for_interrupt This way, coqide only depends on 3 files outside ide/ : Coq_config, Flags, Ide_intf. Makefile and ocamlbuild are adapted accordingly. TODO: how should we signal coqide error, warnings, etc ? For the moment, some Printf.eprintf, some failwith. To uniformize later... git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@13930 85f007b7-540e-0410-9357-904b9bb8a0f7 --- ide/preferences.ml | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) (limited to 'ide/preferences.ml') diff --git a/ide/preferences.ml b/ide/preferences.ml index a6aaef257..e31a5904a 100644 --- a/ide/preferences.ml +++ b/ide/preferences.ml @@ -8,11 +8,10 @@ open Configwin open Printf -open Util -let pref_file = Filename.concat System.home ".coqiderc" +let pref_file = Filename.concat Minilib.home ".coqiderc" -let accel_file = Filename.concat System.home ".coqide.keys" +let accel_file = Filename.concat Minilib.home ".coqide.keys" let mod_to_str (m:Gdk.Tags.modifier) = match m with @@ -170,9 +169,9 @@ let save_pref () = with _ -> ()); let p = !current in try - let add = Stringmap.add in + let add = Minilib.Stringmap.add in let (++) x f = f x in - Stringmap.empty ++ + Minilib.Stringmap.empty ++ add "cmd_coqc" [p.cmd_coqc] ++ add "cmd_make" [p.cmd_make] ++ add "cmd_coqmakefile" [p.cmd_coqmakefile] ++ @@ -228,7 +227,7 @@ let load_pref () = 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 = Stringmap.find k m in f v with _ -> () in + let set k f = try let v = Minilib.Stringmap.find k m in f v with _ -> () in let set_hd k f = set k (fun v -> f (List.hd v)) in let set_bool k f = set_hd k (fun v -> f (bool_of_string v)) in let set_int k f = set_hd k (fun v -> f (int_of_string v)) in @@ -295,14 +294,6 @@ let load_pref () = prerr_endline ("Could not load preferences ("^ (Printexc.to_string e)^").") -let split_string_format s = - try - let i = Util.string_index_from s 0 "%s" in - let pre = (String.sub s 0 i) in - let post = String.sub s (i+2) (String.length s - i - 2) in - pre,post - with Not_found -> s,"" - let configure ?(apply=(fun () -> ())) () = let cmd_coqc = string -- cgit v1.2.3