unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Juanma Barranquero" <lekktu@gmail.com>
Subject: unload-feature of features not loaded from file
Date: Sun, 5 Nov 2006 00:43:30 +0100	[thread overview]
Message-ID: <f7ccd24b0611041543o30a05c89ubed875f60a20a5bc@mail.gmail.com> (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)

             reply	other threads:[~2006-11-04 23:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-04 23:43 Juanma Barranquero [this message]
2006-11-05 19:23 ` unload-feature of features not loaded from file Richard Stallman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f7ccd24b0611041543o30a05c89ubed875f60a20a5bc@mail.gmail.com \
    --to=lekktu@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).