On Wed, Nov 11, 2009 at 1:35 PM, Tassilo Horn
<address@hidden> wrote:
Rocky Bernstein <address@hidden> writes:
Hi Rocky!
> For developing multi-file emacs packages, it would be helpful to have
> something akin to require-relative in Ruby 1.9. That is, one wants to
> load an Emacs Lisp file relative the file that issues the load which
> is often in the same directory or a nearby directory.
`load-file' accepts relative paths.
Let's say your project looks like
foo/foo.el
foo/misc/foo-misc.el
then a (load-file "misc/foo-misc.el") in foo.el should work.
Bye,
Tassilo
I don't see that this does what I need or meant to convey:
one wants to load an Emacs Lisp file relative [to] the [directory of the] file that issues the load
Here my test of the above suggestion..
$ find /tmp/proj -type f -print -exec cat {} \;
/tmp/proj/subdir/subload.el
(load-file "../test1.el")
/tmp/proj/test1.el
(load-file "test3.el")
/tmp/proj/test3.el
(message "test3 here")
Now inside emacs I edit /tmp/proj/subdir/subload.el, and M-x eval-current-buffer. I get:
load-file: Cannot open load file: /tmp/proj/subdir/test3.el
This is loading relative to the directory I started at, /tmp/proj/subdir, not relative to the directory that of the file that issued the load, /tmp/proj/test1.el.