diff options
| author | Richard M. Stallman | 1995-08-02 18:34:19 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1995-08-02 18:34:19 +0000 |
| commit | a5c31fa1f037f82b7a914c33e0fe77f31a7ddd26 (patch) | |
| tree | 874bfee57b28ef851df145db0c078d70445b2ba6 | |
| parent | 91ea2a7a547218570395ab13d7c59217d5810cb9 (diff) | |
| download | emacs-a5c31fa1f037f82b7a914c33e0fe77f31a7ddd26.tar.gz emacs-a5c31fa1f037f82b7a914c33e0fe77f31a7ddd26.zip | |
(unload-feature): Delete the file's load-history element.
(file-set-intersect): Renamed from set-intersect.
(file-dependents): Use new name.
| -rw-r--r-- | lisp/loadhist.el | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/lisp/loadhist.el b/lisp/loadhist.el index 2a62ab51b0d..6b473bb8f0f 100644 --- a/lisp/loadhist.el +++ b/lisp/loadhist.el | |||
| @@ -53,7 +53,7 @@ Actually, return the load argument, if any; this is sometimes the name of a | |||
| 53 | Lisp file without an extension. If the feature came from an eval-buffer on | 53 | Lisp file without an extension. If the feature came from an eval-buffer on |
| 54 | a buffer with no associated file, or an eval-region, return nil." | 54 | a buffer with no associated file, or an eval-region, return nil." |
| 55 | (if (not (featurep feature)) | 55 | (if (not (featurep feature)) |
| 56 | (error "%s is not a currently loaded feature." (symbol-name feature)) | 56 | (error "%s is not a currently loaded feature" (symbol-name feature)) |
| 57 | (car (feature-symbols feature)))) | 57 | (car (feature-symbols feature)))) |
| 58 | 58 | ||
| 59 | (defun file-provides (file) | 59 | (defun file-provides (file) |
| @@ -78,7 +78,7 @@ a buffer with no associated file, or an eval-region, return nil." | |||
| 78 | requires | 78 | requires |
| 79 | )) | 79 | )) |
| 80 | 80 | ||
| 81 | (defun set-intersect (p q) | 81 | (defun file-set-intersect (p q) |
| 82 | ;; Return the set intersection of two lists | 82 | ;; Return the set intersection of two lists |
| 83 | (let ((ret nil)) | 83 | (let ((ret nil)) |
| 84 | (mapcar | 84 | (mapcar |
| @@ -93,7 +93,7 @@ This can include FILE itself." | |||
| 93 | (let ((provides (file-provides file)) (dependents nil)) | 93 | (let ((provides (file-provides file)) (dependents nil)) |
| 94 | (mapcar | 94 | (mapcar |
| 95 | (function (lambda (x) | 95 | (function (lambda (x) |
| 96 | (if (set-intersect provides (file-requires (car x))) | 96 | (if (file-set-intersect provides (file-requires (car x))) |
| 97 | (setq dependents (cons (car x) dependents))))) | 97 | (setq dependents (cons (car x) dependents))))) |
| 98 | load-history) | 98 | load-history) |
| 99 | dependents | 99 | dependents |
| @@ -106,12 +106,12 @@ If the feature is required by any other loaded code, and optional FORCE | |||
| 106 | is nil, raise an error." | 106 | is nil, raise an error." |
| 107 | (interactive "SFeature: ") | 107 | (interactive "SFeature: ") |
| 108 | (if (not (featurep feature)) | 108 | (if (not (featurep feature)) |
| 109 | (error "%s is not a currently loaded feature." (symbol-name feature))) | 109 | (error "%s is not a currently loaded feature" (symbol-name feature))) |
| 110 | (if (not force) | 110 | (if (not force) |
| 111 | (let* ((file (feature-file feature)) | 111 | (let* ((file (feature-file feature)) |
| 112 | (dependents (delete file (copy-sequence (file-dependents file))))) | 112 | (dependents (delete file (copy-sequence (file-dependents file))))) |
| 113 | (if dependents | 113 | (if dependents |
| 114 | (error "Loaded libraries %s depend on %s." | 114 | (error "Loaded libraries %s depend on %s" |
| 115 | (prin1-to-string dependents) file) | 115 | (prin1-to-string dependents) file) |
| 116 | ))) | 116 | ))) |
| 117 | (let* ((flist (feature-symbols feature)) (file (car flist))) | 117 | (let* ((flist (feature-symbols feature)) (file (car flist))) |
| @@ -126,9 +126,11 @@ is nil, raise an error." | |||
| 126 | ((fboundp x) | 126 | ((fboundp x) |
| 127 | (fmakunbound x) | 127 | (fmakunbound x) |
| 128 | (let ((aload (get x 'autoload))) | 128 | (let ((aload (get x 'autoload))) |
| 129 | (if aload (fset x (cons 'autoload aload))))))) | 129 | (if aload (fset x (cons 'autoload aload)))))))) |
| 130 | ) | 130 | (cdr flist)) |
| 131 | (cdr flist)))) | 131 | ;; Delete the load-history element for this file. |
| 132 | (let ((elt (assoc file load-history))) | ||
| 133 | (setq load-history (delq elt load-history))))) | ||
| 132 | 134 | ||
| 133 | (provide 'loadhist) | 135 | (provide 'loadhist) |
| 134 | 136 | ||