[Top][All Lists]

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

Re: relative load-file

From: Rocky Bernstein
Subject: Re: relative load-file
Date: Wed, 11 Nov 2009 14:26:01 -0500

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


then a (load-file "misc/foo-misc.el") in foo.el should work.


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 {} \;
       (load-file "../test1.el")
      (load-file "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.


reply via email to

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