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: Mon, 18 Mar 2019 16:26:58 +0200 Message-ID: <646c8d35-89a7-b12f-8a78-b05e6d8f781c@yandex.ru> References: <20190213212413.868.40960@vcs0.savannah.gnu.org> <20190213212415.148B9209D7@vcs0.savannah.gnu.org> <0ba3ca47-c7d6-a608-536e-94784ba3384b@yandex.ru> <4f4e9ccd-b152-2b37-cad2-6c96b0a64d84@yandex.ru> 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="220891"; 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 Cc: Stefan Monnier , emacs-devel To: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Mar 18 15:34:55 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 1h5tLr-000vHI-DG for ged-emacs-devel@m.gmane.org; Mon, 18 Mar 2019 15:34:55 +0100 Original-Received: from localhost ([127.0.0.1]:42474 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h5tLq-0006k6-9u for ged-emacs-devel@m.gmane.org; Mon, 18 Mar 2019 10:34:54 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:51666) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h5tHn-0005Db-TB for emacs-devel@gnu.org; Mon, 18 Mar 2019 10:30:44 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h5tEG-00019O-Bz for emacs-devel@gnu.org; Mon, 18 Mar 2019 10:27:05 -0400 Original-Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]:40939) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h5tEG-00018Q-12 for emacs-devel@gnu.org; Mon, 18 Mar 2019 10:27:04 -0400 Original-Received: by mail-wr1-x42b.google.com with SMTP id t5so17290091wri.7 for ; Mon, 18 Mar 2019 07:27:03 -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=akFWhH+kGOsuEyj03qW6CozEUCsgAasHugOR2Cwr9CA=; b=q115q4Q7Ij0JPsg0y2Czwfj62kiSPf3pR/gUGnjLlmfIzYBVf+r+mXQ+Zecavp56uS QiKr004n9U/aMGvbimpV2VJ4EaxcW+z9VZCvupM9t5bvX2ri9q0AhGkfc5DOGRVxkusd S88qVFaz56BwYg1l4OpSYtjl5WTUTwjkdoJm3Cp4Qb3EOkRrs9d5SWAZF4HLjDSTtcig Be3IXDK4A2aaxOnxrrP5t5xi0ke+POWwNDdvDUIVTAEiWoKNffbbKi6RdJ4viBsJDo6r aXtJRbsrvT0xCbGrjzJVhec0V0zlMPZo7ucLgQPCTWeT9wd1aBcyBiRP60sO9PXIrIGI JPPg== 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=akFWhH+kGOsuEyj03qW6CozEUCsgAasHugOR2Cwr9CA=; b=FW3FNBbpxfvHO05Xqz/vKAsD60Bi2Lpoxd7HYUO8niC46gKawJuiAFdkNzNYYvaVky K8t5rkpwddzqFDbq4hkmKV26CRkxRt5POxoydOKauYVm4LdQzswGEh1GHu0knetIlFM0 938z0/e8mwcs2vNlaTK1dWV+W5Sy6YdmgshGl85m9ceTeR+klDEve6GCMrYs2j47XKBo 39Z2P5cmp4wNSPAg0QSvTipJk9xaOQO/Hcx6AMAiusXB8c0Nee7p0LBk3Elvq4Qpc8WB 2OPG83xCBWvC0FXhxPihuTWGYD+0bNjuVWUcynpAu+kkpTwJbKfqT5XFb72D/NDMRRRx BNsw== X-Gm-Message-State: APjAAAVGnMmdjVP2JOUFsnfx4+Pg8N5KRqi6lUtwoij83qhb4DJQqw+g UA0xndhKU4nIYNuMy7v2SKq8BB1/ X-Google-Smtp-Source: APXvYqwPivFKL7mZkdl1YVO7CyAnZGDPUHN659GRLO4bS4GKdCr2r1WOmVo3yAiZwgiP8JZO0ExlkQ== X-Received: by 2002:adf:b6a3:: with SMTP id j35mr12651121wre.25.1552919222050; Mon, 18 Mar 2019 07:27:02 -0700 (PDT) Original-Received: from [192.168.0.195] ([109.110.245.170]) by smtp.googlemail.com with ESMTPSA id d10sm28702299wrh.83.2019.03.18.07.27.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 Mar 2019 07:27:01 -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::42b 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:234322 Archived-At: On 17.03.2019 23:46, João Távora wrote: >> Another thing I'd like to note: with flex completion, RET doesn't select >> the current candidate anymore (working as intended, of course). But it's >> a bit disorienting. > > In what situation exactly? Emacs -Q + (setq completion-styles '(flex)) + what? + input is not a prefix match. E.g. M-x describe-variable, then input 'compst'. RET won't select the completion. > You're right, more or less, at least judging from some benchmarks: > > (benchmark-run-compiled 100 > (let ((completion-styles '(flex))) > (completion-all-completions "kill" obarray nil 0))) ; => 4.76s > > (benchmark-run-compiled 100 > (let ((completion-styles '(basic))) > (completion-all-completions "kill" obarray nil 0))) ; => 3.7s > > ... and the first returns a much larger list. Try a smaller input, like just 'k'. The difference is more stark in that case, and the lists of completions are longer. For the same reason (lots of matches), I'm afraid simply moving matching to C won't bring a noticeable improvement. > I was expecting to see much larger differences, though, since my > icomplete and company-based experience is really sluggish. But > I wasn't using these much for the default completion style anyway. > Or maybe the sluggishness is coming from somewhere else. > > Anyway, as I predicted, most of the work is the matching in > completion-pcm--all-completions. I'll try to hack something > there when the pattern has some simple flex-like form. All right. Please let us know of the results.