# HG changeset patch # User Richard M. Stallman # Date 1033270452 0 # Node ID fadbf61035e12ca9652207e14d1936e18d03c5f4 # Parent cb548fe4bcdb0313c8dc4759b180111c1deb6f1e (unload-feature): When undefining a variable, delete its buffer-local bindings. diff -r cb548fe4bcdb -r fadbf61035e1 lisp/loadhist.el --- a/lisp/loadhist.el Sun Sep 29 03:31:15 2002 +0000 +++ b/lisp/loadhist.el Sun Sep 29 03:34:12 2002 +0000 @@ -167,8 +167,14 @@ ;; 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)