From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Completion Date: Mon, 03 Sep 2018 13:19:12 -0400 Message-ID: References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1535995429 30291 195.159.176.226 (3 Sep 2018 17:23:49 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 3 Sep 2018 17:23:49 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Lars Ingebrigtsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Sep 03 19:23:45 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fwsZj-0007j0-GJ for ged-emacs-devel@m.gmane.org; Mon, 03 Sep 2018 19:23:43 +0200 Original-Received: from localhost ([::1]:46248 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fwsbp-0003vu-7a for ged-emacs-devel@m.gmane.org; Mon, 03 Sep 2018 13:25:53 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34431) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fwsVS-0005bI-4l for emacs-devel@gnu.org; Mon, 03 Sep 2018 13:19:18 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fwsVP-0007QO-2u for emacs-devel@gnu.org; Mon, 03 Sep 2018 13:19:18 -0400 Original-Received: from pmta21.teksavvy.com ([76.10.157.36]:57048) by eggs.gnu.org with esmtps (TLS1.0:RSA_ARCFOUR_SHA1:16) (Exim 4.71) (envelope-from ) id 1fwsVO-0007PF-S5 for emacs-devel@gnu.org; Mon, 03 Sep 2018 13:19:15 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A2HuBwCDbI1b//nXSC1bHAEBAQQBAQoBA?= =?us-ascii?q?YNOgVISiEiQEoIglhqBegsThFkCg0ghNRcBAgEBAQEBAQICAmkohTkGeRALDSc?= =?us-ascii?q?SFBgxhTalEBoCiWGKWBeCAIESgxKKVgKNMo4kCZAQiD8iA4V1k2WBQgE3QYEUM?= =?us-ascii?q?xoIMIMokG4jjkABAQ?= X-IPAS-Result: =?us-ascii?q?A2HuBwCDbI1b//nXSC1bHAEBAQQBAQoBAYNOgVISiEiQEoI?= =?us-ascii?q?glhqBegsThFkCg0ghNRcBAgEBAQEBAQICAmkohTkGeRALDScSFBgxhTalEBoCi?= =?us-ascii?q?WGKWBeCAIESgxKKVgKNMo4kCZAQiD8iA4V1k2WBQgE3QYEUMxoIMIMokG4jjkA?= =?us-ascii?q?BAQ?= X-IronPort-AV: E=Sophos;i="5.53,325,1531800000"; d="scan'208";a="44729379" Original-Received: from unknown (HELO fmsmemgm.homelinux.net) ([45.72.215.249]) by smtp.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Sep 2018 13:19:13 -0400 Original-Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848) id A5632AE7DF; Mon, 3 Sep 2018 13:19:12 -0400 (EDT) In-Reply-To: (Lars Ingebrigtsen's message of "Mon, 03 Sep 2018 18:45:10 +0200") X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 76.10.157.36 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:229214 Archived-At: > +if there is one match, but it's not an exact match, the function > +should return the match; Actualy, when there is one match, "the common substring of all matches" is that match, so I think we can make it simpler, e.g.: This specifies a @code{try-completion} operation. The function should return @code{t} if the specified string is a unique and exact match; It should return @code{nil} if there are no matches; and it should return the longest common prefix of all matches otherwise. >>> `minibuffer-allow-text-properties' exists. Would it make sense to add a >>> new variable, like `completion-allow-text-properties', to handle this >>> case as well? >> >> We could, I guess. What's your use case? > > I'm completing over people and films from the IMDB database, and they're > uniquely identified by IDs. I'd like to complete over the names (or > perhaps also adorn the names with more... stuff, like years for the > films (but not complete over that bit))), but get the IMDB IDs back > after choosing a name. What if the user writes the whole name by hand: how do you get the ID in this case? In my experience, the need to handle that "manual case" most of the time ends up covering just as well the case where the user selected an entry from the *Completions*. Stefan