From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.devel Subject: Re: [Emacs-diffs] scratch/new-flex-completion-style 2c75775 2/2: Score, sort and annotate flex-style completions according to match tightness Date: Tue, 12 Mar 2019 00:54:55 +0200 Message-ID: <5c032aeb-c2a1-06cd-14bb-121b7116d713@yandex.ru> References: <20190202232827.27331.87300@vcs0.savannah.gnu.org> <20190202232828.4AE452159A@vcs0.savannah.gnu.org> <556bfb2e-4720-c86a-c964-f057b50041b6@yandex.ru> <87va1xw7ms.fsf@gmail.com> <212f7cc9-c0c6-bcf8-f200-ea74db261dc3@yandex.ru> <2733dee8-f5a6-396f-228a-84f225d43a1c@yandex.ru> <407232ad-b1ef-7338-5fd2-735da9721562@yandex.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="227632"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:66.0) Gecko/20100101 Thunderbird/66.0 Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Mar 12 00:01:14 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h3Tv0-000x6i-Cx for ged-emacs-devel@m.gmane.org; Tue, 12 Mar 2019 00:01:14 +0100 Original-Received: from localhost ([127.0.0.1]:41664 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3Tuz-0001U6-3x for ged-emacs-devel@m.gmane.org; Mon, 11 Mar 2019 19:01:13 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:45998) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3TuA-0000lV-8h for emacs-devel@gnu.org; Mon, 11 Mar 2019 19:00:22 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h3Tp0-0003EJ-E9 for emacs-devel@gnu.org; Mon, 11 Mar 2019 18:55:03 -0400 Original-Received: from mail-lf1-x12d.google.com ([2a00:1450:4864:20::12d]:34468) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h3Tp0-0003DR-3r for emacs-devel@gnu.org; Mon, 11 Mar 2019 18:55:02 -0400 Original-Received: by mail-lf1-x12d.google.com with SMTP id y18so582801lfe.1 for ; Mon, 11 Mar 2019 15:55:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=3w/yhDCH7cz4fCNdTO4WFbhLf2i7Hol3IHZnobpS3xs=; b=dhTZ8UPHA5T0tx9/qXwMD6gcHQesLnLEszPPENvSjdUio55V8yrHwZiuVgev1/AxhA fk38+mbwAmEp94cYSI+Q7QUtWUSgVyW+bZFx1OYjAaVNg6ScA75U/GFVm1b3wG9htq3S XT+Eql+H3R6MlUa1KDWO5sy9xYWcdnFZfPsE2nMLikPzmKa0fMxvEUcL+f5Uw6f/E/YU KVbZxBK9LmBR32DDL9y0bc9ELh3kvR8rMU89xK226YW2lM7wWCB5ydhnNU82TbSfe6oq WsQjVJQhngEItte/BK7fkY7CEWBkbc0a4M6ZlhGyFLh4TU9hatWgfw7M5tEN4/3Fcqww T4Eg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=3w/yhDCH7cz4fCNdTO4WFbhLf2i7Hol3IHZnobpS3xs=; b=jBJAtaguXRw2Vu9Hxk9aP0lxLkgn/u2hc5hX8SRrcfHam4KTkrGF4IKCZSXdO1ts78 s5smzzY5aMO4A8zfgsSLKHrORv7j7jHuzTjoYrMWUB9qzbwnNTYVSeGfwMqq0tA8wo30 v1qq3VjcHJTfroznCcYMdyS409iIRClIIk+q5bqn5yQ1lJglWlURas19dnQ4OLZ89SH9 e7Q3bTlJByl/t7eCZPJWuBWnJDmdMU9kgz6fRyjv3gUKdU0rtn0Re7BxxGRlLAJ+FARo oEF9h4A57xJ17aJFKzrk0YVKAac2CCEFrOqsibHBODPiAjKh0aXqeF4pOAgJhmlJWopK tBKw== X-Gm-Message-State: APjAAAVeJl/OG83KbnZ9dRQ2OAj1V3P4pTJ1+x7H8x1Zx9YekqBLrlLm P6g4YAGi2eYh6QewEWRd2+d40/Zc X-Google-Smtp-Source: APXvYqy9IB6V6/5mlNdgewW4iacb4Z1YeZo9w7LactHF2jFkYskrYNrkgVmkTCxyP9ykxoXvpsibeQ== X-Received: by 2002:a19:198d:: with SMTP id 135mr10031415lfz.92.1552344899756; Mon, 11 Mar 2019 15:54:59 -0700 (PDT) Original-Received: from [192.168.1.3] ([185.105.174.23]) by smtp.googlemail.com with ESMTPSA id n7sm1115060ljj.71.2019.03.11.15.54.57 (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Mon, 11 Mar 2019 15:54:58 -0700 (PDT) In-Reply-To: Content-Language: en-US X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::12d X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:234077 Archived-At: On 11.03.2019 03:15, Stefan Monnier wrote: > Of course, if we're careful we can try and tune the weighting of the > types of scores so that both scoring have a visible impact, but I have > the impression that it's going to require too careful tuning to be > usable in practice. While possible, I think in practice it will require using just one combined sorting function, instead of passing the list of completions though several independent sorting functions. Although please feel free to prove me wrong, because I like the list-of-functions approach. > Ah, we could yes. That's equivalent to using another global var, indeed. > Currently we use global vars (completion-styles and > completion-cycle-threshold) for that purpose, mostly by accident. Fair enough. completion-sort-functions, then? > I'm afraid that if we drop the display-sort and use cycle-sort > everywhere, there's going to be a very strong reaction from users not > appreciating the change. Even more so if the heuristic is poor. In that case I'd suggest dropping cycle-sort and, for now, keeping display-sort behavior as is. But make additional sorting configurable like we've been discussing, via completion-sort-functions, as well as package/user overrides in completion-category-*.