From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= Newsgroups: gmane.emacs.devel Subject: Re: master ab23fa4: Sort by recency in flex completion style when no flexy stuff happening Date: Tue, 17 Aug 2021 15:51:20 +0100 Message-ID: References: <20210815123354.31232.42056@vcs0.savannah.gnu.org> <20210815123355.592B620B72@vcs0.savannah.gnu.org> <616ed0c3-525f-4975-d2dd-6818e4bcbe14@yandex.ru> <59241d71-dcfb-cbab-a769-cd0532990307@yandex.ru> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000001a21fe05c9c274fc" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39304"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel To: Dmitry Gutov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Aug 17 16:52:28 2021 Return-path: Envelope-to: ged-emacs-devel@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 1mG0S3-0009yA-1l for ged-emacs-devel@m.gmane-mx.org; Tue, 17 Aug 2021 16:52:27 +0200 Original-Received: from localhost ([::1]:34234 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mG0S1-0004wZ-5n for ged-emacs-devel@m.gmane-mx.org; Tue, 17 Aug 2021 10:52:25 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54540) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mG0RE-0004GA-Dt for emacs-devel@gnu.org; Tue, 17 Aug 2021 10:51:36 -0400 Original-Received: from mail-pj1-x1032.google.com ([2607:f8b0:4864:20::1032]:36533) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mG0RC-0007Mg-15 for emacs-devel@gnu.org; Tue, 17 Aug 2021 10:51:35 -0400 Original-Received: by mail-pj1-x1032.google.com with SMTP id u13-20020a17090abb0db0290177e1d9b3f7so5659341pjr.1 for ; Tue, 17 Aug 2021 07:51:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=cPY3T1MGPLn+2Z3xZka/4rehPNmxTiNFABW6ZVl2mlY=; b=Rrn8Iwf4qLqTaQ+qxAP+ctnr1G6o2JrPz/h6D/3LU3T7thAt6Viwyr7KuDd8Jx1BgM eN6PPfHSFDSb7bGe4no5MFWVaG6Fx++aV+B8CquOIvovklnHCMedo2EhnTe0uJHdU/Aa IWs2zt52aYzQlEEAZXFLqjoDCbPqZwfmQnIfBFF03JQw4Kc20D9/6xzmM8RuQjBKTYDS I5ky9JjMN35hWFctSKhCvS1ceNJw0uVOFeoTX5kv4snIyTCvHEY/pZCeA5LFheS/I48o QCjt1tUE817/1TSHeXsEbkSG17uAcwgG87bdk8oYqoa0+XGTjp9580CJS7viONWt/SUe Zllw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=cPY3T1MGPLn+2Z3xZka/4rehPNmxTiNFABW6ZVl2mlY=; b=rNGxWPK8VkvH6Vy5AC5pExojIEIvZhxN0NSnC/vxHI2EvC4zemWJzj2UlxBSoGSJ4g XrXs3wlNQMVbf/15uzp0cPRooxZcsm5QaZx9m+OflL3R6Lp6L1aQeh7HC7mSWrpSnWit 7uG1QU77/rGVwAPixFU8hGBCqnfNzugTuz30Dt88SPTmZNbXgjTnwOtANzE3I4bIDE5a Vtb/h90dPuJ2kpUUR2HFh6YqE0wTGONxz7rLpymx0o4rCFMtYTWZPjBzheqqbl3CUk5j sDBmY9GIa4eo3DrNxur56fh/FRbgROqSlyHL6rLf64uM/c36zki9lW3gOcM4YSsPYvin Cv4w== X-Gm-Message-State: AOAM533BAkkgmsYT+BY1maUVjqFiGNy8+p2cRdd6UUCszmyLTHACrrBu /aul8v+Bk7sQArB4EAI6zSOY7g7iGw9FkVXqVHI= X-Google-Smtp-Source: ABdhPJyqJHiDggAdkm/vsA7h7unCUjN5pFdb0Es0YqyGbaYjZ/OBNisUE88tWPKa6/IZiaMv1yCPtUn6aviOx+J8qP4= X-Received: by 2002:aa7:9050:0:b029:3af:7e99:f48f with SMTP id n16-20020aa790500000b02903af7e99f48fmr4028478pfo.2.1629211892260; Tue, 17 Aug 2021 07:51:32 -0700 (PDT) In-Reply-To: <59241d71-dcfb-cbab-a769-cd0532990307@yandex.ru> Received-SPF: pass client-ip=2607:f8b0:4864:20::1032; envelope-from=joaotavora@gmail.com; helo=mail-pj1-x1032.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:272493 Archived-At: --0000000000001a21fe05c9c274fc Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Aug 17, 2021, 13:57 Dmitry Gutov wrote: > On 17.08.2021 10:20, Jo=C3=A3o T=C3=A1vora wrote: > > It is composable, in fact it's inside some "compose-flex-sort-fn` helpe= r > > 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=C3=A3o > --0000000000001a21fe05c9c274fc Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Tue, Aug 17, 2021, 13:57 Dmitry Gutov <dgutov@yandex.ru> wrote:
On 17.08.2021 10:20, Jo=C3=A3o T=C3=A1vora 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 agre= e.
> 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&#= 39;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=C3=A3o
--0000000000001a21fe05c9c274fc--