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 09:38:13 +0000 Message-ID: <871rfal18a.fsf@gmail.com> References: <87k0znsdjb.fsf@gmail.com> <87sgbsv7gg.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="29331"; 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 10:39: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 1ktoze-0007VD-6s for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 28 Dec 2020 10:39:10 +0100 Original-Received: from localhost ([::1]:58694 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ktozc-0000YT-VH for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 28 Dec 2020 04:39:08 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42420) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ktozW-0000YN-AJ for bug-gnu-emacs@gnu.org; Mon, 28 Dec 2020 04:39:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:50905) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ktozW-0001WO-3M for bug-gnu-emacs@gnu.org; Mon, 28 Dec 2020 04:39:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ktozV-0005Ie-Vb for bug-gnu-emacs@gnu.org; Mon, 28 Dec 2020 04:39: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 09:39: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.160914830520325 (code B ref 42149); Mon, 28 Dec 2020 09:39:01 +0000 Original-Received: (at 42149) by debbugs.gnu.org; 28 Dec 2020 09:38:25 +0000 Original-Received: from localhost ([127.0.0.1]:34218 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ktoyu-0005Hl-RI for submit@debbugs.gnu.org; Mon, 28 Dec 2020 04:38:25 -0500 Original-Received: from mail-wr1-f47.google.com ([209.85.221.47]:47026) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ktoyr-0005HX-Pd for 42149@debbugs.gnu.org; Mon, 28 Dec 2020 04:38:22 -0500 Original-Received: by mail-wr1-f47.google.com with SMTP id d13so10758494wrc.13 for <42149@debbugs.gnu.org>; Mon, 28 Dec 2020 01:38:21 -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=TxI+SAYdaG8ufFL2cqWiP8HzU4m5C01u9KmQX1445sw=; b=OBQW6aAH+F/L1NtctEfWxwD/ToZCCEliMF4rndZgSunsMiP8enyMk0TtghCoqFC9PK pqm7ElwSwuIGDgY1En3tP8TbCOl/i5iFA2NAk08z84Ttt3y2BbE7TrVIIE935m68P6eM 2RLjmz+++dp5/xkhK/50yPacqQMrnEZOpgS+nzBtwUi6vef3koCLbbSvzvKf1/vt0L1D BLl46bsPOZaUTKFevhNzrkAaR/KuR63KDxfvC6PNNix+1M0TU6L1GByeQMW+wBfkpXDp dz3lrBxihqqWRGaDjweC5llsGogbi5XgAkdtVDYO9tiAuG1VTCGc9LtVBy6PeCGe8gLb vwYA== 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=TxI+SAYdaG8ufFL2cqWiP8HzU4m5C01u9KmQX1445sw=; b=Md2EMR9fNdb/pyaumLOWNP5uIln2luNcUbQCksG7CcoUDGAW2nHMIbea4sZgjuIZs9 KL+Or9FAtv+mHfQC5GDCrojB6x0HYrwVPEk+z0v0301mLJ+N7du4dPsw0EyhdRi/vxEY OzvUXrAaESGVo03Kjuh6m41STcmi7/sVXYhYWJU+LshXMRTZUQ4oGbrvWMcKHvK6wUNx 2s6wYIXPGnl1NrFucBiikGAR9WWo1ZCwF05quftdOQIF9IKH8B8PzhOm6N3Hhd5mcn2q IyKV3POqK0uMX84Kok9sLNxW/lK6ArZbO45n2a5BrIFVABDN/MGrsfhFg+5AM5bdrF0C ZK9w== X-Gm-Message-State: AOAM532SxlLp9giqMgqd/KwAsSuOWsjorC834mbS3jK2NsxT5UAXyaxm BTIrwkY1bObcZDV7XFi2lw/Rgdpvabs= X-Google-Smtp-Source: ABdhPJwWPrAbKU6BDerI8lLfWfmUXryTotWaHxu7K6x1BN5g83qTW6hNDBIw8A6BGZnTn9ihkkbE9w== X-Received: by 2002:adf:cd8f:: with SMTP id q15mr48804182wrj.79.1609148295394; Mon, 28 Dec 2020 01:38:15 -0800 (PST) Original-Received: from krug (222.201.137.78.rev.vodafone.pt. [78.137.201.222]) by smtp.gmail.com with ESMTPSA id x17sm54931513wro.40.2020.12.28.01.38.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Dec 2020 01:38:14 -0800 (PST) In-Reply-To: (Stefan Monnier's message of "Sun, 27 Dec 2020 16:45:07 -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:196854 Archived-At: Stefan Monnier writes: >> Please find attached a patch with an edited commit message. It should >> be better. > > [ Boy, we are really unacceptably slow at reviewing this. ] > > Thanks very much for your patch. > It looks good to me, but I think it's important we find a fix with which > Jo=C3=A3o agrees. Indeed, I'm very sorry to be a kill-joy here, the patch doesn't look very good to me. Last time I looked it was too complex for me to follow, touches many lines, and created unnecessary consing. I'm convinced the current algorithm in completion-pcm--hilit-commonality is fine for these 1-char edge cases, given that the assumptions hold. >> Furthermore, =E2=80=98completions-first-difference=E2=80=99 and >> =E2=80=98completions-common-part=E2=80=99 would sometimes overlap depend= ing on the >> position of point within the query string. > > Could you point us at the corresponding test? > [ And thanks so much for the tests, this is great! ] Yes, please use the latest tests that I've pushed to the scratch/bug-42149-funny-pcm-completion-scores branch. They are still your test, only discriminated into various ert-deftest. If you want, you can split and discriminate further. > I think Jo=C3=A3o knows the scoring algorithm much more than I do, so I'll > let him judge if the change is sound. I'm not aware that it's not sound, but I do believe it's too complex and not well understood. In constrast, I can understand the three-line fix I did earlier and which covers all of Darios's test cases for the flex completion style. Previously it was failing 7 cases, now it is only failing these 3. F completion-pcm-test-3 F completion-pcm-test-5 F completion-substring-test-4 Jo=C3=A3o