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
commitc5338026d814e984fa3f110b4d1d9d1f1c6ec154 (patch)
tree3ae29d71bed70559294b5a1ce5900c1bf093d131 /lisp/loadhist.el
parente3f7fc2e7802edfdc07a1b93b56f7919291c20bf (diff)
downloademacs-c5338026d814e984fa3f110b4d1d9d1f1c6ec154.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)