From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?Q?=C3=93scar_Fuentes?= Newsgroups: gmane.emacs.devel Subject: Re: Why fido, icycles, ido, icomplete Date: Thu, 07 Nov 2019 02:51:50 +0100 Message-ID: <877e4ce9mx.fsf@telefonica.net> References: <20191106212018.cnddqzlo5rpdhi6s.ref@Ergus> <20191106212018.cnddqzlo5rpdhi6s@Ergus> <877e4c1x3r.fsf@gmail.com> <87o8xoeik4.fsf@telefonica.net> <87k18ceh8w.fsf@telefonica.net> <87a7984j4p.fsf@gmail.com> <87bltoebpe.fsf@telefonica.net> <20191107012158.a3vgc5co2li652mp@Ergus> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="67130"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Nov 07 02:52:21 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.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iSWyC-000HLx-Ow for ged-emacs-devel@m.gmane.org; Thu, 07 Nov 2019 02:52:20 +0100 Original-Received: from localhost ([::1]:38434 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iSWyB-0000pu-JM for ged-emacs-devel@m.gmane.org; Wed, 06 Nov 2019 20:52:19 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37137) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iSWxs-0000oZ-GD for emacs-devel@gnu.org; Wed, 06 Nov 2019 20:52:01 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iSWxr-0005mT-Ai for emacs-devel@gnu.org; Wed, 06 Nov 2019 20:52:00 -0500 Original-Received: from 195-159-176-226.customer.powertech.no ([195.159.176.226]:54190 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iSWxr-0005m3-3z for emacs-devel@gnu.org; Wed, 06 Nov 2019 20:51:59 -0500 Original-Received: from list by blaine.gmane.org with local (Exim 4.89) (envelope-from ) id 1iSWxo-000Gqw-KH for emacs-devel@gnu.org; Thu, 07 Nov 2019 02:51:56 +0100 X-Injected-Via-Gmane: http://gmane.org/ Cancel-Lock: sha1:GUu1YQBWeKqCAH0uCCwFkvuT3Po= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 195.159.176.226 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.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:241899 Archived-At: Ergus writes: >>It takes a set of candidates and a string as inputs. The algorithm >>associates a score to each candidate based on the string and outputs a >>list of matching candidates sorted by the score. >> > 1) Is this what amx (former smex) does? I don't know amx/smex but AFAIK there is only one implementation of the flx algorithm on the Emacs universe. Alos, smex predates flx. > if 1) is it like: ivy???regex-fuzzy + amx? No, IIRC regex-fuzzy turn abc into .*a.*b.*c but flx is much more comples and the scoring algorithm is the key difference. flx scores candidates depending on where each letter matches. For instance, if I type M-x sbke the first candidate is save-buffers-kill-emacs, because it is the candidate that gets the higher score by far. Similarly, when I use my custom command for visiting a file on a git repo that presents as initial candidates all the files obtained through `git ls-files', typing "sxc" on the Emacs git checkout puts source/xdisp.c as the second candidate (the first is etc/xhtml-csismap.rnc) and if I type "lide" the fifth candidate is lisp/ido.el. This last example is penalized because the algorithm gives higher scores to candidates with longer names, which is also the reason why source/xdisp.c is not the first candidate on the previous example. But once we understand the algorithm, we know that the "e" in "lide" does not help because every file inside lisp/ has an ".el" suffix. Simply typing "lid" lisp/ido.el is already the fifth candidate but getting rid of the useless "e" and typing "lido" puts that file as the first candidate.