Two patches related to XMonad.Prompt

Hi folks, I really got used to using emacs ido mode, which offers a pretty powerful and intuitive fuzzy matching of completions, so I wanted to port the same to XMonad.Prompt. This required two patches, included in the attached patch bundles: (1) Completions should be sortable by how well they match the current query string. This turned out to be a very easy addition of a 'sorter' function to XPConfig, which is parameterized by the current query string. The default is 'const id', that is, no sorting is done, which is exactly the old behaviour of XMonad.Prompt. (2) A new module XMonad.Prompt.FuzzyMatch that implements the fuzzy matching. The exact rules for matching and sorting of matches are explained in its documentation. As usual, let me know if anything needs to straightened out before these patches can be applied. Cheers, Norbert

Norbert Zeh
I really got used to using emacs ido mode, which offers a pretty powerful and intuitive fuzzy matching of completions, so I wanted to port the same to XMonad.Prompt.
I've wanted this for a long time, can't wait to try it out. Thanks! -- Peter Jones, Founder, Devalot.com Defending the honor of good code

Excellent. Once you get to try it out, any feedback on how to improve the
sorting, if any, would be appreciated. It took me some tries to come up
with the current version, which I am pretty happy with as far as matching
my sorting expectations goes, but that doesn't mean that there aren't more
intuitive criteria for sorting. In the end, of course, it's all heuristic
anyway.
Cheers,
Norbert
On Mon, Mar 16, 2015 at 11:59 AM Peter Jones
Norbert Zeh
writes: I really got used to using emacs ido mode, which offers a pretty powerful and intuitive fuzzy matching of completions, so I wanted to port the same to XMonad.Prompt.
I've wanted this for a long time, can't wait to try it out. Thanks!
-- Peter Jones, Founder, Devalot.com Defending the honor of good code
_______________________________________________ xmonad mailing list xmonad@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/xmonad

Norbert Zeh
On Mon, Mar 16, 2015 at 11:59 AM Peter Jones wrote:
Norbert Zeh
writes: I really got used to using emacs ido mode, which offers a pretty powerful and intuitive fuzzy matching of completions, so I wanted to port the same to XMonad.Prompt.
I've wanted this for a long time, can't wait to try it out. Thanks! Excellent. Once you get to try it out, any feedback on how to improve the sorting, if any, would be appreciated. It took me some tries to come up with the current version, which I am pretty happy with as far as matching my sorting expectations goes, but that doesn't mean that there aren't more intuitive criteria for sorting. In the end, of course, it's all heuristic anyway.
I've been playing with your fuzzy matching for about a week now. I really, really like it. The only issue I have is that I can't seem to get tab completion to work. For simple prompts I can just press enter once the item I want is selected. But for more complicated menus, such as the shell menu, I want to be able to press tab and have the current item expanded so I can start entering arguments. This doesn't seem to work. I've also noticed that if I have fuzzy matching turned on in the shell prompt and start to complete a file path it crashes the prompt and I have to restart xmonad to remove the X window that the prompt created. -- Peter Jones, Founder, Devalot.com Defending the honor of good code

Hi Peter,
Sorry for not replying in a timely manner. My summer has been insanely
busy. Unfortunately, I cannot offer any particularly helpful comment at
this point either. The problems you describe are proof that proper testing
would go a long way - my bad. I'll try to find the time to look at this in
the coming weeks to see what can be done to fix this. Having said this, I
personally don't use FuzzyMatch in the Shell prompt; for commands, standard
prefix filtering seems to be more effective. Still, you should of course
be able to use it if you want it.
Cheers,
Norbert
On Tue, Jul 14, 2015 at 1:09 PM, Peter Jones
On Mon, Mar 16, 2015 at 11:59 AM Peter Jones wrote:
Norbert Zeh
writes: I really got used to using emacs ido mode, which offers a pretty
and intuitive fuzzy matching of completions, so I wanted to port the same to XMonad.Prompt.
I've wanted this for a long time, can't wait to try it out. Thanks! Excellent. Once you get to try it out, any feedback on how to improve
Norbert Zeh
writes: powerful the sorting, if any, would be appreciated. It took me some tries to come up with the current version, which I am pretty happy with as far as matching my sorting expectations goes, but that doesn't mean that there aren't more intuitive criteria for sorting. In the end, of course, it's all heuristic anyway.
I've been playing with your fuzzy matching for about a week now. I really, really like it.
The only issue I have is that I can't seem to get tab completion to work. For simple prompts I can just press enter once the item I want is selected. But for more complicated menus, such as the shell menu, I want to be able to press tab and have the current item expanded so I can start entering arguments. This doesn't seem to work.
I've also noticed that if I have fuzzy matching turned on in the shell prompt and start to complete a file path it crashes the prompt and I have to restart xmonad to remove the X window that the prompt created.
-- Peter Jones, Founder, Devalot.com Defending the honor of good code
_______________________________________________ xmonad mailing list xmonad@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/xmonad
participants (2)
-
Norbert Zeh
-
Peter Jones