From 53aaf457fe5bf2d432b20b136e5c5eef6365dc68 Mon Sep 17 00:00:00 2001 From: Romain Francoise Date: Tue, 25 Oct 2005 19:25:23 +0000 Subject: [PATCH] (find-library-name): Also strip extension if library name ends in .el, to take advantage of `find-library-suffixes'. --- lisp/ChangeLog | 6 ++++++ lisp/emacs-lisp/find-func.el | 6 +++--- 2 files changed, 9 insertions(+), 3 deletions(-) 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) -- 2.39.5