--- a/src/Pure/Thy/thy_read.ML Mon Apr 22 15:42:20 1996 +0200
+++ b/src/Pure/Thy/thy_read.ML Tue Apr 23 12:38:16 1996 +0200
@@ -1354,18 +1354,24 @@
in Symtab.lookup (d2, id) end;
-(*CD to a directory and load its ROOT.ML file;
+(*Temporarily enter a directory and load its ROOT.ML file;
also do some work for HTML generation*)
-fun use_dir dirname =
- (cd dirname;
- if !make_html then init_html() else ();
- use "ROOT.ML";
- finish_html());
+local
-fun exit_use_dir dirname =
- (cd dirname;
- if !make_html then init_html() else ();
- exit_use "ROOT.ML";
- finish_html());
+ fun gen_use_dir use_cmd dirname =
+ let val old_dir = pwd ();
+ in cd dirname;
+ if !make_html then init_html() else ();
+ use_cmd "ROOT.ML";
+ finish_html();
+ cd old_dir
+ end;
+
+in
+
+ val use_dir = gen_use_dir use;
+ val exit_use_dir = gen_use_dir exit_use;
+
+end
end;