From 7fd4c6e5b96a0340eb4aa7601992e71ba0034af5 Mon Sep 17 00:00:00 2001 From: "nicolas.pouillard" Date: Thu, 6 Mar 2008 17:39:28 +0100 Subject: Fix xmonadPromptC and use it. darcs-hash:20080306163928-94725-0476d932b8aabe1e760946d7d0da54386987c9b6.gz --- XMonad/Prompt/XMonad.hs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/XMonad/Prompt/XMonad.hs b/XMonad/Prompt/XMonad.hs index ee99f0e..4fd5dbb 100644 --- a/XMonad/Prompt/XMonad.hs +++ b/XMonad/Prompt/XMonad.hs @@ -21,7 +21,8 @@ module XMonad.Prompt.XMonad ( import XMonad import XMonad.Prompt -import XMonad.Actions.Commands (defaultCommands, runCommand') +import XMonad.Actions.Commands (defaultCommands) +import Data.Maybe (fromMaybe) -- $usage -- You can use this module with the following in your @~\/.xmonad\/xmonad.hs@: @@ -44,8 +45,10 @@ instance XPrompt XMonad where xmonadPrompt :: XPConfig -> X () xmonadPrompt c = do cmds <- defaultCommands - mkXPrompt XMonad c (mkComplFunFromList' (map fst cmds)) runCommand' + xmonadPromptC cmds c -- | An xmonad prompt with a custom command list xmonadPromptC :: [(String, X ())] -> XPConfig -> X () -xmonadPromptC commands c = mkXPrompt XMonad c (mkComplFunFromList' (map fst commands)) runCommand' +xmonadPromptC commands c = + mkXPrompt XMonad c (mkComplFunFromList' (map fst commands)) $ + fromMaybe (return ()) . (`lookup` commands) -- cgit v1.2.3