]> code.delx.au - gnu-emacs/blobdiff - lisp/loadhist.el
*** empty log message ***
[gnu-emacs] / lisp / loadhist.el
index 00597615c2d39c954f2da69713e01ddb3eb11ee8..e609596e4a8e0c4502aa970548cdfa783a28c351 100644 (file)
@@ -167,8 +167,14 @@ is nil, raise an error."
               ;; Remove any feature names that this file provided.
               (if (eq (car x) 'provide)
                   (setq features (delq (cdr x) features)))
-              (if (eq (car x) 'defvar)
-                 (makunbound (cdr x))))
+              (when (eq (car x) 'defvar)
+               ;; Kill local values as much as possible.
+               (dolist (buf (buffer-list))
+                 (with-current-buffer buf
+                   (kill-local-variable (cdr x))))
+               ;; Get rid of the default binding if we can.
+               (unless (local-variable-if-set-p (cdr x))
+                 (makunbound (cdr x)))))
             (t
              (when (fboundp x)
                (if (fboundp 'ad-unadvise)