From: Romain Francoise Date: Tue, 25 Oct 2005 19:25:23 +0000 (+0000) Subject: (find-library-name): Also strip extension if library name ends in .el, X-Git-Tag: emacs-pretest-22.0.90~6288 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=53aaf457fe5bf2d432b20b136e5c5eef6365dc68;p=emacs.git (find-library-name): Also strip extension if library name ends in .el, to take advantage of `find-library-suffixes'. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index a904cee7943..71c8ee24b6d 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2005-10-25 Romain Francoise + + * 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 * menu-bar.el (menu-bar-help-menu): Say which kind of therapist. diff --git a/lisp/emacs-lisp/find-func.el b/lisp/emacs-lisp/find-func.el index 0cebeeb6f7f..2f394c2c470 100644 --- a/lisp/emacs-lisp/find-func.el +++ b/lisp/emacs-lisp/find-func.el @@ -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)