GNU bug report logs -
#17467
24.3; locate-library returning spurious path
Previous Next
Reported by: Alex Kosorukoff <alex <at> 3form.com>
Date: Sun, 11 May 2014 16:51:02 UTC
Severity: minor
Tags: patch
Found in version 24.3
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
Message #59 received at 17467 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
On Sun, May 11, 2014 at 3:55 PM, Stefan Monnier <monnier <at> 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
>
[Message part 2 (text/html, inline)]
This bug report was last modified 4 years and 226 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.