unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Re: master ab23fa4: Sort by recency in flex completion style when no flexy stuff happening
       [not found] ` <20210815123355.592B620B72@vcs0.savannah.gnu.org>
@ 2021-08-17  1:41   ` Dmitry Gutov
  2021-08-17  7:20     ` João Távora
  2021-08-19 11:25     ` João Távora
  0 siblings, 2 replies; 5+ messages in thread
From: Dmitry Gutov @ 2021-08-17  1:41 UTC (permalink / raw)
  To: emacs-devel, João Távora

On 15.08.2021 15:33, Jo�o T�vora wrote:
>      Sort by recency in flex completion style when no flexy stuff happening
>      
>      Fixes: bug#49888
>      
>      * minibuffer.el (completion--flex-adjust-metadata): Fall back to usual
>      alphanumeric, length, recency strategy if no minibuffer input.  There
>      is still a bug indicated by the nearby FIXMEs, though.

On the balance, it's a good change, but I hope we can agree that it's 
not really the proper place to choose the default sorting method.

It would be great if sorting were implemented in a more composable way.



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: master ab23fa4: Sort by recency in flex completion style when no flexy stuff happening
  2021-08-17  1:41   ` master ab23fa4: Sort by recency in flex completion style when no flexy stuff happening Dmitry Gutov
@ 2021-08-17  7:20     ` João Távora
  2021-08-17 12:57       ` Dmitry Gutov
  2021-08-19 11:25     ` João Távora
  1 sibling, 1 reply; 5+ messages in thread
From: João Távora @ 2021-08-17  7:20 UTC (permalink / raw)
  To: Dmitry Gutov; +Cc: emacs-devel

It is composable, in fact it's inside some "compose-flex-sort-fn` helper
function to take into account the table's sorting.

if you mean the problem of code duplication, however, then I also agree.
See the FIXMEs explaining the situation.

If you mean something else, please clarify.

João



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: master ab23fa4: Sort by recency in flex completion style when no flexy stuff happening
  2021-08-17  7:20     ` João Távora
@ 2021-08-17 12:57       ` Dmitry Gutov
  2021-08-17 14:51         ` João Távora
  0 siblings, 1 reply; 5+ messages in thread
From: Dmitry Gutov @ 2021-08-17 12:57 UTC (permalink / raw)
  To: João Távora; +Cc: emacs-devel

On 17.08.2021 10:20, João Távora wrote:
> It is composable, in fact it's inside some "compose-flex-sort-fn` helper
> function to take into account the table's sorting.
> 
> if you mean the problem of code duplication, however, then I also agree.
> See the FIXMEs explaining the situation.
> 
> If you mean something else, please clarify.

It does "compose" things, but it makes all the decisions, so it's 
impossible to control from the outside.

One of the things I'd like to do is to sort taking into account both 
flex sorting and the previous occurrences of the completions in the 
buffer (by adding the scores together, or somehow else combining them).

I see there are other possible uses described in bug#45260. Perhaps this 
discussion could move there.

But what I imagined is some middle layer above the completion styles 
which would do the sorting. The above discussion is based on the 
existing practice, however, where the tables provide the sorting logic 
(and not, say, sorting scores which can be combined somewhere else).



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: master ab23fa4: Sort by recency in flex completion style when no flexy stuff happening
  2021-08-17 12:57       ` Dmitry Gutov
@ 2021-08-17 14:51         ` João Távora
  0 siblings, 0 replies; 5+ messages in thread
From: João Távora @ 2021-08-17 14:51 UTC (permalink / raw)
  To: Dmitry Gutov; +Cc: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 1468 bytes --]

On Tue, Aug 17, 2021, 13:57 Dmitry Gutov <dgutov@yandex.ru> wrote:

> On 17.08.2021 10:20, João Távora wrote:
> > It is composable, in fact it's inside some "compose-flex-sort-fn` helper
> > function to take into account the table's sorting.
> >
> > if you mean the problem of code duplication, however, then I also agree.
> > See the FIXMEs explaining the situation.
> >
> > If you mean something else, please clarify.
>
> It does "compose" things, but it makes all the decisions, so it's
> impossible to control from the outside.
>

I guess you could add a variable or two there, but the way it works is by
design.

>
> One of the things I'd like to do is to sort taking into account both
> flex sorting and the previous occurrences of the completions in the
> buffer (by adding the scores together, or somehow else combining them).
>

That sounds interesting, maybe it's a good idea for a new completion style,
which may share some code, maybe a lot of code, with flex.

I see there are other possible uses described in bug#45260. Perhaps this
> discussion could move there.
>

Put me in Cc, if you want.

But what I imagined is some middle layer above the completion styles
> which would do the sorting. The above discussion is based on the
> existing practice, however, where the tables provide the sorting logic
> (and not, say, sorting scores which can be combined somewhere else).
>

Sounds interesting.

João

>

[-- Attachment #2: Type: text/html, Size: 2765 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: master ab23fa4: Sort by recency in flex completion style when no flexy stuff happening
  2021-08-17  1:41   ` master ab23fa4: Sort by recency in flex completion style when no flexy stuff happening Dmitry Gutov
  2021-08-17  7:20     ` João Távora
@ 2021-08-19 11:25     ` João Távora
  1 sibling, 0 replies; 5+ messages in thread
From: João Távora @ 2021-08-19 11:25 UTC (permalink / raw)
  To: Dmitry Gutov; +Cc: emacs-devel

Dmitry Gutov <dgutov@yandex.ru> writes:

> On 15.08.2021 15:33, Jo�o T�vora wrote:
>>      Sort by recency in flex completion style when no flexy stuff happening
>>           Fixes: bug#49888
>>           * minibuffer.el (completion--flex-adjust-metadata): Fall
>> back to usual
>>      alphanumeric, length, recency strategy if no minibuffer input.  There
>>      is still a bug indicated by the nearby FIXMEs, though.
>
> On the balance, it's a good change, but I hope we can agree that it's
> not really the proper place to choose the default sorting method.

I've now pushed an adjusment for this fix that is functionally
equivalent but duplicates no code of completion-all-sorted-completions
at all.

Thus, the "default" sorting method can be chosen there to be whatever.
The flex style won't specify any display-sort-function/cycle sort
function unless there is "flexy stuff happening".

João






^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-08-19 11:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20210815123354.31232.42056@vcs0.savannah.gnu.org>
     [not found] ` <20210815123355.592B620B72@vcs0.savannah.gnu.org>
2021-08-17  1:41   ` master ab23fa4: Sort by recency in flex completion style when no flexy stuff happening Dmitry Gutov
2021-08-17  7:20     ` João Távora
2021-08-17 12:57       ` Dmitry Gutov
2021-08-17 14:51         ` João Távora
2021-08-19 11:25     ` João Távora

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).