equal
deleted
inserted
replaced
215 |
215 |
216 (* get informed about files *) |
216 (* get informed about files *) |
217 |
217 |
218 val thy_name = Path.implode o #1 o Path.split_ext o Path.base; |
218 val thy_name = Path.implode o #1 o Path.split_ext o Path.base; |
219 |
219 |
220 val inform_file_retracted = Thy_Info.if_known_thy Thy_Info.remove_thy o thy_name; |
220 val inform_file_retracted = Thy_Info.kill_thy o thy_name; |
221 |
221 |
222 fun inform_file_processed path state = |
222 fun inform_file_processed path state = |
223 let val name = thy_name path in |
223 let val name = thy_name path in |
224 if Toplevel.is_toplevel state andalso Thy_Info.known_thy name then |
224 if Toplevel.is_toplevel state then |
225 Thy_Info.register_thy (Toplevel.end_theory Position.none state) |
225 Thy_Info.register_thy (Toplevel.end_theory Position.none state) |
226 handle ERROR msg => |
226 handle ERROR msg => |
227 (warning (cat_lines [msg, "Failed to register theory: " ^ quote name]); |
227 (warning (cat_lines [msg, "Failed to register theory: " ^ quote name]); |
228 tell_file_retracted true (Path.base path)) |
228 tell_file_retracted true (Path.base path)) |
229 else raise Toplevel.UNDEF |
229 else raise Toplevel.UNDEF |
802 let |
802 let |
803 val url = #url vs |
803 val url = #url vs |
804 val filepath = PgipTypes.path_of_pgipurl url |
804 val filepath = PgipTypes.path_of_pgipurl url |
805 val filedir = Path.dir filepath |
805 val filedir = Path.dir filepath |
806 val thy_name = Path.implode o #1 o Path.split_ext o Path.base |
806 val thy_name = Path.implode o #1 o Path.split_ext o Path.base |
807 val openfile_retract = Output.no_warnings_CRITICAL |
807 val openfile_retract = Output.no_warnings_CRITICAL Thy_Info.kill_thy o thy_name; |
808 (Thy_Info.if_known_thy Thy_Info.remove_thy) o thy_name; |
|
809 in |
808 in |
810 case !currently_open_file of |
809 case !currently_open_file of |
811 SOME f => raise PGIP ("<openfile> when a file is already open!\nCurrently open file: " ^ |
810 SOME f => raise PGIP ("<openfile> when a file is already open!\nCurrently open file: " ^ |
812 PgipTypes.string_of_pgipurl url) |
811 PgipTypes.string_of_pgipurl url) |
813 | NONE => (openfile_retract filepath; |
812 | NONE => (openfile_retract filepath; |