From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jonas Bernoulli Newsgroups: gmane.emacs.bugs Subject: bug#14054: completing against a hash-table doesn't work as documented Date: Tue, 26 Mar 2013 03:55:51 +0100 Message-ID: <871ub2hnt4.fsf@bernoul.li> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1364266619 25423 80.91.229.3 (26 Mar 2013 02:56:59 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 26 Mar 2013 02:56:59 +0000 (UTC) To: 14054@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Mar 26 03:57:25 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UKK4h-00074I-GH for geb-bug-gnu-emacs@m.gmane.org; Tue, 26 Mar 2013 03:57:23 +0100 Original-Received: from localhost ([::1]:49313 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UKK4J-0000dL-O4 for geb-bug-gnu-emacs@m.gmane.org; Mon, 25 Mar 2013 22:56:59 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:43484) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UKK4C-0000cj-M9 for bug-gnu-emacs@gnu.org; Mon, 25 Mar 2013 22:56:57 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UKK47-00082l-VN for bug-gnu-emacs@gnu.org; Mon, 25 Mar 2013 22:56:52 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:41260) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UKK45-00082E-NJ for bug-gnu-emacs@gnu.org; Mon, 25 Mar 2013 22:56:47 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1UKK6H-0002w9-RX for bug-gnu-emacs@gnu.org; Mon, 25 Mar 2013 22:59:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Jonas Bernoulli Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 26 Mar 2013 02:59:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 14054 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.136426671911258 (code B ref -1); Tue, 26 Mar 2013 02:59:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 26 Mar 2013 02:58:39 +0000 Original-Received: from localhost ([127.0.0.1]:45369 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UKK5v-0002vW-5e for submit@debbugs.gnu.org; Mon, 25 Mar 2013 22:58:39 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:60056) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UKK5t-0002vP-D7 for submit@debbugs.gnu.org; Mon, 25 Mar 2013 22:58:37 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UKK3U-0007qc-LT for submit@debbugs.gnu.org; Mon, 25 Mar 2013 22:56:20 -0400 Original-Received: from lists.gnu.org ([208.118.235.17]:58112) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UKK3U-0007qY-Ht for submit@debbugs.gnu.org; Mon, 25 Mar 2013 22:56:08 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:43041) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UKK3N-00009T-V1 for bug-gnu-emacs@gnu.org; Mon, 25 Mar 2013 22:56:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UKK3H-0007kZ-Qh for bug-gnu-emacs@gnu.org; Mon, 25 Mar 2013 22:56:01 -0400 Original-Received: from mail-ee0-f46.google.com ([74.125.83.46]:44057) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UKK3H-0007kL-HH for bug-gnu-emacs@gnu.org; Mon, 25 Mar 2013 22:55:55 -0400 Original-Received: by mail-ee0-f46.google.com with SMTP id e49so3469138eek.19 for ; Mon, 25 Mar 2013 19:55:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:from:to:subject:user-agent:date:message-id :mime-version:content-type; bh=sZi8G3tkv8T8vj6/CRUG24+qn87JFW8d19d7JxsGHXw=; b=umP1BoMMUMuTocM4sQcPbNlXNRqgxDy+yTTr3k/us7tCj4gV3zV9absGFBNAvG993Y VacEk9MFbEOHkchUp7pD+xNTstY61IC/oFU762ngxthzGydgEn63fQV65HQSHuL+yweL u1rum3AU9JOVluvFd1IJKQke52EcfhCJLgJvilNZQtjEyD4A2Fp/9vT4XCAWStVOBzr/ Qvc74kKZSpOmG3hubmtQzN5KPdwfXNE/tzzw7vXfboVy5Ti9bruY2Hcvz0se1L8EGsUU Xt0PHKNzPca+ViElA8MiGZ3XCwe6StLshqq2TiYVP3Q21FL10IDBekJIcy/7sk5gC47v YyfA== X-Received: by 10.15.107.205 with SMTP id cb53mr11269522eeb.14.1364266554005; Mon, 25 Mar 2013 19:55:54 -0700 (PDT) Original-Received: from lem (178-83-148-119.dynamic.hispeed.ch. [178.83.148.119]) by mx.google.com with ESMTPS id q5sm22384201eeo.17.2013.03.25.19.55.52 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 25 Mar 2013 19:55:53 -0700 (PDT) User-agent: mu4e 0.9.9.5-dev6; emacs 24.3.1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:72901 Archived-At: `completing-read's doc-strings sais I should read `try-completion's (and `all-completions's) doc-string for details on COLLECTION. `try-completion's doc-string sais: > If COLLECTION is a hash-table, all the keys that are strings or > symbols are the possible completions. (1) To my this implies that all other keys are simply ignored, as it doesn't say that all keys _have to by_ strings or symbols. However using e.g. a vector or number as key causes a `wrong-type-argument' error in `test-completion'. (2) It explicity sais that a key can be a symbol. However this causes the same error: (let ((ht (make-hash-table))) (puthash 'key 'val ht) (test-completion "input" ht)) I tried using hash-tables created with all three predefined hash-table tests `eq', `eql', and `equal; none worked. Note that depending on the "order" of elements in the hash-table no error is raised by `test-completion' if a string key "before" the first non-string key matches: no error (let ((ht (make-hash-table))) (puthash "first" 'val ht) (puthash 'second 'val ht) (test-completion "first" ht)) error (let ((ht (make-hash-table))) (puthash 'first 'val ht) (puthash "second" 'val ht) (test-completion "second" ht)) I have tried with 23.4, 24.2, 24.3, and 24.3.50; they all behave the this way.