-
Notifications
You must be signed in to change notification settings - Fork 4
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
Contribute this to Emacs? #16
Comments
I would love to see this readily available in Emacs! |
@axelf4 friendly ping :) |
@axelf4 another friendly ping |
Just wanted to say thank you for writing hotfuzz. This is by far the best completion I've ever tested in Emacs (and I've tested quite a few). The C library also makes it really fast. I'm not sure why it isn't more popular, it is so much better than everything else. If it could be included in Emacs, or at least land in melpa-stable, it would make it more popular and likely better in the long term! |
Sorry for the late response! This being an attempt at a canonical Emacs Lisp implementation of the algorithm by Gotoh used by most fuzzy searchers, I agree it would make sense for something like this to ship with GNU Emacs. I have signed FSF copyright assignment papers, but the one time I tried submitting a package for GNU ELPA I received no response, which made me a bit predisposed against that ordeal. :) That said, if the GNU Emacs maintainers agree, I would be very willing to contribute this to Emacs.
That is not completely true. The Lisp implementation of hotfuzz manages to be about as fast as |
You should contact @monnier.
Interesting, but I don't understand exactly what you mean. Can you show an example (maybe a contrived example) of a use case (interactive or programmatic) where the "additional assumption" plays a role? I.e. where |
Hotfuzz both filters and sorts the completions already in It breaks down in contrived cases like: (let ((all (completion-all-completions
string table nil (length string) md)))
(setcdr (last all) nil)
(setq all (shuffle all)) ; Not OK if using hotfuzz, but fine with flex
(pop all) ; ... same here
;; Not OK if using flex or hotfuzz, though technically ought to be
;; allowed as the documentation makes no mention of this limitation.
(dolist (x all)
(set-text-properties 0 (length x) () x))
(funcall (completion-metadata-get md 'display-sort-function) all)) since the I cannot think of any non-contrived examples (would not be a very good assumption to make otherwise!).
I meant that the added assumption would need to be codified. |
Thanks for clarifying @axelf4 👍 |
+1 to contributing to Emacs
I found using company with its multi-backend adapter also flips the result.
In fussy's implementation, I ended up just setting a completion-score text property on the result (https://github.com/jojojames/fussy/blob/9c532c28c04cc776692bf51118cbe5dd9d263594/fussy.el#L650 & jojojames/fzf-native@3e8f527) and settling (taking the performance hit of setting the text property on every candidate) for sorting as a company-transformer (https://github.com/jojojames/fussy/blob/9c532c28c04cc776692bf51118cbe5dd9d263594/fussy.el#L1123) and modifying completion--adjust-metadata to sort by 'completion-score (https://github.com/jojojames/fussy/blob/9c532c28c04cc776692bf51118cbe5dd9d263594/fussy.el#L752) |
Hi @axelf4 I just found out about this project. I'm the guy who created
flex
. As far as I can see, hotfuzz is likeflex
but presumably better in every possible way. If that is true, I think we should just replace Emacs'sflex
with it, so long as you're willing to contribute the code to GNU Emacs (signing FSF papers, etc). WDYT?The text was updated successfully, but these errors were encountered: