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: Tue, 29 Dec 2020 13:27:05 +0000 Message-ID: <87ft3oivyu.fsf@gmail.com> References: <87sgbsv7gg.fsf@gmail.com> <877dp1kfzz.fsf@gmail.com> <8735zpjz64.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="12122"; 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 Tue Dec 29 14:28:34 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 1kuF3B-0002oS-TZ for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 29 Dec 2020 14:28:34 +0100 Original-Received: from localhost ([::1]:58716 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kuF3A-00015G-TU for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 29 Dec 2020 08:28:32 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36540) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kuF2h-00014g-2g for bug-gnu-emacs@gnu.org; Tue, 29 Dec 2020 08:28:04 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:54670) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kuF2g-0003NO-HW for bug-gnu-emacs@gnu.org; Tue, 29 Dec 2020 08:28:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kuF2g-0003iQ-Av for bug-gnu-emacs@gnu.org; Tue, 29 Dec 2020 08:28:02 -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: Tue, 29 Dec 2020 13:28: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.160924843914232 (code B ref 42149); Tue, 29 Dec 2020 13:28:02 +0000 Original-Received: (at 42149) by debbugs.gnu.org; 29 Dec 2020 13:27:19 +0000 Original-Received: from localhost ([127.0.0.1]:37983 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kuF1z-0003hU-2n for submit@debbugs.gnu.org; Tue, 29 Dec 2020 08:27:19 -0500 Original-Received: from mail-wm1-f54.google.com ([209.85.128.54]:34132) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kuF1w-0003hF-A0 for 42149@debbugs.gnu.org; Tue, 29 Dec 2020 08:27:17 -0500 Original-Received: by mail-wm1-f54.google.com with SMTP id g25so1239778wmh.1 for <42149@debbugs.gnu.org>; Tue, 29 Dec 2020 05:27:16 -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=ChLAjYvGxdpquRVo7eFXQX11v8cvxG9nCL6xs/k6Nkc=; b=tc7g12ER1ctSUJIyjFAmn4n/NDvdrdiKzUPfpvOAS7Z8ilrpbXdjKv5ME72Kx8cgnQ LSosPs7r0AadaaRH6c7CWKCKGtUtAlt0KrfSmdBvWe2XLnE2EMw0r5uh7Xtw+UfhLNAQ YVKewSSh8AMRbe9k7KpTK7WzomSqkI5qpWrKnAq1IQYCGQfpcXlpjM4HTdU/tt+wNtaR IF+qLChIE9FN0bQaDJJfWC61kohRQagESJ0GPUaAftJchpSXmGzjLQiyVEPSKYnBzdWi D3s6q0huQyE55zNF2soxMG8r8uxm4tzkoguPNUgiOKJpcwSUMGsuufMvGEP+B+02ynfb HlNw== 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=ChLAjYvGxdpquRVo7eFXQX11v8cvxG9nCL6xs/k6Nkc=; b=WIm791ZlrfRz+yFT+4uMnA93JJgu+gTPAhg28rHBcez9fxoYJSqmhDgo1jNctKsh5f c1hW3JNMHfntcarL5Z0jLnQMUuRiJcTCQjLYMd1ZhPqLF9hSABoC9FKs4GtD/TWC/5rg nOPpc43A5E6hUajnwcbcJWaRvie9hDpgn8Bfh+vCR94vjHOauMT/6SgqgzwWD818239r 683J0EGoAdtKMzfC5AAk9PD0EjJRLlLLivqHCJkKMxqV8jdd0+KkrRzUx/qgCfBBZPaI Cxi1sB0zUF7K9IRT4o0WpzgJgIoV+lkHmjX0r2pDAXN3NzYH+2g0RyzoTUCoesSdCShW y9wA== X-Gm-Message-State: AOAM530qr/fp86TSYVJ0JJLyqydqmfanSWBSRhvjxyxnUwykiu0DNCMH mFS1X7jT09uaoUk5tdglmBLj8fyI6EU= X-Google-Smtp-Source: ABdhPJyYb0iVxR8Yicr0Ew44rgRV079dSn/5HRnZVQVQ0AgHpARzxO1uJKQZIM+yvGZHwcCoJCWqSg== X-Received: by 2002:a1c:e0d4:: with SMTP id x203mr3616983wmg.68.1609248429894; Tue, 29 Dec 2020 05:27:09 -0800 (PST) Original-Received: from krug (222.201.137.78.rev.vodafone.pt. [78.137.201.222]) by smtp.gmail.com with ESMTPSA id r7sm3490967wmh.2.2020.12.29.05.27.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Dec 2020 05:27:08 -0800 (PST) In-Reply-To: <8735zpjz64.fsf@gmail.com> ("=?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?="'s message of "Mon, 28 Dec 2020 23:20:19 +0000") 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:196925 Archived-At: Jo=C3=A3o T=C3=A1vora writes: > Stefan Monnier writes: > >>> I think this elimination of consecutive `any' should also be included in >>> Jo=C3=A3o=E2=80=99s branch. >> >> I just pushed (a rewrite of) that change to `master`. > > 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. Meanwhile, I found that the patch after my sig fixes the remaining two Dario tests, concerning the presumed misplacement of 'completions-first-difference. I hadn't touched this part explicitly, and it doesn't seem to make a world of difference, so I'll leave it up to you two if we should isntall something like this or not. (I do think some form of tests should go in). I'll put this bit of patch in the side branch scratch/bug-42149-funny-pcm-completion-scores, too Jo=C3=A3o diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index dc37c5f447..074d436b35 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -3332,11 +3332,12 @@ completion-pcm--hilit-commonality ;; for that extra bit of match (bug#42149). (unless (=3D from match-end) (funcall update-score-and-face from match-end)) - (if (> (length str) pos) - (add-face-text-property - pos (1+ pos) - 'completions-first-difference - nil str)) + (cl-loop for p from pos below (length str) + unless (eq (get-text-property p 'face str) + 'completions-common-part) + return (add-face-text-property p (1+ p) + 'completions-first-diff= erence + nil str)) (unless (zerop (length str)) (put-text-property 0 1 'completion-score