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#47711: bug#48841: bug#47711: bug#48841: bug#47711: [PATCH VERSION 2] Add new `completion-filter-completions` API and deferred highlighting Date: Tue, 31 Oct 2023 22:52:06 +0200 Message-ID: <5181f95e-61e7-c8c4-6389-44ee57e0c749@gutov.dev> References: <3d3f894f-a6fa-53ae-5d50-c3aa9bffc73e@daniel-mendler.de> <56ab18b1-4348-9b2c-85bb-af9b76cd429a@daniel-mendler.de> <328f87eb-6474-1442-e1ca-9ae8deb2a84a@yandex.ru> <83fsvcbio7.fsf@gnu.org> <9f432d18-e70f-54c1-0173-1899fb66d176@gutov.dev> <877cnafv39.fsf@gmail.com> <9447dde3-b8e7-2ec0-9a9c-72c4cf9d12a8@gutov.dev> <7d14bc13-4419-816c-5708-c42988c39c02@gutov.dev> <5d0a78cc-4fa0-ef04-3462-1826f17d7d56@gutov.dev> <877cn8asud.fsf@gmail.com> <8734xtauqj.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4481"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Cc: Daniel Mendler , Eli Zaretskii , Stefan Monnier , 47711@debbugs.gnu.org To: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Oct 31 21:52:53 2023 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 1qxvjH-0000uE-NJ for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 31 Oct 2023 21:52:52 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qxviw-0001rq-37; Tue, 31 Oct 2023 16:52:30 -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 1qxviu-0001qo-86 for bug-gnu-emacs@gnu.org; Tue, 31 Oct 2023 16:52:28 -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 1qxvit-0001L3-Sy for bug-gnu-emacs@gnu.org; Tue, 31 Oct 2023 16:52:27 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qxvjR-0004hc-PU for bug-gnu-emacs@gnu.org; Tue, 31 Oct 2023 16:53:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 31 Oct 2023 20:53:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 47711 X-GNU-PR-Package: emacs Original-Received: via spool by 47711-submit@debbugs.gnu.org id=B47711.169878557618066 (code B ref 47711); Tue, 31 Oct 2023 20:53:01 +0000 Original-Received: (at 47711) by debbugs.gnu.org; 31 Oct 2023 20:52:56 +0000 Original-Received: from localhost ([127.0.0.1]:49380 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qxvjL-0004hI-W3 for submit@debbugs.gnu.org; Tue, 31 Oct 2023 16:52:56 -0400 Original-Received: from wout3-smtp.messagingengine.com ([64.147.123.19]:44727) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qxvjI-0004h2-8d for 47711@debbugs.gnu.org; Tue, 31 Oct 2023 16:52:53 -0400 Original-Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id EF41032009D2; Tue, 31 Oct 2023 16:52:10 -0400 (EDT) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Tue, 31 Oct 2023 16:52:11 -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:sender:subject:subject:to:to; s=fm2; t= 1698785530; x=1698871930; bh=UmS9zeCKzfDDRZoWryamZWOz6AfHjirJySz LTlRqmKc=; b=HXArrWOg8Xq2fOUDtQHSumUyX6f1tX/LAFfpQ0ES4lwhWb3i1yy aZVqlmF4VstpkjSZlNOCqOuvAkph5Oa1IQRpRD8ehXiy25KS+WMiVAYoO+0vBGup 2rI5V+1pin2eSr0JK7rj5rVhg0WRRa2xX4lZpKigEkVnC9sYAYkdQlj8RPo0NZpx SH3xmt8nybriJSg1i64YMCm0vkYerHHel9K9rwSshbksff5/acbFFiiSFWt7N3Ul /Wb8tPqGsfz7VfE1KX1AteABFWZvuFFW79C+Y5FGpJNdhzNl5DvtIPJAbOIUu+Kc FLUQp1BICycbDUqqCfnPJNJ1T7Dmj5sp4CQ== 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:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1698785530; x=1698871930; bh=UmS9zeCKzfDDRZoWryamZWOz6AfHjirJySz LTlRqmKc=; b=PlxSH5AcQYogzy8SKeBBAth/4Lt2Z3M5Trd1AjqN94+Sloylf1p aLCbYVYvlAEqHadGyUyF8ZMSWweXXW3MljxOX0TaJfN0jf1QKA3ntUozm0Q6WYOB C5Y6eJq5F/L3dvQK/6jpRO/syKU+7dlQjTYQC0pa5I+yDx1vFfArl/95sPb69cqN GEgV2zx8Vf1ctSPgQPF7TlYIJ/yVsmjIIjxS6hmY+U9gxW10MOC/uYVpK1Bp9pta IQq6QZoatvqoMe06BHmO5NxfAmTW6HON2TT0gcBfVbw+1XWdq/6zDi6wD01aAm7a EoomyE4ggoU2psXmzT73wzgQUaXZGUPh3yQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedruddtvddgudegtdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefkffggfgfuvfevfhfhjggtgfesthekredttdefjeenucfhrhhomhepffhm ihhtrhihucfiuhhtohhvuceoughmihhtrhihsehguhhtohhvrdguvghvqeenucggtffrrg htthgvrhhnpefhffehleejffegffeugefhkeektdffgfehjedvgeejtedtudehueffgffg feejheenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe gumhhithhrhiesghhuthhovhdruggvvh X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 31 Oct 2023 16:52:08 -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:273573 Archived-At: On 31/10/2023 12:55, João Távora wrote: >> Which keys are those? I only know about one key - 'completion-score'. > > Yes, that's the one. I suppose adding this key to the property lists of > large number of strings, which is only done once, is what's causing > the anomaly. Ah, I didn't realize that the text property/value pairs were stored as plists internally as well. And that also triggers consing. >>>> But if course it would be nice to avoid the wart, so if you have any >>>> better ideas, they are welcome. >>> >>> I'm not saying it would necessarily spread even further, but if you want >>> to do scoring "just in time" like I suggested -- presumably to >>> completely avoid propertizing strings -- that particular wart spreads a >>> little more and thus becomes something that is slightly harder to remove >>> later on. >> >> Could you describe the other places you think it might spread to? Other >> completion styles like Orderless? > > Maybe, I don't know. But here I just meant that to do that idea it spreads > only one further degree. I'm not saying it would necessarily spread even > further. It seems like the only code that would be concerned with it are completion styles that also do sorting, or completion tables that would do similar things to this "with quoting" business. But I'm not aware of any other examples of the latter aside from what is inside Emacs itself. >> Anyway, have you looked into what it would take to solve it? > > No, naively, I just think it's a similar situation of display and business > logic being mixed up. Presumably the quoted stuff is just for insertion > (and display?), and the unquoted stuff is what patterns/scoring should > operate on. Apparently it's good for insertion, but according to that comment inside the function, the unquoted stuff might actually be better for display. I'm not 100% clear which of the versions is better for scoring/highlighting, but apparently the unquoted one. > But, IMO, there's no need to tackle it right now. > > If the thing holding you back from the lazy-hilit-2023-v4.patch is the > completion-score propertization, I can move it to the sorting step > in a future v5 and add spread the completion--unquoted thing a little > bit more. I think that's the main blocker, yes.