From 715c76f3c6c62b36ded138715e7e26e04a134c14 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Gerd=20M=C3=B6llmann?= Date: Fri, 21 Oct 2022 16:57:20 +0200 Subject: [PATCH] Fixes for minibuf-tests This was a remnant of a time when I made obarrays packages. * src/minibuf.c (Ftry_completion): Handle case collection being obarray. (Fall_completions): Same. (Ftest_completion): And same again. --- src/minibuf.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/minibuf.c b/src/minibuf.c index 36b8d401d92..2fc2afafcf2 100644 --- a/src/minibuf.c +++ b/src/minibuf.c @@ -1622,6 +1622,10 @@ or from one of the possible completions. */) if (FUNCTIONP (collection)) return call3 (collection, string, predicate, Qnil); + /* Fake obarray? */ + if (VECTORP (collection)) + collection = Faref (collection, make_fixnum (0)); + /* Use a package's symbol table for completion, but remember that we are working on a package, because we are called with a predicate that takes only one argument, which is a remnant ob obarrays. @@ -1850,6 +1854,11 @@ with a space are ignored unless STRING itself starts with a space. */) { Lisp_Object tail, elt, eltstring; Lisp_Object allmatches; + + /* Fake obarray? */ + if (VECTORP (collection)) + collection = Faref (collection, make_fixnum (0)); + int type = HASH_TABLE_P (collection) ? 3 : PACKAGEP (collection) ? 2 : NILP (collection) || (CONSP (collection) && !FUNCTIONP (collection)); @@ -2052,6 +2061,12 @@ the values STRING, PREDICATE and `lambda'. */) CHECK_STRING (string); + /* If a vector (obarray), use the package stored in slot 0. */ + if (VECTORP (collection)) + collection = Faref (collection, make_fixnum (0)); + + /* If a package, use its symbol table. Remember that it's not a + normal hash-table. */ const bool symbol_table_p = PACKAGEP (collection); if (symbol_table_p) collection = PACKAGE_SYMBOLS (collection); -- 2.39.2