1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-24 10:38:38 +00:00

(unload-feature): Don't care if FILE is a dependency of itself.

This commit is contained in:
Richard M. Stallman 1995-01-20 23:13:51 +00:00
parent 7112bf0f2a
commit e01ac82c3e

View File

@ -71,7 +71,8 @@ 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.
"Return the list of loaded libraries that depend on FILE.
This can include FILE itself."
(let ((provides (file-provides file)) (dependents nil))
(mapcar
(function (lambda (x)
@ -90,7 +91,8 @@ is nil, raise an error."
(if (not (featurep feature))
(error "%s is not a currently loaded feature." (symbol-name feature)))
(if (not force)
(let* ((file (feature-file feature)) (dependents (file-dependents file)))
(let* ((file (feature-file feature))
(dependents (delete file (copy-sequence (file-dependents file)))))
(if dependents
(error "Loaded libraries %s depend on %s."
(prin1-to-string dependents) file)