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#48545: 28.0.50; `icomplete-vertical-mode` does not support the `group-function` Date: Thu, 19 Aug 2021 18:02:57 +0300 Message-ID: <54e4e409-5525-b796-9e9c-582735995cc1@yandex.ru> References: <10d162d5-2cd6-dd87-3289-a0187dfbf51f@daniel-mendler.de> <871r6sw9iz.fsf@gmail.com> <87a6lfnld0.fsf@gmail.com> <87eearulft.fsf@gmail.com> <871r6pr8bk.fsf@gmail.com> 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="4980"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 To: 48545@debbugs.gnu.org, joaotavora@gmail.com, mail@daniel-mendler.de Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Aug 19 17:04:24 2021 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 1mGjag-00011Z-P5 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 19 Aug 2021 17:04:22 +0200 Original-Received: from localhost ([::1]:50652 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mGjae-0001xs-Py for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 19 Aug 2021 11:04:20 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35898) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mGjaN-0001xL-Cr for bug-gnu-emacs@gnu.org; Thu, 19 Aug 2021 11:04:07 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:49079) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mGjaM-0001YB-T5 for bug-gnu-emacs@gnu.org; Thu, 19 Aug 2021 11:04:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mGjaM-0005EJ-Pe for bug-gnu-emacs@gnu.org; Thu, 19 Aug 2021 11:04:02 -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, 19 Aug 2021 15:04:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 48545 X-GNU-PR-Package: emacs Original-Received: via spool by 48545-submit@debbugs.gnu.org id=B48545.162938538720012 (code B ref 48545); Thu, 19 Aug 2021 15:04:02 +0000 Original-Received: (at 48545) by debbugs.gnu.org; 19 Aug 2021 15:03:07 +0000 Original-Received: from localhost ([127.0.0.1]:60622 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mGjZT-0005Cg-1Q for submit@debbugs.gnu.org; Thu, 19 Aug 2021 11:03:07 -0400 Original-Received: from mail-wr1-f44.google.com ([209.85.221.44]:34644) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mGjZR-0005CD-Dx for 48545@debbugs.gnu.org; Thu, 19 Aug 2021 11:03:05 -0400 Original-Received: by mail-wr1-f44.google.com with SMTP id h13so9641492wrp.1 for <48545@debbugs.gnu.org>; Thu, 19 Aug 2021 08:03:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=Voix9ZxoIQKodYOZ2v5rjl2PAgNMEiejwcRHYq6guWY=; b=XydnGIArw799qaDckQEbUKxexxLJ4NhSo1NjuxI4d5Law6d9/TbPrB3FthGD1VOzFW t5RAtHADJKqVX2GmWJYilLPLjCAJyPdLCMo+Yal0+nSk8bCyIKkAwzG2fWjwrWE5lJNy PXfcnhB8flll3Rzen7glJZ3SuejIO025hsGtDk59iXrV91Yf4b/tFIKj8yOhgpEdSppm afp+Fo+HRhRmMFd+TnpeDzPHB6nOrtebGAWP5vSxFkdvMgiEiNM3FGmXWflgMaRvIyRO 1vrebzSFxFdycf17Q5bVtPwFlisrfXiWExHaTde8/w+miu8wB6RvN3EWu2zpfyO1Eym/ 3gBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=Voix9ZxoIQKodYOZ2v5rjl2PAgNMEiejwcRHYq6guWY=; b=EMWevYy0k2IDVUK/z5En53CE5XUMcvbeh4RuE6+OjQimrPXbomrYaktMTFYve33G31 W5oZeTok6N8MqBHYWU369NxTw4T6GGBtrLnQwx5nqZA9+vosIAPelHSCWOJY+iIZTWsq XFISWmjroDrhRlUx4U4falDt1mIxjzFeGYh89sqNPnMNlKYQPihm4k2qmu2mo7b/FQ0y D2Jhn0V1LyYFcv5SczG5C061Hf1dNCQDM64ieGN7DGjxUTNtdcIHsaUuEDP7T+sEOzTb m11LQwhQCwVNxhdtw/GuurdomcpoBQYNsCDc1fIIqwHkpaMOxtnUeriR546Kj7fr+tZF ZNcw== X-Gm-Message-State: AOAM532TTP+BSQkQJJAQ87YfZM1ZqF9ro9w75vpE30lPrp7eWrP5mJeU M+5Wr5AXs/DPJ9C/O39Vq+0= X-Google-Smtp-Source: ABdhPJzkfSWnuHtGCFhBEvc0hAyWIxbSE5BaiTXgwsiIsvoTHYgnGGLVqOaKjTTEcRfblCTFcc5avQ== X-Received: by 2002:adf:f4cf:: with SMTP id h15mr4436021wrp.67.1629385379567; Thu, 19 Aug 2021 08:02:59 -0700 (PDT) Original-Received: from [192.168.0.6] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id x18sm3140740wrw.19.2021.08.19.08.02.58 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 19 Aug 2021 08:02:58 -0700 (PDT) In-Reply-To: <871r6pr8bk.fsf@gmail.com> Content-Language: en-US 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" Xref: news.gmane.io gmane.emacs.bugs:212223 Archived-At: 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.