all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Xah Lee <xahlee@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: elisp: isn't default-directory always the dir of current file??
Date: Mon, 2 Mar 2009 12:38:44 -0800 (PST)	[thread overview]
Message-ID: <3fde486e-8b96-49d3-a69e-a727216ca5bf@k9g2000prh.googlegroups.com> (raw)
In-Reply-To: gogm0l$2jh3$1@colin2.muc.de

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	other threads:[~2009-03-02 20:38 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-02  6:54 elisp: isn't default-directory always the dir of current file?? Xah Lee
2009-03-02  7:27 ` Xah Lee
2009-03-02  7:46   ` Xah Lee
2009-03-02 10:32     ` Lennart Borgman
     [not found]     ` <mailman.2198.1235989932.31690.help-gnu-emacs@gnu.org>
2009-03-02 20:32       ` Xah Lee
2009-03-03 16:45         ` Mike Mattie
     [not found]         ` <mailman.2298.1236115585.31690.help-gnu-emacs@gnu.org>
2009-03-03 22:49           ` Xah Lee
2009-03-02 13:12 ` Alan Mackenzie
2009-03-02 20:38   ` Xah Lee [this message]
2009-03-03  4:06     ` Kevin Rodgers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3fde486e-8b96-49d3-a69e-a727216ca5bf@k9g2000prh.googlegroups.com \
    --to=xahlee@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.