From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Luc Teirlinck Newsgroups: gmane.emacs.devel Subject: Re: test-completion and hash-tables Date: Thu, 18 Dec 2003 17:57:38 -0600 (CST) Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <200312182357.hBINvcW04557@raven.dms.auburn.edu> References: <200312150317.hBF3Hxg16766@raven.dms.auburn.edu> NNTP-Posting-Host: deer.gmane.org X-Trace: sea.gmane.org 1071792365 29159 80.91.224.253 (19 Dec 2003 00:06:05 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 19 Dec 2003 00:06:05 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Fri Dec 19 01:06:00 2003 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AX89Y-0006Ib-00 for ; Fri, 19 Dec 2003 01:06:00 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1AX89Y-0004iF-00 for ; Fri, 19 Dec 2003 01:06:00 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AX96L-00084I-O8 for emacs-devel@quimby.gnus.org; Thu, 18 Dec 2003 20:06:45 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1AX96B-00083J-UF for emacs-devel@gnu.org; Thu, 18 Dec 2003 20:06:35 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1AX95f-0007kJ-K8 for emacs-devel@gnu.org; Thu, 18 Dec 2003 20:06:34 -0500 Original-Received: from [131.204.53.104] (helo=manatee.dms.auburn.edu) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AX95f-0007k5-1e for emacs-devel@gnu.org; Thu, 18 Dec 2003 20:06:03 -0500 Original-Received: from raven.dms.auburn.edu (raven.dms.auburn.edu [131.204.53.29]) by manatee.dms.auburn.edu (8.12.10/8.12.10) with ESMTP id hBJ04qKk007531; Thu, 18 Dec 2003 18:04:52 -0600 (CST) Original-Received: (from teirllm@localhost) by raven.dms.auburn.edu (8.11.6+Sun/8.11.6) id hBINvcW04557; Thu, 18 Dec 2003 17:57:38 -0600 (CST) X-Authentication-Warning: raven.dms.auburn.edu: teirllm set sender to teirllm@dms.auburn.edu using -f Original-To: monnier@iro.umontreal.ca In-reply-to: (message from Stefan Monnier on 18 Dec 2003 18:05:29 -0500) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:18756 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:18756 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> ============================================================