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

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

Re: elisp: isn't default-directory always the dir of current file??


From: Alan Mackenzie
Subject: Re: elisp: isn't default-directory always the dir of current file??
Date: Mon, 2 Mar 2009 13:12:53 +0000 (UTC)
User-agent: tin/1.6.2-20030910 ("Pabbay") (UNIX) (FreeBSD/4.11-RELEASE (i386))

Hi, Xah!

In comp.emacs Xah Lee <xahlee@gmail.com> wrote:
> elisp question.

> it seems to me, that the var default-directory is not updated when
> using load-file.

It isn't.  Why should it be?  default-directory is associated with the
current _buffer_.  If you use this directory as the base for a relative
file name to do something wierd (like loading lisp code), why should that
change default-directory?

> For example, i have in my .emacs this line and nothing else:

> (load-file "web/emacs/xah_emacs_init.el")

> Then, in the file xah_emacs_init.el
> has this line

> (load-file "emacs2/init.el")

> and nothing else.

> However, it is a error because it cannot find init.el.

> When adding (message default-directory) to the xah_emacs_init.el, it
> still thinks that the dir is "~/".

> The elisp doc on default-directory and load-file indicates that this
> should work.

Really?  I've had a look for this and haven't found it.  Care to quote
from the page?

> Xah

-- 
Alan Mackenzie (Nuremberg, Germany).



reply via email to

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