emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/loadhist.el,v


From: Kim F. Storm
Subject: [Emacs-diffs] Changes to emacs/lisp/loadhist.el,v
Date: Fri, 06 Apr 2007 17:03:19 +0000

CVSROOT:        /cvsroot/emacs
Module name:    emacs
Changes by:     Kim F. Storm <kfstorm>  07/04/06 17:03:19

Index: loadhist.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/loadhist.el,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -b -r1.45 -r1.46
--- loadhist.el 11 Feb 2007 11:11:09 -0000      1.45
+++ loadhist.el 6 Apr 2007 17:03:19 -0000       1.46
@@ -111,17 +111,18 @@
          (setq dependents (cons (car x) dependents))))
     dependents))
 
-(defun read-feature (prompt)
-  "Read a feature name \(string\) from the minibuffer.
-Prompt with PROMPT and completing from `features', and
-return the feature \(symbol\)."
-  (intern (completing-read prompt
-                          (mapcar (lambda (feature)
-                                    (list (symbol-name feature)))
-                                  features)
-                          ;; Complete only features loaded from a file
-                          #'(lambda (f) (feature-file (intern (car f))))
-                          t)))
+(defun read-feature (prompt &optional loaded-p)
+  "Read feature name from the minibuffer, prompting with string PROMPT.
+If optional second arg LOADED-P is non-nil, the feature must be loaded
+from a file."
+  (intern
+   (completing-read prompt
+                   (cons nil features)
+                   (and loaded-p
+                        #'(lambda (f)
+                            (and f     ; ignore nil
+                                 (feature-file f))))
+                   loaded-p)))
 
 (defvaralias 'loadhist-hook-functions 'unload-feature-special-hooks)
 (defvar unload-feature-special-hooks
@@ -162,7 +163,9 @@
 variable `unload-hook-features-list' and could remove features from it
 in the event that the package has done something normally-ill-advised,
 such as redefining an Emacs function."
-  (interactive (list (read-feature "Feature: ") current-prefix-arg))
+  (interactive
+   (list
+    (read-feature "Unload feature: " t) current-prefix-arg))
   (unless (featurep feature)
     (error "%s is not a currently loaded feature" (symbol-name feature)))
   (unless force




reply via email to

[Prev in Thread] Current Thread [Next in Thread]