comparison lisp/emacs-lisp/find-func.el @ 69169:10a4ff23378e

(find-library-suffixes): Use `get-load-suffixes' instead of `load-suffixes'. (find-library-name): Use `load-file-rep-suffixes' instead of '("").
author Luc Teirlinck <teirllm@auburn.edu>
date Mon, 27 Feb 2006 02:03:00 +0000
parents 067115a6e738
children 62a4fbb2cb81 5754737d1e04
comparison
equal deleted inserted replaced
69168:6e701396a0ec 69169:10a4ff23378e
140 140
141 ;;; Functions: 141 ;;; Functions:
142 142
143 (defun find-library-suffixes () 143 (defun find-library-suffixes ()
144 (let ((suffixes nil)) 144 (let ((suffixes nil))
145 (dolist (suffix load-suffixes (nreverse suffixes)) 145 (dolist (suffix (get-load-suffixes) (nreverse suffixes))
146 (unless (string-match "elc" suffix) (push suffix suffixes))))) 146 (unless (string-match "elc" suffix) (push suffix suffixes)))))
147 147
148 (defun find-library-name (library) 148 (defun find-library-name (library)
149 "Return the absolute file name of the Lisp source of LIBRARY." 149 "Return the absolute file name of the Lisp source of LIBRARY."
150 ;; Strip off the extension to take advantage of library suffixes in 150 ;; Strip off the extension to take advantage of library suffixes in
151 ;; the call to `locate-file'. 151 ;; the call to `locate-file'.
152 (if (string-match "\\.el\\(c\\(\\..*\\)?\\)?\\'" library) 152 (if (string-match "\\.el\\(c\\(\\..*\\)?\\)?\\'" library)
153 (setq library (replace-match "" t t library))) 153 (setq library (replace-match "" t t library)))
154 (or (locate-file library 154 (or (locate-file library
155 (or find-function-source-path load-path) 155 (or find-function-source-path load-path)
156 (append (find-library-suffixes) '(""))) 156 (append (find-library-suffixes) load-file-rep-suffixes))
157 (error "Can't find library %s" library))) 157 (error "Can't find library %s" library)))
158 158
159 (defvar find-function-C-source-directory 159 (defvar find-function-C-source-directory
160 (let ((dir (expand-file-name "src" source-directory))) 160 (let ((dir (expand-file-name "src" source-directory)))
161 (when (and (file-directory-p dir) (file-readable-p dir)) 161 (when (and (file-directory-p dir) (file-readable-p dir))