From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Xah Lee Newsgroups: gmane.emacs.help Subject: Re: elisp: isn't default-directory always the dir of current file?? Date: Sun, 1 Mar 2009 23:27:09 -0800 (PST) Organization: http://groups.google.com Message-ID: <015bc5de-e438-4f92-b647-717776e51dc7@e1g2000pra.googlegroups.com> References: <19d2e227-6275-4b23-90f3-98c914a95156@o8g2000pre.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1235988199 6697 80.91.229.12 (2 Mar 2009 10:03:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 2 Mar 2009 10:03:19 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Mar 02 11:04:36 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Le50l-0001ji-4i for geh-help-gnu-emacs@m.gmane.org; Mon, 02 Mar 2009 11:04:35 +0100 Original-Received: from localhost ([127.0.0.1]:49959 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Le4zQ-0004kY-3t for geh-help-gnu-emacs@m.gmane.org; Mon, 02 Mar 2009 05:03:12 -0500 Original-Path: news.stanford.edu!newsfeed.stanford.edu!postnews.google.com!e1g2000pra.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help,comp.emacs Original-Lines: 40 Original-NNTP-Posting-Host: 24.6.175.142 Original-X-Trace: posting.google.com 1235978829 337 127.0.0.1 (2 Mar 2009 07:27:09 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Mon, 2 Mar 2009 07:27:09 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: e1g2000pra.googlegroups.com; posting-host=24.6.175.142; posting-account=bRPKjQoAAACxZsR8_VPXCX27T2YcsyMA User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10_4_11; en) AppleWebKit/525.27.1 (KHTML, like Gecko) Version/3.2.1 Safari/525.27.1, gzip(gfe), gzip(gfe) Original-Xref: news.stanford.edu gnu.emacs.help:167209 comp.emacs:97895 X-Mailman-Approved-At: Mon, 02 Mar 2009 04:59:45 -0500 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:62513 Archived-At: On Mar 1, 10:54 pm, Xah Lee wrote: > elisp question. > > it seems to me, that the var default-directory is not updated when > using load-file. > > 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. > > Xah What i wanted to do was that when a file is loaded, put that file's dir to the load-path. I expected this to work: (add-to-list 'load-path default-directory ) but that didn't. The following works though: (add-to-list 'load-path (file-name-directory load-file-name)) Xah =E2=88=91 http://xahlee.org/ =E2=98=84