diff lisp/loadhist.el @ 442:abe6d1db359e r21-2-36

Import from CVS: tag r21-2-36
author cvs
date Mon, 13 Aug 2007 11:35:02 +0200
parents 3ecd8885ac67
children 25e260cb7994
line wrap: on
line diff
--- a/lisp/loadhist.el	Mon Aug 13 11:33:40 2007 +0200
+++ b/lisp/loadhist.el	Mon Aug 13 11:35:02 2007 +0200
@@ -123,7 +123,11 @@
       (when dependents
 	(error "Loaded libraries %s depend on %s"
 	       (prin1-to-string dependents) file))))
-  (let* ((flist (feature-symbols feature)) (file (car flist)))
+  (let* ((flist (feature-symbols feature))
+	 (file (car flist)))
+    (flet ((reset-aload (x)
+	     (let ((aload (get x 'autoload)))
+	       (if aload (fset x (cons 'autoload aload))))))
     (mapcar
      #'(lambda (x)
 	 (cond ((stringp x) nil)
@@ -131,12 +135,17 @@
 		;; Remove any feature names that this file provided.
 		(if (eq (car x) 'provide)
 		    (setq features (delq (cdr x) features))))
-	       ((boundp x) (makunbound x))
+	       ((and (boundp x)
+		     (fboundp x))
+		(makunbound x)
+		(fmakunbound x)
+		(reset-aload x))
+	       ((boundp x)
+		(makunbound x))
 	       ((fboundp x)
 		(fmakunbound x)
-		(let ((aload (get x 'autoload)))
-		  (if aload (fset x (cons 'autoload aload)))))))
-     (cdr flist))
+		(reset-aload x))))
+     (cdr flist)))
     ;; Delete the load-history element for this file.
     (let ((elt (assoc file load-history)))
       (setq load-history (delq elt load-history)))))