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: Sun, 25 Apr 2021 22:35:00 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1

On 25.04.2021 16:32, Daniel Mendler wrote:
I attached a patch which adds grouping support to the completions buffer. The completion table can specify a `group-function` via its completion metadata.

Currently groups are only displayed in the *Completions* buffer if `completions-format=one-column`. My proposal is to split up the function `completion--insert-strings` into three functions `completion--insert-strings-one-column/vertical/horizontal` in a follow-up patch. Then the grouping display can also be implemented for the other display formats.

Group title support is already present in the Vertico, Selectrum and external Icomplete-vertical UI. Similarly we can add support to the recently added `icomplete-vertical-mode` by Gregory.

There is a patch to `xref.el` included, which makes use of the grouping functionality, when the `completing-read` show function is used:

(setq xref-show-xrefs-function #'xref-show-definitions-completing-read)

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.

I wonder if there can be other examples of group-function usage added which work okay with the default completion UI.

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.

Another minor issue is that the docstring still says "Return title of candidate" rather than "group title" or "group name".

Not going to comment on the changes to minibuffer.el, at least for now.



reply via email to

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