From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Nikolaj Schumacher Newsgroups: gmane.emacs.help Subject: Re: completing-read() on list of vectors Date: Fri, 12 Sep 2008 19:58:44 +0200 Message-ID: References: <728990ea-9650-49dc-b4c3-4f9578856039@8g2000hse.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1221242353 1385 80.91.229.12 (12 Sep 2008 17:59:13 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 12 Sep 2008 17:59:13 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: =?utf-8?Q?Nordl=C3=B6w?= Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Sep 12 20:00:09 2008 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KeCwD-0004hd-B0 for geh-help-gnu-emacs@m.gmane.org; Fri, 12 Sep 2008 20:00:09 +0200 Original-Received: from localhost ([127.0.0.1]:34707 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KeCvD-000608-3z for geh-help-gnu-emacs@m.gmane.org; Fri, 12 Sep 2008 13:59:07 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KeCuw-000603-Rv for help-gnu-emacs@gnu.org; Fri, 12 Sep 2008 13:58:50 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KeCuu-0005zr-AL for help-gnu-emacs@gnu.org; Fri, 12 Sep 2008 13:58:49 -0400 Original-Received: from [199.232.76.173] (port=38269 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KeCuu-0005zo-5x for help-gnu-emacs@gnu.org; Fri, 12 Sep 2008 13:58:48 -0400 Original-Received: from dd18200.kasserver.com ([85.13.138.168]:52482) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KeCuu-0000p5-89 for help-gnu-emacs@gnu.org; Fri, 12 Sep 2008 13:58:48 -0400 Original-Received: from thursday (BAH41aa.bah.pppool.de [77.135.65.170]) by dd18200.kasserver.com (Postfix) with ESMTP id CD5B81801D400; Fri, 12 Sep 2008 19:58:50 +0200 (CEST) In-Reply-To: <728990ea-9650-49dc-b4c3-4f9578856039@8g2000hse.googlegroups.com> (=?utf-8?Q?=22Nordl=C3=B6w=22's?= message of "Fri\, 12 Sep 2008 03\:30\:53 -0700 \(PDT\)") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2.50 (darwin) X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 2) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:57487 Archived-At: Nordl=C3=B6w wrote: > I guess I need to give it an explicit completion function (as second > argument) to achieve lookups of list of vectors where for example > "accumulate" is used as key and the return value is the whole list > element (vector). The easiest way would be just to duplicate the first element in a cons. (a . [a b c d]) Or use a hash map. Certainly, you could also write your own completion functions, but it will be significantly slower, because it's written in lisp. (If speed that's of any concern...) > Why doesn't completing-read() already work on list of vectors where > first vector element is a string aswell? Unfortunately, there are few functions capable of working with vectors. Consequently, They are rarely used. (Consequently, there are few functions capable of working with them.) regards, Nikolaj Schumacher