/[emacs]/emacs/lisp/loadhist.el
ViewVC logotype

Diff of /emacs/lisp/loadhist.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.29 by uid65627, Mon Feb 16 17:49:26 2004 UTC revision 1.30 by rms, Sun Jan 2 23:43:51 2005 UTC
# Line 51  a buffer with no associated file, or an Line 51  a buffer with no associated file, or an
51        (error "%S is not a currently loaded feature" feature)        (error "%S is not a currently loaded feature" feature)
52      (car (feature-symbols feature))))      (car (feature-symbols feature))))
53    
54    (defun file-loadhist-lookup (file)
55      "Return the `load-history' element for FILE."
56      ;; First look for FILE as given.
57      (let ((symbols (assoc file load-history)))
58        ;; Try converting a library name to an absolute file name.
59        (and (null symbols)
60             (let ((absname (find-library-name file)))
61               (if (not (equal absname file))
62                   (setq symbols (cdr (assoc absname load-history))))))
63        ;; Try converting an absolute file name to a library name.
64        (and (null symbols) (string-match "[.]el\\'" file)
65             (let ((libname (file-name-nondirectory file)))
66               (string-match "[.]el\\'" libname)
67               (setq libname (substring libname 0 (match-beginning 0)))
68               (setq symbols (cdr (assoc libname load-history)))))
69        symbols))
70    
71  (defun file-provides (file)  (defun file-provides (file)
72    "Return the list of features provided by FILE."    "Return the list of features provided by FILE."
73    (let ((symbols (cdr (assoc file load-history)))    (let ((symbols (file-loadhist-lookup file))
74          provides)          provides)
75      (mapc (lambda (x)      (mapc (lambda (x)
76              (if (and (consp x) (eq (car x) 'provide))              (if (and (consp x) (eq (car x) 'provide))
# Line 63  a buffer with no associated file, or an Line 80  a buffer with no associated file, or an
80    
81  (defun file-requires (file)  (defun file-requires (file)
82    "Return the list of features required by FILE."    "Return the list of features required by FILE."
83    (let ((symbols (cdr (assoc file load-history)))    (let ((symbols (file-loadhist-lookup file))
84          requires)          requires)
85      (mapc (lambda (x)      (mapc (lambda (x)
86              (if (and (consp x) (eq (car x) 'require))              (if (and (consp x) (eq (car x) 'require))

Legend:
Removed from v.1.29  
changed lines
  Added in v.1.30

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26