# HG changeset patch
# User Richard M. Stallman <rms@gnu.org>
# Date 842553076 0
# Node ID 9ba176963a26783d84918f8bd1e24f07c70ef742
# Parent  b7131e99a79652564895198031439a69ae269e0c
(read-feature): New function.
(unload-feature): Read FEATURE interactively with read-feature.

diff -r b7131e99a796 -r 9ba176963a26 lisp/loadhist.el
--- a/lisp/loadhist.el	Thu Sep 12 17:29:17 1996 +0000
+++ b/lisp/loadhist.el	Thu Sep 12 18:31:16 1996 +0000
@@ -101,12 +101,22 @@
     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)