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) Daniel