From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#71419: 30.0.50; Completion does not always highlight the "common part" corresponding to suffix Date: Thu, 13 Jun 2024 02:57:43 +0300 Message-ID: <8446cd2d-7f27-4742-8193-3d83e7ef5f21@gutov.dev> References: <96abea7d-3e18-4a81-8b6c-79dd0b496420@gutov.dev> <1dc364dc-1a16-4de4-9372-767906494610@gutov.dev> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------LEGlwJ5I30yCb0AQRQRsEqAn" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19523"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird Cc: 71419@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jun 13 01:58:33 2024 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 1sHXrM-0004sa-DV for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 13 Jun 2024 01:58:33 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sHXqv-0002Ni-I3; Wed, 12 Jun 2024 19:58:05 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sHXqt-0002NT-K8 for bug-gnu-emacs@gnu.org; Wed, 12 Jun 2024 19:58:03 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sHXqt-0002KJ-Bt for bug-gnu-emacs@gnu.org; Wed, 12 Jun 2024 19:58:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sHXqs-0001Y9-GQ for bug-gnu-emacs@gnu.org; Wed, 12 Jun 2024 19:58:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 12 Jun 2024 23:58:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71419 X-GNU-PR-Package: emacs Original-Received: via spool by 71419-submit@debbugs.gnu.org id=B71419.17182366755930 (code B ref 71419); Wed, 12 Jun 2024 23:58:02 +0000 Original-Received: (at 71419) by debbugs.gnu.org; 12 Jun 2024 23:57:55 +0000 Original-Received: from localhost ([127.0.0.1]:60316 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sHXqk-0001XY-Iv for submit@debbugs.gnu.org; Wed, 12 Jun 2024 19:57:54 -0400 Original-Received: from fout6-smtp.messagingengine.com ([103.168.172.149]:57725) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sHXqh-0001XE-Nu for 71419@debbugs.gnu.org; Wed, 12 Jun 2024 19:57:52 -0400 Original-Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailfout.nyi.internal (Postfix) with ESMTP id 3DB67138014F; Wed, 12 Jun 2024 19:57:47 -0400 (EDT) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Wed, 12 Jun 2024 19:57:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm3; t=1718236667; x=1718323067; bh=j4biu7YSLx pOqq2PYhBjroceHfjBtZXKzxw2aPk6qwA=; b=fkhaPSgNWoHHL8fYYxCrji0F8T pNWnuj2FGcnW4DgbWuSjPa31ITprPkV4UsfJAQ/vnmmAVVYG7A3t4oeGuU5O3WWy eUCeO3A0qyj337d0l8iDWo0EkOCBN76uuQx/j+oZQNGjMjFzy3axXhYTJ4z80OA0 iELbiTzb2sykoColhhAmXzRQ+ek6TUuVZVDtRTN2Hr5tKfulIWXVZhOiTWtUZXLJ 2ZYhSiyuGpL4RpIjOAkw7H+XY/lVstd4dR+SD1+mN3DdLG5oRLKJPebk+xAGBOYG uw1B+pY3mAWUs1hmbEeIcIMbOTsBFU4XqJd4iCs/L6/8We8C+QR41X7yPAzQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; t=1718236667; x=1718323067; bh=j4biu7YSLxpOqq2PYhBjroceHfjB tZXKzxw2aPk6qwA=; b=e9QWPfI1kL/3FrbBhheeOMdweQjcHyMh2GrmSU04HjT6 RPqIDvVdIbMUIGWEu32y6er0jBdL1lH/M+ODN9OIMB2L09KvwaUwPIuYGdpbpBAR oEQx4TixiLSbF0f1ipxsHcIboaleyyVxttxBp/sSNDRB/fTTSQErJHHcB0Gbpjdo RwsU46ddEPHxTot0fKMS5onVkiocmxL6H3DzKcpTINK5dCZXSe1bbnGcYDaSGiyi S0uHtjhTL8N70P19lrOq1DbmFJocohoUYzMdrew4KSk7ZffOSGRFZCvx1mmuiCGC fWfWTPpKYCqO7icImZEJlKpJOWlAdrZbBfVuVsO8cg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrfeduiedgtdejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurheptgfkffggfgfuvfevfhfhjgesmhdtreertddvjeenucfhrhhomhepffhmihht rhihucfiuhhtohhvuceoughmihhtrhihsehguhhtohhvrdguvghvqeenucggtffrrghtth gvrhhnpeehleefudekudduveekieelgfeiffdvkefhkeeljeeujeegueekveffkeejjeev heenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegumh hithhrhiesghhuthhovhdruggvvh X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 12 Jun 2024 19:57:46 -0400 (EDT) Content-Language: en-US In-Reply-To: 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:287172 Archived-At: This is a multi-part message in MIME format. --------------LEGlwJ5I30yCb0AQRQRsEqAn Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 10/06/2024 00:06, Stefan Monnier wrote: >> diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el >> index f62cb2566b2..144cda8cfdc 100644 >> --- a/lisp/minibuffer.el >> +++ b/lisp/minibuffer.el >> @@ -3816,7 +3816,7 @@ completion-basic-all-completions >> 'point >> (substring afterpoint 0 (cdr bounds))))) >> (all (completion-pcm--all-completions prefix pattern table pred))) >> - (completion-hilit-commonality all point (car bounds)))) >> + (completion-pcm--hilit-commonality pattern all))) >> >> ;;; Partial-completion-mode style completion. > > Thanks for tracking it down. It matches my expectation. Thanks, now fixed on master. >> But it would have been nice to be able to use it in the "progressive >> improvement" kind of fashion: when the suffix and the other parts are >> highlighted correctly, we do the right thing; if the style missed the >> suffix highlighting, we do the other thing - and put the responsibility on >> the third party. > > 🙂 It could work like in the attached. I agree that it's somewhat brittle, though. If you're not in favor of installing this patch, what would be your preferred strategy for fixing bug#70968? We could try resurrecting the relevant part of Daniel's patch for completion-all-completions, but it means a fair amount of breakage. Or another dynamic variable similar to completion-lazy-hilit-fn... FWIW my interest here is how to better implement the same step in company-mode, but the default UI is a good common ground. --------------LEGlwJ5I30yCb0AQRQRsEqAn Content-Type: text/x-patch; charset=UTF-8; name="completions--count-common-spans.diff" Content-Disposition: attachment; filename="completions--count-common-spans.diff" Content-Transfer-Encoding: base64 ZGlmZiAtLWdpdCBhL2xpc3AvbWluaWJ1ZmZlci5lbCBiL2xpc3AvbWluaWJ1ZmZlci5lbApp bmRleCAxNDRjZGE4Y2ZkYy4uZDg5NTIwOTQxOTYgMTAwNjQ0Ci0tLSBhL2xpc3AvbWluaWJ1 ZmZlci5lbAorKysgYi9saXNwL21pbmlidWZmZXIuZWwKQEAgLTI1NTEsNiArMjU1MSwyNSBA QCBjb21wbGV0aW9ucy0tYWZ0ZXItY2hhbmdlCiAgICAgICAod2l0aC1zZWxlY3RlZC13aW5k b3cgd2luZG93CiAgICAgICAgIChjb21wbGV0aW9ucy0tZGVzZWxlY3QpKSkpKQogCisoZGVm dW4gY29tcGxldGlvbnMtLWNvdW50LWNvbW1vbi1zcGFucyAoc3RyKQorICAobGV0ICgocG9z IDApCisgICAgICAgIHByZXYtcG9zCisgICAgICAgIHZhbHVlCisgICAgICAgIChzdW0gMCkp CisgICAgKHdoaWxlIHBvcworICAgICAgKHdoZW4gcHJldi1wb3MKKyAgICAgICAgKGNsLWlu Y2Ygc3VtICgtIHBvcyBwcmV2LXBvcykpKQorICAgICAgKGlmIChhbmQgKHNldHEgdmFsdWUg KGdldC10ZXh0LXByb3BlcnR5IHBvcyAnZmFjZSBzdHIpKQorICAgICAgICAgICAgICAgKGlm IChsaXN0cCB2YWx1ZSkKKyAgICAgICAgICAgICAgICAgICAobWVtcSAnY29tcGxldGlvbnMt Y29tbW9uLXBhcnQgdmFsdWUpCisgICAgICAgICAgICAgICAgIChlcSAnY29tcGxldGlvbnMt Y29tbW9uLXBhcnQgdmFsdWUpKSkKKyAgICAgICAgICAoc2V0cSBwcmV2LXBvcyBwb3MpCisg ICAgICAgIChzZXRxIHByZXYtcG9zIG5pbCkpCisgICAgICAoc2V0cSBwb3MgKG5leHQtc2lu Z2xlLXByb3BlcnR5LWNoYW5nZSBwb3MgJ2ZhY2Ugc3RyKSkKKyAgICAgICh3aGVuIChhbmQg KG5vdCBwb3MpIHByZXYtcG9zKQorICAgICAgICAoY2wtaW5jZiBzdW0gKC0gKGxlbmd0aCBz dHIpIHByZXYtcG9zKSkpKQorICAgIHN1bSkpCisKIChkZWZ1biBtaW5pYnVmZmVyLWNvbXBs ZXRpb24taGVscCAoJm9wdGlvbmFsIHN0YXJ0IGVuZCkKICAgIkRpc3BsYXkgYSBsaXN0IG9m IHBvc3NpYmxlIGNvbXBsZXRpb25zIG9mIHRoZSBjdXJyZW50IG1pbmlidWZmZXIgY29udGVu dHMuIgogICAoaW50ZXJhY3RpdmUpCkBAIC0yNzA2LDYgKzI3MjUsMTAgQEAgbWluaWJ1ZmZl ci1jb21wbGV0aW9uLWhlbHAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDs7 IGJ1dCB0aGF0IGNsYXNoZWQgd2l0aCBhbm90aGVyIGV4aXN0aW5nIG1hcmtlci4KICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIChjbC1kZWNmIChudGggMSBiYXNlLXBvc2l0 aW9uKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKC0gZW5k IHN0YXJ0IChsZW5ndGggY2hvaWNlKSkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICA7OyBDb21wbGV0aW9uIHN0eWxlIHRoYXQgZG9lc24ndCBtYXRjaCBzdWZmaXguCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodW5sZXNzICg+IChjb21wbGV0aW9u cy0tY291bnQtY29tbW9uLXNwYW5zIGNob2ljZSkKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgKC0gKHBvaW50KSBzdGFydCkpCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIChzZXRxIGVuZCAocG9pbnQpKSkKICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIDs7IEZJWE1FOiBVc2UgYG1kJyB0byBkbyBxdW90aW5n JnRlcm1pbmF0b3IgaGVyZS4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChj b21wbGV0aW9uLS1yZXBsYWNlIHN0YXJ0IChtaW4gZW5kIChwb2ludC1tYXgpKSBjaG9pY2Up CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobGV0KiAoKG1pbmlidWZmZXIt Y29tcGxldGlvbi10YWJsZSBjdGFibGUpCg== --------------LEGlwJ5I30yCb0AQRQRsEqAn--