Prompt completion: Longest common string

Well, I don't know if I can be clear enough; I'm looking to be able to "complete" when I press tab instead of cycle through every option. For example: Run: gno a lot of output that starts with gnome- I would expect that pressing <Tab> turns gno to gnome- I've been looking trough the Xmonad.Prompt and Xmonad.Prompt.Shell in the contrib docs, but I can't find the correct function to do it. I guess it have to do with 'mkComplFunFromList' or 'nextCompletion', but I don't how (or where) to start :( Any help/guidance would be greatly appreciated. Regards, -- Pablo Olmos de Aguilera Corradini - @PaBLoX http://www.glatelier.org/ http://about.me/pablox/ http://www.linkedin.com/in/pablooda/ Linux User: #456971 - http://counter.li.org/

On Sun, Jun 03, 2012 at 12:06:20AM -0400, Pablo Olmos de Aguilera Corradini wrote:
Well, I don't know if I can be clear enough; I'm looking to be able to "complete" when I press tab instead of cycle through every option.
For example:
Run: gno a lot of output that starts with gnome-
I would expect that pressing <Tab> turns gno to gnome-
I've been looking trough the Xmonad.Prompt and Xmonad.Prompt.Shell in the contrib docs, but I can't find the correct function to do it.
Sadly, it seems the current behavior is hard-coded (see the 'completionHandle' function here: http://xmonad.org/xmonad-docs/xmonad-contrib/src/XMonad-Prompt.html ) There doesn't seem to be a way to configure things to get the behavior you want. It does seem like a sensible behavior though, and of course patches to XMonad.Prompt allowing it to be configured would be welcome. -Brent

On 5 June 2012 08:54, Brent Yorgey
On Sun, Jun 03, 2012 at 12:06:20AM -0400, Pablo Olmos de Aguilera Corradini wrote:
Well, I don't know if I can be clear enough; I'm looking to be able to "complete" when I press tab instead of cycle through every option.
For example:
Run: gno a lot of output that starts with gnome-
I would expect that pressing <Tab> turns gno to gnome-
I've been looking trough the Xmonad.Prompt and Xmonad.Prompt.Shell in the contrib docs, but I can't find the correct function to do it.
Sadly, it seems the current behavior is hard-coded (see the 'completionHandle' function here:
http://xmonad.org/xmonad-docs/xmonad-contrib/src/XMonad-Prompt.html
) There doesn't seem to be a way to configure things to get the behavior you want. It does seem like a sensible behavior though, and of course patches to XMonad.Prompt allowing it to be configured would be welcome.
-Brent
Thanks for your kind answer :). I'm just learning haskell through xmonad, so I guess it's gonna be some time before I get the enough skill to do it, but I'll keep it in mind. It has been a real (and fun) challenge to learn a functional language. PS.- Nice xmonad.hs, I've been inspired a lot in it :) Saludos! -- Pablo Olmos de Aguilera Corradini - @PaBLoX http://www.glatelier.org/ http://about.me/pablox/ http://www.linkedin.com/in/pablooda/ Linux User: #456971 - http://counter.li.org/
participants (2)
-
Brent Yorgey
-
Pablo Olmos de Aguilera Corradini