diff options
author | Richard M. Stallman <rms@gnu.org> | 2007-02-11 11:11:09 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 2007-02-11 11:11:09 +0000 |
commit | 531309ebc83fbf64708a8a179b530dbea39d9ab9 (patch) | |
tree | 0fe77debbbf05bfeb6819a5232723c5a13717795 /lisp/loadhist.el | |
parent | ecf4f6dec2409e2ec2f709ecda14a3e6baa26aab (diff) | |
download | emacs-531309ebc83fbf64708a8a179b530dbea39d9ab9.tar.gz |
(unload-feature): Handle (t . SYMBOL) entries in load history.
Diffstat (limited to 'lisp/loadhist.el')
-rw-r--r-- | lisp/loadhist.el | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/lisp/loadhist.el b/lisp/loadhist.el index 8ca1de4aeca..39d51a280f5 100644 --- a/lisp/loadhist.el +++ b/lisp/loadhist.el @@ -173,6 +173,9 @@ such as redefining an Emacs function." (prin1-to-string dependents) file)))) (let* ((unload-hook-features-list (feature-symbols feature)) (file (pop unload-hook-features-list)) + ;; If non-nil, this is a symbol for which we should + ;; restore a previous autoload if possible. + restore-autoload (unload-hook (intern-soft (concat (symbol-name feature) "-unload-hook")))) ;; Try to avoid losing badly when hooks installed in critical @@ -209,6 +212,7 @@ such as redefining an Emacs function." (dolist (elt unload-hook-features-list) (when (symbolp elt) (elp-restore-function elt)))) + (dolist (x unload-hook-features-list) (if (consp x) (case (car x) @@ -221,10 +225,14 @@ such as redefining an Emacs function." (when (fboundp 'ad-unadvise) (ad-unadvise fun)) (let ((aload (get fun 'autoload))) - (if aload + (if (and aload (eq fun restore-autoload)) (fset fun (cons 'autoload aload)) (fmakunbound fun)))))) - ((t require defface) nil) + ;; (t . SYMBOL) comes before (defun . SYMBOL) + ;; and says we should restore SYMBOL's autoload + ;; when we undefine it. + ((t) (setq restore-autoload (cdr x))) + ((require defface) nil) (t (message "Unexpected element %s in load-history" x))) ;; Kill local values as much as possible. (dolist (buf (buffer-list)) |