aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman2002-09-29 03:34:12 +0000
committerRichard M. Stallman2002-09-29 03:34:12 +0000
commit3147ee6dbce06908d914c41cee3d79b086062c0d (patch)
treedafe4efcf9dca890eb84286ba10ea69036ea8eff
parentebaa33494bec61deaf0d935745fff13cee38d473 (diff)
downloademacs-3147ee6dbce06908d914c41cee3d79b086062c0d.tar.gz
emacs-3147ee6dbce06908d914c41cee3d79b086062c0d.zip
(unload-feature): When undefining a variable, delete its buffer-local bindings.
-rw-r--r--lisp/loadhist.el10
1 files changed, 8 insertions, 2 deletions
diff --git a/lisp/loadhist.el b/lisp/loadhist.el
index 00597615c2d..e609596e4a8 100644
--- a/lisp/loadhist.el
+++ b/lisp/loadhist.el
@@ -167,8 +167,14 @@ is nil, raise an error."
167 ;; Remove any feature names that this file provided. 167 ;; Remove any feature names that this file provided.
168 (if (eq (car x) 'provide) 168 (if (eq (car x) 'provide)
169 (setq features (delq (cdr x) features))) 169 (setq features (delq (cdr x) features)))
170 (if (eq (car x) 'defvar) 170 (when (eq (car x) 'defvar)
171 (makunbound (cdr x)))) 171 ;; Kill local values as much as possible.
172 (dolist (buf (buffer-list))
173 (with-current-buffer buf
174 (kill-local-variable (cdr x))))
175 ;; Get rid of the default binding if we can.
176 (unless (local-variable-if-set-p (cdr x))
177 (makunbound (cdr x)))))
172 (t 178 (t
173 (when (fboundp x) 179 (when (fboundp x)
174 (if (fboundp 'ad-unadvise) 180 (if (fboundp 'ad-unadvise)