]> git.eshelyaron.com Git - emacs.git/commitdiff
(find-library-name): Also strip extension if library name ends in .el,
authorRomain Francoise <romain@orebokech.com>
Tue, 25 Oct 2005 19:25:23 +0000 (19:25 +0000)
committerRomain Francoise <romain@orebokech.com>
Tue, 25 Oct 2005 19:25:23 +0000 (19:25 +0000)
to take advantage of `find-library-suffixes'.

lisp/ChangeLog
lisp/emacs-lisp/find-func.el

index a904cee7943bdabf1ac29998095b110a7b28c166..71c8ee24b6db65a7aecce29e27c7d37fb8be47a9 100644 (file)
@@ -1,3 +1,9 @@
+2005-10-25  Romain Francoise  <romain@orebokech.com>
+
+       * emacs-lisp/find-func.el (find-library-name): Also strip
+       extension if library name ends in .el, to take advantage of
+       `find-library-suffixes'.
+
 2005-10-25  Richard M. Stallman  <rms@gnu.org>
 
        * menu-bar.el (menu-bar-help-menu): Say which kind of therapist.
index 0cebeeb6f7fdef9410803332a6ac0cde94098497..2f394c2c470579d3517ad4c51409c96aa8ee90b9 100644 (file)
@@ -142,9 +142,9 @@ See the functions `find-function' and `find-variable'."
 
 (defun find-library-name (library)
   "Return the absolute file name of the Lisp 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)
+  ;; Strip off the extension to take advantage of library suffixes in
+  ;; the call to `locate-file'.
+  (if (string-match "\\.el\\(c\\(\\..*\\)?\\)?\\'" library)
       (setq library (replace-match "" t t library)))
   (or (locate-file library
                   (or find-function-source-path load-path)