]> code.delx.au - gnu-emacs/commitdiff
* lisp/loadhist.el (read-feature): Get rid of fake feature nil.
authorLeo Liu <sdl.web@gmail.com>
Fri, 15 Nov 2013 06:52:40 +0000 (14:52 +0800)
committerLeo Liu <sdl.web@gmail.com>
Fri, 15 Nov 2013 06:52:40 +0000 (14:52 +0800)
* src/minibuf.c (Ftry_completion, Fall_completions)
(Ftest_completion): Use FUNCTIONP.  (Bug#15889)

lisp/ChangeLog
lisp/loadhist.el
src/ChangeLog
src/minibuf.c

index 1be44bceff960ae3737256b2653f8e8012ad09bb..e3eb6da2f71746beaf7bc7cf92c562d2129e51e8 100644 (file)
@@ -1,3 +1,7 @@
+2013-11-15  Leo Liu  <sdl.web@gmail.com>
+
+       * loadhist.el (read-feature): Get rid of fake feature nil.  (Bug#15889)
+
 2013-11-14  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * progmodes/gud.el (ctl-x-map):
index 620344734b36fb8a1c3f0d11b830591c769cd925..b8433e1cbaab31e5170c0baf37abfd65e22b55eb 100644 (file)
@@ -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
index 8131c7b7355e4bfa3e7f7fadb4b063ff9cbd9fd8..92174beb27b490b033e9c6e0aa9c76410cb16f90 100644 (file)
@@ -1,3 +1,8 @@
+2013-11-15  Leo Liu  <sdl.web@gmail.com>
+
+       * minibuf.c (Ftry_completion, Fall_completions)
+       (Ftest_completion): Use FUNCTIONP.  (Bug#15889)
+
 2013-11-15  Paul Eggert  <eggert@cs.ucla.edu>
 
        * lisp.h (DEFINE_GDB_SYMBOL_BEGIN, DEFINE_GDB_SYMBOL_END):
index 7ca4dae089b0e41f203646ec1751f587bc850531..8eb1a2890e0015f9eed531596f1789167a924e07 100644 (file)
@@ -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))