From e01ac82c3ea516c9212744de441ff769c96a3dcf Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Fri, 20 Jan 1995 23:13:51 +0000 Subject: [PATCH] (unload-feature): Don't care if FILE is a dependency of itself. --- lisp/loadhist.el | 6 ++++-- 1 file 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)