From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Newsgroups: gmane.emacs.bugs Subject: bug#42149: Substring and flex completion ignore implicit trailing =?UTF-8?Q?=E2=80=98any=E2=80=99?= Date: Mon, 28 Dec 2020 16:58:30 +0000 Message-ID: <87im8lkguh.fsf@gmail.com> References: <874kk7107v.fsf@gmail.com> <875z4ml1l2.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29763"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 42149@debbugs.gnu.org, Dario Gjorgjevski To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Dec 28 17:59:10 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ktvrR-0007TJ-G3 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 28 Dec 2020 17:59:09 +0100 Original-Received: from localhost ([::1]:48406 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ktvrQ-0007P4-CI for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 28 Dec 2020 11:59:08 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43782) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ktvrK-0007Oa-4x for bug-gnu-emacs@gnu.org; Mon, 28 Dec 2020 11:59:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:53372) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ktvrJ-0003oM-Ty for bug-gnu-emacs@gnu.org; Mon, 28 Dec 2020 11:59:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ktvrJ-0004at-SZ for bug-gnu-emacs@gnu.org; Mon, 28 Dec 2020 11:59:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 28 Dec 2020 16:59:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 42149 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 42149-submit@debbugs.gnu.org id=B42149.160917472317622 (code B ref 42149); Mon, 28 Dec 2020 16:59:01 +0000 Original-Received: (at 42149) by debbugs.gnu.org; 28 Dec 2020 16:58:43 +0000 Original-Received: from localhost ([127.0.0.1]:36681 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ktvr0-0004a9-Mx for submit@debbugs.gnu.org; Mon, 28 Dec 2020 11:58:42 -0500 Original-Received: from mail-wr1-f41.google.com ([209.85.221.41]:41872) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ktvqx-0004Zv-P8 for 42149@debbugs.gnu.org; Mon, 28 Dec 2020 11:58:41 -0500 Original-Received: by mail-wr1-f41.google.com with SMTP id a12so11820753wrv.8 for <42149@debbugs.gnu.org>; Mon, 28 Dec 2020 08:58:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=R3g3zZVTkKNmwjCJ9Z2kYk+9K33l8+uYXjwjZdLe9c0=; b=mJWoYNEl8B7Boyol6A2pw85Dsq4HVby1HMYvcqGBVAvr00MlpoR17WIv7krSHGMUDY Oub9/XdyMZ66V66Ab5Exd+NphMGqILmmGIK/+GzwxYx7UxJ8AB8IO1wEfKoUQKevedur C4J66GIk3cUHx2svmTPMKHsdJKmO3l/1G/v5sl9qEvpqVkxe7/mW1TCAUvM125bXEf3E YotoYvpP+/YVS4U1pUKfgJ0TTVgDCPzQFygZ0gcvgZoph262nnwN/udoUWV1ZPbHy7eL hHYEWHrECmXnJFOqNZj5WyproIuUTyopkWuUUeZJZ/4B/ZrbjXajwxpX/q3zxGZYtVoS MVjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=R3g3zZVTkKNmwjCJ9Z2kYk+9K33l8+uYXjwjZdLe9c0=; b=bKw0uRYKoQkGPhVU6dMI+dg8F3vPngKagJVo9i5r7JIt4Wf4u5GVoeCG5usA9Z3+TF uRPx8/8eapu6F+rBLDyI7rI3nmH9lOluRmkfSihVrkLz3ab9U1vYmLLzHYUKw1JdXKWF oWqw3eOHEaqqkC1UVpvJKepYlhAMcNMnJBJcQ3ygmKR3m+GWtPRPm1U2dNY+3e+KoYbE es8J8BSCpSAIf5uCy73gccUV05nIb0bSQabxoOcya8e6OezKHFn3UL5acK7NrQtXe2OQ /sOV7QDfjr1O+CSN+INn7QMl6/7sUtJ7T222yeqJ3P3RPwcnP4/47aG6gdHeCAflbi8C +s/g== X-Gm-Message-State: AOAM5335Z4BhxaYrTamYWidhg5vwNcP7qVjXwVmcvs5Z1xthvyuxha0q 8X1i078g8XECV9SqBd00S3oRQIQj/BA= X-Google-Smtp-Source: ABdhPJysTjXRlqEf/DWagvY3ZQJyVe5YcQbLhKrz+X3wcveRMeBei/uuoB5ACrSCBs+WUihOBhgmng== X-Received: by 2002:a5d:4e92:: with SMTP id e18mr53753228wru.66.1609174713640; Mon, 28 Dec 2020 08:58:33 -0800 (PST) Original-Received: from krug (6.213.115.89.rev.vodafone.pt. [89.115.213.6]) by smtp.gmail.com with ESMTPSA id w13sm55585246wrt.52.2020.12.28.08.58.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Dec 2020 08:58:32 -0800 (PST) In-Reply-To: (Stefan Monnier's message of "Mon, 28 Dec 2020 11:03:54 -0500") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:196874 Archived-At: Stefan Monnier writes: >> This is one of them. >> >> (ert-deftest completion-pcm-test-3 () >> ;; Full match! >> (should (eql >> (completion--pcm-score >> (car (completion-pcm-all-completions >> "R" '("R" "hello") nil 1))) >> 1.0))) > > BTW, a good improvement to the tests would be to replace the score > equality tests with score ordering comparisons (like "score of foo > > score of bar") since it'd be perfectly OK to use a different scoring > system which gives different values as long as the relative ordering is > still obeyed. I'm not so sure I agree. I mean, I agree with the general principle, but I also think in our particular algorithm we can make some simple guarantees about the absolute value of the computed score in such trivial situations. In this case, Dario's test asserts that a full and perfect match has a score of 1 (hundred percent). So the test is only brittle if we break down this pillar, and I don't think we should. At least I don't think we have good reason to. Jo=C3=A3o