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] master b0e318d 2/2: Score flex-style completions according to match tightness Date: Sat, 16 Mar 2019 03:13:43 +0200 Message-ID: <0ba3ca47-c7d6-a608-536e-94784ba3384b@yandex.ru> References: <20190213212413.868.40960@vcs0.savannah.gnu.org> <20190213212415.148B9209D7@vcs0.savannah.gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="240432"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1 To: emacs-devel@gnu.org, =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Mar 16 02:35:22 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 1h4yEM-0010RR-GR for ged-emacs-devel@m.gmane.org; Sat, 16 Mar 2019 02:35:22 +0100 Original-Received: from localhost ([127.0.0.1]:35365 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h4yEL-0000pY-7L for ged-emacs-devel@m.gmane.org; Fri, 15 Mar 2019 21:35:21 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:57331) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h4y7f-00059F-QQ for emacs-devel@gnu.org; Fri, 15 Mar 2019 21:28:28 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h4xtU-0003DQ-Mv for emacs-devel@gnu.org; Fri, 15 Mar 2019 21:13:49 -0400 Original-Received: from mail-lj1-x232.google.com ([2a00:1450:4864:20::232]:42930) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h4xtU-0003D8-Dk for emacs-devel@gnu.org; Fri, 15 Mar 2019 21:13:48 -0400 Original-Received: by mail-lj1-x232.google.com with SMTP id v22so3669749lje.9 for ; Fri, 15 Mar 2019 18:13:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=/z8VEKkkLXP2JWulPNb9v6zDf49BVdLxZjdeRKIS+N0=; b=sa9yJbFktRUuvrjDG330MF2GIShWWhDG3v3CU2gqocINhOhL9+CGJLnpn8tfHwi9Q+ TMDfd5Qns0RI1hMC4BHlznPOpXtuRb3zxziNf7PunPEujLMWujuOkbD/rJkM6Sq4z7E7 Nw9/+jmKJfB+RH6M67IR0TV6W56TAfnt2RfHngLZeF97Xjvlbp6oK0QEPFlPxffsW+aI uPd9lahGRomzaKXv2BqKERwhwLJG6oBTGQZdg+1F1lk6mv/P8Ig6J/tJI2BWhbhC/vIG 1sDHi4P1KpyKJdc5nOb1bO3wm9EA+AHA8Lte5bQTDYqsoEcIN0o2mDXeIWmAAYpOkA8z hXuQ== 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:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=/z8VEKkkLXP2JWulPNb9v6zDf49BVdLxZjdeRKIS+N0=; b=PuF5rNRbl9xQOxGVIel0zxV/udEeVWtI3CiLETd+Fs3lXKGEnYSxMg1CE1ig+ofqLO bDtFTGMJOhSotxyrVGCikfwBiNj9EvCFC73OFud15MFEgFHqCjE7yhfkmOAkf1OT2bwD WCQIzXX5w+HOilggS0FGphzx9NO0Yv7aWOFpTfnCGEbB8q62UfgScxRQk+0i9A/8Dz+9 pYat8YTr5Mb56osEQYClZhySFm5g0hunRyqTssXUws0Ce7W/NjuHUD+oOiuzuhdK8hlA yZoMbLMzu5e4d3tN9l7CCoP871k5iYkww4zAn0kf5oav1bALoLtKxwCax2yIngMrhZkO dMzw== X-Gm-Message-State: APjAAAUqnBtDucZ6mfT/ZqjfYcmfYrGQyG6FGtMNaCmKJdET1exlAaqQ LTL2MhiYPiL41m8dsbIYbYMpud54 X-Google-Smtp-Source: APXvYqyTa3LWCykMYvzzU0ht7bHhk41D/wfMU+3wCtBoq4b4gg5qyOsjoKT0bcyxPikFNWTukkZ5Ww== X-Received: by 2002:a2e:91c8:: with SMTP id u8mr3716677ljg.185.1552698826123; Fri, 15 Mar 2019 18:13:46 -0700 (PDT) Original-Received: from [192.168.1.3] ([185.105.174.23]) by smtp.googlemail.com with ESMTPSA id m1sm767066lfh.36.2019.03.15.18.13.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 15 Mar 2019 18:13:45 -0700 (PDT) In-Reply-To: <20190213212415.148B9209D7@vcs0.savannah.gnu.org> 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::232 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:234193 Archived-At: Hi Joao, Now that I've been seeing company-capf test failures mentioning completion-score for a while (e.g. see https://travis-ci.org/company-mode/company-mode/jobs/507061364), I really have to ask: Why does a completion-pcm--??? function add the scores? And even does that unconditionally, and depends on the value of a flex-related variable. While the flex style isn't even used. On 13.02.2019 23:24, Jo�o T�vora wrote: > branch: master > commit b0e318d27f10b820f1cfad6ea98793c11fc782a4 > Author: João Távora > Commit: João Távora > > Score flex-style completions according to match tightness > > The new completion style needs to score completion matches so that we > can use it later on when sorting the completions. This is because > "foo" can flex-match "foobar", "frodo" and "barfromsober" but we > probably want "foobar" to appear at the top of the completion list. > > This change introduces a scoring formula and adds scoring hints in the > candidate string's `completion-score' property. > > * lisp/minibuffer.el (completion-pcm--hilit-commonality): Propertize > completion with 'completion-score > (flex-score-falloff): New variable.