unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* unload-feature of features not loaded from file
@ 2006-11-04 23:43 Juanma Barranquero
  2006-11-05 19:23 ` Richard Stallman
  0 siblings, 1 reply; 2+ messages in thread
From: Juanma Barranquero @ 2006-11-04 23:43 UTC (permalink / raw)


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?

                    /L/e/k/t/u

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)))
 				   features)
-			   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)

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: unload-feature of features not loaded from file
  2006-11-04 23:43 unload-feature of features not loaded from file Juanma Barranquero
@ 2006-11-05 19:23 ` Richard Stallman
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Stallman @ 2006-11-05 19:23 UTC (permalink / raw)
  Cc: emacs-devel

Please install.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-11-05 19:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-04 23:43 unload-feature of features not loaded from file Juanma Barranquero
2006-11-05 19:23 ` Richard Stallman

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).