From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#23638: "load" should use directory from load-file-name as a final fallback Date: Sun, 07 Feb 2021 14:14:32 +0100 Message-ID: <875z346mvb.fsf@gnus.org> References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7540"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 23638@debbugs.gnu.org To: Robert Weiner Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Feb 07 14:15:53 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l8juq-0001r4-Uv for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 07 Feb 2021 14:15:52 +0100 Original-Received: from localhost ([::1]:50000 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l8jup-0000lL-Sy for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 07 Feb 2021 08:15:51 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60144) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l8ju2-0000kM-77 for bug-gnu-emacs@gnu.org; Sun, 07 Feb 2021 08:15:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:35525) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l8ju1-0002di-UE for bug-gnu-emacs@gnu.org; Sun, 07 Feb 2021 08:15:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1l8ju1-0006FF-P0 for bug-gnu-emacs@gnu.org; Sun, 07 Feb 2021 08:15:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 07 Feb 2021 13:15:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23638 X-GNU-PR-Package: emacs Original-Received: via spool by 23638-submit@debbugs.gnu.org id=B23638.161270368723970 (code B ref 23638); Sun, 07 Feb 2021 13:15:01 +0000 Original-Received: (at 23638) by debbugs.gnu.org; 7 Feb 2021 13:14:47 +0000 Original-Received: from localhost ([127.0.0.1]:47071 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l8jtn-0006EY-Ic for submit@debbugs.gnu.org; Sun, 07 Feb 2021 08:14:47 -0500 Original-Received: from quimby.gnus.org ([95.216.78.240]:35246) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l8jtj-0006EI-1C for 23638@debbugs.gnu.org; Sun, 07 Feb 2021 08:14:46 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=cae0eIv7vqNyEqWCUt1HllTuN7sKY6MuGw0DS2TslQQ=; b=QD28+kLarZoNjG8/2hwoT8t31E tZ5qjgmaAnpYmjk9mSC00L0MK3BpmFTuKh1r8AbNfNU/9xARZpVL7kC/tpuTciJU9WP1L+TM8psLs SHeI0SwvevCgetLcJPh177SXeC0gPA+6XIf57yEGhWYf1anclzJQuGOIbjOOAl5giNUk=; Original-Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l8jtZ-0000Xk-GK; Sun, 07 Feb 2021 14:14:37 +0100 X-Now-Playing: James White and the Blacks's _Off White_: "White Savage" In-Reply-To: (Robert Weiner's message of "Sat, 28 May 2016 10:33:20 -0400") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:199483 Archived-At: Robert Weiner writes: > The "load" function could do more of the right thing in the case where > an absolute path is given in a load call and then within the file > loaded, require or load references are made to relative files whose > directories are not in load path but the files do exist within the > directory specified by the original load. It's an interesting idea, and I guess it's pretty trivial to implement? That is, if `load' is called with an absolute path, then bind `load-path' and add the directory to the value locally. It sounds convenient, but also kinda chaotic -- if I load "/tmp/foo.el", then I may not want to load anything else from "/tmp/" just because "/tmp/foo.el" says "(require 'bar)". That is, it sounds kinda insecure. There's also the issue of being consistent -- today, '(load "/tmp/foo.el")' and `C-x C-f /tmp/foo.el RET' and then `eval-buffer' gives the same result... but this wouldn't be the case if we changed `load' this way. Now, we could add a new command `load-file-with-directory' or something that would do this -- that would be more clear, at least, that we're playing games with `load-path', and would be almost as convenient as if `load' did this itself. Any opinions here? -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no