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

From: Dmitry Gutov <[email-masked]>
Date: Tue, 28 Sep 2021 19:30:49 +0300

On 28.09.2021 19:09, João Távora wrote:
> On Tue, Sep 28, 2021 at 1:38 PM Dmitry Gutov <[email-masked]> wrote:
> 
>> So the references to company-capf in that discussion are necessary, but
>> incidental.
> 
> So it should be possible to describe the problem in simpler terms.  Which
> is what I'm asking you to do.  In the simplest terms _possible_ of course.

I have already done this here. Twice, I think?

And more, if we count the underlying technical issue that is the 
headline of this report.

> It's not about the beginner developer here, it's about the user.

The user-developer line is fairly blurred in this particular case.

> The beginner developer of the c-a-p-f API has to do more work
  than the user to understand what the purpose is of the things
> she is invoking.  If she invokes 'flex' in some program, she must
> be aware of what she's doing, of how 'flex' works.

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.

>> But would it? Break existing behavior in any scenario that matters?
> 
> See my reply to Omar.

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.

In your scenario, which UI is the user going through? What completion 
table would they be querying?

How much effort would it be for such UI to switch to a completion table 
that doesn't specify the sorting function, so that 'flex' still applies 
its sorting, to the satisfaction of your hypothetical user, while now 
satisfying Omar's user as well?

>>> 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.
> 
> So you're talking about changing defaults.  But flex is not even the default,
> so I don't understand.  Why are people using it if they're not content with
> what it does?
> 
> Do a 'flix' style, as I've suggested multiple times! Look,  if you're right and
> it represents much less friction it should rapidly become popular and your
> burdens will be solved.  It probably take few lines of code.

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.

Furthermore, 'flex' being in the core implicitly gives it a strong 
recommendation over alternatives.

>>> 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.
> 
> So you decide that it's a good idea for a beginner to mix company internals
> into her adventures.... Questionable, I'd say.

See the thread.