all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Emacs needs truely useful flex matching
@ 2013-03-21 15:02 Le Wang
  2013-03-21 17:49 ` Óscar Fuentes
  2013-03-22  2:36 ` Richard Stallman
  0 siblings, 2 replies; 12+ messages in thread
From: Le Wang @ 2013-03-21 15:02 UTC (permalink / raw)
  To: emacs-devel

Hi all,

Since there is a big thread about a standard way to recognise project roots, I
want to bring up another area in which Emacs is falling behind other
Editors (Sublime Text, Textmate, and Vim).
Choosing from a very large list of files (or any strings for that matter) with
a minimum of keystrokes.

ido-mode has `ido-enable-flex-matching', but that does not do the smart
sorting required.

Vim has this through the Command-T plugin.  The best way to "get it" is by
watching it in action:
https://s3.amazonaws.com/s3.wincent.com/command-t/screencasts/command-t-demo.mov

Skip to 6 minutes to see it in action in a large project with
repetitive path segments.

Homepage here: https://wincent.com/products/command-t

The matching engine is implemented in C and it interfaces with Vim through the
Ruby bridge.  I think in order to sort a large list of strings (> 10k), this
will also have to be implemented in C to be fast enough if done for Emacs.

The sorting algorithm is roughly this for a query: "abcd"

1. Get all matches for "a.*b.*c.*c"
2. Calculate score of each match
    - contiguous matched chars gets a boost
    - matches at word and camelCase boundaries (abbreviation) get a boost
    - matches with smallest starting index gets a boost
2. Sort list according to score.

A lot of my colleagues use this kind of flex matching to navigate around our
large code base in Sublime Text and I'm very jealous that with so few
keystrokes the most useful
matches just float to the top.

This navigation could be implemented with Helm if Emacs had a builtin
fast smart flex sorting engine.


--
Le



^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2013-04-15 13:50 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-21 15:02 Emacs needs truely useful flex matching Le Wang
2013-03-21 17:49 ` Óscar Fuentes
2013-03-21 23:34   ` Le Wang
2013-03-21 23:58   ` Stefan Monnier
2013-03-22  1:00     ` Le Wang
2013-03-22  8:24       ` Eli Zaretskii
2013-03-22 11:18         ` Dmitry Gutov
2013-04-14 16:48       ` Le Wang
2013-04-14 18:18         ` Stefan Monnier
2013-04-15  0:14           ` Le Wang
2013-04-15 13:50             ` Stefan Monnier
2013-03-22  2:36 ` Richard Stallman

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.