From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= Newsgroups: gmane.emacs.devel Subject: Re: new-flex-completion-style Date: Thu, 14 Feb 2019 14:59:59 +0000 Message-ID: References: <20190202232827.27331.87300@vcs0.savannah.gnu.org> <20190202232828.4AE452159A@vcs0.savannah.gnu.org> <87lg2mynrg.fsf@gmail.com> <871s4czm5n.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="57278"; mail-complaints-to="usenet@blaine.gmane.org" Cc: emacs-devel To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Feb 14 16:16:11 2019 Return-path: Envelope-to: ged-emacs-devel@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 1guIkA-000EhP-52 for ged-emacs-devel@m.gmane.org; Thu, 14 Feb 2019 16:16:06 +0100 Original-Received: from localhost ([127.0.0.1]:50019 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1guIk9-0004GZ-4o for ged-emacs-devel@m.gmane.org; Thu, 14 Feb 2019 10:16:05 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:51730) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1guIh6-0002XZ-JQ for emacs-devel@gnu.org; Thu, 14 Feb 2019 10:12:57 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1guIUt-0001aw-Sr for emacs-devel@gnu.org; Thu, 14 Feb 2019 10:00:28 -0500 Original-Received: from mail-qk1-x72f.google.com ([2607:f8b0:4864:20::72f]:46166) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1guIUq-0001Uw-SW for emacs-devel@gnu.org; Thu, 14 Feb 2019 10:00:16 -0500 Original-Received: by mail-qk1-x72f.google.com with SMTP id i5so3698839qkd.13 for ; Thu, 14 Feb 2019 07:00:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=zpmEBEf/xLW4rFHqwzq96LWNzj9ioEwKVKZQuzg610Y=; b=RMhXN9VtNoGadY4RshhJkQpGMxUqo0AR5mTLScwo3lVLhhqC5uu9vNC5UVNBGSJ9tc xgMjUXWspLtZ97w3CW9h7vEQH+9pDE6XIAzKL5p0pZ4vlHv6Z8v/fSyu0ZzIAZrt9qL3 ug1O0U4c7iNmOKzSjmu2u9AG4eE+oQEQpQl0L/1BOvrGRbo4hDdvSb1UT3yqZnlfj7Xn 4neu7euhnuUBg++IOlH+v6IjFc/ggQ+Zp5n0W1wo6THaytY0zGiP6BOUGxuc+SBY+3UJ xjuFvzyuKrXE9ODRGkpJ+9Mho+39vS3bB4oRndXQsTcpCGA9s5kIDd2e+5cJB54Rq74j eXfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=zpmEBEf/xLW4rFHqwzq96LWNzj9ioEwKVKZQuzg610Y=; b=ezLFokA2w6o7SRj1pS7pytt9s1JC7v+KkzhllieFlzcr7i0PhYdwcxuOqE9WII3Nis r4pD+xZMTlhLZGawhFNwHVGufyisASGZQeXlLXTOIthIQ3IYSJOQj7GllcvkmessCsiz vQLaI/4TsgtaqGr7YYwSIxxkB3ux0aDgPLEphUAmIS3XmXljRnsI2+XUsOFgW4fYevJl DCa7rErZ/QNWA4SpPpxDGLIIGXzaYmrdMA9TcNAWM6ykZDCgciV4NU3oQFAwglOs4OiA tfRjV4SaN+acDXOgcbTyXRV/ofBQB9k280kWT4s+yBA+qBO2X1yZdd5qyj0ifjYS4Grs ksVw== X-Gm-Message-State: AHQUAuYF8HBc3PDkDzCg22oUtI5LKaWXaMdQ4aTshHtaGCZtniLG3a67 tjB3XhOzTj+DJtFP0aixLFm4+oQFAh3dWNZxLIc= X-Google-Smtp-Source: AHgI3IYDymvXChWe6dlEI0PU+OfFjguolx7sxzmYBZKs2UFbskOMuh+OYa/Ur/kA2UaO8tinDrqx9NGQ/qHujLJYFFg= X-Received: by 2002:ae9:f20f:: with SMTP id m15mr3196303qkg.200.1550156410456; Thu, 14 Feb 2019 07:00:10 -0800 (PST) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::72f 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:233325 Archived-At: On Thu, Feb 14, 2019 at 1:55 PM Jo=C3=A3o T=C3=A1vora wrote: > > On Thu, Feb 14, 2019 at 1:36 PM Stefan Monnier = wrote: > > > > > I don't think it's odd. I call the former "scattered match" > > > and the latter a "tighter match". > > > > Don't you find it odd that "foo" gives a better score to > > "fotttttttttttttttto" than to "foto" ? > > Perhaps. But as it stands it doesn't make sense to > compare scores across different length strings. > > It does make sense to compare the score between > foo's matches of foot and foto. > > > [ Given them the same score sounds acceptable, tho. ] > > Feel free to add some kind of normalization to the function > if you can come up with it. Or come up with another function > entirely. As I said, a function that measures the distance > in "boring editing operations" between the pattern and the target > would be a nicer measure. I've been experimenting with a simpler function that just counts the number of "holes" and the length of those holes separately in the denominator. The numerator is the same and a perfect match is still a 1. It seems to fare better for your cases. For foo Eventually we could weight the number and length of holes differently so we can get this: score(foo,barfoobaz) > score(foo,fabrobazo) > score(foo,fotttttttttttttttttttttto) Which would be nicer, I think. Jo=C3=A3o