unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Alex Kosorukoff <alex@3form.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 17467 <17467@debbugs.gnu.org>
Subject: bug#17467: 24.3; locate-library returning spurious path
Date: Sun, 11 May 2014 17:41:48 -0700	[thread overview]
Message-ID: <CAHD9_tQjJi5fWHYnOR1yfdvqzonbn27BpC+AE+BVM+NDathVvQ@mail.gmail.com> (raw)
In-Reply-To: <jwveh003p2x.fsf-monnier+emacsbugs@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 1559 bytes --]

On Sun, May 11, 2014 at 3:55 PM, Stefan Monnier <monnier@iro.umontreal.ca>wrote:

> > Yes, this makes sense. Here is a patch that the issues you mentioned.
>
> I'm still not sure which situations you want to exclude, so it's hard to
> judge whether your patch does do it...


I exclude anything that is not ending with .el, .elc, .el.gz, or .elc.gz,
for example, my patch won't return any files that have no extension and
will not return files that have only .gz that is not preceded by el or elc.
Otherwise, the latest patch works the same way as the original
locate-library

> +         (locate-file library
> > +                      (or path load-path)
> > +                      (unless (or nosuffix (string-suffix-p ".el.gz"
> library))
>
> ...but special casing ".el.gz" is definitely not a good idea.  Why would
> it need special treatment?
> It's extremely rare for `library' to end in ".el.gz" here.
>

This is because if a user specified .el.gz already, we shouldn't try to
extend it by appending extra suffixes, e.g. looking for .el.gz.el,
el.gz.elc or .el.gz.gz, none of those suffixes can't possibly result in
valid library names. If a user specified only .el or .elc, then we still
can have two options for suffixes ("", ".gz"). If none of the known
suffixes were specified, we have four options produced by
 (get-load-suffixes). BTW, this was not the last patch, it won't apply to
older emacs versions and also not handling .elc.gz (which should not be
extended just like .el.gz). My last patch is using string-match.


>
>
>         Stefan
>

[-- Attachment #2: Type: text/html, Size: 2625 bytes --]

  reply	other threads:[~2014-05-12  0:41 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-11 16:06 bug#17467: 24.3; locate-library returning spurious path Alex Kosorukoff
2014-05-11 17:03 ` Eli Zaretskii
2014-05-11 17:38   ` Alex Kosorukoff
2014-05-11 17:46     ` Eli Zaretskii
2014-05-11 17:53       ` Alex Kosorukoff
2014-05-11 18:10         ` Eli Zaretskii
2014-05-11 18:55           ` Alex Kosorukoff
2014-05-11 22:55             ` Stefan Monnier
2014-05-12  0:41               ` Alex Kosorukoff [this message]
2014-05-11 17:37 ` Glenn Morris
2014-05-11 17:43   ` Alex Kosorukoff
2014-05-11 19:50 ` Stefan Monnier
2014-05-11 20:45   ` Alex Kosorukoff
2014-05-11 21:00     ` Alex Kosorukoff
2014-05-11 21:19     ` Glenn Morris
2014-05-11 22:31       ` Alex Kosorukoff
2014-05-11 21:56     ` Stefan Monnier
2014-05-12  0:20       ` Alex Kosorukoff
2014-05-12  0:32         ` Glenn Morris
2014-05-12  1:35           ` Alex Kosorukoff
2014-05-12  2:02             ` Alex Kosorukoff
2014-05-12  2:18         ` Stefan Monnier
2014-05-12  4:36           ` Alex Kosorukoff
2014-05-12  6:39             ` Stefan Monnier
2014-05-12 17:46               ` Alex Kosorukoff
2020-08-25 10:39           ` Lars Ingebrigtsen
2020-08-25 14:22             ` Stefan Monnier
2020-08-25 14:25               ` Lars Ingebrigtsen
2020-10-13  1:41             ` Lars Ingebrigtsen
2014-05-15 19:39 ` Stefan Monnier
2014-05-15 23:57   ` Alex Kosorukoff

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAHD9_tQjJi5fWHYnOR1yfdvqzonbn27BpC+AE+BVM+NDathVvQ@mail.gmail.com \
    --to=alex@3form.com \
    --cc=17467@debbugs.gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).