From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: relative load-file Date: Tue, 17 Nov 2009 22:20:05 -0500 Message-ID: References: <6cd6de210911110901v24307163i253e69e89c72c9e@mail.gmail.com> <6cd6de210911140744t75b84417udfa6921cc8fe424f@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 1258514442 25595 80.91.229.12 (18 Nov 2009 03:20:42 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 18 Nov 2009 03:20:42 +0000 (UTC) Cc: emacs-devel@gnu.org To: M Jared Finder Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Nov 18 04:20:35 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 1NAb5v-00072L-0x for ged-emacs-devel@m.gmane.org; Wed, 18 Nov 2009 04:20:35 +0100 Original-Received: from localhost ([127.0.0.1]:51446 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NAb5u-0001i8-6e for ged-emacs-devel@m.gmane.org; Tue, 17 Nov 2009 22:20:34 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NAb5o-0001hr-Iv for emacs-devel@gnu.org; Tue, 17 Nov 2009 22:20:28 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NAb5j-0001cj-Kt for emacs-devel@gnu.org; Tue, 17 Nov 2009 22:20:27 -0500 Original-Received: from [199.232.76.173] (port=37021 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NAb5j-0001cW-Do for emacs-devel@gnu.org; Tue, 17 Nov 2009 22:20:23 -0500 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:62872 helo=ironport2-out.pppoe.ca) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NAb5j-0003aH-5c for emacs-devel@gnu.org; Tue, 17 Nov 2009 22:20:23 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av8EACf3AkvO+II8/2dsb2JhbACBTtRUhDsEiVE X-IronPort-AV: E=Sophos;i="4.44,762,1249272000"; d="scan'208";a="49578458" Original-Received: from 206-248-130-60.dsl.teksavvy.com (HELO ceviche.home) ([206.248.130.60]) by ironport2-out.pppoe.ca with ESMTP; 17 Nov 2009 22:20:05 -0500 Original-Received: by ceviche.home (Postfix, from userid 20848) id 25F98B40C9; Tue, 17 Nov 2009 22:20:05 -0500 (EST) In-Reply-To: (M. Jared Finder's message of "Sun, 15 Nov 2009 13:59:10 -0800") 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:117143 Archived-At: > Let me state this clearly, because I'm not sure you're getting it. > A function that is being defined does not necessarily get defined > from a file. I think he gets it, mind you. His usage pattern is just different. His request makes sense. But as long as his code is written properly (expand-file-name (file-name-directory (or load-file-name buffer-file-name))) should give the right result both during load and during eval-buffer. We could also change #$ to return (or load-file-name buffer-file-name) rather than load-file-name so that (expand-file-name (file-name-directory #$)) does the trick even more reliably. Stefan