Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fuzzy matching #296

Closed
tuhdo opened this issue Feb 4, 2015 · 14 comments
Closed

Fuzzy matching #296

tuhdo opened this issue Feb 4, 2015 · 14 comments

Comments

@tuhdo
Copy link

tuhdo commented Feb 4, 2015

Someone implemented fuzzy matching with company: http://sixty-north.com/blog/a-more-full-featured-company-mode-backend, although rudimentary. I wonder if we can integrate with existing solution like flx? That would improve usability a lot.

@dgutov
Copy link
Member

dgutov commented Feb 4, 2015

No: they implemented a backend that performs fuzzy matching. It could use flx, or any other method, but doing fuzzy matching for all backends imposes different requirements on the framework (Company).

@tuhdo
Copy link
Author

tuhdo commented Feb 5, 2015

So, it is possible to integrate flx for Emacs Lisp and dabbrev backends and gradually add more in the future? When I see this article, I thought that what we need is a proper fuzzy completion engine rather than manually specify abbrevs.

@dgutov
Copy link
Member

dgutov commented Feb 5, 2015

So, it is possible to integrate flx for Emacs Lisp

No, it's not. Or not particularly easy, at least. On the other hand, (add-to-list 'completion-styles 'initials t) will get you almost the same benefits.

and dabbrev

That's easier, but it would involve collecting all words from buffers and applyling flx to them. Which is necessarily slower than what we're doing now (we filter by prefix while searching). I'll let yourself measure, by how much.

Anyway, we can't use flx directly until it's in GNU ELPA.

@tuhdo
Copy link
Author

tuhdo commented Feb 5, 2015

(add-to-list 'completion-styles 'initials t)

I've just added it but when I tried company-elisp on string "wcb" or "atl" (add-to-list), it cannot complete.

@dgutov
Copy link
Member

dgutov commented Feb 5, 2015

You should try company-capf instead.

@tuhdo
Copy link
Author

tuhdo commented Feb 5, 2015

Nice. But how can I type to start narrow to a single candidate? Currently, it only gives a list and prevent me from entering anything.

@dgutov
Copy link
Member

dgutov commented Feb 5, 2015

That might be impossible: initials means initials.

You can write your own completion style, however, but that's not a trivial task.

@tuhdo
Copy link
Author

tuhdo commented Feb 5, 2015

Alright. This is good enough. I might combine it with C-M-s to narrow further. I think you should enable this by default. That is, add it to default backends.

@dgutov
Copy link
Member

dgutov commented Feb 5, 2015

What exactly should I add to the default backends? company-capf is already there.

And company-elisp isn't, if you have a recent enough Emacs.

@tuhdo
Copy link
Author

tuhdo commented Feb 5, 2015

Sorry it was my customization. Anyway, we should leave this issue open hopefully it will be implemented in a few more years or someone creates an external package that integrate with flx.

@dgutov
Copy link
Member

dgutov commented Feb 5, 2015

No need: it's a duplicate of #47.

@dgutov dgutov closed this as completed Feb 5, 2015
@jasonm23
Copy link

jasonm23 commented May 3, 2015

Please add a duplicate label to this.

@dgutov
Copy link
Member

dgutov commented May 7, 2015

@jasonm23 Ok, added.

@jasonm23
Copy link

jasonm23 commented May 7, 2015

Cheers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants