diff options
| author | Richard M. Stallman | 1996-09-12 18:31:16 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1996-09-12 18:31:16 +0000 |
| commit | d4708676d2afbf84114f0572997e593cf545b11b (patch) | |
| tree | 25cc0e1a6d5556648af554322ef50e5f5a05d20b | |
| parent | a1faca26314b34b592f391baa5bc4d014bc1ef2c (diff) | |
| download | emacs-d4708676d2afbf84114f0572997e593cf545b11b.tar.gz emacs-d4708676d2afbf84114f0572997e593cf545b11b.zip | |
(read-feature): New function.
(unload-feature): Read FEATURE interactively with read-feature.
| -rw-r--r-- | lisp/loadhist.el | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/lisp/loadhist.el b/lisp/loadhist.el index 22387b4448a..726ae22e8da 100644 --- a/lisp/loadhist.el +++ b/lisp/loadhist.el | |||
| @@ -101,12 +101,22 @@ This can include FILE itself." | |||
| 101 | dependents | 101 | dependents |
| 102 | )) | 102 | )) |
| 103 | 103 | ||
| 104 | (defun read-feature (prompt) | ||
| 105 | "Read a feature name \(string\) from the minibuffer, | ||
| 106 | prompting with PROMPT and completing from `features', and | ||
| 107 | return the feature \(symbol\)." | ||
| 108 | (intern (completing-read prompt | ||
| 109 | (mapcar (function (lambda (feature) | ||
| 110 | (list (symbol-name feature)))) | ||
| 111 | features) | ||
| 112 | nil t))) | ||
| 113 | |||
| 104 | ;;;###autoload | 114 | ;;;###autoload |
| 105 | (defun unload-feature (feature &optional force) | 115 | (defun unload-feature (feature &optional force) |
| 106 | "Unload the library that provided FEATURE, restoring all its autoloads. | 116 | "Unload the library that provided FEATURE, restoring all its autoloads. |
| 107 | If the feature is required by any other loaded code, and optional FORCE | 117 | If the feature is required by any other loaded code, and optional FORCE |
| 108 | is nil, raise an error." | 118 | is nil, raise an error." |
| 109 | (interactive "SFeature: ") | 119 | (interactive (list (read-feature "Feature: "))) |
| 110 | (if (not (featurep feature)) | 120 | (if (not (featurep feature)) |
| 111 | (error "%s is not a currently loaded feature" (symbol-name feature))) | 121 | (error "%s is not a currently loaded feature" (symbol-name feature))) |
| 112 | (if (not force) | 122 | (if (not force) |