summaryrefslogtreecommitdiff
path: root/lisp/loadhist.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1995-01-20 23:13:51 +0000
committerRichard M. Stallman <rms@gnu.org>1995-01-20 23:13:51 +0000
commite01ac82c3ea516c9212744de441ff769c96a3dcf (patch)
treec158c53bee1fd686260e1f0d9e26dd5c6d3127f1 /lisp/loadhist.el
parent7112bf0f2a1ab3fc16f4234088247e3f56e2ac2b (diff)
downloademacs-e01ac82c3ea516c9212744de441ff769c96a3dcf.tar.gz
(unload-feature): Don't care if FILE is a dependency of itself.
Diffstat (limited to 'lisp/loadhist.el')
-rw-r--r--lisp/loadhist.el6
1 files changed, 4 insertions, 2 deletions
diff --git a/lisp/loadhist.el b/lisp/loadhist.el
index 23091d1f0f3..e2a598f8a2c 100644
--- a/lisp/loadhist.el
+++ b/lisp/loadhist.el
@@ -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)