194 |
(dolist (elt (cdr unload-hook-features-list)) |
(dolist (elt (cdr unload-hook-features-list)) |
195 |
(if (symbolp elt) |
(if (symbolp elt) |
196 |
(elp-restore-function elt)))) |
(elp-restore-function elt)))) |
197 |
(mapc |
(dolist (x (cdr unload-hook-features-list)) |
198 |
(lambda (x) |
(when (consp x) |
199 |
(cond ((stringp x) nil) |
;; Remove any feature names that this file provided. |
200 |
((consp x) |
(if (eq (car x) 'provide) |
201 |
;; Remove any feature names that this file provided. |
(setq features (delq (cdr x) features))) |
202 |
(if (eq (car x) 'provide) |
(when (eq (car x) 'defvar) |
203 |
(setq features (delq (cdr x) features))) |
;; Kill local values as much as possible. |
204 |
(when (eq (car x) 'defvar) |
(dolist (buf (buffer-list)) |
205 |
;; Kill local values as much as possible. |
(with-current-buffer buf |
206 |
(dolist (buf (buffer-list)) |
(kill-local-variable (cdr x)))) |
207 |
(with-current-buffer buf |
;; Get rid of the default binding if we can. |
208 |
(kill-local-variable (cdr x)))) |
(unless (local-variable-if-set-p (cdr x)) |
209 |
;; Get rid of the default binding if we can. |
(makunbound (cdr x)))) |
210 |
(unless (local-variable-if-set-p (cdr x)) |
(when (eq (car x) 'defun) |
211 |
(makunbound (cdr x))))) |
(let ((fun (cdr x))) |
212 |
(t |
(when (fboundp fun) |
213 |
(when (fboundp x) |
(if (fboundp 'ad-unadvise) |
214 |
(if (fboundp 'ad-unadvise) |
(ad-unadvise fun)) |
215 |
(ad-unadvise x)) |
(fmakunbound fun) |
216 |
(fmakunbound x) |
(let ((aload (get fun 'autoload))) |
217 |
(let ((aload (get x 'autoload))) |
(if aload (fset fun (cons 'autoload aload))))))))) |
|
(if aload (fset x (cons 'autoload aload)))))))) |
|
|
(cdr unload-hook-features-list)) |
|
218 |
;; Delete the load-history element for this file. |
;; Delete the load-history element for this file. |
219 |
(let ((elt (assoc file load-history))) |
(let ((elt (assoc file load-history))) |
220 |
(setq load-history (delq elt load-history))))) |
(setq load-history (delq elt load-history))))) |