There's long been an issue with "use" when trying to compile and run files which themselves contain "use". For example if ROOT.ML contains: use "first.ML"; use "second.ML";
The inner calls to "use" are taken relative to whatever the original working directory was set to, which means that ROOT.ML always has to be called with the right directory. It's not possible to call use "/home/david/mydirectory/ROOT.ML"; from an arbitrary directory.
I've committed a change to the NestedUse branch which is one possible solution to this. The version of "use" in there records the full path to the parent directory of the file name when a file is "used". If that file then contains a nested call to "use" the file is first checked as previously using the original working directory but if that fails it looks for the name by appending the parent directory to the name given. So in the example above, it would first look for "./first.ML" and only if that does not exist would it look for "/home/david/mydirectory/first.ML".
This seems as though it should achieve the desired effect with the minimum change to existing programs but there are other alternatives. For example, should it look first relative to the parent directory?
David