159 make_browser_info (f (theories, files, tex_index, html_index, graph)); |
159 make_browser_info (f (theories, files, tex_index, html_index, graph)); |
160 |
160 |
161 |
161 |
162 (* state *) |
162 (* state *) |
163 |
163 |
164 val browser_info = ref empty_browser_info; |
164 val browser_info = Unsynchronized.ref empty_browser_info; |
165 fun change_browser_info f = CRITICAL (fn () => change browser_info (map_browser_info f)); |
165 fun change_browser_info f = |
166 |
166 CRITICAL (fn () => Unsynchronized.change browser_info (map_browser_info f)); |
167 val suppress_tex_source = ref false; |
167 |
|
168 val suppress_tex_source = Unsynchronized.ref false; |
168 fun no_document f x = setmp_noncritical suppress_tex_source true f x; |
169 fun no_document f x = setmp_noncritical suppress_tex_source true f x; |
169 |
170 |
170 fun init_theory_info name info = |
171 fun init_theory_info name info = |
171 change_browser_info (fn (theories, files, tex_index, html_index, graph) => |
172 change_browser_info (fn (theories, files, tex_index, html_index, graph) => |
172 (Symtab.update (name, info) theories, files, tex_index, html_index, graph)); |
173 (Symtab.update (name, info) theories, files, tex_index, html_index, graph)); |
227 verbose = verbose, readme = readme}: session_info; |
228 verbose = verbose, readme = readme}: session_info; |
228 |
229 |
229 |
230 |
230 (* state *) |
231 (* state *) |
231 |
232 |
232 val session_info = ref (NONE: session_info option); |
233 val session_info = Unsynchronized.ref (NONE: session_info option); |
233 |
234 |
234 fun with_session x f = (case ! session_info of NONE => x | SOME info => f info); |
235 fun with_session x f = (case ! session_info of NONE => x | SOME info => f info); |
235 fun with_context f = f (Context.theory_name (ML_Context.the_global_context ())); |
236 fun with_context f = f (Context.theory_name (ML_Context.the_global_context ())); |
236 |
237 |
237 |
238 |