60 blobs_digests = blobs_digests, |
60 blobs_digests = blobs_digests, |
61 blobs_index = blobs_index, |
61 blobs_index = blobs_index, |
62 tokens = toks ~~ sources} |
62 tokens = toks ~~ sources} |
63 end; |
63 end; |
64 |
64 |
65 fun commands_accepted ids = Output.protocol_message Markup.commands_accepted [commas ids]; |
65 fun commands_accepted ids = Output.protocol_message Markup.commands_accepted [XML.Text (commas ids)]; |
66 |
66 |
67 val _ = |
67 val _ = |
68 Isabelle_Process.protocol_command "Document.define_command" |
68 Isabelle_Process.protocol_command "Document.define_command" |
69 (fn id :: name :: blobs :: toks :: sources => |
69 (fn id :: name :: blobs :: toks :: sources => |
70 let |
70 let |
144 ((new_id, edited, assign_update) |> |
144 ((new_id, edited, assign_update) |> |
145 let |
145 let |
146 open XML.Encode; |
146 open XML.Encode; |
147 fun encode_upd (a, bs) = |
147 fun encode_upd (a, bs) = |
148 string (space_implode "," (map Value.print_int (a :: bs))); |
148 string (space_implode "," (map Value.print_int (a :: bs))); |
149 in triple int (list string) (list encode_upd) end |
149 in triple int (list string) (list encode_upd) end); |
150 |> YXML.chunks_of_body); |
|
151 in Document.start_execution state' end))); |
150 in Document.start_execution state' end))); |
152 |
151 |
153 val _ = |
152 val _ = |
154 Isabelle_Process.protocol_command "Document.remove_versions" |
153 Isabelle_Process.protocol_command "Document.remove_versions" |
155 (fn [versions_yxml] => Document.change_state (fn state => |
154 (fn [versions_yxml] => Document.change_state (fn state => |
156 let |
155 let |
157 val versions = |
156 val versions = |
158 YXML.parse_body versions_yxml |> |
157 YXML.parse_body versions_yxml |> |
159 let open XML.Decode in list int end; |
158 let open XML.Decode in list int end; |
160 val state1 = Document.remove_versions versions state; |
159 val state1 = Document.remove_versions versions state; |
161 val _ = Output.protocol_message Markup.removed_versions [versions_yxml]; |
160 val _ = Output.protocol_message Markup.removed_versions [XML.Text (versions_yxml)]; |
162 in state1 end)); |
161 in state1 end)); |
163 |
162 |
164 val _ = |
163 val _ = |
165 Isabelle_Process.protocol_command "Document.dialog_result" |
164 Isabelle_Process.protocol_command "Document.dialog_result" |
166 (fn [serial, result] => |
165 (fn [serial, result] => |