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: Sun, 9 Jun 2024 23:38:57 +0300 Message-ID: <1dc364dc-1a16-4de4-9372-767906494610@gutov.dev> References: <96abea7d-3e18-4a81-8b6c-79dd0b496420@gutov.dev> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4121"; 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 Sun Jun 09 22:47:00 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 1sGPRL-0000sz-GK for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 09 Jun 2024 22:47:00 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sGPRA-0002fG-LK; Sun, 09 Jun 2024 16:46:48 -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 1sGPR9-0002eq-Ch for bug-gnu-emacs@gnu.org; Sun, 09 Jun 2024 16:46:47 -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 1sGPR7-0000PW-SF for bug-gnu-emacs@gnu.org; Sun, 09 Jun 2024 16:46:47 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sGPRO-0000Eo-Cm for bug-gnu-emacs@gnu.org; Sun, 09 Jun 2024 16:47: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: Sun, 09 Jun 2024 20:47: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.1717966000852 (code B ref 71419); Sun, 09 Jun 2024 20:47:02 +0000 Original-Received: (at 71419) by debbugs.gnu.org; 9 Jun 2024 20:46:40 +0000 Original-Received: from localhost ([127.0.0.1]:59602 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sGPR1-0000Dg-Ib for submit@debbugs.gnu.org; Sun, 09 Jun 2024 16:46:39 -0400 Original-Received: from wfout4-smtp.messagingengine.com ([64.147.123.147]:41631) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sGPQy-0000DD-D7 for 71419@debbugs.gnu.org; Sun, 09 Jun 2024 16:46:37 -0400 Original-Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailfout.west.internal (Postfix) with ESMTP id 837001C00086; Sun, 9 Jun 2024 16:39:00 -0400 (EDT) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Sun, 09 Jun 2024 16:39:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding: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=1717965540; x=1718051940; bh=Z8s4RXWWELCiGWqZioPKnoYBoI9Wt+2aG+UFp8++Mz0=; b= Frr/HStWuojbT2kJQ8gqbQ/WwMVj/Ef2vUHD4m7arHN2rT9D5VJUl0Gu1VDF+uXd Isk7o643+FyfQL4sfpDI8OZmoc8F4UEpESUvM4c3NLeqHZulWq8ALu4om10j+sD0 6sVOj4f8qG/Pg5VfQ8lg4QXdjGz/BEQU04ewLBhiqzpXKiAnfEDMyy9CuEZrXWlU GZbUgWImphFkUBd/h3LBbSIJ521H09p+UTryLL9+J9t8usFoSTYRZUGSnrYPuH+L X9ts59b2vgf4HlECQAO7g0/L+Vc934Q8sMeIvNgpNY990a6S6HABh9PkAPU++KUE N3VUBpa1sJcUhzKPnQXHHA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :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=1717965540; x= 1718051940; bh=Z8s4RXWWELCiGWqZioPKnoYBoI9Wt+2aG+UFp8++Mz0=; b=W 4MuvDnBTKkv4owSWpfR++b4rT2MM6V1Y6wIoC/uPGtrNerW/6Hjh8EWbYSRE1EgQ 17RT2Y+WOuIJaIk7WvCAcZAOOgBj/46TJHOff+IzZQ/lYY3B+hbY8BLqQNO6+IQP 39A6TKbW9JPDOKLFnsnoZdi44qEMK8N+Kn1k31yyzPcndJZ/RQkVOgAvbAs8mXSD 5UMbVRUn4yHJkvZeBBZ45Ywh5ZEv32Rxqf1E/5MLrTqVlExg1nXNWIy+EOF6zxgb 98ozZhokm51hV4pC4OBHDF0jMgIUfvwdUN/KOSF5NPdvLNQygRKr02cR3ZWu6094 oufJQzd1//bja9sOOzwnQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrfedtjedgudehtdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefkffggfgfuvfevfhfhjggtgfesthejredttddvjeenucfhrhhomhepffhm ihhtrhihucfiuhhtohhvuceoughmihhtrhihsehguhhtohhvrdguvghvqeenucggtffrrg htthgvrhhnpeetudeljeegheetgfehgeejkeeuhedvveeikeeufedtvddtveefhfdvveeg udejheenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe gumhhithhrhiesghhuthhovhdruggvvh X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 9 Jun 2024 16:38:59 -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:286974 Archived-At: On 09/06/2024 16:52, Stefan Monnier wrote: >> For example: >> >> 1. Type (fo|-function >> 2. C-M-i >> >> You get 5 completions (the exact number is not important), where "fo" is >> highlighted in all of them, but "function is not. > > Looks like a bug in the `basic` completion style: it filters things that > match the glob pattern `fo*-function` yet it only highlights the prefix. Yes, thanks. Looks like this one-liner fixes it: 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. >> Also, highlighting is information. If it was more uniform, we could use >> it to e.g. address the FIXME in completion-all-completions. > > I don't think it could be trusted to always provide the needed data (and > even if it does, it would be sufficiently clunky to use that I'm not > sure we'd want to rely on it). You're probably right. 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.