Subject: Re: bug#17467: 24.3; locate-library returning spurious path

From: Stefan Monnier <[email-masked]>
Date: Mon, 12 May 2014 02:39:04 -0400

> variant matched tramp.el.old which is not a valid library name.

Who cares?  The point is that if the user asks to load foo.el.old, we
should consider load-file-rep-suffixes, whereas for "foo" we shouldn't.
I'm not particularly worried about finding files with name "foo.el.old.el".

> +          (unless nosuffix
> +            (if (string-match "\\.elc?\\(\\.gz\\)?\\'" library)

I don't want to hardcode "gz" here.  We have load-file-rep-suffixes for that.

> +                (if (= 2 (length (match-data))) load-file-rep-suffixes)
> +              (get-load-suffixes))))))

If you only use (get-load-suffixes) that will fail when we (load "~/.gnus").
My check for absolute-file-name-p was not an optimization.

        Stefan