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: Xah Lee
Subject: Re: elisp: isn't default-directory always the dir of current file??
Date: Mon, 2 Mar 2009 12:38:44 -0800 (PST)
User-agent: G2/1.0

On Mar 2, 5:12 am, Alan Mackenzie <a...@muc.de> wrote:
> Hi, Xah!
>
> In comp.emacs Xah Lee <xah...@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?

good point.

i misunderstood default-directory's purpose.

What i sought is load-file-name or buffer-file-name.
(file-name-directory (if load-file-name load-file-name buffer-file-
name))

  Xah
∑ http://xahlee.org/

reply via email to

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