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: Thu, 13 May 2021 15:31:29 +0100 Message-ID: <87im3maeny.fsf@gmail.com> References: <87sgbsv7gg.fsf@gmail.com> <877dp1kfzz.fsf@gmail.com> <8735zpjz64.fsf@gmail.com> <877dk3rnoo.fsf@gnus.org> 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="16983"; 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 , Stefan Monnier To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu May 13 16:32:12 2021 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 1lhCNo-0004Iw-N3 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 13 May 2021 16:32:12 +0200 Original-Received: from localhost ([::1]:33414 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lhCNn-0002eu-Nl for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 13 May 2021 10:32:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60134) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lhCNe-0002cz-Fr for bug-gnu-emacs@gnu.org; Thu, 13 May 2021 10:32:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:60726) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lhCNe-0003Pt-6T for bug-gnu-emacs@gnu.org; Thu, 13 May 2021 10:32:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lhCNe-00051t-3T for bug-gnu-emacs@gnu.org; Thu, 13 May 2021 10:32:02 -0400 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: Thu, 13 May 2021 14:32:02 +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.162091630119305 (code B ref 42149); Thu, 13 May 2021 14:32:02 +0000 Original-Received: (at 42149) by debbugs.gnu.org; 13 May 2021 14:31:41 +0000 Original-Received: from localhost ([127.0.0.1]:44039 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lhCNI-00051J-Iz for submit@debbugs.gnu.org; Thu, 13 May 2021 10:31:40 -0400 Original-Received: from mail-wm1-f52.google.com ([209.85.128.52]:34444) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lhCNG-000514-3m for 42149@debbugs.gnu.org; Thu, 13 May 2021 10:31:38 -0400 Original-Received: by mail-wm1-f52.google.com with SMTP id u5-20020a7bc0450000b02901480e40338bso1031104wmc.1 for <42149@debbugs.gnu.org>; Thu, 13 May 2021 07:31:38 -0700 (PDT) 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=Pb6mluQgfRMUCZctE8kGcqyrqTj/J2MropToEcv6f3U=; b=VPn/J3k/GyaGmEha7T2YDpqvXdaMs7uZDD7x2ilfpZhMA8jPM7ROzVibDoLw5dSDQ3 vbUrs5jhIrGUeFUnhSzOQO0iTjp5Sd88PIywgDzeMvWmMU4kBMRPHes2xk/jv+MsY4f8 1Wx2BKw3N/Fum5dORNqqfr5L55Jsjx77ldhHEquNSEghZ5I2SQ5NSvrwD0kUeG4RBkEO YtIqJqP0PAU3jvKSDr0j3nzIi7+iyadts5duz0N0fOkCTDJDLHLpbIEHpjqzgS2tF0a8 5KcIaCnEWBzkwC1u2ib9VWlgdJXlDc6gfXQDROdo83CH/MulnIU4paNAGquR6O+zfQLt 9AEg== 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=Pb6mluQgfRMUCZctE8kGcqyrqTj/J2MropToEcv6f3U=; b=Zz8TlTNsh4y1yH3tc78CZxEL37wm7J4jzWTfTOr550HNB6tW/cV7X8m3ILb/hTxCho c4cYikap5M+3VrpdwXyjfvsxjlDAciq9n6g4YsfwYWOxY4ZmzHc68y6sA+vDj64juhW4 FFidpVAUDysoUzKqvdhkb2TnEc/iT4garUxM+4Jtv1edWDyyr2xvLy5tqe1XNtB+6SHo fxqszZB9gRkUnSsDSE7CS4QcqWAw2msU5MT+hxCXrP8iKC9nt/NGWDbk8oH5KiUASxor EDkOOdP/s2BOj4XieNcB0umOIPNg5tgx1h1DatR5tk1Ju958Az2jOKPBq2P5DHiKb7t2 G07Q== X-Gm-Message-State: AOAM533Dh7BAxNPeTLne4G0ikVovrdQadBrqEPoIjnKO8BnwTKHwmF9e q4apRDpRzbxH4nzE8iH4kkI= X-Google-Smtp-Source: ABdhPJybWqR1dkYElr7LwNpOAfdhsxRJiLqbqm60nTRbt0+2iwRkZd7ScYBdEAFpu9U8fKW2x1LKtg== X-Received: by 2002:a05:600c:4242:: with SMTP id r2mr4131189wmm.140.1620916292261; Thu, 13 May 2021 07:31:32 -0700 (PDT) Original-Received: from krug ([89.180.156.166]) by smtp.gmail.com with ESMTPSA id v12sm3238724wrv.76.2021.05.13.07.31.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 May 2021 07:31:31 -0700 (PDT) In-Reply-To: <877dk3rnoo.fsf@gnus.org> (Lars Ingebrigtsen's message of "Thu, 13 May 2021 11:24:39 +0200") 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:206443 Archived-At: Lars Ingebrigtsen writes: > Jo=C3=A3o T=C3=A1vora writes: > >> And I just pushed my cleaned up fix to to master as well, thus hopefully >> fixing the brunt of this bug. Dario and others, please test this. I >> haven't yet pushed the tests, since we're not entirely sure of those, >> but I think we should break them up further and push them too, once we >> come to an aggreement on what and how they should test exactly. > > I've only skimmed this long thread, but my understanding of it is that > the reported bug was fixed... but there was some discussion about > including (or not) Dario's tests? > > Which (if I'm grepping correctly) would be the patch below? I tried > applying it, and: > > 2 unexpected results: > FAILED completion-pcm-all-completions-test > FAILED completion-substring-all-completions-test > > I have not looked into this further -- Jo=C3=A3o, what's the state here? I think you applied the original patch of two failing tests, the tests that demonstrate a particular bug. So it makes sense that hey fail. I think we want to merge what's in the scratch/bug-42149-funny-pcm-completion-scores. I attach a summary of the four commtis there. Then we want to close this issue. Not sure if it's merged yet, but I don't think so. I was waiting for Dario's comments on it, they never arrived, but I'm veryq confident that this fixes the issues reported here. There are 4 commits there. And if you merge this branch, _don't_ also try to merge the patch you tried earlier: the branch already contains a rewrite of those tests. Jo=C3=A3o commit 03c160fb1573107586355e851c111326debfe95a Author: Jo=C3=A3o T=C3=A1vora Date: Tue Dec 29 13:31:46 2020 +0000 Fix "first-differente" face in completion-pcm--hilit-commonality =20=20=20=20 Fixes: bug#42149 =20=20=20=20 Depending on the position of point in the completion and the completion style being used, it may or may not make sense for this face to appear immediately after point. This patch assumes that it should appear in the first non-matched character after point, which may likely be the next one to type to disambiguate between two or more completions. =20=20=20=20 Suggested by Dario Gjorgjevski . =20=20=20=20 * lisp/minibuffer.el (completion-pcm--hilit-commonality): Fix occasional misplacement of completions-first-differente. commit d8c596f7309bd6fd6e127b8027dfb4c508afd2ea Author: Jo=C3=A3o T=C3=A1vora Date: Mon Dec 28 09:10:19 2020 +0000 Robustify a helper function for test/lisp/minibuffer-tests.el =20=20=20=20 completion--pcm-first-difference-pos wasn't taking into account the fact that faces may come in lists. bug#42149 =20=20=20=20 * test/lisp/minibuffer-tests.el (completion--pcm-first-difference-pos): Robustify. commit d333ec4cabd21244e5ee468b3a7475fa2dcbe614 Author: Jo=C3=A3o T=C3=A1vora Date: Tue Nov 24 23:15:40 2020 +0000 Make a completion test robust to custom completion styles =20=20=20=20 * test/lisp/minibuffer-tests.el (completion-test1): Make test resilient to more completion styles. commit 0265a99ed6b035930fdb21d5bcfdab0707b303aa Author: Jo=C3=A3o T=C3=A1vora Date: Tue Nov 24 22:34:22 2020 +0000 Add tests for bug#42149 =20=20=20=20 * test/lisp/minibuffer-tests.el (completion--pcm-score) (completion--pcm-first-difference-pos): New helpers. (completion-pcm-test-1, completion-pcm-test-2) (completion-pcm-test-3, completion-pcm-test-4) (completion-pcm-test-5, completion-pcm-test-6) (completion-substring-test-1, completion-substring-test-2) (completion-substring-test-3, completion-substring-test-4) (completion-flex-test-1, completion-flex-test-2) (completion-flex-test-3): New tests. =20=20=20=20 Co-authored-by: Dario Gjorgjevski Jo=C3=A3o