]> git.eshelyaron.com Git - emacs.git/commitdiff
(unload-feature): Don't care if FILE is a dependency of itself.
authorRichard M. Stallman <rms@gnu.org>
Fri, 20 Jan 1995 23:13:51 +0000 (23:13 +0000)
committerRichard M. Stallman <rms@gnu.org>
Fri, 20 Jan 1995 23:13:51 +0000 (23:13 +0000)
lisp/loadhist.el

index 23091d1f0f3b1820614acc110fd9ed54fc6f2e93..e2a598f8a2c6d0c6b9f1ed16c3c1fdeda5bae493 100644 (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)