From: Leo Liu Date: Fri, 15 Nov 2013 06:52:40 +0000 (+0800) Subject: * lisp/loadhist.el (read-feature): Get rid of fake feature nil. X-Git-Tag: emacs-24.3.90~173^2^2~42^2~45^2~387^2~821 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=a1f03e8916caa24f1abc2aa14f98a79303017698;p=emacs.git * lisp/loadhist.el (read-feature): Get rid of fake feature nil. * src/minibuf.c (Ftry_completion, Fall_completions) (Ftest_completion): Use FUNCTIONP. (Bug#15889) --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 1be44bceff9..e3eb6da2f71 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2013-11-15 Leo Liu + + * loadhist.el (read-feature): Get rid of fake feature nil. (Bug#15889) + 2013-11-14 Stefan Monnier * progmodes/gud.el (ctl-x-map): diff --git a/lisp/loadhist.el b/lisp/loadhist.el index 620344734b3..b8433e1cbaa 100644 --- a/lisp/loadhist.el +++ b/lisp/loadhist.el @@ -101,14 +101,10 @@ A library name is equivalent to the file name that `load-library' would load." "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))) + (intern (completing-read prompt + features + (and loaded-p #'feature-file) + loaded-p))) (defvaralias 'loadhist-hook-functions 'unload-feature-special-hooks) (defvar unload-feature-special-hooks diff --git a/src/ChangeLog b/src/ChangeLog index 8131c7b7355..92174beb27b 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2013-11-15 Leo Liu + + * minibuf.c (Ftry_completion, Fall_completions) + (Ftest_completion): Use FUNCTIONP. (Bug#15889) + 2013-11-15 Paul Eggert * lisp.h (DEFINE_GDB_SYMBOL_BEGIN, DEFINE_GDB_SYMBOL_END): diff --git a/src/minibuf.c b/src/minibuf.c index 7ca4dae089b..8eb1a2890e0 100644 --- a/src/minibuf.c +++ b/src/minibuf.c @@ -1199,9 +1199,7 @@ is used to further constrain the set of candidates. */) type = (HASH_TABLE_P (collection) ? hash_table : VECTORP (collection) ? obarray_table : ((NILP (collection) - || (CONSP (collection) - && (!SYMBOLP (XCAR (collection)) - || NILP (XCAR (collection))))) + || (CONSP (collection) && !FUNCTIONP (collection))) ? list_table : function_table)); ptrdiff_t idx = 0, obsize = 0; int matchcount = 0; @@ -1460,9 +1458,7 @@ with a space are ignored unless STRING itself starts with a space. */) Lisp_Object allmatches; int type = HASH_TABLE_P (collection) ? 3 : VECTORP (collection) ? 2 - : NILP (collection) || (CONSP (collection) - && (!SYMBOLP (XCAR (collection)) - || NILP (XCAR (collection)))); + : NILP (collection) || (CONSP (collection) && !FUNCTIONP (collection)); ptrdiff_t idx = 0, obsize = 0; ptrdiff_t bindcount = -1; Lisp_Object bucket, tem, zero; @@ -1691,9 +1687,7 @@ the values STRING, PREDICATE and `lambda'. */) CHECK_STRING (string); - if ((CONSP (collection) - && (!SYMBOLP (XCAR (collection)) || NILP (XCAR (collection)))) - || NILP (collection)) + if (NILP (collection) || (CONSP (collection) && !FUNCTIONP (collection))) { tem = Fassoc_string (string, collection, completion_ignore_case ? Qt : Qnil); if (NILP (tem))