Yes, thank you.<br><br>Now i have new problem. maybe it's even a bug.<br>If I define prompt in this way:<br><br>data Songs = Songs<br>instance XPrompt Songs where<br>ššš showXPrompt Songsš = "Song: "<br><br>songsPrompt :: XPConfig -> X ()<br>
songsPrompt c = do<br>ššš cmds <- io $ getSongs<br>ššš mkXPrompt Songs c (mkComplFunFromList' cmds) (\s -> spawn "mpc play")<br><br>getSongs = return ["Nigthwish - 1", "Nightwish - 2"]<br>
<br>(Notice song names)<br><br>Then i call this prompt and hit <tab> twice to select second "song", and i get this in prompt:<br>"Song: Nightwish - Nightwish - 1"<br>if i hit tab more, i get:<br>
"Song: Nightwish - Nightwish - Nightwish - Nightwish - 1"<br><br>But if remove spaces:<br>getSongs = return ["Nigthwish-1", "Nightwish-2"]<br>Everything works fine.<br><br>This behaviour is made on purpose? Or it's my mistake somewhere? )<br>
<br>Thank you.<br><br><div class="gmail_quote">2009/3/3 Daniel Schoepe <span dir="ltr"><<a href="mailto:asgaroth_@gmx.de">asgaroth_@gmx.de</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div></div><div class="h5">÷ÌÁÄÉÍÉÒ óÉÄÏÒÅÎËÏ wrote:<br>
> Hi<br>
><br>
> I wrote my custom prompts for selecting playlists and songs in mpd and<br>
> used mkComplFunFromList to make completion function.<br>
> What is the easiest way to enable partial matching of input against<br>
> completion list. I mean so that compare was like<br>
> select .. from ... where ... like '%input%'<br>
> ?<br>
><br>
> Thank you.<br>
<br>
</div></div>As far as I know, you'd have to define a custom completion function<br>
instead of creating it with mkComplFunFromList. So something like this<br>
should work:<br>
<br>
infixCompl _ [] = return []<br>
infixCompl l s = return $ filter (s `isInfixOf`) l<br>
<br>
That would create a function that returns all the matches in the list<br>
if, the input string occurs in the element.<br>
<br>
_______________________________________________<br>
xmonad mailing list<br>
<a href="mailto:xmonad@haskell.org">xmonad@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/xmonad" target="_blank">http://www.haskell.org/mailman/listinfo/xmonad</a><br>
</blockquote></div><br>