]> matita.cs.unibo.it Git - helm.git/commitdiff
better pp of virtuals
authorEnrico Tassi <enrico.tassi@inria.fr>
Fri, 19 Dec 2008 21:45:45 +0000 (21:45 +0000)
committerEnrico Tassi <enrico.tassi@inria.fr>
Fri, 19 Dec 2008 21:45:45 +0000 (21:45 +0000)
helm/software/matita/matita.glade
helm/software/matita/matitaMathView.ml
helm/software/matita/virtuals.ml
helm/software/matita/virtuals.mli

index 11a7321d6e7a39cbb200a6b01b146916c0050f92..fb585f50d262e489c2b65b41178ffcf374e59b61 100644 (file)
                             <child>
                               <widget class="GtkImageMenuItem" id="showUnicodeTable">
                                 <property name="visible">True</property>
-                                <property name="tooltip" translatable="yes">Show the conversion table from TeX to UTF8</property>
-                                <property name="label" translatable="yes">Tex/UTF8 table</property>
+                                <property name="tooltip" translatable="yes">Show the conversion table from TeX like sequences to UTF-8</property>
+                                <property name="label" translatable="yes">TeX/UTF-8 table</property>
                                 <property name="use_underline">True</property>
                                 <child internal-child="image">
                                   <widget class="GtkImage" id="menu-item-image20">
index 70079c4726a0729527cebbfb2974d774edb2c81d..7cb2aa7cbec948ef3cdfbad183f8e959eedd0fb8 100644 (file)
@@ -1134,12 +1134,24 @@ class cicBrowser_impl ~(history:MatitaTypes.mathViewer_entry MatitaMisc.history)
 
     method private tex () =
       let b = Buffer.create 1000 in
+      Printf.bprintf b "UTF-8 equivalence classes (rotate with ALT-L):\n\n";
+      List.iter 
+        (fun l ->
+           List.iter (fun sym ->
+             Printf.bprintf b "  %s" (Glib.Utf8.from_unichar sym) 
+           ) l;
+           Printf.bprintf b "\n";
+        )
+        (List.sort 
+          (fun l1 l2 -> compare (List.hd l1) (List.hd l2))
+          (Virtuals.get_all_eqclass ()));
+      Printf.bprintf b "\n\nVirtual keys (trigger with ALT-L):\n\n";
       List.iter 
         (fun tag, items -> 
-           Printf.bprintf b "%s:\n" tag;
+           Printf.bprintf b "  %s:\n" tag;
            List.iter 
              (fun names, symbol ->
-                Printf.bprintf b "\t%s\t%s\n" 
+                Printf.bprintf b "  \t%s\t%s\n" 
                   (Glib.Utf8.from_unichar symbol)
                   (String.concat ", " names))
              (List.sort 
index 4d7b91507e9250e9cbf199440edb1dd3b8a85021..229e780c28d8513951d1745e62595a7af7c642bb 100644 (file)
@@ -56,4 +56,13 @@ let similar_symbols symbol =
   with Not_found -> []
 ;;
 
+let get_all_eqclass () =
+  let rc = ref [] in
+  Hashtbl.iter 
+    (fun k v ->
+      if not (List.mem v !rc) then
+        rc := v :: !rc)
+    classes;
+  !rc
+;;
 
index ec77c244b4810c979aa51cabd894d175cf247f9d..09e350a3ade44d3f6bbdaee7a09563b029a3b806 100644 (file)
@@ -11,4 +11,6 @@ val get_all_virtuals : unit -> (tag * (string list * symbol) list) list
 val add_eqclass: symbol list -> unit
 val similar_symbols: symbol -> symbol list
 
+val get_all_eqclass: unit -> symbol list list
+
 (* (["\\lambda";"\\"], "λ", ["logics";"letters"]) *)