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: Thu, 2 Nov 2023 16:40:29 +0200 Message-ID: References: <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> <5181f95e-61e7-c8c4-6389-44ee57e0c749@gutov.dev> <31cadbfd-d086-a04f-0ed9-17ce70b4282c@gutov.dev> 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="36668"; 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 Thu Nov 02 15:41:48 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 1qyYtH-0009IP-AZ for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 02 Nov 2023 15:41:48 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qyYsy-0000nM-R1; Thu, 02 Nov 2023 10:41:28 -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 1qyYsx-0000nB-BD for bug-gnu-emacs@gnu.org; Thu, 02 Nov 2023 10:41:27 -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 1qyYsx-0005ge-3A for bug-gnu-emacs@gnu.org; Thu, 02 Nov 2023 10:41:27 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qyYtV-0005QH-Lz for bug-gnu-emacs@gnu.org; Thu, 02 Nov 2023 10:42: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: Thu, 02 Nov 2023 14:42: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.169893609720814 (code B ref 47711); Thu, 02 Nov 2023 14:42:01 +0000 Original-Received: (at 47711) by debbugs.gnu.org; 2 Nov 2023 14:41:37 +0000 Original-Received: from localhost ([127.0.0.1]:55705 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qyYt3-0005PX-CC for submit@debbugs.gnu.org; Thu, 02 Nov 2023 10:41:37 -0400 Original-Received: from wout2-smtp.messagingengine.com ([64.147.123.25]:37119) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qyYsm-0005Ot-FD for 47711@debbugs.gnu.org; Thu, 02 Nov 2023 10:41:31 -0400 Original-Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id 738D8320046F; Thu, 2 Nov 2023 10:40:34 -0400 (EDT) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Thu, 02 Nov 2023 10:40:34 -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= 1698936033; x=1699022433; bh=EWF5POCf3+e108eOVZ6h/3WW3qmiCykTFTG MuCc9o1U=; b=QlC2BTQRv5COR5T17NBS5PzKPlnGRt8AgUPiwwcq8Z7TW8P4JWb oMFyJ/VqCblJK4ss4flCARoQor4inVuRmkP+2FxIDjm3Mx/ejWREYdrcsPbfojN3 hgvhye5YHtPd/7gvR7uhnWkevS9+AcbTArgAlEYVIXBq5hCZbJxkmNpx+6juxu1J zWudnpjP5uysDEMhQNURE7IiWPnk9NxZc+unY4GzEP1+ma1Q7U83L0dh64+oPxVM boF6ohbeH2Q2+k6Jkw4C0s9JRtM4gkV+TWgeROUrNIXPiD+e5EPd/G72U0s/J77T uMwcAcd8iOHqzLJJ0HLBGwKo5+OXdLw7qHQ== 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= 1698936033; x=1699022433; bh=EWF5POCf3+e108eOVZ6h/3WW3qmiCykTFTG MuCc9o1U=; b=Ieog6pUFNQ2DBf+Sfbq8rj11VbwWAfQYe/2Wsg/c0wJqSOO+mkM dArfmWTDfbFHaOS1JAn39RWY+hml/n3nZOb24ynWcs+jrOL4+C2EL6wiFef1MbAj X77fn1zt53rfFEvCWivfTbCXq8wSBSEa6GYM8ruBROY+vIRw9AfYcJIYR9He0d2Y dZ8Dn5YNg/Ott9LNQv+zL41KFbOhLIGzuNyDgs8N5x7iqpKlQh8kRPPKf2QVzzRp bUgIKa/W1Mfrfmba9yjdthdPbSA7ZpIZYuFrEibzDaaddNfIRhq4g+fUUZyFtyHr 03ZNBElqMFTHP/yEC11Aj+5fBsg/wX/c8TA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedruddtiedgieejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtkeertddtfeejnecuhfhrohhmpeffmhhi thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth htvghrnhephfffheeljeffgeffueeghfekkedtfffgheejvdegjeettdduheeufffggfef jeehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepug hmihhtrhihsehguhhtohhvrdguvghv X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 2 Nov 2023 10:40:31 -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:273652 Archived-At: On 02/11/2023 11:48, João Távora wrote: > On Wed, Nov 1, 2023 at 10:45 PM Dmitry Gutov wrote: > >>> If orderless (which I've never tried), does some kind of scoring of >>> completions, it probably also needs the same complications of flex. >> >> Turns out, Orderless doesn't do any scoring or sorting. Only filtering. > > Interesting, so if I M-x d i f f with orderless I don't get results in > any particular order? Right. And input "diff" actually results in prefix-only matching. But if the input contains space (or any other pre-configured delimiter character), then it's translated to a set of substring matches, performed in any order. So "diff mode" does not translate to ".*diff.*mode", but a more complex regexp with all permutations. IOW, this whole approach results in stricter matching with fewer results, so a smarter sort isn't that necessary. >>>>>> 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. >>> >>> No idea what the unquoted stuff is for, so I haven't really tested it. >> >> A couple of scenarios: > > Thanks. Then I think it is working OK, but it would be safer if you were > to double-check yourself, as I really never use this functionality. They look okay, yes. I imagine Daniel also tested the 'completion--unquoted' solution before offering his patches. > I addressed all your docstring suggestions, fixed a bug and significantly > simplified the code in the latest version of the patch. I also > removed the instrumentation in icomplete.el. Patch attached here > and pushed to feature/completion-lazy-hilit. Thank you. I don't see that the bug was, but deferring the scoring even in the eager highlighting case looks sensible (why not, indeed, if the performance is no worse).