help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: require (was: Re: Hooks in minor modes)


From: Yuri Khan
Subject: Re: require (was: Re: Hooks in minor modes)
Date: Tue, 4 May 2021 12:40:42 +0700

On Tue, 4 May 2021 at 09:30, Emanuel Berg via Users list for the GNU
Emacs text editor <help-gnu-emacs@gnu.org> wrote:

> The objective is to make sure when you `require' B from A,
> as long as they are in the same directory, A will find B,
> because A will first look in its own directory.

It does not work that way. Relative directory names in load-path are
not resolved against the ‘require’ing file.

$ cat /tmp/test-load-path/foo/xyzzy.el
(require 'plugh)
(message "foo/xyzzy")
(provide 'xyzzy)

$ cat /tmp/test-load-path/foo/plugh.el
(message "foo/plugh")
(provide 'plugh)

$ emacs -Q
(add-to-list 'load-path ".")
(load-library "/tmp/test-load-path/foo/xyzzy.el")
⇒ Lisp error: (file-missing "Cannot open load file" "No such file or
directory" "plugh")



reply via email to

[Prev in Thread] Current Thread [Next in Thread]