- (if (not (featurep feature))
- (error "%s is not a currently loaded feature" (symbol-name feature))
- (car (feature-symbols feature))))
+ (unless (featurep feature)
+ (error "%s is not a currently loaded feature" (symbol-name feature)))
+ (car (feature-symbols feature)))
+
+(defun file-symbols (file)
+ "Return the file and list of symbols associated with FILE.
+The file name in the returned list is the string used to load the file,
+and may not be the same string as FILE, but it will be equivalent."
+ (or (assoc file load-history)
+ (assoc (file-name-sans-extension file) load-history)
+ (assoc (concat file ".el") load-history)
+ (assoc (concat file ".elc") load-history)))