unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#23638: "load" should use directory from load-file-name as a final fallback
@ 2016-05-28 14:33 Robert Weiner
  2016-05-28 14:49 ` bug#23638: Someone thought relative file loading was enough of a problem, he wrote a whole package for it Robert Weiner
  2021-02-07 13:14 ` bug#23638: "load" should use directory from load-file-name as a final fallback Lars Ingebrigtsen
  0 siblings, 2 replies; 4+ messages in thread
From: Robert Weiner @ 2016-05-28 14:33 UTC (permalink / raw)
  To: 23638

[-- Attachment #1: Type: text/plain, Size: 1294 bytes --]

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.

[-- Attachment #2: Type: text/html, Size: 1436 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-05-08 12:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-28 14:33 bug#23638: "load" should use directory from load-file-name as a final fallback Robert Weiner
2016-05-28 14:49 ` bug#23638: Someone thought relative file loading was enough of a problem, he wrote a whole package for it Robert Weiner
2021-02-07 13:14 ` bug#23638: "load" should use directory from load-file-name as a final fallback Lars Ingebrigtsen
2022-05-08 12:22   ` Lars Ingebrigtsen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).