summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeo Liu <sdl.web@gmail.com>2013-11-15 14:52:40 +0800
committerLeo Liu <sdl.web@gmail.com>2013-11-15 14:52:40 +0800
commita1f03e8916caa24f1abc2aa14f98a79303017698 (patch)
tree44f4654406788beadcee133feb5557743d136044
parent1a191e5c73cdae3d3b34f5fc3501bfd2ddf50ec8 (diff)
* lisp/loadhist.el (read-feature): Get rid of fake feature nil.
* src/minibuf.c (Ftry_completion, Fall_completions) (Ftest_completion): Use FUNCTIONP. (Bug#15889)
-rw-r--r--lisp/ChangeLog4
-rw-r--r--lisp/loadhist.el12
-rw-r--r--src/ChangeLog5
-rw-r--r--src/minibuf.c12
4 files changed, 16 insertions, 17 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 1be44bceff..e3eb6da2f7 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -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):
diff --git a/lisp/loadhist.el b/lisp/loadhist.el
index 620344734b..b8433e1cba 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 8131c7b735..92174beb27 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -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):
diff --git a/src/minibuf.c b/src/minibuf.c
index 7ca4dae089..8eb1a2890e 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))