summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1996-09-12 18:31:16 +0000
committerRichard M. Stallman <rms@gnu.org>1996-09-12 18:31:16 +0000
commit3cf6e0e35bb95efab988fee0e0f3e4828ff31e59 (patch)
treef670ee569d879b2dee2f0fcfda6309628cd21ff9
parent983cac0b57f374afa6318261bc0338136bb48cac (diff)
downloademacs-3cf6e0e35bb95efab988fee0e0f3e4828ff31e59.tar.gz
(read-feature): New function.
(unload-feature): Read FEATURE interactively with read-feature.
-rw-r--r--lisp/loadhist.el12
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."
dependents
))
+(defun read-feature (prompt)
+ "Read a feature name \(string\) from the minibuffer,
+prompting with PROMPT and completing from `features', and
+return the feature \(symbol\)."
+ (intern (completing-read prompt
+ (mapcar (function (lambda (feature)
+ (list (symbol-name feature))))
+ features)
+ nil t)))
+
;;;###autoload
(defun unload-feature (feature &optional force)
"Unload the library that provided FEATURE, restoring all its autoloads.
If the feature is required by any other loaded code, and optional FORCE
is nil, raise an error."
- (interactive "SFeature: ")
+ (interactive (list (read-feature "Feature: ")))
(if (not (featurep feature))
(error "%s is not a currently loaded feature" (symbol-name feature)))
(if (not force)