From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.devel Subject: Re: Completion Date: Mon, 03 Sep 2018 19:40:57 +0200 Message-ID: References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1535996356 23243 195.159.176.226 (3 Sep 2018 17:39:16 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 3 Sep 2018 17:39:16 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Sep 03 19:39:12 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 1fwsoe-0005qL-9n for ged-emacs-devel@m.gmane.org; Mon, 03 Sep 2018 19:39:08 +0200 Original-Received: from localhost ([::1]:46299 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fwsqk-0006L8-It for ged-emacs-devel@m.gmane.org; Mon, 03 Sep 2018 13:41:18 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40293) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fwsqa-0006Ks-F5 for emacs-devel@gnu.org; Mon, 03 Sep 2018 13:41:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fwsqX-0000f7-Ay for emacs-devel@gnu.org; Mon, 03 Sep 2018 13:41:08 -0400 Original-Received: from hermes.netfonds.no ([80.91.224.195]:51521) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fwsqW-0000e5-IC for emacs-devel@gnu.org; Mon, 03 Sep 2018 13:41:05 -0400 Original-Received: from cm-84.212.221.165.getinternet.no ([84.212.221.165] helo=stories) by hermes.netfonds.no with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1fwsqQ-00081Z-3n; Mon, 03 Sep 2018 19:41:00 +0200 Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAHlBMVEVfXV8SChBDQUB3dHMF BAkCAgaQh3ssJClwbW8EAwgaZRNoAAACSklEQVQ4jW3Uv4+bMBQHcMtUIWNJiXLZ0nfSOSMNEsca ydU1Y6V6YENB8mVMrJPcEYUTYa0EA//tPduQ+9HzgAKffP0eP2wCnw52IuGut6Pr275vOY7eHDiZ m2t9JqxyvkNoHWQonRCZwB+YaltzMCC6rEf486CCcMu4m7g1gP8VQvybeqAO0y+Y4+3OQIYluqz7 7XlMSe95hxd564qH/a7rt94ULLimOFn2C19rTVXVwFHGz0NrBmaPDVPnVRXBHQLn14QFikBvX2E7 AjHwV8aXWe1rpUML+8Z3gDWaOrkcvfiJvwVTvEmSy8orwhHgmngPTP0Pcws2wYYa10Qe+1CuGUXw 13WCt+TgWx7TlZyQEuG8TuTGwXyApIp8W0PuoSqCMUFkPbQbSwqxm+rrPgUVjV1FEiCNHTxG2C4M CQPRB/BHyFNbHAHv3CRuZXE5nhaQszDEd27AJFIDZ28D9ECeggGgXDkgSQS0SE4W7rHGGZoGQMak Ll/hEjHYQIRPTFYfQRkAC+QK5itRG0UazcrSwHkAsZgxPckXWp0WdJUQ2FtYiuxXRfVEptOCLVQi yxGy7qaiMJGxd3gHuAwQGCa83HdAi/qaGECrpDAwGRLxZ7DsPoJit8R2ZQASC0rF9wHnD0GAU/Xi JibawQzBftMIy75DYHWRegcDP95CdGZ3eeo12G7qYGsgQ9AGSoRmgBCLi5vSJqYldjUAN12JrWJB oJiG70FAT2/ADlzVwy4y1sBEYMZPkZkNA0+2FuYjLO0mwx9wbYfY7gsiYj391QNdLwAAAABJRU5E rkJggg== In-Reply-To: (Stefan Monnier's message of "Mon, 03 Sep 2018 13:19:12 -0400") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 80.91.224.195 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:229215 Archived-At: Stefan Monnier writes: >> +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. Yes, that seems clearer. > 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*. Oh, I didn't even consider that the user may type the name. Yeah, you're right; returning the text properties wouldn't really be generally useful here... -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no