(find-library-name): Correctly find "f.el.gz" from "f.elc" or "f.elc.gz".

This commit is contained in:
Stefan Monnier 2002-09-25 18:58:37 +00:00
parent f2d2436d43
commit 1a40d81d1a

View file

@ -121,8 +121,8 @@ See the functions `find-function' and `find-variable'."
"Return the full name of the elisp source of LIBRARY."
;; If the library is byte-compiled, try to find a source library by
;; the same name.
(if (string-match "\\.el\\(c\\(\\..*\\)\\)\\'" library)
(setq library (replace-match "" t t library 1)))
(if (string-match "\\.el\\(c\\(\\..*\\)?\\)\\'" library)
(setq library (replace-match "" t t library)))
(or (locate-file library
(or find-function-source-path load-path)
(append (find-library-suffixes) '("")))