unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Dmitry Gutov <dgutov@yandex.ru>
To: 48545@debbugs.gnu.org, joaotavora@gmail.com, mail@daniel-mendler.de
Subject: bug#48545: 28.0.50; `icomplete-vertical-mode` does not support the `group-function`
Date: Thu, 19 Aug 2021 18:02:57 +0300	[thread overview]
Message-ID: <54e4e409-5525-b796-9e9c-582735995cc1@yandex.ru> (raw)
In-Reply-To: <871r6pr8bk.fsf@gmail.com>

On 19.08.2021 14:18, João Távora wrote:
> I noticed a quirk, though.  If I add '-l etags' to the 'emacs -Q' line,
> one gets 6 matches instead of 5 (due to etags having another
> xref-location-marker).  That's fine, but due to the default
> alphanumeric/length sorting, it gets shoved into the group of xref.el
> matches and thus we get two xref.el groups.  I.e. it looks like
> 
>      xref.el
>      (cl-defgeneric xref-location-marker)
>      (cl-defmethod xref-location-marker ((l xref-file-location)))
>      (cl-defmethod xref-location-marker ((l xref-bogus-location)))
>      etags.el
>      (cl-defmethod xref-location-marker ((l xref-etags-location)))
>      xref.el
>      (cl-defmethod xref-location-marker ((l xref-buffer-location)))
>      elisp-mode.el
>      (cl-defmethod xref-location-marker ((l xref-elisp-location)))
> 
> I don't use completions-group so I don't care strongly for this, but I
> believe that this is generally undesired, for non-filtering scenarios.
> All the entries from the xref.el group should probably be clumped
> together.  If a user were flex-matching and thus expecting certain sort
> score-based order, it_would_  make sense to me, but here no flexy things
> were happening at all.
> 
> To fix this, perhaps the default sorting methods should be turned off in
> completion-all-sorted-completions in minibuffer.el if a table supplies
> `group-function`.  A patch for this is after my sig.

We discussed this problem when group-function was introduced. Another 
approach is to just change the method of grouping: first the completions 
are sorted, and then they are sorted into groups.

The group that goes first is the group to which the first completion in 
the sorted list belongs to. It doesn't matter whether some of the 
subsequent items in it are sorted at the end of the list: as long as 
they return the same value for "group", they get put into that first group.

I wonder which strategy Daniel ultimately chose to use in Consult. 
Perhaps we should document it in the API, so that the implementations 
stay consistent.





  parent reply	other threads:[~2021-08-19 15:02 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-20 18:56 bug#48545: 28.0.50; `icomplete-vertical-mode` does not support the `group-function` Daniel Mendler
2021-08-17 12:17 ` João Távora
2021-08-18  9:38   ` Kévin Le Gouguec
2021-08-18  9:55     ` João Távora
2021-08-19 11:18       ` João Távora
2021-08-19 12:38         ` Kévin Le Gouguec
2021-08-19 13:29           ` João Távora
2021-08-19 19:36             ` Kévin Le Gouguec
2021-08-19 15:02         ` Dmitry Gutov [this message]
2021-08-19 19:41           ` João Távora
2021-08-19 22:37             ` Dmitry Gutov
2021-08-19 23:39               ` João Távora
2021-08-19 23:51                 ` Dmitry Gutov
2021-08-20 10:35                   ` João Távora
2021-08-21  2:09                     ` Dmitry Gutov
2021-08-21  9:40                       ` João Távora
2021-08-21 12:01                         ` Dmitry Gutov
2021-08-21 12:42                           ` João Távora
2021-08-22 13:52                             ` Dmitry Gutov
2021-08-22 15:44                               ` João Távora
2021-08-21  0:24                   ` João Távora

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54e4e409-5525-b796-9e9c-582735995cc1@yandex.ru \
    --to=dgutov@yandex.ru \
    --cc=48545@debbugs.gnu.org \
    --cc=joaotavora@gmail.com \
    --cc=mail@daniel-mendler.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).