aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1996-09-12 18:31:16 +0000
committerRichard M. Stallman1996-09-12 18:31:16 +0000
commitd4708676d2afbf84114f0572997e593cf545b11b (patch)
tree25cc0e1a6d5556648af554322ef50e5f5a05d20b
parenta1faca26314b34b592f391baa5bc4d014bc1ef2c (diff)
downloademacs-d4708676d2afbf84114f0572997e593cf545b11b.tar.gz
emacs-d4708676d2afbf84114f0572997e593cf545b11b.zip
(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."
101 dependents 101 dependents
102 )) 102 ))
103 103
104(defun read-feature (prompt)
105 "Read a feature name \(string\) from the minibuffer,
106prompting with PROMPT and completing from `features', and
107return 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.
107If the feature is required by any other loaded code, and optional FORCE 117If the feature is required by any other loaded code, and optional FORCE
108is nil, raise an error." 118is 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)