[xmonad] Partial match in prompt

Daniel Schoepe asgaroth_ at gmx.de
Tue Mar 3 13:21:24 EST 2009


Владимир Сидоренко wrote:
> Hi
> 
> I wrote my custom prompts for selecting playlists and songs in mpd and
> used mkComplFunFromList to make completion function.
> What is the easiest way to enable partial matching of input against
> completion list. I mean so that compare was like
> select .. from ... where ... like '%input%'
> ?
> 
> Thank you.

As far as I know, you'd have to define a custom completion function
instead of creating it with mkComplFunFromList. So something like this
should work:

infixCompl _ [] = return []
infixCompl l s = return $ filter (s `isInfixOf`) l

That would create a function that returns all the matches in the list
if, the input string occurs in the element.



More information about the xmonad mailing list