From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= Newsgroups: gmane.emacs.devel Subject: Re: [Emacs-diffs] master b0e318d 2/2: Score flex-style completions according to match tightness Date: Sun, 17 Mar 2019 21:27:55 +0000 Message-ID: References: <20190213212413.868.40960@vcs0.savannah.gnu.org> <20190213212415.148B9209D7@vcs0.savannah.gnu.org> <0ba3ca47-c7d6-a608-536e-94784ba3384b@yandex.ru> <2fb59831-642d-e70f-057b-bcb2a0cc280a@yandex.ru> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="180203"; mail-complaints-to="usenet@blaine.gmane.org" Cc: emacs-devel To: Dmitry Gutov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Mar 17 22:44:11 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 1h5dZj-000klU-0n for ged-emacs-devel@m.gmane.org; Sun, 17 Mar 2019 22:44:11 +0100 Original-Received: from localhost ([127.0.0.1]:60516 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h5dZi-0006bd-1C for ged-emacs-devel@m.gmane.org; Sun, 17 Mar 2019 17:44:10 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:47535) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h5dX8-0005GC-Ao for emacs-devel@gnu.org; Sun, 17 Mar 2019 17:41:31 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h5dKE-0007sx-LK for emacs-devel@gnu.org; Sun, 17 Mar 2019 17:28:11 -0400 Original-Received: from mail-qk1-x72d.google.com ([2607:f8b0:4864:20::72d]:34851) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h5dKE-0007sd-DD for emacs-devel@gnu.org; Sun, 17 Mar 2019 17:28:10 -0400 Original-Received: by mail-qk1-x72d.google.com with SMTP id z13so8551025qki.2 for ; Sun, 17 Mar 2019 14:28:10 -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:content-transfer-encoding; bh=8eYhXVcPdRLuTpw7iXP0XjyZFsM1LsBtXb8hOgeLQ0A=; b=GAO10aHDUvg/WuWAX86uTiuxyGBlTT3nLcPe7fcxJ99y4niBFJsGpa17gUHSfI+fJq 2B/7KjbkQJqSua7BixxIff4DEhvM3W5unB2vJyja/d2qxx83jQ+PTGYggiLyZZCpVDlo TdV36iXyKu0oMwjvp4S9ftk4dun+VgYS5ZW5b/hWauSlnUYfkXe1CF6ydUUpkjxUulX4 OepZLvVqzgTDEbdCJm8aDX52vQatzKJ1xfx1ISIZMp7QbB54ulNjNYrGWCN0dINj3gL1 FqBtV9Asw2u+dUxrdUYzHR2PCbSsN97E5lsqYS0EBnTTLGWLm6mcMV9i6j6PYTsA5Yt0 gdew== 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:content-transfer-encoding; bh=8eYhXVcPdRLuTpw7iXP0XjyZFsM1LsBtXb8hOgeLQ0A=; b=ahAB5AUDhV2jL9pKHRYHlQtNMCMFFsXC8Hxsi/aNL+aAZFmUplS/6EQQF9CMUmgCKn 6C8nGrNY2/o5PD1xff0XgO5L5Xni3aE8gLVogiOaA5puIvF6foppMvFgOzrhF3AuQc07 NppBlLQ3/w9RrWqoznE+MQ3jNJ5Ji+FhVfEmJvedSGAMSulfx7I/IvSzrV5o56+N0ydK O40zQnpUo5SPoAq+1y7U9EP7Zeqr72rUuR5C7PoTy/nsKhQKgZga2dcQIRr4az/iOHcN fG9qDgG1G20RcBdD4bFFVE42kVzdYBJUNrwA8Sd3OJel+kIWk0cx5nBNApdhMd6W13Tp yfrw== X-Gm-Message-State: APjAAAVo8NwF4/qFGPz+3HcOg9UTX3MJfglY82/8zSlM96Sf76lycuTs iqfRoJnfjNaHOpCriyu3nOfFVL+3s8L9yiFfC3g= X-Google-Smtp-Source: APXvYqx34dFunNExcGWyZYd0i5A6tYFWjilF0TWaDmCBfVOBJ8c5ec5ohiYKYEb63kHgDgTI4xM+fzj43ZgpzZDo3JQ= X-Received: by 2002:a37:c5d2:: with SMTP id k79mr10380714qkl.234.1552858089856; Sun, 17 Mar 2019 14:28:09 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::72d 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:234306 Archived-At: [sorry for the double mail Dmitry] On Sun, Mar 17, 2019 at 8:22 PM Dmitry Gutov wrote: > > On 17.03.2019 21:09, Jo=C3=A3o T=C3=A1vora wrote: > > >> You did, but that's neither here not there. A fix PR would be welcome, > >> but I'll get around to it otherwise myself, no problem. > > > > I sent you a PR that should fix it. > > Thanks! > > > That would be nice, of course, but it's not strictly required to > > start making use of it in company.el: you can look for it and act > > accordingly when it's found. > > The sorting function to use should come from somewhere, right? Yes, in this case it would come from company. I was thinking you could sort by `completion-score` in descending order. > But if you just want to try and see how well the sorting works, you can > add one to `company-transformers`. Thanks, I added (defun sort-by-company-score (cands) (cl-sort cands #'> :key (lambda (cand) (or (get-text-property 0 'completion-score cand) 0))) (add-to-list 'company-transformers 'sort-by-company-score) And it behaves much better. My idea is that something like this could be be built-in into company (after the lexicographical sort). Jo=C3=A3o On Sun, Mar 17, 2019 at 8:22 PM Dmitry Gutov wrote: > > On 17.03.2019 21:09, Jo=C3=A3o T=C3=A1vora wrote: > > >> You did, but that's neither here not there. A fix PR would be welcome, > >> but I'll get around to it otherwise myself, no problem. > > > > I sent you a PR that should fix it. > > Thanks! > > > That would be nice, of course, but it's not strictly required to > > start making use of it in company.el: you can look for it and act > > accordingly when it's found. > > The sorting function to use should come from somewhere, right? > > But if you just want to try and see how well the sorting works, you can > add one to `company-transformers`. --=20 Jo=C3=A3o T=C3=A1vora