aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman2005-10-21 17:19:10 +0000
committerRichard M. Stallman2005-10-21 17:19:10 +0000
commit1c11da91f818e6d54ed2bd7d4a24c020e60d91f0 (patch)
tree7f08b67f1c0409c2fbe99a6c6ca2b92d1fd077c7
parent0fc213e97e73856593019fafdaebdf6c121e6e44 (diff)
downloademacs-1c11da91f818e6d54ed2bd7d4a24c020e60d91f0.tar.gz
emacs-1c11da91f818e6d54ed2bd7d4a24c020e60d91f0.zip
(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.
-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."
53 (car (feature-symbols feature)))) 53 (car (feature-symbols feature))))
54 54
55(defun file-loadhist-lookup (file) 55(defun file-loadhist-lookup (file)
56 "Return the `load-history' element for FILE." 56 "Return the `load-history' element for FILE.
57FILE can be a file name, or a library name.
58A library name is equivalent to the file name that `load-library' would load."
57 ;; First look for FILE as given. 59 ;; First look for FILE as given.
58 (let ((symbols (assoc file load-history))) 60 (let ((symbols (assoc file load-history)))
59 ;; Try converting a library name to an absolute file name. 61 ;; Try converting a library name to an absolute file name.
60 (and (null symbols) 62 (and (null symbols)
61 (let ((absname (find-library-name file))) 63 (let ((absname
62 (if (not (equal absname file)) 64 (locate-file file load-path load-suffixes)))
63 (setq symbols (cdr (assoc absname load-history)))))) 65 (and absname (not (equal absname file))
64 ;; Try converting an absolute file name to a library name. 66 (setq symbols (cdr (assoc absname load-history))))))
65 (and (null symbols) (string-match "[.]el\\'" file)
66 (let ((libname (file-name-nondirectory file)))
67 (string-match "[.]el\\'" libname)
68 (setq libname (substring libname 0 (match-beginning 0)))
69 (setq symbols (cdr (assoc libname load-history)))))
70 symbols)) 67 symbols))
71 68
72(defun file-provides (file) 69(defun file-provides (file)
73 "Return the list of features provided by FILE." 70 "Return the list of features provided by FILE as it was loaded.
71FILE can be a file name, or a library name.
72A library name is equivalent to the file name that `load-library' would load."
74 (let ((symbols (file-loadhist-lookup file)) 73 (let ((symbols (file-loadhist-lookup file))
75 provides) 74 provides)
76 (mapc (lambda (x) 75 (mapc (lambda (x)
@@ -80,7 +79,9 @@ a buffer with no associated file, or an `eval-region', return nil."
80 provides)) 79 provides))
81 80
82(defun file-requires (file) 81(defun file-requires (file)
83 "Return the list of features required by FILE." 82 "Return the list of features required by FILE as it was loaded.
83FILE can be a file name, or a library name.
84A library name is equivalent to the file name that `load-library' would load."
84 (let ((symbols (file-loadhist-lookup file)) 85 (let ((symbols (file-loadhist-lookup file))
85 requires) 86 requires)
86 (mapc (lambda (x) 87 (mapc (lambda (x)
@@ -98,7 +99,9 @@ a buffer with no associated file, or an `eval-region', return nil."
98 99
99(defun file-dependents (file) 100(defun file-dependents (file)
100 "Return the list of loaded libraries that depend on FILE. 101 "Return the list of loaded libraries that depend on FILE.
101This can include FILE itself." 102This can include FILE itself.
103FILE can be a file name, or a library name.
104A library name is equivalent to the file name that `load-library' would load."
102 (let ((provides (file-provides file)) 105 (let ((provides (file-provides file))
103 (dependents nil)) 106 (dependents nil))
104 (dolist (x load-history dependents) 107 (dolist (x load-history dependents)