mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-06-14 12:31:25 +00:00
(read-feature): New function.
(unload-feature): Read FEATURE interactively with read-feature.
This commit is contained in:
parent
a1faca2631
commit
d4708676d2
1 changed files with 11 additions and 1 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue