[m-rev.] for review: deep profiler user interface improvements

Peter Wang wangp at students.csse.unimelb.edu.au
Mon Apr 2 13:43:21 AEST 2007


Branches: main

Some interface improvements for mdprof_cgi.

html_format.m:
query.m:
	Insert "<WBR>" tags after some characters to suggest where the browser
	may break long module, procedure and file names over multiple lines.
	This improves the chances that tables will not become too wide to fit
	in the browser window.

	Add square brackets around the links at the bottom of generated pages,
	e.g. "[Sort by name]".  Give such links the CSS class "button" and add
	margins to increase visual separation between the links.

	Write the "Toggle fields:" etc. labels in bold to make them stand out,
	and add line breaks so that the first button after the label is easier
	to find (on the next line, at the the left margin).

	Spell out "self+descendants." rather than "self+desc."


Index: html_format.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/deep_profiler/html_format.m,v
retrieving revision 1.17
diff -u -r1.17 html_format.m
--- html_format.m	2 Apr 2007 02:38:00 -0000	1.17
+++ html_format.m	2 Apr 2007 03:41:55 -0000
@@ -137,6 +137,12 @@
     %
 :- func escape_html_string(string) = string.
 
+    % Like escape_html_string, but additionally inserts zero-width space
+    % characters to suggest where long strings can be broken over multiple
+    % lines.
+    %
+:- func escape_break_html_string(string) = string.
+
 %-----------------------------------------------------------------------------%
 %-----------------------------------------------------------------------------%
 
@@ -229,6 +235,7 @@
                 [s(select_colgroup_background(Pref, !.GroupNum))])
         )
     ),
+    ButtonStyle = "  A.button { margin: 5px; text-decoration: none; }\n",
     HTML =
         "<STYLE TYPE=""text/css"">\n" ++
         IdStyle ++
@@ -237,6 +244,7 @@
         CallSeqsStyle ++
         AllocStyle ++
         MemoryStyle ++
+        ButtonStyle ++
         "</STYLE>\n".
 
 :- func select_colgroup_background(preferences, int) = string.
@@ -282,11 +290,11 @@
     "<p>\n" ++
     footer_pref_toggles(Cmd, Pref, Deep) ++
     "<br>\n" ++
-    string.format("<A HREF=""%s"">Menu</A>\n",
+    string.format("<A CLASS=""button"" HREF=""%s"">[Menu]</A>\n",
         [s(deep_cmd_pref_to_url(Pref, Deep, deep_cmd_menu))]) ++
-    string.format("<A HREF=""%s"">Restart</A>\n",
+    string.format("<A CLASS=""button"" HREF=""%s"">[Restart]</A>\n",
         [s(deep_cmd_pref_to_url(Pref, Deep, deep_cmd_restart))]) ++
-    string.format("<A HREF=""%s"">Quit</A>\n",
+    string.format("<A CLASS=""button"" HREF=""%s"">[Quit]</A>\n",
         [s(deep_cmd_pref_to_url(Pref, Deep, deep_cmd_quit))]) ++
     "</BODY>\n" ++
     "</HTML>\n".
@@ -416,8 +424,8 @@
     ;
         Port1Fields = Fields ^ port_fields := no_port,
         Port1Pref = Pref ^ pref_fields := Port1Fields,
-        Port1Msg = "No port counts",
-        Port1Toggle = string.format("<A HREF=""%s"">%s</A>\n",
+        Port1Msg = "[No port counts]",
+        Port1Toggle = string.format("<A CLASS=""button"" HREF=""%s"">%s</A>\n",
             [s(deep_cmd_pref_to_url(Port1Pref, Deep, Cmd)), s(Port1Msg)])
     ),
     ( Fields ^ port_fields = port ->
@@ -425,8 +433,8 @@
     ;
         Port2Fields = Fields ^ port_fields := port,
         Port2Pref = Pref ^ pref_fields := Port2Fields,
-        Port2Msg = "Port counts",
-        Port2Toggle = string.format("<A HREF=""%s"">%s</A>\n",
+        Port2Msg = "[Port counts]",
+        Port2Toggle = string.format("<A CLASS=""button"" HREF=""%s"">%s</A>\n",
             [s(deep_cmd_pref_to_url(Port2Pref, Deep, Cmd)), s(Port2Msg)])
     ),
     ( Fields ^ time_fields = no_time ->
@@ -434,8 +442,8 @@
     ;
         Time1Fields = Fields ^ time_fields := no_time,
         Time1Pref = Pref ^ pref_fields := Time1Fields,
-        Time1Msg = "No time info",
-        Time1Toggle = string.format("<A HREF=""%s"">%s</A>\n",
+        Time1Msg = "[No time info]",
+        Time1Toggle = string.format("<A CLASS=""button"" HREF=""%s"">%s</A>\n",
             [s(deep_cmd_pref_to_url(Time1Pref, Deep, Cmd)), s(Time1Msg)])
     ),
     ( Fields ^ time_fields = ticks ->
@@ -443,8 +451,8 @@
     ;
         Time2Fields = Fields ^ time_fields := ticks,
         Time2Pref = Pref ^ pref_fields := Time2Fields,
-        Time2Msg = "Ticks",
-        Time2Toggle = string.format("<A HREF=""%s"">%s</A>\n",
+        Time2Msg = "[Ticks]",
+        Time2Toggle = string.format("<A CLASS=""button"" HREF=""%s"">%s</A>\n",
             [s(deep_cmd_pref_to_url(Time2Pref, Deep, Cmd)), s(Time2Msg)])
     ),
     ( Fields ^ time_fields = time ->
@@ -452,8 +460,8 @@
     ;
         Time3Fields = Fields ^ time_fields := time,
         Time3Pref = Pref ^ pref_fields := Time3Fields,
-        Time3Msg = "Times",
-        Time3Toggle = string.format("<A HREF=""%s"">%s</A>\n",
+        Time3Msg = "[Times]",
+        Time3Toggle = string.format("<A CLASS=""button"" HREF=""%s"">%s</A>\n",
             [s(deep_cmd_pref_to_url(Time3Pref, Deep, Cmd)), s(Time3Msg)])
     ),
     ( Fields ^ time_fields = ticks_and_time->
@@ -461,8 +469,8 @@
     ;
         Time4Fields = Fields ^ time_fields := ticks_and_time,
         Time4Pref = Pref ^ pref_fields := Time4Fields,
-        Time4Msg = "Ticks and times",
-        Time4Toggle = string.format("<A HREF=""%s"">%s</A>\n",
+        Time4Msg = "[Ticks and times]",
+        Time4Toggle = string.format("<A CLASS=""button"" HREF=""%s"">%s</A>\n",
             [s(deep_cmd_pref_to_url(Time4Pref, Deep, Cmd)), s(Time4Msg)])
     ),
     ( Fields ^ time_fields = time_and_percall ->
@@ -470,8 +478,8 @@
     ;
         Time5Fields = Fields ^ time_fields := time_and_percall,
         Time5Pref = Pref ^ pref_fields := Time5Fields,
-        Time5Msg = "Times and per-call times",
-        Time5Toggle = string.format("<A HREF=""%s"">%s</A>\n",
+        Time5Msg = "[Times and per-call times]",
+        Time5Toggle = string.format("<A CLASS=""button"" HREF=""%s"">%s</A>\n",
             [s(deep_cmd_pref_to_url(Time5Pref, Deep, Cmd)), s(Time5Msg)])
     ),
     ( Fields ^ time_fields = ticks_and_time_and_percall ->
@@ -479,8 +487,8 @@
     ;
         Time6Fields = Fields ^ time_fields := ticks_and_time_and_percall,
         Time6Pref = Pref ^ pref_fields := Time6Fields,
-        Time6Msg = "Ticks and times and per-call times",
-        Time6Toggle = string.format("<A HREF=""%s"">%s</A>\n",
+        Time6Msg = "[Ticks and times and per-call times]",
+        Time6Toggle = string.format("<A CLASS=""button"" HREF=""%s"">%s</A>\n",
             [s(deep_cmd_pref_to_url(Time6Pref, Deep, Cmd)), s(Time6Msg)])
     ),
     ( Fields ^ callseqs_fields = no_callseqs ->
@@ -488,8 +496,8 @@
     ;
         CallSeqs1Fields = Fields ^ callseqs_fields := no_callseqs,
         CallSeqs1Pref = Pref ^ pref_fields := CallSeqs1Fields,
-        CallSeqs1Msg = "No call sequence number info",
-        CallSeqs1Toggle = string.format("<A HREF=""%s"">%s</A>\n",
+        CallSeqs1Msg = "[No call sequence number info]",
+        CallSeqs1Toggle = string.format("<A CLASS=""button"" HREF=""%s"">%s</A>\n",
             [s(deep_cmd_pref_to_url(CallSeqs1Pref, Deep, Cmd)),
                 s(CallSeqs1Msg)])
     ),
@@ -498,8 +506,8 @@
     ;
         CallSeqs2Fields = Fields ^ callseqs_fields := callseqs,
         CallSeqs2Pref = Pref ^ pref_fields := CallSeqs2Fields,
-        CallSeqs2Msg = "Call sequence numbers",
-        CallSeqs2Toggle = string.format("<A HREF=""%s"">%s</A>\n",
+        CallSeqs2Msg = "[Call sequence numbers]",
+        CallSeqs2Toggle = string.format("<A CLASS=""button"" HREF=""%s"">%s</A>\n",
             [s(deep_cmd_pref_to_url(CallSeqs2Pref, Deep, Cmd)),
                 s(CallSeqs2Msg)])
     ),
@@ -508,8 +516,8 @@
     ;
         CallSeqs3Fields = Fields ^ callseqs_fields := callseqs_and_percall,
         CallSeqs3Pref = Pref ^ pref_fields := CallSeqs3Fields,
-        CallSeqs3Msg = "Call sequence numbers including per-call",
-        CallSeqs3Toggle = string.format("<A HREF=""%s"">%s</A>\n",
+        CallSeqs3Msg = "[Call sequence numbers including per-call]",
+        CallSeqs3Toggle = string.format("<A CLASS=""button"" HREF=""%s"">%s</A>\n",
             [s(deep_cmd_pref_to_url(CallSeqs3Pref, Deep, Cmd)),
                 s(CallSeqs3Msg)])
     ),
@@ -518,8 +526,8 @@
     ;
         Alloc1Fields = Fields ^ alloc_fields := no_alloc,
         Alloc1Pref = Pref ^ pref_fields := Alloc1Fields,
-        Alloc1Msg = "No allocations",
-        Alloc1Toggle = string.format("<A HREF=""%s"">%s</A>\n",
+        Alloc1Msg = "[No allocations]",
+        Alloc1Toggle = string.format("<A CLASS=""button"" HREF=""%s"">%s</A>\n",
             [s(deep_cmd_pref_to_url(Alloc1Pref, Deep, Cmd)), s(Alloc1Msg)])
     ),
     ( Fields ^ alloc_fields = alloc ->
@@ -527,8 +535,8 @@
     ;
         Alloc2Fields = Fields ^ alloc_fields := alloc,
         Alloc2Pref = Pref ^ pref_fields := Alloc2Fields,
-        Alloc2Msg = "Allocations",
-        Alloc2Toggle = string.format("<A HREF=""%s"">%s</A>\n",
+        Alloc2Msg = "[Allocations]",
+        Alloc2Toggle = string.format("<A CLASS=""button"" HREF=""%s"">%s</A>\n",
             [s(deep_cmd_pref_to_url(Alloc2Pref, Deep, Cmd)), s(Alloc2Msg)])
     ),
     ( Fields ^ alloc_fields = alloc_and_percall ->
@@ -536,8 +544,8 @@
     ;
         Alloc3Fields = Fields ^ alloc_fields := alloc_and_percall,
         Alloc3Pref = Pref ^ pref_fields := Alloc3Fields,
-        Alloc3Msg = "Allocations and per-call allocations",
-        Alloc3Toggle = string.format("<A HREF=""%s"">%s</A>\n",
+        Alloc3Msg = "[Allocations and per-call allocations]",
+        Alloc3Toggle = string.format("<A CLASS=""button"" HREF=""%s"">%s</A>\n",
             [s(deep_cmd_pref_to_url(Alloc3Pref, Deep, Cmd)), s(Alloc3Msg)])
     ),
     ( Fields ^ memory_fields = no_memory ->
@@ -545,8 +553,8 @@
     ;
         Memory1Fields = Fields ^ memory_fields := no_memory,
         Memory1Pref = Pref ^ pref_fields := Memory1Fields,
-        Memory1Msg = "No memory info",
-        Memory1Toggle = string.format("<A HREF=""%s"">%s</A>\n",
+        Memory1Msg = "[No memory info]",
+        Memory1Toggle = string.format("<A CLASS=""button"" HREF=""%s"">%s</A>\n",
             [s(deep_cmd_pref_to_url(Memory1Pref, Deep, Cmd)), s(Memory1Msg)])
     ),
     ( Fields ^ memory_fields = memory(units_words) ->
@@ -554,8 +562,8 @@
     ;
         Memory2Fields = Fields ^ memory_fields := memory(units_words),
         Memory2Pref = Pref ^ pref_fields := Memory2Fields,
-        Memory2Msg = "Words",
-        Memory2Toggle = string.format("<A HREF=""%s"">%s</A>\n",
+        Memory2Msg = "[Words]",
+        Memory2Toggle = string.format("<A CLASS=""button"" HREF=""%s"">%s</A>\n",
             [s(deep_cmd_pref_to_url(Memory2Pref, Deep, Cmd)), s(Memory2Msg)])
     ),
     ( Fields ^ memory_fields = memory(units_bytes) ->
@@ -563,8 +571,8 @@
     ;
         Memory3Fields = Fields ^ memory_fields := memory(units_bytes),
         Memory3Pref = Pref ^ pref_fields := Memory3Fields,
-        Memory3Msg = "Bytes",
-        Memory3Toggle = string.format("<A HREF=""%s"">%s</A>\n",
+        Memory3Msg = "[Bytes]",
+        Memory3Toggle = string.format("<A CLASS=""button"" HREF=""%s"">%s</A>\n",
             [s(deep_cmd_pref_to_url(Memory3Pref, Deep, Cmd)), s(Memory3Msg)])
     ),
     ( Fields ^ memory_fields = memory_and_percall(units_words) ->
@@ -573,8 +581,8 @@
         Memory4Fields = Fields ^ memory_fields :=
             memory_and_percall(units_words),
         Memory4Pref = Pref ^ pref_fields := Memory4Fields,
-        Memory4Msg = "Words and per-call words",
-        Memory4Toggle = string.format("<A HREF=""%s"">%s</A>\n",
+        Memory4Msg = "[Words and per-call words]",
+        Memory4Toggle = string.format("<A CLASS=""button"" HREF=""%s"">%s</A>\n",
             [s(deep_cmd_pref_to_url(Memory4Pref, Deep, Cmd)), s(Memory4Msg)])
     ),
     ( Fields ^ memory_fields = memory_and_percall(units_bytes) ->
@@ -583,21 +591,22 @@
         Memory5Fields = Fields ^ memory_fields :=
             memory_and_percall(units_bytes),
         Memory5Pref = Pref ^ pref_fields := Memory5Fields,
-        Memory5Msg = "Bytes and per-call bytes",
-        Memory5Toggle = string.format("<A HREF=""%s"">%s</A>\n",
+        Memory5Msg = "[Bytes and per-call bytes]",
+        Memory5Toggle = string.format("<A CLASS=""button"" HREF=""%s"">%s</A>\n",
             [s(deep_cmd_pref_to_url(Memory5Pref, Deep, Cmd)), s(Memory5Msg)])
     ),
     ( Fields = default_fields(Deep) ->
         DefaultToggle = ""
     ;
-        DefaultMsg  = "Restore defaults",
+        DefaultMsg  = "[Restore defaults]",
         DefaultPref = Pref ^ pref_fields := default_fields(Deep),
-        DefaultToggle = string.format("<A HREF=""%s"">%s</A>\n",
+        DefaultToggle = string.format("<A CLASS=""button"" HREF=""%s"">%s</A>\n",
             [s(deep_cmd_pref_to_url(DefaultPref, Deep, Cmd)), s(DefaultMsg)])
     ),
     HTML =
-        "Toggle fields:\n" ++
+        "<strong>Toggle fields:</strong>\n" ++
         DefaultToggle ++
+        "<br>\n" ++
         Port1Toggle ++ Port2Toggle ++
         "<br>\n" ++
         Time1Toggle ++ Time2Toggle ++ Time3Toggle ++
@@ -618,15 +627,15 @@
         Pref ^ pref_anc = no,
         Display1 = yes,
         Display2 = yes,
-        Msg1 = "One ancestor",
+        Msg1 = "[One ancestor]",
         Pref1 = Pref ^ pref_anc := yes(1),
-        Msg2 = "Two ancestors",
+        Msg2 = "[Two ancestors]",
         Pref2 = Pref ^ pref_anc := yes(2),
-        Msg3 = "Three ancestors",
+        Msg3 = "[Three ancestors]",
         Pref3 = Pref ^ pref_anc := yes(3),
-        Msg4 = "Five ancestors",
+        Msg4 = "[Five ancestors]",
         Pref4 = Pref ^ pref_anc := yes(5),
-        Msg5 = "Ten ancestors",
+        Msg5 = "[Ten ancestors]",
         Pref5 = Pref ^ pref_anc := yes(10)
     ;
         Pref ^ pref_anc = yes(OldAncestorLimit),
@@ -640,26 +649,26 @@
         ;
             Display2 = no
         ),
-        Msg1 = "Halve ancestors",
+        Msg1 = "[Halve ancestors]",
         Pref1 = Pref ^ pref_anc := yes(OldAncestorLimit // 2),
-        Msg2 = "Remove an ancestor",
+        Msg2 = "[Remove an ancestor]",
         Pref2 = Pref ^ pref_anc := yes(OldAncestorLimit - 1),
-        Msg3 = "Add an ancestor",
+        Msg3 = "[Add an ancestor]",
         Pref3 = Pref ^ pref_anc := yes(OldAncestorLimit + 1),
-        Msg4 = "Double ancestors",
+        Msg4 = "[Double ancestors]",
         Pref4 = Pref ^ pref_anc := yes(OldAncestorLimit * 2),
-        Msg5 = "Unlimited ancestors",
+        Msg5 = "[Unlimited ancestors]",
         Pref5 = Pref ^ pref_anc := no
     ),
-    Toggle1 = string.format("<A HREF=""%s"">%s</A>\n",
+    Toggle1 = string.format("<A CLASS=""button"" HREF=""%s"">%s</A>\n",
         [s(deep_cmd_pref_to_url(Pref1, Deep, Cmd)), s(Msg1)]),
-    Toggle2 = string.format("<A HREF=""%s"">%s</A>\n",
+    Toggle2 = string.format("<A CLASS=""button"" HREF=""%s"">%s</A>\n",
         [s(deep_cmd_pref_to_url(Pref2, Deep, Cmd)), s(Msg2)]),
-    Toggle3 = string.format("<A HREF=""%s"">%s</A>\n",
+    Toggle3 = string.format("<A CLASS=""button"" HREF=""%s"">%s</A>\n",
         [s(deep_cmd_pref_to_url(Pref3, Deep, Cmd)), s(Msg3)]),
-    Toggle4 = string.format("<A HREF=""%s"">%s</A>\n",
+    Toggle4 = string.format("<A CLASS=""button"" HREF=""%s"">%s</A>\n",
         [s(deep_cmd_pref_to_url(Pref4, Deep, Cmd)), s(Msg4)]),
-    Toggle5 = string.format("<A HREF=""%s"">%s</A>\n",
+    Toggle5 = string.format("<A CLASS=""button"" HREF=""%s"">%s</A>\n",
         [s(deep_cmd_pref_to_url(Pref5, Deep, Cmd)), s(Msg5)]),
     (
         Display1 = yes,
@@ -676,7 +685,7 @@
         MaybeToggle2 = ""
     ),
     HTML =
-        "Toggle ancestors:\n" ++
+        "<strong>Toggle ancestors:</strong><br />\n" ++
         MaybeToggle1 ++ MaybeToggle2 ++ Toggle3 ++ Toggle4 ++ Toggle5.
 
 :- func footer_box_toggle(cmd, preferences, deep) = string.
@@ -685,13 +694,13 @@
     (
         Pref ^ pref_box = nobox,
         Pref1 = Pref ^ pref_box := box,
-        Msg1 = "Box"
+        Msg1 = "[Box]"
     ;
         Pref ^ pref_box = box,
         Pref1 = Pref ^ pref_box := nobox,
-        Msg1 = "Unbox"
+        Msg1 = "[Unbox]"
     ),
-    HTML = string.format("<A HREF=""%s"">%s</A>\n",
+    HTML = string.format("<A CLASS=""button"" HREF=""%s"">%s</A>\n",
         [s(deep_cmd_pref_to_url(Pref1, Deep, Cmd)), s(Msg1)]).
 
 :- func footer_colour_toggle(cmd, preferences, deep) = string.
@@ -700,13 +709,13 @@
     (
         Pref ^ pref_colour = colour_none,
         Pref1 = Pref ^ pref_colour := colour_column_groups,
-        Msg1 = "Colour column groups"
+        Msg1 = "[Colour column groups]"
     ;
         Pref ^ pref_colour = colour_column_groups,
         Pref1 = Pref ^ pref_colour := colour_none,
-        Msg1 = "Fade column groups"
+        Msg1 = "[Fade column groups]"
     ),
-    HTML = string.format("<A HREF=""%s"">%s</A>\n",
+    HTML = string.format("<A CLASS=""button"" HREF=""%s"">%s</A>\n",
         [s(deep_cmd_pref_to_url(Pref1, Deep, Cmd)), s(Msg1)]).
 
 :- func footer_summarize_toggle(cmd, preferences, deep) = string.
@@ -715,13 +724,13 @@
     (
         Pref ^ pref_summarize = summarize,
         Pref1 = Pref ^ pref_summarize := dont_summarize,
-        Msg1 = "Expand higher order calls"
+        Msg1 = "[Expand higher order calls]"
     ;
         Pref ^ pref_summarize = dont_summarize,
         Pref1 = Pref ^ pref_summarize := summarize,
-        Msg1 = "Summarize higher order calls"
+        Msg1 = "[Summarize higher order calls]"
     ),
-    HTML = string.format("<A HREF=""%s"">%s</A>\n",
+    HTML = string.format("<A CLASS=""button"" HREF=""%s"">%s</A>\n",
         [s(deep_cmd_pref_to_url(Pref1, Deep, Cmd)), s(Msg1)]).
 
 :- func footer_contour_toggle(cmd, preferences, deep) = string.
@@ -730,13 +739,13 @@
     (
         Pref ^ pref_contour = no_contour,
         Pref1 = Pref ^ pref_contour := apply_contour,
-        Msg1 = "Apply contour exclusion"
+        Msg1 = "[Apply contour exclusion]"
     ;
         Pref ^ pref_contour = apply_contour,
         Pref1 = Pref ^ pref_contour := no_contour,
-        Msg1 = "Don't apply contour exclusion"
+        Msg1 = "[Don't apply contour exclusion]"
     ),
-    HTML = string.format("<A HREF=""%s"">%s</A>\n",
+    HTML = string.format("<A CLASS=""button"" HREF=""%s"">%s</A>\n",
         [s(deep_cmd_pref_to_url(Pref1, Deep, Cmd)), s(Msg1)]).
 
 :- func footer_time_format_toggle(cmd, preferences, deep) = string.
@@ -764,26 +773,26 @@
         (
             Pref ^ pref_time = no_scale,
             Pref1 = Pref ^ pref_time := scale_by_millions,
-            Msg1  = "Time in s, us",
+            Msg1  = "[Time in s, us]",
             Pref2 = Pref ^ pref_time := scale_by_thousands,
-            Msg2  = "Time in s, ms, us, ns"
+            Msg2  = "[Time in s, ms, us, ns]"
         ;
             Pref ^ pref_time = scale_by_millions,
             Pref1 = Pref ^ pref_time := no_scale,
-            Msg1  = "Time in s",
+            Msg1  = "[Time in s]",
             Pref2 = Pref ^ pref_time := scale_by_thousands,
-            Msg2  = "Time in s, ms, us, ns"
+            Msg2  = "[Time in s, ms, us, ns]"
         ;
             Pref ^ pref_time = scale_by_thousands,
             Pref1 = Pref ^ pref_time := no_scale,
-            Msg1  = "Time in s",
+            Msg1  = "[Time in s]",
             Pref2 = Pref ^ pref_time := scale_by_millions,
-            Msg2  = "Time in s, us"
+            Msg2  = "[Time in s, us]"
         ),
         HTML =
-            string.format("<A HREF=""%s"">%s</A>\n",
+            string.format("<A CLASS=""button"" HREF=""%s"">%s</A>\n",
                 [s(deep_cmd_pref_to_url(Pref1, Deep, Cmd)), s(Msg1)]) ++
-            string.format("<A HREF=""%s"">%s</A>\n",
+            string.format("<A CLASS=""button"" HREF=""%s"">%s</A>\n",
                 [s(deep_cmd_pref_to_url(Pref2, Deep, Cmd)), s(Msg2)])
     ).
 
@@ -815,27 +824,27 @@
     (
         Criteria = by_context,
         Criteria1 = by_name,
-        Msg1 = "Sort by name",
+        Msg1 = "[Sort by name]",
         Criteria2 =
             by_cost(default_cost_kind, default_incl_desc, default_scope),
-        Msg2 = "Sort by cost"
+        Msg2 = "[Sort by cost]"
     ;
         Criteria = by_name,
         Criteria1 = by_context,
-        Msg1 = "Sort by context",
+        Msg1 = "[Sort by context]",
         Criteria2 =
             by_cost(default_cost_kind, default_incl_desc, default_scope),
-        Msg2 = "Sort by cost"
+        Msg2 = "[Sort by cost]"
     ;
         Criteria = by_cost(_, _, _),
         Criteria1 = by_context,
-        Msg1 = "Sort by context",
+        Msg1 = "[Sort by context]",
         Criteria2 = by_name,
-        Msg2 = "Sort by name"
+        Msg2 = "[Sort by name]"
     ),
-    Toggle1 = string.format("<A HREF=""%s"">%s</A>\n",
+    Toggle1 = string.format("<A CLASS=""button"" HREF=""%s"">%s</A>\n",
         [s(UpdateCriteria(Criteria1)), s(Msg1)]),
-    Toggle2 = string.format("<A HREF=""%s"">%s</A>\n",
+    Toggle2 = string.format("<A CLASS=""button"" HREF=""%s"">%s</A>\n",
         [s(UpdateCriteria(Criteria2)), s(Msg2)]),
     (
         Criteria = by_cost(CostKind, InclDesc, Scope),
@@ -847,7 +856,8 @@
         ),
         ToggleRest = ""
     ),
-    HTML = "Toggle ordering criteria:\n" ++ Toggle1 ++ Toggle2 ++ ToggleRest.
+    HTML = "<strong>Toggle ordering criteria:</strong><br />\n" ++
+        Toggle1 ++ Toggle2 ++ ToggleRest.
 
 :- func toggle_cost_criteria(cost_kind, include_descendants, measurement_scope,
     update_cost_criteria_func) = string.
@@ -860,8 +870,8 @@
         ; CostKind = cost_allocs
         ; CostKind = cost_words
         ),
-        MsgCalls = "Sort by calls",
-        ToggleCalls = string.format("<A HREF=""%s"">%s</A>\n",
+        MsgCalls = "[Sort by calls]",
+        ToggleCalls = string.format("<A CLASS=""button"" HREF=""%s"">%s</A>\n",
             [s(UpdateCriteria(cost_calls, InclDesc, Scope)), s(MsgCalls)])
     ;
         CostKind = cost_calls,
@@ -874,8 +884,8 @@
         ; CostKind = cost_allocs
         ; CostKind = cost_words
         ),
-        MsgRedos = "Sort by redos",
-        ToggleRedos = string.format("<A HREF=""%s"">%s</A>\n",
+        MsgRedos = "[Sort by redos]",
+        ToggleRedos = string.format("<A CLASS=""button"" HREF=""%s"">%s</A>\n",
             [s(UpdateCriteria(cost_redos, InclDesc, Scope)), s(MsgRedos)])
     ;
         CostKind = cost_redos,
@@ -888,8 +898,8 @@
         ; CostKind = cost_allocs
         ; CostKind = cost_words
         ),
-        MsgTime = "Sort by time",
-        ToggleTime = string.format("<A HREF=""%s"">%s</A>\n",
+        MsgTime = "[Sort by time]",
+        ToggleTime = string.format("<A CLASS=""button"" HREF=""%s"">%s</A>\n",
             [s(UpdateCriteria(cost_time, InclDesc, Scope)), s(MsgTime)])
     ;
         CostKind = cost_time,
@@ -902,8 +912,8 @@
         ; CostKind = cost_allocs
         ; CostKind = cost_words
         ),
-        MsgCallSeqs = "Sort by call sequence numbers",
-        ToggleCallSeqs = string.format("<A HREF=""%s"">%s</A>\n",
+        MsgCallSeqs = "[Sort by call sequence numbers]",
+        ToggleCallSeqs = string.format("<A CLASS=""button"" HREF=""%s"">%s</A>\n",
             [s(UpdateCriteria(cost_callseqs, InclDesc, Scope)),
                 s(MsgCallSeqs)])
     ;
@@ -917,8 +927,8 @@
         ; CostKind = cost_callseqs
         ; CostKind = cost_words
         ),
-        MsgAllocs = "Sort by allocations",
-        ToggleAllocs = string.format("<A HREF=""%s"">%s</A>\n",
+        MsgAllocs = "[Sort by allocations]",
+        ToggleAllocs = string.format("<A CLASS=""button"" HREF=""%s"">%s</A>\n",
             [s(UpdateCriteria(cost_allocs, InclDesc, Scope)), s(MsgAllocs)])
     ;
         CostKind = cost_allocs,
@@ -931,8 +941,8 @@
         ; CostKind = cost_callseqs
         ; CostKind = cost_allocs
         ),
-        MsgWords = "Sort by words",
-        ToggleWords = string.format("<A HREF=""%s"">%s</A>\n",
+        MsgWords = "[Sort by words]",
+        ToggleWords = string.format("<A CLASS=""button"" HREF=""%s"">%s</A>\n",
             [s(UpdateCriteria(cost_words, InclDesc, Scope)), s(MsgWords)])
     ;
         CostKind = cost_words,
@@ -940,24 +950,24 @@
     ),
     (
         InclDesc = self,
-        MsgDesc = "Include descendants",
-        ToggleDesc = string.format("<A HREF=""%s"">%s</A>\n",
+        MsgDesc = "[Include descendants]",
+        ToggleDesc = string.format("<A CLASS=""button"" HREF=""%s"">%s</A>\n",
             [s(UpdateCriteria(CostKind, self_and_desc, Scope)), s(MsgDesc)])
     ;
         InclDesc = self_and_desc,
-        MsgDesc = "Exclude descendants",
-        ToggleDesc = string.format("<A HREF=""%s"">%s</A>\n",
+        MsgDesc = "[Exclude descendants]",
+        ToggleDesc = string.format("<A CLASS=""button"" HREF=""%s"">%s</A>\n",
             [s(UpdateCriteria(CostKind, self, Scope)), s(MsgDesc)])
     ),
     (
         Scope = per_call,
-        MsgScope = "Count overall cost",
-        ToggleScope = string.format("<A HREF=""%s"">%s</A>\n",
+        MsgScope = "[Count overall cost]",
+        ToggleScope = string.format("<A CLASS=""button"" HREF=""%s"">%s</A>\n",
             [s(UpdateCriteria(CostKind, InclDesc, overall)), s(MsgScope)])
     ;
         Scope = overall,
-        MsgScope = "Count per-call cost",
-        ToggleScope = string.format("<A HREF=""%s"">%s</A>\n",
+        MsgScope = "[Count per-call cost]",
+        ToggleScope = string.format("<A CLASS=""button"" HREF=""%s"">%s</A>\n",
             [s(UpdateCriteria(CostKind, InclDesc, per_call)), s(MsgScope)])
     ),
     Toggles = ToggleCalls ++ ToggleRedos ++ ToggleTime ++ ToggleCallSeqs ++
@@ -975,14 +985,14 @@
     Pref0 ^ pref_inactive = inactive_items(Procs, Modules),
     (
         Modules = inactive_show,
-        Msg  = "Hide inactive modules",
+        Msg  = "[Hide inactive modules]",
         Pref = Pref0 ^ pref_inactive := inactive_items(Procs, inactive_hide)
     ;
         Modules = inactive_hide,
-        Msg  = "Show inactive modules",
+        Msg  = "[Show inactive modules]",
         Pref = Pref0 ^ pref_inactive := inactive_items(Procs, inactive_show)
     ),
-    HTML = string.format("<A HREF=""%s"">%s</A>\n",
+    HTML = string.format("<A CLASS=""button"" HREF=""%s"">%s</A>\n",
         [s(deep_cmd_pref_to_url(Pref, Deep, Cmd)), s(Msg)]).
 
 :- func footer_inactive_procs_toggle(cmd, preferences, deep) = string.
@@ -991,14 +1001,14 @@
     Pref0 ^ pref_inactive = inactive_items(Procs, Modules),
     (
         Procs = inactive_show,
-        Msg = "Hide inactive procedures",
+        Msg = "[Hide inactive procedures]",
         Pref = Pref0 ^ pref_inactive := inactive_items(inactive_hide, Modules)
     ;
         Procs = inactive_hide,
-        Msg = "Show inactive procedures",
+        Msg = "[Show inactive procedures]",
         Pref = Pref0 ^ pref_inactive := inactive_items(inactive_show, Modules)
     ),
-    HTML = string.format("<A HREF=""%s"">%s</A>\n",
+    HTML = string.format("<A CLASS=""button"" HREF=""%s"">%s</A>\n",
         [s(deep_cmd_pref_to_url(Pref, Deep, Cmd)), s(Msg)]).
 
 %-----------------------------------------------------------------------------%
@@ -1550,7 +1560,8 @@
 add_context(Context, LineGroup0) = LineGroup :-
     LineGroup0 =
         line_group(FileName, LineNumber, Name, Own, Desc, HTML0, LaterLines),
-    HTML = string.format("<TD CLASS=id>%s</TD>%s", [s(Context), s(HTML0)]),
+    HTML = string.format("<TD CLASS=id>%s</TD>%s",
+        [s(Context), s(HTML0)]),
     LineGroup =
         line_group(FileName, LineNumber, Name, Own, Desc, HTML, LaterLines).
 
@@ -2231,18 +2242,18 @@
     deep_lookup_proc_statics(Deep, PSPtr, PS),
     ProcName = PS ^ ps_refined_id,
     HTML = string.format("<A HREF=""%s"">%s</A>",
-        [s(URL), s(escape_html_string(ProcName))]).
+        [s(URL), s(escape_break_html_string(ProcName))]).
 
 module_name_to_html_ref(Pref, Deep, ModuleName) = HTML :-
     URL = deep_cmd_pref_to_url(Pref, Deep, deep_cmd_module(ModuleName)),
     HTML = string.format("<A HREF=""%s"">%s</A>",
-        [s(URL), s(escape_html_string(ModuleName))]).
+        [s(URL), s(escape_break_html_string(ModuleName))]).
 
 clique_ptr_to_html_ref(Pref, Deep, ProcName, CliquePtr) = HTML :-
     CliquePtr = clique_ptr(CliqueNum),
     URL = deep_cmd_pref_to_url(Pref, Deep, deep_cmd_clique(CliqueNum)),
     HTML = string.format("<A HREF=""%s"">%s</A>",
-        [s(URL), s(escape_html_string(ProcName))]).
+        [s(URL), s(escape_break_html_string(ProcName))]).
 
 deep_cmd_pref_to_url(Pref, Deep, Cmd) =
     machine_datafile_cmd_pref_to_url(Deep ^ server_name_port,
@@ -2259,39 +2270,28 @@
 
 %-----------------------------------------------------------------------------%
 
-% This code was pretty much taken directly from extras/cgi/html.m.
+escape_html_string(String) =
+    replace_special_chars(special_html_char, String).
 
-escape_html_string(String) = EscapedString :-
-    string.to_char_list(String, Chars),
-    escape_html_chars(Chars, [], EscapedChars),
-    string.from_char_list(EscapedChars, EscapedString).
+escape_break_html_string(String) =
+    replace_special_chars(special_html_char_or_break, String).
 
-    % escape_html_chars(Chars, !EscChars):
-    %
-    % Put an escaped form of all the characters in Chars in front of
-    % !.EscChars, yielding !:EscChars.
-    %
-:- pred escape_html_chars(list(char)::in, list(char)::in, list(char)::out)
-    is det.
+:- func replace_special_chars(pred(char, string)::in(pred(in, out) is semidet),
+    string::in) = (string::out).
 
-escape_html_chars([], !EscChars).
-escape_html_chars([Char | Chars], !EscChars) :-
-    escape_html_chars(Chars, !EscChars),
-    escape_html_char(Char, !EscChars).
+replace_special_chars(SpecialCharTable, String0) = String :-
+    string.foldr(replace_special_char_2(SpecialCharTable), String0, [], Chars),
+    string.from_char_list(Chars, String).
 
-    % escape_html_char(Char, !EscChars):
-    %
-    % Put an escaped form of the character Char in front of !.EscChars,
-    % yielding !:EscChars.
-    %
-:- pred escape_html_char(char::in, list(char)::in, list(char)::out) is det.
+:- pred replace_special_char_2(pred(char, string)::in(pred(in, out) is semidet),
+    char::in, list(char)::in, list(char)::out) is det.
 
-escape_html_char(Char, !EscChars) :-
-    ( special_html_char(Char, String) ->
+replace_special_char_2(SpecialCharTable, Char, !Acc) :-
+    ( SpecialCharTable(Char, String) ->
         string.to_char_list(String, Chars),
-        list.append(Chars, !EscChars)
+        list.append(Chars, !Acc)
     ;
-        !:EscChars = [Char | !.EscChars]
+        list.cons(Char, !Acc)
     ).
 
 :- pred special_html_char(char::in, string::out) is semidet.
@@ -2299,6 +2299,36 @@
 special_html_char('&', "&").
 special_html_char('<', "<").
 special_html_char('>', ">").
+special_html_char('''', "'").
+special_html_char('"', """).
+
+    % In addition to escaping special HTML characters, insert zero-width space
+    % characters to suggest where the browser may split up long sequences of
+    % characters over multiple lines.
+    %
+:- pred special_html_char_or_break(char::in, string::out) is semidet.
+
+special_html_char_or_break('&', "&").
+special_html_char_or_break('<', "<").
+special_html_char_or_break('>', ">").
+special_html_char_or_break('''', "'").
+special_html_char_or_break('"', """).
+special_html_char_or_break('.', "." ++ zero_width_space).
+special_html_char_or_break('_', "_" ++ zero_width_space).
+special_html_char_or_break('/', "/" ++ zero_width_space).
+special_html_char_or_break(':', ":" ++ zero_width_space).
+
+    % U+8203 is the Unicode 'ZERO WIDTH SPACE' character.  It is supported
+    % by modern browsers, but tends breaks search as the invisible character
+    % is not ignored when searching.
+    %
+    % The <WBR> tag is non-standard but doesn't break search in Firefox (at
+    % least).
+    %
+:- func zero_width_space = string.
+
+% zero_width_space = "​".
+zero_width_space = "<wbr />".
 
 %-----------------------------------------------------------------------------%
 :- end_module html_format.
Index: query.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/deep_profiler/query.m,v
retrieving revision 1.15
diff -u -r1.15 query.m
--- query.m	1 Dec 2006 15:03:46 -0000	1.15
+++ query.m	2 Apr 2007 03:41:55 -0000
@@ -357,7 +357,7 @@
             menu_item(Deep, Pref,
                 deep_cmd_top_procs(rank_range(1, 100), cost_time,
                     self_and_desc, overall),
-                "Top 100 most expensive procedures: time, self+desc.")
+                "Top 100 most expensive procedures: time, self+descendants.")
         ;
             ""
         ) ++
@@ -370,7 +370,7 @@
         menu_item(Deep, Pref,
             deep_cmd_top_procs(rank_range(1, 100), cost_callseqs,
                 self_and_desc, overall),
-            "Top 100 most expensive procedures: callseqs, self+desc.") ++
+            "Top 100 most expensive procedures: callseqs, self+descendants.") ++
         "<li>\n" ++
         menu_item(Deep, Pref,
             deep_cmd_top_procs(rank_range(1, 100), cost_words, self, overall),
@@ -379,7 +379,7 @@
         menu_item(Deep, Pref,
             deep_cmd_top_procs(rank_range(1, 100), cost_words, self_and_desc,
                 overall),
-            "Top 100 most expensive procedures: words, self+desc.")
+            "Top 100 most expensive procedures: words, self+descendants.")
             ++
         ( ShouldDisplayTimes = yes ->
             "<li>\n" ++
@@ -390,7 +390,7 @@
             menu_item(Deep, Pref,
                 deep_cmd_top_procs(threshold(1.0), cost_time, self_and_desc,
                     overall),
-                "Procedures above 1% threshold: time, self+desc.")
+                "Procedures above 1% threshold: time, self+descendants.")
         ;
             ""
         ) ++
@@ -402,7 +402,7 @@
         menu_item(Deep, Pref,
             deep_cmd_top_procs(threshold(1.0), cost_callseqs, self_and_desc,
                 overall),
-            "Procedures above 1% threshold: callseqs, self+desc.")
+            "Procedures above 1% threshold: callseqs, self+descendants.")
             ++
         "<li>\n" ++
         menu_item(Deep, Pref,
@@ -412,7 +412,7 @@
         menu_item(Deep, Pref,
             deep_cmd_top_procs(threshold(1.0), cost_words, self_and_desc,
                 overall),
-            "Procedures above 1% threshold: words, self+desc.")
+            "Procedures above 1% threshold: words, self+descendants.")
             ++
         "</ul>\n" ++
         "<p>\n" ++
@@ -1063,7 +1063,7 @@
     sum_line_group_measurements(SubLines, Own, Desc),
     SummaryHTML =
         string.format("<TD CLASS=id>%s:%d</TD>\n",
-            [s(escape_html_string(FileName)), i(LineNumber)]) ++
+            [s(escape_break_html_string(FileName)), i(LineNumber)]) ++
 
         % NOTE: we don't escape HTML special characters for
         % 'CallSiteName' because it has already been done.
@@ -1099,7 +1099,7 @@
             FileName, LineNumber, Kind, CallerPSPtr, CallSiteCallList)
     ),
     CSSContext = string.format("%s:%d",
-        [s(escape_html_string(FileName)), i(LineNumber)]),
+        [s(escape_break_html_string(FileName)), i(LineNumber)]),
     LineGroup = add_context(CSSContext, LineGroup0).
 
 :- func normal_call_site_summary_to_html(preferences, deep, string, int,
@@ -1264,11 +1264,10 @@
     deep_lookup_csd_desc(Deep, CSDPtr, CallSiteDesc),
     deep_lookup_clique_index(Deep, CalleePDPtr, CalleeCliquePtr),
     call_site_dynamic_context(Deep, CSDPtr, FileName, LineNumber),
-    Context = string.format("%s:%d", [s(escape_html_string(FileName)),
-        i(LineNumber)]),
+    Context = string.format("%s:%d", [s(escape_break_html_string(FileName)), i(LineNumber)]),
     HTML = call_to_html(Pref, Deep, CallSiteDisplay, Context,
         CallerPDPtr, CalleePDPtr, MaybeCallerCliquePtr, CalleeCliquePtr),
-    ProcName = escape_html_string(proc_dynamic_name(Deep, CalleePDPtr)),
+    ProcName = escape_break_html_string(proc_dynamic_name(Deep, CalleePDPtr)),
     LineGroup = line_group(FileName, LineNumber, ProcName,
         CallSiteOwn, CallSiteDesc, HTML, unit).
 
@@ -1362,7 +1361,7 @@
     ChosenCliquePtr = clique_ptr(ChosenCliqueNum),
     WrappedProcName = string.format("<A HREF=""%s"">%s</A>",
         [s(deep_cmd_pref_to_url(Pref, Deep, deep_cmd_clique(ChosenCliqueNum))),
-        s(escape_html_string(ProcName))]),
+        s(escape_break_html_string(ProcName))]),
     (
         CallSiteDisplay ^ display_wrap = wrap_url_always,
         UsedProcName0 = WrappedProcName
@@ -1373,7 +1372,7 @@
             ( CallerCliquePtr \= CalleeCliquePtr ->
                 UsedProcName0 = WrappedProcName
             ;
-                UsedProcName0 = escape_html_string(ProcName)
+                UsedProcName0 = escape_break_html_string(ProcName)
             )
         ;
             MaybeCallerCliquePtr = no,
@@ -1382,12 +1381,12 @@
                 UsedProcName0 = WrappedProcName
             ;
                 Assume = assume_within_clique,
-                UsedProcName0 = escape_html_string(ProcName)
+                UsedProcName0 = escape_break_html_string(ProcName)
             )
         )
     ;
         CallSiteDisplay ^ display_wrap = wrap_url_never,
-        UsedProcName0 = escape_html_string(ProcName)
+        UsedProcName0 = escape_break_html_string(ProcName)
     ),
     (
         UsedProcName0 = WrappedProcName,
@@ -1395,7 +1394,7 @@
     ->
         UsedProcName = UsedProcName0
     ;
-        UsedProcName = escape_html_string(ProcName)
+        UsedProcName = escape_break_html_string(ProcName)
     ),
     HTML =
         string.format("<TD CLASS=id>%s</TD>\n", [s(Context)]) ++
@@ -1449,10 +1448,10 @@
     CmdProc    = deep_cmd_proc_callers(PSI, group_by_proc, 1),
     CmdModule  = deep_cmd_proc_callers(PSI, group_by_module, 1),
     CmdClique  = deep_cmd_proc_callers(PSI, group_by_clique, 1),
-    LinkSite   = "Group callers by call site",
-    LinkProc   = "Group callers by procedure",
-    LinkModule = "Group callers by module",
-    LinkClique = "Group callers by clique",
+    LinkSite   = "[Group callers by call site]",
+    LinkProc   = "[Group callers by procedure]",
+    LinkModule = "[Group callers by module]",
+    LinkClique = "[Group callers by clique]",
     % Don't display more lines than BunchSize, to avoid quadratic behaviour
     % in Netscape.
     BunchSize = 100,
@@ -1467,13 +1466,13 @@
         IdFields = source_proc,
         Entity = "call site",
         GroupToggles =
-            string.format("<A HREF=""%s"">%s</A>\n",
+            string.format("<A CLASS=""button"" HREF=""%s"">%s</A>\n",
                 [s(deep_cmd_pref_to_url(Pref, Deep, CmdProc)),
                 s(LinkProc)]) ++
-            string.format("<A HREF=""%s"">%s</A>\n",
+            string.format("<A CLASS=""button"" HREF=""%s"">%s</A>\n",
                 [s(deep_cmd_pref_to_url(Pref, Deep, CmdModule)),
                 s(LinkModule)]) ++
-            string.format("<A HREF=""%s"">%s</A>\n",
+            string.format("<A CLASS=""button"" HREF=""%s"">%s</A>\n",
                 [s(deep_cmd_pref_to_url(Pref, Deep, CmdClique)),
                 s(LinkClique)])
     ;
@@ -1487,13 +1486,13 @@
         IdFields = source_proc,
         Entity = "procedure",
         GroupToggles =
-            string.format("<A HREF=""%s"">%s</A>\n",
+            string.format("<A CLASS=""button"" HREF=""%s"">%s</A>\n",
                 [s(deep_cmd_pref_to_url(Pref, Deep, CmdSite)),
                 s(LinkSite)]) ++
-            string.format("<A HREF=""%s"">%s</A>\n",
+            string.format("<A CLASS=""button"" HREF=""%s"">%s</A>\n",
                 [s(deep_cmd_pref_to_url(Pref, Deep, CmdModule)),
                 s(LinkModule)]) ++
-            string.format("<A HREF=""%s"">%s</A>\n",
+            string.format("<A CLASS=""button"" HREF=""%s"">%s</A>\n",
                 [s(deep_cmd_pref_to_url(Pref, Deep, CmdClique)),
                 s(LinkClique)])
     ;
@@ -1508,13 +1507,13 @@
         IdFields = rank_module,
         Entity = "module",
         GroupToggles =
-            string.format("<A HREF=""%s"">%s</A>\n",
+            string.format("<A CLASS=""button"" HREF=""%s"">%s</A>\n",
                 [s(deep_cmd_pref_to_url(Pref, Deep, CmdSite)),
                 s(LinkSite)]) ++
-            string.format("<A HREF=""%s"">%s</A>\n",
+            string.format("<A CLASS=""button"" HREF=""%s"">%s</A>\n",
                 [s(deep_cmd_pref_to_url(Pref, Deep, CmdProc)),
                 s(LinkProc)]) ++
-            string.format("<A HREF=""%s"">%s</A>\n",
+            string.format("<A CLASS=""button"" HREF=""%s"">%s</A>\n",
                 [s(deep_cmd_pref_to_url(Pref, Deep, CmdClique)),
                 s(LinkClique)])
     ;
@@ -1529,13 +1528,13 @@
         IdFields = source_proc,
         Entity = "clique",
         GroupToggles =
-            string.format("<A HREF=""%s"">%s</A>\n",
+            string.format("<A CLASS=""button"" HREF=""%s"">%s</A>\n",
                 [s(deep_cmd_pref_to_url(Pref, Deep, CmdSite)),
                 s(LinkSite)]) ++
-            string.format("<A HREF=""%s"">%s</A>\n",
+            string.format("<A CLASS=""button"" HREF=""%s"">%s</A>\n",
                 [s(deep_cmd_pref_to_url(Pref, Deep, CmdProc)),
                 s(LinkProc)]) ++
-            string.format("<A HREF=""%s"">%s</A>\n",
+            string.format("<A CLASS=""button"" HREF=""%s"">%s</A>\n",
                 [s(deep_cmd_pref_to_url(Pref, Deep, CmdModule)),
                 s(LinkModule)])
     ),
@@ -1556,7 +1555,7 @@
         FirstCmd = deep_cmd_proc_callers(PSI, CallerGroups, 1),
         FirstLink = "First group",
         FirstToggle =
-            string.format("<A HREF=""%s"">%s</A>\n",
+            string.format("<A CLASS=""button"" HREF=""%s"">%s</A>\n",
                 [s(deep_cmd_pref_to_url(Pref, Deep, FirstCmd)), s(FirstLink)])
     ;
         FirstToggle = ""
@@ -1565,7 +1564,7 @@
         PrevCmd = deep_cmd_proc_callers(PSI, CallerGroups, BunchNum - 1),
         PrevLink = "Previous group",
         PrevToggle =
-            string.format("<A HREF=""%s"">%s</A>\n",
+            string.format("<A CLASS=""button"" HREF=""%s"">%s</A>\n",
                 [s(deep_cmd_pref_to_url(Pref, Deep, PrevCmd)), s(PrevLink)])
     ;
         PrevToggle = ""
@@ -1574,7 +1573,7 @@
         NextCmd = deep_cmd_proc_callers(PSI, CallerGroups, BunchNum + 1),
         NextLink = "Next group",
         NextToggle =
-            string.format("<A HREF=""%s"">%s</A>\n",
+            string.format("<A CLASS=""button"" HREF=""%s"">%s</A>\n",
                 [s(deep_cmd_pref_to_url(Pref, Deep, NextCmd)), s(NextLink)])
     ;
         NextToggle = ""
@@ -1620,7 +1619,7 @@
     Cmd = deep_cmd_proc(PSI),
     WrappedProcName = string.format("<A HREF=""%s"">%s</A>",
         [s(deep_cmd_pref_to_url(Pref, Deep, Cmd)),
-            s(escape_html_string(ProcName))]),
+            s(escape_break_html_string(ProcName))]),
     ( NumLines = 0 ->
         HTML = string.format("<H3>There are no %ss calling %s</H3>",
             [s(Parent), s(WrappedProcName)])
@@ -1661,7 +1660,7 @@
         zero_own_prof_info, Own, zero_inherit_prof_info, Desc),
     HTML =
         string.format("<TD CLASS=id>%s:%d</TD>\n",
-            [s(FileName), i(LineNumber)]) ++
+            [s(escape_break_html_string(FileName)), i(LineNumber)]) ++
         string.format("<TD CLASS=id>%s</TD>\n",
             [s(proc_static_to_html_ref(Pref, Deep, CallerPSPtr))]),
     LineGroup = line_group(FileName, LineNumber, CallerProcName,
@@ -1679,7 +1678,7 @@
         zero_own_prof_info, Own, zero_inherit_prof_info, Desc),
     HTML =
         string.format("<TD CLASS=id>%s:%d</TD>\n",
-            [s(FileName), i(LineNumber)]) ++
+            [s(escape_break_html_string(FileName)), i(LineNumber)]) ++
         string.format("<TD CLASS=id>%s</TD>\n",
             [s(proc_static_to_html_ref(Pref, Deep, CallerPSPtr))]),
     LineGroup = line_group(FileName, LineNumber, CallerProcName,
@@ -1852,21 +1851,21 @@
 
 proc_summary_toggles_to_html(Pref, Deep, PSPtr) = HTML :-
     PSPtr = proc_static_ptr(PSI),
-    Msg1 = "Parent call sites",
+    Msg1 = "[Parent call sites]",
     Cmd1 = deep_cmd_proc_callers(PSI, group_by_call_site, 1),
-    Msg2 = "Parent procedures",
+    Msg2 = "[Parent procedures]",
     Cmd2 = deep_cmd_proc_callers(PSI, group_by_proc, 1),
-    Msg3 = "Parent modules",
+    Msg3 = "[Parent modules]",
     Cmd3 = deep_cmd_proc_callers(PSI, group_by_module, 1),
-    Msg4 = "Parent cliques",
+    Msg4 = "[Parent cliques]",
     Cmd4 = deep_cmd_proc_callers(PSI, group_by_clique, 1),
-    Link1 = string.format("<A HREF=""%s"">%s</A>\n",
+    Link1 = string.format("<A CLASS=""button"" HREF=""%s"">%s</A>\n",
         [s(deep_cmd_pref_to_url(Pref, Deep, Cmd1)), s(Msg1)]),
-    Link2 = string.format("<A HREF=""%s"">%s</A>\n",
+    Link2 = string.format("<A CLASS=""button"" HREF=""%s"">%s</A>\n",
         [s(deep_cmd_pref_to_url(Pref, Deep, Cmd2)), s(Msg2)]),
-    Link3 = string.format("<A HREF=""%s"">%s</A>\n",
+    Link3 = string.format("<A CLASS=""button"" HREF=""%s"">%s</A>\n",
         [s(deep_cmd_pref_to_url(Pref, Deep, Cmd3)), s(Msg3)]),
-    Link4 = string.format("<A HREF=""%s"">%s</A>\n",
+    Link4 = string.format("<A CLASS=""button"" HREF=""%s"">%s</A>\n",
         [s(deep_cmd_pref_to_url(Pref, Deep, Cmd4)), s(Msg4)]),
     HTML =
         Link1 ++
@@ -1885,7 +1884,7 @@
     Pref = Pref0 ^ pref_criteria := Criteria,
     URL = deep_cmd_pref_to_url(Pref, Deep, Cmd),
     Str = string.format("<A HREF=%s>%s</A>",
-        [s(URL), s(escape_html_string(Str0))]).
+        [s(URL), s(escape_break_html_string(Str0))]).
 
 :- func wrap_proc_links(proc_static_ptr, preferences, deep, string,
     order_criteria) = string.
@@ -1896,7 +1895,7 @@
     Pref = Pref0 ^ pref_criteria := Criteria,
     URL = deep_cmd_pref_to_url(Pref, Deep, Cmd),
     Str = string.format("<A HREF=%s>%s</A>",
-        [s(URL), s(escape_html_string(Str0))]).
+        [s(URL), s(escape_break_html_string(Str0))]).
 
 :- func wrap_proc_callers_links(proc_static_ptr, caller_groups, int,
     preferences, deep, string, order_criteria) = string.
@@ -1908,7 +1907,7 @@
     Pref = Pref0 ^ pref_criteria := Criteria,
     URL = deep_cmd_pref_to_url(Pref, Deep, Cmd),
     Str = string.format("<A HREF=%s>%s</A>",
-        [s(URL), s(escape_html_string(Str0))]).
+        [s(URL), s(escape_break_html_string(Str0))]).
 
 :- func wrap_module_links(string, preferences, deep, string,
     order_criteria) = string.
@@ -1918,7 +1917,7 @@
     Pref = Pref0 ^ pref_criteria := Criteria,
     URL = deep_cmd_pref_to_url(Pref, Deep, Cmd),
     Str = string.format("<A HREF=%s>%s</A>",
-        [s(URL), s(escape_html_string(Str0))]).
+        [s(URL), s(escape_break_html_string(Str0))]).
 
 :- func wrap_modules_links(preferences, deep, string, order_criteria) = string.
 
@@ -1927,7 +1926,7 @@
     Pref = Pref0 ^ pref_criteria := Criteria,
     URL = deep_cmd_pref_to_url(Pref, Deep, Cmd),
     Str = string.format("<A HREF=%s>%s</A>",
-        [s(URL), s(escape_html_string(Str0))]).
+        [s(URL), s(escape_break_html_string(Str0))]).
 
 :- func wrap_top_procs_links(display_limit, preferences, deep, string,
     order_criteria) = string.
@@ -1944,7 +1943,7 @@
         Cmd = deep_cmd_top_procs(Limit, CostKind, InclDesc, Scope),
         URL = deep_cmd_pref_to_url(Pref, Deep, Cmd),
         Str = string.format("<A HREF=%s>%s</A>",
-            [s(URL), s(escape_html_string(Str0))])
+            [s(URL), s(escape_break_html_string(Str0))])
     ).
 
 %----------------------------------------------------------------------------%
--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to:       mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions:          mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the reviews mailing list