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#45260: 28.0.50; Maybe flex should only sort when there is no sorting metadata? Date: Tue, 28 Sep 2021 15:38:11 +0300 Message-ID: References: <86a6uehpod.fsf@matem.unam.mx> <87v944wdxu.fsf@gmail.com> <847fabdb-8b06-dd0f-b2ad-6c71d2f5c3cd@yandex.ru> <87v944uiv5.fsf@gmail.com> <87lf3hr0x5.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="16998"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 Cc: 45260@debbugs.gnu.org, Omar =?UTF-8?Q?Antol=C3=ADn?= Camarena To: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Sep 28 14:39:21 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 1mVCOG-0004Dq-Hf for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 28 Sep 2021 14:39:20 +0200 Original-Received: from localhost ([::1]:54530 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mVCOF-00009z-G8 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 28 Sep 2021 08:39:19 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34104) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mVCO0-00008C-8h for bug-gnu-emacs@gnu.org; Tue, 28 Sep 2021 08:39:05 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:60764) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mVCNy-0004nv-I2 for bug-gnu-emacs@gnu.org; Tue, 28 Sep 2021 08:39:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mVCNy-0005Uo-9d for bug-gnu-emacs@gnu.org; Tue, 28 Sep 2021 08:39: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: Tue, 28 Sep 2021 12:39:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 45260 X-GNU-PR-Package: emacs Original-Received: via spool by 45260-submit@debbugs.gnu.org id=B45260.163283270221079 (code B ref 45260); Tue, 28 Sep 2021 12:39:02 +0000 Original-Received: (at 45260) by debbugs.gnu.org; 28 Sep 2021 12:38:22 +0000 Original-Received: from localhost ([127.0.0.1]:44077 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mVCNK-0005Tt-1j for submit@debbugs.gnu.org; Tue, 28 Sep 2021 08:38:22 -0400 Original-Received: from mail-wr1-f52.google.com ([209.85.221.52]:37376) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mVCNH-0005Th-Sm for 45260@debbugs.gnu.org; Tue, 28 Sep 2021 08:38:21 -0400 Original-Received: by mail-wr1-f52.google.com with SMTP id t8so57875739wrq.4 for <45260@debbugs.gnu.org>; Tue, 28 Sep 2021 05:38:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=bVctP9YUXo9FVg/X82FIE/BD0RrbT6DVDeT3BhQ+oBg=; b=No9nUvojzF9TqfjC/L+JxRlOzCwIjgb4jID2ec2wSAS/QluTthfe0R0Hk5dJW5DRUU JjUaph1xZAmJhlp9y9vEvgoTCBLtuYG70GgfJNgex+uhMqo1AYh2fYuNKRAePqYIjV3k P8bNgzkj+Ie4CzGtLdHK6oMRsnRmGroELlDcJXwIcphnaxzkVgYxzb7yoRvZ5QDJCVxE 2p4dzrTCv46N4WIEojoErw5J/KTaegpBDfy3/xa/vmeKt5FQyoWUHmtSy0nGlSywUMyR UxHH3TxziuS9ny2FxrzDd3FCdAIFSZPsdJqmI7kcytYhZXkKt8+YnLf3Vt6KfADsJyUr p1FA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=bVctP9YUXo9FVg/X82FIE/BD0RrbT6DVDeT3BhQ+oBg=; b=tQ9JD8x7ocNlpPikOZ9H6Q/INbPQwmS66sRYi8bZ7gCktyI0cQ7KRg2XXfXMVoRV0s vY3DZczGIFmJCzi39BKQZ2h8ZIbh4iIJl67Ctp8EKi1TiF8e1LLoqVlzs3AG2PqIK3p0 Jtujf5WXng+atOoESUGxhrj9aIrZCQ5M+y10nVRyzaB4f7Fj7XQltziuiP55m86C7STx KOViHX9DnAWGehQ1juptbeGe6XrQNOZaBBc8EtJPNLNPxx3BH96U4Ifhuf18B1AuOJAE daWyMepl6pt3VmhPZ260Ijn2Dt9GJUnA9tnNVWPy1pz4+8fzY5Nxb0Cc5dsEP6HdUNiB vE4Q== X-Gm-Message-State: AOAM5331yIH7WqzdUb/bGSeOSionOJ1y249L2BfslftSUUza9/6eAghR EKlF0mcAAxG7VbpZxwb3yzc= X-Google-Smtp-Source: ABdhPJxHGvLYQTbWXMtQrPwzKMk9fczWb8PHA9H6vJdMY3mNvhEHmhLpQJ9uBCNfvpYzCu5VUprvVg== X-Received: by 2002:a05:6000:168b:: with SMTP id y11mr6142351wrd.350.1632832693918; Tue, 28 Sep 2021 05:38:13 -0700 (PDT) Original-Received: from [192.168.0.6] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id z6sm3758695wmp.1.2021.09.28.05.38.12 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 28 Sep 2021 05:38:13 -0700 (PDT) In-Reply-To: <87lf3hr0x5.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:215770 Archived-At: On 28.09.2021 03:36, João Távora wrote: > Dmitry Gutov writes: > >> On 28.09.2021 02:25, João Távora wrote: >> >> It's an example of a user trying to write a completion table (to be >> consumed by company-capf, as they usually are) > > Hm? A table is consumed by any capf-capable frontend. That's not limited > to `company-capf'. Right. But some frontend is required. So the references to company-capf in that discussion are necessary, but incidental. >> with sorting logic and tripping over the flex style overriding it. > > But where is the "tripping" if, to the best of my knowledge (and given > that you chose this specific Emacs bug), the complaint is about > something that the flex style was designed to do from the very > beginning? That thing is sort, first and foremost, by how well the > pattern entered by the user matches each candidate. Doesn't this user > like that? If not, it's fine. But not appreciating a behaviour doesn't > count as "tripping over" to me. Since we're talking about a beginner learning the c-a-p-f API, saying "it is intended to work this way" is rather off base. I think the question is rather which choice will ultimately lead to less friction. While still leading to the expected behavior in all practical cases, of course. >> You should read it (the last few messages will suffice). > > I tried to, it's full of references to company internals that I can't > evaluate. Is the user writing a table specifically for company? Or > modifying company? Or both? I must understand it in terms of a simpler > example. They're asking how to write a completion table which does sorting. It later turned out that they have the flex completion style set up in personal configuration. If you follow the discussion, you can note this conflict wasn't particularly easy to discover. And the practice of asking for "full reproduction starting with emacs -Q" in such threads feels fairly out of place. >> Having many similar-but-slightly-different styles available is >> unlikely to reduce my support burdens. > > But "reducing your support burdens" cannot come at the cost of breaking > existing behaviour. Look at the simple 5-line examples I gave to Omar > (to which there was no reply, unfortunately). I expect those examples > to sort in a certain way, and I guess Omar would to like them some other > way. But would it? Break existing behavior in any scenario that matters? Do we know of any completion table which specifies display-sort-function, where we're sure we want 'flex' to re-sort anyway? > What is the problem with you telling those users to use 'pikachu' > instead of 'flex'? Or tell them to set a hypothetical variable > flex-prefer-table-sorting to t? Discovery. > I also suggest that people: "if you're writing a completion table, make > sure you try it without company as well". Not something I'm eager to recommend to somebody just starting out. It wouldn't help here either, I believe.