bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#45260: 28.0.50; Maybe flex should only sort when there is no sorting


From: Dmitry Gutov
Subject: bug#45260: 28.0.50; Maybe flex should only sort when there is no sorting metadata?
Date: Tue, 17 Aug 2021 17:49:39 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0

On 17.08.2021 17:05, João Távora wrote:
On Tue, Aug 17, 2021, 13:43 Dmitry Gutov <dgutov@yandex.ru <mailto:dgutov@yandex.ru>> wrote:

    On 17.08.2021 13:41, João Távora wrote:
     > I've
     > not seen an example of a table where its original sorting
    mattered more
     > _when_  there is some search pattern.

    Do you have examples of completion tables which do specify sorting, but
    where flex sorting obviously should take precedence?


No, do you? Love to see them, or the converse. But does it matter? Flex is for searching with patterns, stable sorted by scores, solving ties with whatever sort order came first. Dmitry/flex, or Flix, or Flax, may be something else, you understand? It's by design like this.

If there aren't any such significant cases, flex could do what Omar is suggesting, solving the reported problem with no real downside. I would admit it to be a hackish move, but no more so than the recent commit ab23fa4.

Having multiple similar styles is of course an option, but it comes with code duplication and associated inconveniences (how many such styles should Emacs include OOTB?).

That could be solved with some more general approach, like have both styles and completion tables return sorting scores (with documented possible values and meanings), and do the combined sorting somewhere in the layer above. Then the user could choose the combining strategy, configured separately.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]