X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fmatita%2Fmatita.ml;h=97595d1926004de1e8eb2e844b34affb9b9caf14;hb=acf29bdbdcdc6ad8c2d9d27e8a47500981b605cd;hp=3f08dd1c8f85f2410bda535ee3767e75eaa62c18;hpb=a2929cb64c8956a19d5da550911018efe46f189c;p=helm.git diff --git a/helm/matita/matita.ml b/helm/matita/matita.ml index 3f08dd1c8..97595d192 100644 --- a/helm/matita/matita.ml +++ b/helm/matita/matita.ml @@ -63,6 +63,15 @@ let script = ~buffer:gui#main#scriptTextView#buffer ~init:(Lazy.force MatitaEngine.initial_status) ~mathviewer:(MatitaMathView.mathViewer ()) + ~urichooser:(fun uris -> + try + MatitaGui.interactive_uri_choice ~selection_mode:`SINGLE + ~title:"Matita: URI chooser" + ~msg:"Select the URI" ~hide_uri_entry:true + ~hide_try:true ~ok_label:"_Apply" ~ok_action:`SELECT + ~copy_cb:(fun s -> gui#main#scriptTextView#buffer#insert ("\n"^s^"\n")) + () ~id:"boh?" uris + with MatitaTypes.Cancel -> []) () (* math viewers *) @@ -70,7 +79,7 @@ let _ = let sequent_viewer = MatitaMathView.sequentViewer_instance () in let sequents_viewer = MatitaMathView.sequentsViewer_instance () in sequent_viewer#set_href_callback - (Some (fun uri -> (MatitaMathView.cicBrowser ())#loadUri uri)); + (Some (fun uri -> (MatitaMathView.cicBrowser ())#load (`Uri uri))); let browser_observer _ = MatitaMathView.refresh_all_browsers () in let sequents_observer status = sequents_viewer#reset; @@ -133,10 +142,24 @@ let _ = (fun _ -> if script#onGoingProof () then MatitaLog.debug (CicMetaSubst.ppmetasenv script#proofMetasenv [])); + addDebugItem "dump coercions Db" (fun _ -> + List.iter ( + fun (s,t,u) -> + MatitaLog.debug ( + UriManager.name_of_uri u ^ ":" ^ + UriManager.name_of_uri s ^ " -> " ^ UriManager.name_of_uri t)) + (CoercDb.to_list ()) + ); addDebugItem "rotate light bulbs" (fun _ -> let nb = gui#main#hintNotebook in nb#goto_page ((nb#current_page + 1) mod 3)); + (* + addDebugItem "print (on stdout) \"statement\" grammar entry" + (fun _ -> + Grammar.print_entry Format.std_formatter + (Grammar.Entry.obj CicTextualParser2.statement); + Format.pp_print_flush Format.std_formatter ());*) end (** *) @@ -149,14 +172,17 @@ let _ = print_endline "\nThanks for using Matita!\n"); Sys.catch_break true; (try - script#loadFrom Sys.argv.(1); + gui#loadScript Sys.argv.(1); with Invalid_argument _ -> ()); if Filename.basename Sys.argv.(0) = "cicbrowser" then begin (* cicbrowser *) Helm_registry.set "matita.mode" "cicbrowser"; let browser = MatitaMathView.cicBrowser () in - try - browser#loadUri Sys.argv.(1) - with Invalid_argument _ -> () + let entry = + try + `Uri Sys.argv.(1) + with Invalid_argument _ -> `Dir "cic:/" + in + browser#load entry end else begin (* matita *) Helm_registry.set "matita.mode" "matita"; gui#main#mainWin#show ();