summaryrefslogtreecommitdiff
path: root/lisp/loadhist.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>2005-04-17 15:57:00 +0000
committerRichard M. Stallman <rms@gnu.org>2005-04-17 15:57:00 +0000
commit23ce2debd8e46dbb86cedde0f948f2e107ae5d1e (patch)
tree262f46c1c983b7ce0b9d00d293b2a95718451947 /lisp/loadhist.el
parent868e7865bfcf46d7f4be84f25c87e977ac79aacd (diff)
downloademacs-23ce2debd8e46dbb86cedde0f948f2e107ae5d1e.tar.gz
(unload-feature): Update for new format of load-history. Simplify the code.
Diffstat (limited to 'lisp/loadhist.el')
-rw-r--r--lisp/loadhist.el44
1 files changed, 21 insertions, 23 deletions
diff --git a/lisp/loadhist.el b/lisp/loadhist.el
index 76ef87ee845..473c8dc3bc8 100644
--- a/lisp/loadhist.el
+++ b/lisp/loadhist.el
@@ -194,29 +194,27 @@ such as redefining an Emacs function."
(dolist (elt (cdr unload-hook-features-list))
(if (symbolp elt)
(elp-restore-function elt))))
- (mapc
- (lambda (x)
- (cond ((stringp x) nil)
- ((consp x)
- ;; Remove any feature names that this file provided.
- (if (eq (car x) 'provide)
- (setq features (delq (cdr x) features)))
- (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)
- (ad-unadvise x))
- (fmakunbound x)
- (let ((aload (get x 'autoload)))
- (if aload (fset x (cons 'autoload aload))))))))
- (cdr unload-hook-features-list))
+ (dolist (x (cdr unload-hook-features-list))
+ (when (consp x)
+ ;; Remove any feature names that this file provided.
+ (if (eq (car x) 'provide)
+ (setq features (delq (cdr x) features)))
+ (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))))
+ (when (eq (car x) 'defun)
+ (let ((fun (cdr x)))
+ (when (fboundp fun)
+ (if (fboundp 'ad-unadvise)
+ (ad-unadvise fun))
+ (fmakunbound fun)
+ (let ((aload (get fun 'autoload)))
+ (if aload (fset fun (cons 'autoload aload)))))))))
;; Delete the load-history element for this file.
(let ((elt (assoc file load-history)))
(setq load-history (delq elt load-history)))))