[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: test-completion and hash-tables
From: |
Luc Teirlinck |
Subject: |
Re: test-completion and hash-tables |
Date: |
Thu, 18 Dec 2003 17:57:38 -0600 (CST) |
Stefan Monnier wrote:
I completely forgot the issue of case-fold when writing the code.
But I think the same problem is present with obarrays (tho you might want
to check), in which case it´s a very long standing bug.
The problem indeed occurs for obarrays as well. Moreover there is an
additional problem for the obarray case. In the ielm run below,
test-completion threw an error, because minibuffer-completion-table
was nil. But nothing in the documentation of test-completion talks
about minibuffer-completion-table. Since test-completion got exported
to Lisp, it is supposed to be a general function, having nothing in
itself to do with minibuffers. At least, that is what `(elisp)Basic
Completion' currently says. The docstring does not talk about
minibuffers either.
I do not understand the following line in the Ftest_completion code in
minibuf.c (line 1679 in the latest unchanged version I have):
tem = oblookup (Vminibuffer_completion_table,
....
This is the second call to oblookup in the "else if (VECTORP (alist))"
case.
Ielm run illustrating both problems:
===File ~/obarrayielm=======================================
*** Welcome to IELM *** Type (describe-mode) for help.
ELISP> (intern "aBcxYz")
aBcxYz
ELISP> (test-completion "AbCXyZ" obarray)
*** Eval error *** Wrong type argument: vectorp, nil
ELISP> (try-completion "AbCXyZ" obarray)
nil
ELISP> (all-completions "AbCXyZ" obarray)
nil
ELISP> minibuffer-completion-table
nil
ELISP> (setq minibuffer-completion-table obarray)
;; Long output flushed.
ELISP> (test-completion "AbCXyZ" obarray)
nil
ELISP> (setq completion-ignore-case t)
t
ELISP> (test-completion "AbCXyZ" obarray)
nil
ELISP> (test-completion "aBcxYz" obarray)
t
ELISP> ============================================================