From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Tassilo Horn Newsgroups: gmane.emacs.help Subject: Completion: display of candidates Date: Mon, 18 Feb 2019 08:54:26 +0100 Message-ID: <877edx8rbh.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="15374"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Feb 18 08:55:01 2019 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gvdlU-0003qp-0f for geh-help-gnu-emacs@m.gmane.org; Mon, 18 Feb 2019 08:55:00 +0100 Original-Received: from localhost ([127.0.0.1]:53918 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvdlT-0001Cf-0O for geh-help-gnu-emacs@m.gmane.org; Mon, 18 Feb 2019 02:54:59 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:42135) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvdlD-0001Bz-2u for help-gnu-emacs@gnu.org; Mon, 18 Feb 2019 02:54:43 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:40505) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvdlA-0000m5-Pp for help-gnu-emacs@gnu.org; Mon, 18 Feb 2019 02:54:42 -0500 Original-Received: from auth2-smtp.messagingengine.com ([66.111.4.228]:47637) by fencepost.gnu.org with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.82) (envelope-from ) id 1gvdl3-0000io-FX for help-gnu-emacs@gnu.org; Mon, 18 Feb 2019 02:54:35 -0500 Original-Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailauth.nyi.internal (Postfix) with ESMTP id 965DF20A0E for ; Mon, 18 Feb 2019 02:54:32 -0500 (EST) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute7.internal (MEProxy); Mon, 18 Feb 2019 02:54:32 -0500 X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtledrudduvddguddulecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfhuthenuceurghilhhouhhtmecu fedttdenucenucfjughrpefhvffufffkfgggtgesthdtredttdertdenucfhrhhomhepvf grshhsihhlohcujfhorhhnuceothhsughhsehgnhhurdhorhhgqeenucfkphepudefgedr udduledrvdegrdduleehnecurfgrrhgrmhepmhgrihhlfhhrohhmpehthhhorhhnodhmvg hsmhhtphgruhhthhhpvghrshhonhgrlhhithihqdekieejfeekjeekgedqieefhedvleek qdhtshguhheppehgnhhurdhorhhgsehfrghsthhmrghilhdrfhhmnecuvehluhhsthgvrh fuihiivgeptd X-ME-Proxy: Original-Received: from jiffyarch (j289989.servers.jiffybox.net [134.119.24.195]) by mail.messagingengine.com (Postfix) with ESMTPA id AE0F1E405D for ; Mon, 18 Feb 2019 02:54:31 -0500 (EST) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:119437 Archived-At: Hi all, I have a function of one argument which computes a list of completions matching the given argument. I can then use (completing-read "Prompt: " (completion-table-dynamic #'my-function)) in order to read with completion from the minibuffer. So far, so good, but I have two questions: 1. The docs for completion-table-dynamic say that the given function should return an alist (not just a list) but doesn't describe the structure of the entries. Neither do I find a description in the info docs. So what should it be? 2. Is there a way to display and complete on a different representation than the actual completion candidates? In my case, my-func returns absolute file names but I'd like to complete on just the basename, and display the entries in the form of "basename (directory)". Bye, Tassilo