summaryrefslogtreecommitdiff
path: root/lisp/loadhist.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>2005-10-21 17:19:10 +0000
committerRichard M. Stallman <rms@gnu.org>2005-10-21 17:19:10 +0000
commit1c11da91f818e6d54ed2bd7d4a24c020e60d91f0 (patch)
tree7f08b67f1c0409c2fbe99a6c6ca2b92d1fd077c7 /lisp/loadhist.el
parent0fc213e97e73856593019fafdaebdf6c121e6e44 (diff)
(file-loadhist-lookup): Call locate-library
instead of find-library-name. Don't try converting abs file names to library names, since load-history no longer has library names in it. (file-dependents, file-provides, file-requires): Doc fixes.
Diffstat (limited to 'lisp/loadhist.el')
-rw-r--r--lisp/loadhist.el29
1 files changed, 16 insertions, 13 deletions
diff --git a/lisp/loadhist.el b/lisp/loadhist.el
index 61c4192387d..f23715f3825 100644
--- a/lisp/loadhist.el
+++ b/lisp/loadhist.el
@@ -53,24 +53,23 @@ a buffer with no associated file, or an `eval-region', return nil."
(car (feature-symbols feature))))
(defun file-loadhist-lookup (file)
- "Return the `load-history' element for FILE."
+ "Return the `load-history' element for FILE.
+FILE can be a file name, or a library name.
+A library name is equivalent to the file name that `load-library' would load."
;; First look for FILE as given.
(let ((symbols (assoc file load-history)))
;; Try converting a library name to an absolute file name.
(and (null symbols)
- (let ((absname (find-library-name file)))
- (if (not (equal absname file))
- (setq symbols (cdr (assoc absname load-history))))))
- ;; Try converting an absolute file name to a library name.
- (and (null symbols) (string-match "[.]el\\'" file)
- (let ((libname (file-name-nondirectory file)))
- (string-match "[.]el\\'" libname)
- (setq libname (substring libname 0 (match-beginning 0)))
- (setq symbols (cdr (assoc libname load-history)))))
+ (let ((absname
+ (locate-file file load-path load-suffixes)))
+ (and absname (not (equal absname file))
+ (setq symbols (cdr (assoc absname load-history))))))
symbols))
(defun file-provides (file)
- "Return the list of features provided by FILE."
+ "Return the list of features provided by FILE as it was loaded.
+FILE can be a file name, or a library name.
+A library name is equivalent to the file name that `load-library' would load."
(let ((symbols (file-loadhist-lookup file))
provides)
(mapc (lambda (x)
@@ -80,7 +79,9 @@ a buffer with no associated file, or an `eval-region', return nil."
provides))
(defun file-requires (file)
- "Return the list of features required by FILE."
+ "Return the list of features required by FILE as it was loaded.
+FILE can be a file name, or a library name.
+A library name is equivalent to the file name that `load-library' would load."
(let ((symbols (file-loadhist-lookup file))
requires)
(mapc (lambda (x)
@@ -98,7 +99,9 @@ a buffer with no associated file, or an `eval-region', return nil."
(defun file-dependents (file)
"Return the list of loaded libraries that depend on FILE.
-This can include FILE itself."
+This can include FILE itself.
+FILE can be a file name, or a library name.
+A library name is equivalent to the file name that `load-library' would load."
(let ((provides (file-provides file))
(dependents nil))
(dolist (x load-history dependents)