all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Óscar Fuentes" <ofv@wanadoo.es>
To: emacs-devel@gnu.org
Subject: Re: Why fido, icycles, ido, icomplete
Date: Thu, 07 Nov 2019 02:51:50 +0100	[thread overview]
Message-ID: <877e4ce9mx.fsf@telefonica.net> (raw)
In-Reply-To: 20191107012158.a3vgc5co2li652mp@Ergus

Ergus <spacibba@aol.com> 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.




  reply	other threads:[~2019-11-07  1:51 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20191106212018.cnddqzlo5rpdhi6s.ref@Ergus>
2019-11-06 21:20 ` Why fido, icycles, ido, icomplete Ergus
2019-11-06 21:30   ` Daniele Nicolodi
2019-11-06 22:27     ` Ergus
2019-11-06 22:03   ` João Távora
2019-11-06 22:39     ` Óscar Fuentes
2019-11-06 22:57       ` João Távora
2019-11-06 23:07         ` Óscar Fuentes
2019-11-07  0:36           ` João Távora
2019-11-07  1:07             ` Óscar Fuentes
2019-11-07  1:21               ` Ergus
2019-11-07  1:51                 ` Óscar Fuentes [this message]
2019-11-07 10:09               ` João Távora
2019-11-07 18:50                 ` Óscar Fuentes
2019-11-06 23:21     ` Ergus
2019-11-06 23:59       ` Óscar Fuentes
2019-11-07  0:47         ` Ergus
2019-11-07  2:20           ` Óscar Fuentes
2019-11-07  4:59             ` Ergus
2019-11-07 18:26               ` Óscar Fuentes
2019-11-07 14:09             ` Stefan Monnier
2019-11-07 20:35               ` Óscar Fuentes
2019-11-07 21:11                 ` Stefan Monnier
2019-11-07 22:18                   ` Óscar Fuentes
2019-11-07 22:30                     ` Stefan Monnier
2019-11-07 22:34                     ` João Távora
2019-11-07  0:27       ` João Távora
2019-11-07  1:09         ` Ergus
2019-11-07 10:39           ` João Távora
2019-11-07 15:00             ` Ergus
2019-11-08 17:54     ` Filipp Gunbin
2019-11-08 18:10       ` Óscar Fuentes
2019-11-08 18:45       ` Nicolas Semrau
2019-11-08 19:12       ` Eli Zaretskii
2019-11-08 21:31         ` Juanma Barranquero
2019-11-08 22:54           ` João Távora
2019-11-08 23:11             ` Ergus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=877e4ce9mx.fsf@telefonica.net \
    --to=ofv@wanadoo.es \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.