Normally to find which file corresponds to a loaded feature, one could use the (locate-library LIBRARY &optional NOSUFFIX PATH INTERACTIVE-CALL)
function.
However, if the user used the function (load-file FILE)
a file that is not located in a directory listed in load-path can be loaded. A call to locate-library will not find it.
Also, lets say that there are several files that provide the same FEATURE because they have the same (provide FEATURE)
form in them, and they are all stored in a directory listed in the load-path and one of them is loaded, locate-library
will always report the file it finds with what is the content of the load-path at the moment of the execution of locate-library. This may happen in the following scenarioS:
- while developing where several copies of the file exists in various directories or,
- on projects that create the final distributed file from a set of smaller files.
I am trying to find a way to identify the path of the file that was originally used to load the existing feature, regardless of any modification that might have occurred to load-path after the file was loaded and even if the file was loaded from a load-file
call.
Is this feasible?