[Top][All Lists]

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

unload-feature of features not loaded from file

From: Juanma Barranquero
Subject: unload-feature of features not loaded from file
Date: Sun, 5 Nov 2006 00:43:30 +0100

There are features in `features' which are not loaded from a file:

 (remove-if #'(lambda (f) (feature-file f) features) =>
(make-network-process emacs)

But M-x unload-feature allows selecting them, and fails with an error
=> "wrong type argument: stringp, nil".

The simplest fix is adding a predicate to the call to
`completing-read' in `read-feature', filtering out these troublesome
features. A slightly more general fix would be adding an optional
PREDICATE argument to `read-feature', and passing an adequate
filtering predicate from `unload-feature'. However, I don't think
`read-feature' is much used outside of `unload-feature', so this
generalization seems unnecessary.

So, it is OK to install the following trivial fix?


Index: lisp/loadhist.el
RCS file: /cvsroot/emacs/emacs/lisp/loadhist.el,v
retrieving revision 1.40
diff -u -2 -r1.40 loadhist.el
--- lisp/loadhist.el    29 Jul 2006 15:05:50 -0000      1.40
+++ lisp/loadhist.el    4 Nov 2006 23:32:00 -0000
@@ -120,5 +120,7 @@
                                     (list (symbol-name feature)))
-                          nil t)))
+                          ;; Return only features loaded from a file
+                          #'(lambda (f) (feature-file (intern (car f))))
+                          t)))

 (defvaralias 'loadhist-hook-functions 'unload-feature-special-hooks)

reply via email to

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