From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: load-path contains directories or directory names? Date: Fri, 23 Oct 2015 10:25:06 +0300 Message-ID: <83h9lirqr1.fsf@gnu.org> References: <86lhauus4x.fsf@stephe-leake.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1445585160 28153 80.91.229.3 (23 Oct 2015 07:26:00 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 23 Oct 2015 07:26:00 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stephen Leake Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Oct 23 09:25:47 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZpWjT-00034S-1K for ged-emacs-devel@m.gmane.org; Fri, 23 Oct 2015 09:25:47 +0200 Original-Received: from localhost ([::1]:36732 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZpWjS-0001RS-3i for ged-emacs-devel@m.gmane.org; Fri, 23 Oct 2015 03:25:46 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36989) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZpWj1-0001RN-NP for emacs-devel@gnu.org; Fri, 23 Oct 2015 03:25:24 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZpWix-0006d3-OO for emacs-devel@gnu.org; Fri, 23 Oct 2015 03:25:19 -0400 Original-Received: from mtaout20.012.net.il ([80.179.55.166]:54769) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZpWix-0006cx-Go for emacs-devel@gnu.org; Fri, 23 Oct 2015 03:25:15 -0400 Original-Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0NWN00100WJ04000@a-mtaout20.012.net.il> for emacs-devel@gnu.org; Fri, 23 Oct 2015 10:25:02 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([84.94.185.246]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NWN000LBWLQU070@a-mtaout20.012.net.il>; Fri, 23 Oct 2015 10:25:02 +0300 (IDT) In-reply-to: <86lhauus4x.fsf@stephe-leake.org> X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 X-Received-From: 80.179.55.166 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:192456 Archived-At: > From: Stephen Leake > Date: Thu, 22 Oct 2015 23:26:54 -0500 > > Here `dir' is taken from load-path, or a similar user-provided path. The > doc string for `load-path' says it consists of "directory names". In > emacs -Q, `load-path' indeed has no elements that end in '/'. > > However, after (package-initialize), `load-path' had elements that end > in '/'. This comes from package-autoload-ensure-default-file in > package.el, which adds lines like this to each package's autoload: > > "(add-to-list 'load-path (or (file-name-directory #$) (car load-path)))\n" > > Is this a bug, or should code that uses `load-path' tolerate this? It's a bug, patches are welcome to fix it. > On the other hand, since `load-path' can be modified by users, perhaps > code must be tolerant anyway. That's a separate issue. Defensive programming is frequently a good thing. But IMO we shouldn't _force_ Lisp packages into defensive programming, so I think Emacs itself should only put directory names into load-path.