From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: npostavs@users.sourceforge.net Newsgroups: gmane.emacs.bugs Subject: bug#16406: load prefers directories rather than searching load-path Date: Sun, 21 Aug 2016 12:35:22 -0400 Message-ID: <8737lyulkl.fsf@users.sourceforge.net> References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1471797382 14591 195.159.176.226 (21 Aug 2016 16:36:22 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 21 Aug 2016 16:36:22 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) Cc: 16406@debbugs.gnu.org To: Glenn Morris Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Aug 21 18:36:18 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bbVjN-0003Wk-22 for geb-bug-gnu-emacs@m.gmane.org; Sun, 21 Aug 2016 18:36:17 +0200 Original-Received: from localhost ([::1]:37543 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bbVjK-0000sv-8Z for geb-bug-gnu-emacs@m.gmane.org; Sun, 21 Aug 2016 12:36:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49865) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bbVjE-0000sZ-Te for bug-gnu-emacs@gnu.org; Sun, 21 Aug 2016 12:36:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bbVj8-0005Si-Ux for bug-gnu-emacs@gnu.org; Sun, 21 Aug 2016 12:36:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:38296) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bbVj8-0005Se-Rb for bug-gnu-emacs@gnu.org; Sun, 21 Aug 2016 12:36:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bbVj8-0002rU-Hc for bug-gnu-emacs@gnu.org; Sun, 21 Aug 2016 12:36:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: npostavs@users.sourceforge.net Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 21 Aug 2016 16:36:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 16406 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 16406-submit@debbugs.gnu.org id=B16406.147179731710937 (code B ref 16406); Sun, 21 Aug 2016 16:36:02 +0000 Original-Received: (at 16406) by debbugs.gnu.org; 21 Aug 2016 16:35:17 +0000 Original-Received: from localhost ([127.0.0.1]:36008 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bbViP-0002qG-8g for submit@debbugs.gnu.org; Sun, 21 Aug 2016 12:35:17 -0400 Original-Received: from mail-it0-f49.google.com ([209.85.214.49]:35213) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bbViN-0002pu-3n; Sun, 21 Aug 2016 12:35:15 -0400 Original-Received: by mail-it0-f49.google.com with SMTP id x131so69698022ite.0; Sun, 21 Aug 2016 09:35:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=upldKtgc4unfkv8sKbFfEv/ct9fXEzYFj/p+I4OOo6k=; b=nRuNYy/uLFegcqgaAb+7DdTPl8+atgnxADkUvf2g99RR1cS4en+dvrhh06cduXQm1e JsxyMxWeqc/IkX7a+bWL2VyyEQ9vWoMuUfGmQQ3GxL3JJesYmEmNwDSVZ7S2x/wiGAGq EtFDzhMuvNXMQKqOntGTaY4wAGNV4rJvADtCFudj9PPL5/iC+1+kf+CmZC+zXi0YwjbG Fma2bd1JhNTEgJ3SaecMUc9sQcvHb9Ki3LOZ0e49lM2ofdKmx8KTfx559i6zqpGeuhaJ Z/wrjiPwudbV1WeMYEAZKH3kCltJHJrcYvqraLdUU71n56moacGo+STC/UKndLjVgPba wTqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=upldKtgc4unfkv8sKbFfEv/ct9fXEzYFj/p+I4OOo6k=; b=d1R4eMDjmyAyKsIRrewmrhnlRxSyDspf1Nyod9r050PQKe+kzokThnbFTXsUc6q2p/ 8rC58QNOVKl/NWeaa3uZOGN2Lb/3ch5H63WFIqgZGbuLZAhEICtIz7cARuNO2dXmx+fi pgb7EdtGyHNUqHSZKxDFU3KlS20ogMi+5UBgj6wPKK4bY4hgNQcIDPlh2C2F2213kup+ 7aJJoeo3FEIYVmLDHl/I8OGChJxpdrNqTxcdBlGMUbLm9cKvP7Fwzw1Aoo8YShsK2luQ FwVDXTzX1TmjFPfPXTMvwook0t1PCvK+Llq+MaL1yxKXq7Ga0a87pAsriPNdB32KHkdf YqMg== X-Gm-Message-State: AEkooutrChZw9S+kDWctWpDLQpF/T7b8cZSjSQGlPAok6Woyf++8usITJIeZjt6CrfUPbw== X-Received: by 10.36.224.70 with SMTP id c67mr14662161ith.21.1471797309621; Sun, 21 Aug 2016 09:35:09 -0700 (PDT) Original-Received: from zony ([45.2.7.130]) by smtp.googlemail.com with ESMTPSA id g78sm6175825itb.12.2016.08.21.09.35.08 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 21 Aug 2016 09:35:08 -0700 (PDT) In-Reply-To: (Glenn Morris's message of "Fri, 10 Jan 2014 00:23:57 -0500") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:122459 Archived-At: --=-=-= Content-Type: text/plain tags 16406 patch quit Glenn Morris writes: > Package: emacs > Version: 24.3 > > From the Emacs source directory, wanting to load the standard info.el library: > > ./src/emacs -Q -l info > > Cannot open load file: is a directory, /tmp/emacs/trunk/info > > It seems dumb for load prefer a directory. Seems simple enough to fix, here is a patch (this also covers #17848 "add suffix search to -l even when directory part in argument"): --=-=-= Content-Type: text/plain Content-Disposition: inline; filename=v1-0001-Improvements-to-load-argument-handling.patch Content-Description: patch >From 38faf8846f7738b533aa29622fd7f78a8c6c81cd Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Sun, 21 Aug 2016 10:51:38 -0400 Subject: [PATCH v1] Improvements to --load argument handling * lisp/startup.el (command-line-1): Search for files with load-suffixes in default dir (Bug #17484). Only pass normal files that were found, since `load' doesn't handle directories (Bug #16406). --- lisp/startup.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lisp/startup.el b/lisp/startup.el index fcdc376..9134604 100644 --- a/lisp/startup.el +++ b/lisp/startup.el @@ -2392,8 +2392,9 @@ command-line-1 (or argval (pop command-line-args-left)))) ;; Take file from default dir if it exists there; ;; otherwise let `load' search for it. - (file-ex (expand-file-name file))) - (when (file-exists-p file-ex) + (file-ex (locate-file file (list default-directory) + load-suffixes))) + (when (and file-ex (file-regular-p file-ex)) (setq file file-ex)) (load file nil t))) -- 2.9.2 --=-=-=--