From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alex Kosorukoff Newsgroups: gmane.emacs.bugs Subject: bug#17467: 24.3; locate-library returning spurious path Date: Sun, 11 May 2014 19:02:56 -0700 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=089e0149cc30be9bb104f92a5988 X-Trace: ger.gmane.org 1399860264 21250 80.91.229.3 (12 May 2014 02:04:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 12 May 2014 02:04:24 +0000 (UTC) Cc: 17467 <17467@debbugs.gnu.org> To: Glenn Morris Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon May 12 04:04:16 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1WjfbD-0006D7-KW for geb-bug-gnu-emacs@m.gmane.org; Mon, 12 May 2014 04:04:15 +0200 Original-Received: from localhost ([::1]:35024 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WjfbD-0004Og-54 for geb-bug-gnu-emacs@m.gmane.org; Sun, 11 May 2014 22:04:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38811) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wjfb5-0004Nf-Dh for bug-gnu-emacs@gnu.org; Sun, 11 May 2014 22:04:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wjfb0-0000fr-MX for bug-gnu-emacs@gnu.org; Sun, 11 May 2014 22:04:07 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:42559) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wjfb0-0000fk-J4 for bug-gnu-emacs@gnu.org; Sun, 11 May 2014 22:04:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Wjfb0-0002DF-5m for bug-gnu-emacs@gnu.org; Sun, 11 May 2014 22:04:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alex Kosorukoff Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 12 May 2014 02:04:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 17467 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 17467-submit@debbugs.gnu.org id=B17467.13998602068441 (code B ref 17467); Mon, 12 May 2014 02:04:02 +0000 Original-Received: (at 17467) by debbugs.gnu.org; 12 May 2014 02:03:26 +0000 Original-Received: from localhost ([127.0.0.1]:59910 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WjfaP-0002C2-Bx for submit@debbugs.gnu.org; Sun, 11 May 2014 22:03:25 -0400 Original-Received: from mail-oa0-f51.google.com ([209.85.219.51]:40830) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WjfaM-0002Bf-6U for 17467@debbugs.gnu.org; Sun, 11 May 2014 22:03:22 -0400 Original-Received: by mail-oa0-f51.google.com with SMTP id n16so7536984oag.10 for <17467@debbugs.gnu.org>; Sun, 11 May 2014 19:03:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=MZhueeIO9Ov+nLt3AeIwQUPvxbQw5Mn4lGtCscbhML0=; b=B0NJAUHqHWCDMgq0Tj/0h3ll65+LUG1o6QYoN6iXU6YmZD2D5oYBHaFhmsD3Z9d2vN HFEty5uthdDbMyaMJ4BCqgRO/F24oCTSCuDTbpcDQpIP7ebnRI3SfDm8TA1kcg6ZbFLj wn43cdMX5XT8c2Go4fojBR0dSM+0t+HKv3HY1dKJ31LOEH8pYmYYrUI92MKvnYN1E13Y 89MLF35Zjkl6NyHZA7N+T7nFLX7Xzsfa4B3mGrUDtfgdaL3Jz0wjvBsmaTxqlju0AnSO rQfMm3Uj+/rPYz96g9jSHD3uCu4dp6lOO1moUQO5wBzKFCfOEc9dmX29GD+9fHhjDym2 EGOg== X-Received: by 10.60.39.131 with SMTP id p3mr30422518oek.44.1399860196447; Sun, 11 May 2014 19:03:16 -0700 (PDT) Original-Received: by 10.182.240.131 with HTTP; Sun, 11 May 2014 19:02:56 -0700 (PDT) In-Reply-To: X-Google-Sender-Auth: wLj1mdpt3Gj4kdWi2QKKG6zBZqU X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.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-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:88949 Archived-At: --089e0149cc30be9bb104f92a5988 Content-Type: text/plain; charset=UTF-8 I am wondering whether we can deprecate the usage of this function in ways other than locating libraries? In the case of gnus the call to locate-library can be simply removed assuming the second parameter of load is set to t. Gnus will start faster without this redundant load-path traversal. On Sun, May 11, 2014 at 6:35 PM, Alex Kosorukoff wrote: > Thank you for the example. You are right, gnus-start.el is using > locate-library to check existence of its init files and uses load to search > for them again right after. Given how that code is written, we probably > should keep locate-library as is since at least some people people are > relying on its ability to locate arbitrary files that are not libraries. > > > On Sun, May 11, 2014 at 5:32 PM, Glenn Morris wrote: > >> Alex Kosorukoff wrote: >> >> > I think these file names are more appropriate for data files, not >> > executable ones. It is undesirable that a name "tramp.gz" will shadow a >> > valid library file "tramp.elc" that won't be found as a result. When you >> > say those names aren't spurious, do you have a particular example of an >> > emacs elisp library in mind which file name ends with a suffix other >> than >> > .el .elc .el.gz .elc.gz? I think the main difference is that I assume >> that >> > this list is exhaustive and you imply that it is not. You can prove me >> > wrong by a single example. >> >> I've somewhat lost track of exactly what you want an example of, but: >> >> When Gnus starts, it will read the `gnus-site-init-file' >> (`.../site-lisp/gnus-init' by default) and `gnus-init-file' (`~/.gnus' >> by default) files. These are normal Emacs Lisp files and can be used >> to avoid cluttering your `~/.emacs' and `site-init' files with Gnus >> stuff. Gnus will also check for files with the same names as these, >> but with `.elc' and `.el' suffixes. In other words, if you have set >> `gnus-init-file' to `~/.gnus', it will look for `~/.gnus.elc', >> `~/.gnus.el', and finally `~/.gnus' (in this order). >> >> and it uses locate-library to do that. >> > > --089e0149cc30be9bb104f92a5988 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
I am wondering whether we can deprecate the usage of this = function in ways other than locating libraries? In the case of gnus the cal= l to locate-library can be simply removed assuming the second parameter of = load is set to t. Gnus will start faster without this redundant load-path t= raversal.


On Sun, May 1= 1, 2014 at 6:35 PM, Alex Kosorukoff <alex@3form.com> wrote:
=
Thank you for the example. You are right, gnus-start.el is= using locate-library to check existence of its init files and uses load to= search for them again right after. Given how that code is written, we prob= ably should keep locate-library as is since at least some people people are= relying on its ability to locate arbitrary files that are not libraries.


On Sun, May 1= 1, 2014 at 5:32 PM, Glenn Morris <rgm@gnu.org> wrote:
Alex Kosorukoff wrote:

> I think these file names are more appropriate for data files, not
> executable ones. It is undesirable that a name "tramp.gz" wi= ll shadow a
> valid library file "tramp.elc" that won't be found as a = result. When you
> say those names aren't spurious, do you have a particular =C2=A0ex= ample of an
> emacs elisp library in mind which file name ends with a suffix other t= han
> .el .elc .el.gz .elc.gz? I think the main difference is that I assume = that
> this list is exhaustive and you imply that it is not. You can prove me=
> wrong by a single example.

I've somewhat lost track of exactly what you want an example of, = but:

=C2=A0 =C2=A0 =C2=A0 =C2=A0When Gnus starts, it will read the `gnus-site-in= it-file'
=C2=A0 =C2=A0 (`.../site-lisp/gnus-init' by default) and `gnus-init-fil= e' (`~/.gnus'
=C2=A0 =C2=A0 by default) files. =C2=A0These are normal Emacs Lisp files an= d can be used
=C2=A0 =C2=A0 to avoid cluttering your `~/.emacs' and `site-init' f= iles with Gnus
=C2=A0 =C2=A0 stuff. =C2=A0Gnus will also check for files with the same nam= es as these,
=C2=A0 =C2=A0 but with `.elc' and `.el' suffixes. =C2=A0In other wo= rds, if you have set
=C2=A0 =C2=A0 `gnus-init-file' to `~/.gnus', it will look for `~/.g= nus.elc',
=C2=A0 =C2=A0 `~/.gnus.el', and finally `~/.gnus' (in this order).<= br>
and it uses locate-library to do that.


--089e0149cc30be9bb104f92a5988--