From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tassilo Horn Newsgroups: gmane.emacs.devel Subject: Re: relative load-file Date: Wed, 11 Nov 2009 20:54:36 +0100 Message-ID: <87hbt07s77.fsf@thinkpad.tsdh.de> References: <6cd6de210911110901v24307163i253e69e89c72c9e@mail.gmail.com> <87ljic7vu9.fsf@thinkpad.tsdh.de> <6cd6de210911111126y62c7dfceqb82092c9eef9890d@mail.gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1257969304 22929 80.91.229.12 (11 Nov 2009 19:55:04 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 11 Nov 2009 19:55:04 +0000 (UTC) Cc: emacs-devel@gnu.org To: Rocky Bernstein Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Nov 11 20:54:57 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1N8JHL-0003kY-6B for ged-emacs-devel@m.gmane.org; Wed, 11 Nov 2009 20:54:55 +0100 Original-Received: from localhost ([127.0.0.1]:43937 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N8JHK-0003c5-LG for ged-emacs-devel@m.gmane.org; Wed, 11 Nov 2009 14:54:54 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N8JHE-0003aT-Vc for emacs-devel@gnu.org; Wed, 11 Nov 2009 14:54:49 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N8JH9-0003Q7-Tg for emacs-devel@gnu.org; Wed, 11 Nov 2009 14:54:48 -0500 Original-Received: from [199.232.76.173] (port=44237 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N8JH9-0003Pt-Qk for emacs-devel@gnu.org; Wed, 11 Nov 2009 14:54:43 -0500 Original-Received: from out4.smtp.messagingengine.com ([66.111.4.28]:37118) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1N8JH7-00019f-EM; Wed, 11 Nov 2009 14:54:41 -0500 Original-Received: from compute2.internal (compute2.internal [10.202.2.42]) by gateway1.messagingengine.com (Postfix) with ESMTP id 0EF2CB6520; Wed, 11 Nov 2009 14:54:41 -0500 (EST) Original-Received: from heartbeat2.messagingengine.com ([10.202.2.161]) by compute2.internal (MEProxy); Wed, 11 Nov 2009 14:54:41 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=messagingengine.com; h=from:to:cc:subject:references:date:in-reply-to:message-id:mime-version:content-type; s=smtpout; bh=lmiT2uz/L8Jhcr+v9JEm0AX6+O8=; b=J+K8QsL9tgyR2ISAxBLicxGwvX1mZy3OGgyYwuD9srZ70K79oRE7zOyl6KPDZOwYVL2M6EEdCyHlZ7Fu2wf2XfKkJXYLSIQ+CDHgumcBsXuXub/2QKBAOsL76lGbgvCNgj2BE3NxwljunPKYmgFx/KiWVcGVR9n09zHJds7ZSKs= X-Sasl-enc: zL1XPC1zjMlNTxX03f7zbDY+8k80A9PUpo44BmNAUgWW 1257969280 Original-Received: from thinkpad.tsdh.de (p54AF235A.dip0.t-ipconnect.de [84.175.35.90]) by mail.messagingengine.com (Postfix) with ESMTPA id BE38D6D96; Wed, 11 Nov 2009 14:54:39 -0500 (EST) In-Reply-To: <6cd6de210911111126y62c7dfceqb82092c9eef9890d@mail.gmail.com> (Rocky Bernstein's message of "Wed, 11 Nov 2009 14:26:01 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:116839 Archived-At: Rocky Bernstein writes: Hi Rocky, > 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 {} \; > /tmp/proj/subdir/subload.el > (load-file "../test1.el") > /tmp/proj/test1.el > (load-file "test3.el") > /tmp/proj/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. I see. Well, generally those problems don't occur, because all elisp projects I know put all the *.el files into one directory, and the files are all named proj-xxx.el with one proj.el. This prefixing is kind of a convention (not only for files, but vars and funs, too), because there are no namspaces in elisp. Emacs itself has some subdirs, but all of them are added to the load-path. In both cases, the usual provide/require mechanics suffice. Bye, Tassilo