GNU bug report logs -
#23638
"load" should use directory from load-file-name as a final fallback
Previous Next
Reported by: Robert Weiner <rswgnu <at> gmail.com>
Date: Sat, 28 May 2016 14:35:02 UTC
Severity: wishlist
Tags: wontfix
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
The "load" function could do more of the right thing in the case where an
absolute path is given in a load call and then within the file loaded,
require or load references are made to relative files whose directories are
not in load path but the files do exist within the directory specified by
the original load.
So for example, we have a testing directory, "/tmp/" not in load-path with
files a.el and b.el.
In a.el, there is the line: (require 'b) and then we do a (load
"/tmp/a.el"). The require of b will fail but since load-file-name is set
to /tmp/a.el, if no matches are found in load-path, it would be a simple
matter to try to resolve b in the directory specified in load-file-name as
a fallback.
This would help in many cases when experimenting with new directories of
code that have not yet been added to the load path. It also would help the
Emacs package system since it adds only the top-level directory of a
package to load-path when trying to byte-compile the package. If the
package contains subdirectories, which require or load local files within
these subdirectories, these will fail right now but would succeed with the
above change.
Any comments, suggestions or issues with this? Please consider
implementing this and help make multi-directory packages a reality.
[Message part 2 (text/html, inline)]
This bug report was last modified 3 years and 13 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.