emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] `completing-read`: Add `group-function` support to completio


From: Dmitry Gutov
Subject: Re: [PATCH] `completing-read`: Add `group-function` support to completion metadata
Date: Mon, 26 Apr 2021 00:50:37 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1

On 25.04.2021 22:47, Daniel Mendler wrote:
On 4/25/21 9:35 PM, Dmitry Gutov wrote:
The result looks nice (when enabled), though this function still doesn't work very well with the default completing read. So whether this feature works okay will depend on the alternative UI used.

Dmitry, thank you for looking at the patch!

What do you mean exactly by "it does not work well"?

Sorry, I was basically referring to an earlier discussions where the consensus was that xref-show-definitions-completiong-read doesn't play very well with the default completing-read. Its completion table is odd, one could say. The proposed feature simply doesn't change that.

Perhaps if all currently planned uses of group-function are similarly "odd" (and no additional uses in the core are going to be added in the foreseeable future), you don't need to worry/care about having :group-function added to the core, or at least not yet. Or about updating the *Completions* UI.

And keep it like "unofficial extension", which I'll be happy to support in Xref anyway (and Xref is in ELPA Core, so users will always be able to install the latest version). There are benefits to being such extension: once you're a proper part of the protocol, you become much more set in stone.

Speaking of group-function's implementation there, the text-properties approach seems like an overkill since we can reliably string-match anyway. But it's a minor thing.

I've chosen the text property approach such that the group title retrieval does not lead to allocations (transform=nil). The transform=nil call is performance critical for continuously updating UIs like Icomplete, Vertico etc., since the candidates are grouped after sorting.

But when the list is updated, the elements are basically recreated from the external process's output every time, right? So this only helps if you want to cache the result for repeated invocations of group-function on the same result set.

I'd be curious to see some benchmark results for both versions.

Also, xref-find-definitions usually deals with a limited number of search results. But I guess some of your users set xref-show-xrefs-function to xref-show-definitions-completiong-read too.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]