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 10:38:39 -0700 Message-ID: References: <8361lcuu1f.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a11c339e650e56704f9234e2e X-Trace: ger.gmane.org 1399830023 8109 80.91.229.3 (11 May 2014 17:40:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 11 May 2014 17:40:23 +0000 (UTC) Cc: 17467@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun May 11 19:40: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 1WjXjT-00027z-Hf for geb-bug-gnu-emacs@m.gmane.org; Sun, 11 May 2014 19:40:15 +0200 Original-Received: from localhost ([::1]:33815 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WjXjT-0002jq-6b for geb-bug-gnu-emacs@m.gmane.org; Sun, 11 May 2014 13:40:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50913) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WjXjL-0002hc-Fn for bug-gnu-emacs@gnu.org; Sun, 11 May 2014 13:40:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WjXjH-00046I-1m for bug-gnu-emacs@gnu.org; Sun, 11 May 2014 13:40:07 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:42150) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WjXjG-000467-VH for bug-gnu-emacs@gnu.org; Sun, 11 May 2014 13:40:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1WjXjF-0001js-TO for bug-gnu-emacs@gnu.org; Sun, 11 May 2014 13:40: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: Sun, 11 May 2014 17:40:01 +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.13998299486597 (code B ref 17467); Sun, 11 May 2014 17:40:01 +0000 Original-Received: (at 17467) by debbugs.gnu.org; 11 May 2014 17:39:08 +0000 Original-Received: from localhost ([127.0.0.1]:59499 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WjXiN-0001iK-DT for submit@debbugs.gnu.org; Sun, 11 May 2014 13:39:07 -0400 Original-Received: from mail-ob0-f178.google.com ([209.85.214.178]:45517) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WjXiL-0001hn-KN for 17467@debbugs.gnu.org; Sun, 11 May 2014 13:39:06 -0400 Original-Received: by mail-ob0-f178.google.com with SMTP id va2so7170475obc.9 for <17467@debbugs.gnu.org>; Sun, 11 May 2014 10:39:00 -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=qwctl9hFBsC+JUYkjvUTYsXHLmIO83HqNUdoinRkNmQ=; b=tkTx5BQIldFh1BsCmmp8H7kJc9WI1596z37ZrxS2doTW99J4iW401PeZ7fMgGp/J77 vO/0Q2AFLLIz0MjQdFRaLh+zy82ERysJPgZcNVHweJOIcOaeI761XRysrBUeNkOSCxCS TgwTw0A+CcnGbKwmxzIfdXoOIkAe0FsT8keHK3LiyHrQ4GBRSbylyP1GNg8McnW+wbu/ NbCxI+x9zIGAwPVQFblhrd+3pqHXQFQPjhp0BFkVAWW9dvjQ8LQYHNnbpWSiIW1++XJL F1GhfYu6rYMlPVo/RzQMYYy2MuIWPSlu5QYI3UYymZb6yuzN6MSMNnLDsgq1nXvzhh1E PpCA== X-Received: by 10.182.18.102 with SMTP id v6mr2972791obd.71.1399829939936; Sun, 11 May 2014 10:38:59 -0700 (PDT) Original-Received: by 10.182.240.131 with HTTP; Sun, 11 May 2014 10:38:39 -0700 (PDT) In-Reply-To: <8361lcuu1f.fsf@gnu.org> X-Google-Sender-Auth: PPn_ZA2n7OE5J7rRVqqq6LS6xq0 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:88907 Archived-At: --001a11c339e650e56704f9234e2e Content-Type: text/plain; charset=UTF-8 I think locate-library has an extra parameter nosuffix, so (locate-library "tramp.el" 'nosuffix) will find "tramp.el." I guess for backward compatibility we can set nosuffix to t whenever the name has a valid suffix already. On Sun, May 11, 2014 at 10:03 AM, Eli Zaretskii wrote: > > From: Alex Kosorukoff > > Date: Sun, 11 May 2014 09:06:10 -0700 > > > > locate-library incorrectly generates a set of suffixes to extend the > > base library name (".elc" ".elc.gz" ".el" ".el.gz" "" ".gz"), while it > > should be just (".elc" ".elc.gz" ".el" ".el.gz") when nosuffix is > > nil. This leads to spurious paths found, like name.gz. I found > > this issue because (locate-library "tramp") was returning > > "/home/alex/.emacs.d/trump" not "../lisp/net/trum.elc". The workaround > > is (locate-file "tramp" load-path (get-load-suffixes)) > > What if I say > > (locate-library "tramp.el") > > Shouldn't it be able to find tramp.el.gz then? > --001a11c339e650e56704f9234e2e Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
I think locate-library has an extra parameter nosuffix, so= (locate-library "tramp.el" 'nosuffix) will find "tramp.= el." I guess for backward compatibility we can set nosuffix to t whene= ver the name has a valid suffix already.


On Sun, May 1= 1, 2014 at 10:03 AM, Eli Zaretskii <eliz@gnu.org> wrote:
> From: Alex Kosorukoff <alex@3form= .com>
> Date: Sun, 11 May 2014 09:06:10 -0700
>
> locate-library incorrectly generates a set of suffixes to extend the > base library name (".elc" ".elc.gz" ".el"= ; ".el.gz" "" ".gz"), while it
> should be just (".elc" ".elc.gz" ".el" &= quot;.el.gz") when nosuffix is
> nil. This leads to spurious paths found, like name.gz. I found
> this issue because (locate-library "tramp") was returning > "/home/alex/.emacs.d/trump" not "../lisp/net/trum.elc&q= uot;. The workaround
> is (locate-file "tramp" load-path (get-load-suffixes))

What if I say

=C2=A0 (locate-library "tramp.el")

Shouldn't it be able to find tramp.el.gz then?

--001a11c339e650e56704f9234e2e--