From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= 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 23:17:07 +0100 Message-ID: <87ilykcplo.fsf@gmail.com> 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 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22668"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 45260@debbugs.gnu.org, Omar =?UTF-8?Q?Antol=C3=ADn?= Camarena To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Sep 29 00:18:48 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 1mVLR2-0005jG-CK for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 29 Sep 2021 00:18:48 +0200 Original-Received: from localhost ([::1]:41782 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mVLR1-00076j-8a for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 28 Sep 2021 18:18:47 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49418) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mVLQl-00073a-Su for bug-gnu-emacs@gnu.org; Tue, 28 Sep 2021 18:18:32 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:35699) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mVLQI-0000Az-5N for bug-gnu-emacs@gnu.org; Tue, 28 Sep 2021 18:18:31 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mVLQI-0001yP-0d for bug-gnu-emacs@gnu.org; Tue, 28 Sep 2021 18:18:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 28 Sep 2021 22:18:01 +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.16328674357531 (code B ref 45260); Tue, 28 Sep 2021 22:18:01 +0000 Original-Received: (at 45260) by debbugs.gnu.org; 28 Sep 2021 22:17:15 +0000 Original-Received: from localhost ([127.0.0.1]:47245 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mVLPX-0001xO-GR for submit@debbugs.gnu.org; Tue, 28 Sep 2021 18:17:15 -0400 Original-Received: from mail-wm1-f41.google.com ([209.85.128.41]:41784) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mVLPW-0001xC-AI for 45260@debbugs.gnu.org; Tue, 28 Sep 2021 18:17:15 -0400 Original-Received: by mail-wm1-f41.google.com with SMTP id g19-20020a1c9d13000000b003075062d4daso250380wme.0 for <45260@debbugs.gnu.org>; Tue, 28 Sep 2021 15:17:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=34W6nLAcLqJfHHMc2dvK8j1ldluWvJShJtTu6eTfFSo=; b=XY48qxriwrvyoLPonzhqjWNkas5frdPvz2CD4WtYUiWc8ufCrP7Q7qo+9tWDfHndR8 Jx0YwBUs6/7/cvjFo/IF8YwE9NdKOK+TTNga9qNg07bTGfLXnxzxvsnxgq+1Z2ZEkviA 94dvMWacSTenhg3A25i9kK9TiBftXoOuGq656mmKG8pOc6LHWK5jBlF//DBVdLD+lOBp x+G0V/5muvWw1H/ceZy1CrME9g/+tsdDnW+b6hqtEaWhSuWkJitvgbKmUsYIZpwmkG/m zY6KNOEVfS6hrqXehUb0f02uIByiV/7wZrTC5OqF3569aqhKYpGiYQzk359LpMQ6VWO1 ukhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=34W6nLAcLqJfHHMc2dvK8j1ldluWvJShJtTu6eTfFSo=; b=OGtpK1Zj7TLyGnTDF91wlaaPqgNdmJ+SEH0lj8nIBAQ35enwTAC+XYEtPLXy4RRk0N y0CBSGQTn0IHAGavn4kcqL8Y8xb6xJz3RDIi9wwBjwqgh+dg2jZrS6aoxRuRyYeKIk0d cHuW5yOJPkbZ/bN+qgAuzi93hwt6jwsZX779pO+r2PkkhLu3CBnF/fZeS4CXz9CfzvHm /0LRxNcZZCty+/kHQSup1LjWpteWjlZygtWikxOsQwzpaLwXVVpsEw00qvDj6BAtNq42 dx7tVh9Xt+KwO0RI4cIVMVJGJirwmkgHI03XpKnAbFAaqSGBo2VYD+4I9N6rTXxpyUUv LdiQ== X-Gm-Message-State: AOAM533MinTtVDOLEpQINmutMMOShDzXfA0hsnV+xyqWC5ghNMni3MEV 6pubhWB8rUMhmIA+6TTKS2M= X-Google-Smtp-Source: ABdhPJxZaTSJN0OAKZRLKOrtRBuCmpfPoFIh2shBnbT2NVefo2fm7eDpEurIDOuPJx8fj4A1wjCNaQ== X-Received: by 2002:a05:600c:2904:: with SMTP id i4mr7199624wmd.118.1632867428360; Tue, 28 Sep 2021 15:17:08 -0700 (PDT) Original-Received: from krug (a83-132-177-247.cpe.netcabo.pt. [83.132.177.247]) by smtp.gmail.com with ESMTPSA id w18sm342576wrt.79.2021.09.28.15.17.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Sep 2021 15:17:07 -0700 (PDT) In-Reply-To: (Dmitry Gutov's message of "Tue, 28 Sep 2021 19:30:49 +0300") 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:215807 Archived-At: Dmitry Gutov writes: > And more, if we count the underlying technical issue that is the > headline of this report. Underlying technical isse? As I see it it's a simple feature request. It even starts with the word "Maybe". It started with a description of the "Consult" system, which was very clear. Then I understood the problem and decided that it goes against some fundamental flex behaviour. That is all. Anyhoo, here's my poor man's consult directly from an Emacs -Q *scratch*: ;; This buffer is for text that is not saved, and for Lisp evaluation. ;; To create a file, visit it with C-x C-f and enter text in its buffer. (require 'cl-lib) =20=20=20=20 (defun confabulate () (interactive) (let* ((lines (cl-loop for i from 1 for s in (split-string (buffer-string) "\n") collect (format "%s: %s" i s))) (choice (completing-read "Hey, choose a line: " (lambda (string pred action) (if (eq action 'metadata) `(metadata (cycle-sort-function . ,#'identity)) (complete-with-action action lines string pred))) nil t))) (goto-line (string-to-number choice)))) Eval this and M-x confabulate. Pick your favourite UI (vertico?) and style (orderless?) Does this work how you want? I guess it does, no flex involved. But I use flex and icomplete in my .emacs, and I like the way it works for me, just fine and quite a useful little snippet. I type 'oos' and I get line 7 as my first candidate. Omar would prefer line 1, I guess. I don't. I suppose orderless gives line 1. I'm fine with that. > That seems optimistic. Especially since 'flex' is a rare exception > among other completion styles, in that it affects sorting (through an > opaque mechanism), and not just filtering. I don't care if it's an exception, it's also the only one to do scoring of completions. Quite an important part of it. Without it, it's pretty useless. You think the original table order is _more_ important and should override scoring. I don't get that, but I certainly won't judge you for wanting it. That behaviour is ONE cusotmization variable away. Or a new completion style, which isn't complicated. Do you want me to add this customization variable, yes or no? > Omar brought in a scenario of something the user does, starting with > the UI, and the full use case. > You responded with an abstract piece of behavior. Abstract? I gave a super-clear example, with a three-number answer, and now have even coded it in Elisp. Really, I'm not the one with the "non-categorical evidence" here! > I didn't do 'flex' and I don't do 'flix'. I'm not the > person/place/piece-of-software people come to for completions > styles. I have to deal with existing styles. Even if just one of them > has a problem, that can bring a question or a bug report on my > doorstep. If it's not your bug and you don't know how to answer the question, then just say that to the user. I sympathize with your care for beginner users, I've said that. But here there's nothing I can do. Flex works as designed, to the best of my knowledge. Jo=C3=A3o