From 6769de07f7e06ddf6eea728bd7072ebfe6eff017 Mon Sep 17 00:00:00 2001 From: Daniel Wagner Date: Tue, 28 May 2013 03:39:09 +0200 Subject: use Data.Default wherever possible, and deprecate the things it replaces Ignore-this: 898458b1d2868a70dfb09faf473dc7aa darcs-hash:20130528013909-76d51-863278165b6f149c47b08b31b34e85ddcab19f1f.gz --- XMonad/Prompt.hs | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'XMonad/Prompt.hs') diff --git a/XMonad/Prompt.hs b/XMonad/Prompt.hs index e9613db..0a032c4 100644 --- a/XMonad/Prompt.hs +++ b/XMonad/Prompt.hs @@ -19,6 +19,7 @@ module XMonad.Prompt mkXPrompt , mkXPromptWithReturn , mkXPromptWithModes + , def , amberXPConfig , defaultXPConfig , greenXPConfig @@ -230,7 +231,8 @@ data XPPosition = Top amberXPConfig, defaultXPConfig, greenXPConfig :: XPConfig -defaultXPConfig = +instance Default XPConfig where + def = XPC { font = "-misc-fixed-*-*-*-*-12-*-*-*-*-*-*-*" , bgColor = "grey22" , fgColor = "grey80" @@ -252,8 +254,10 @@ defaultXPConfig = , searchPredicate = isPrefixOf , alwaysHighlight = False } -greenXPConfig = defaultXPConfig { fgColor = "green", bgColor = "black", promptBorderWidth = 0 } -amberXPConfig = defaultXPConfig { fgColor = "#ca8f2d", bgColor = "black", fgHLight = "#eaaf4c" } +{-# DEPRECATED defaultXPConfig "Use def (from Data.Default, and re-exported from XMonad.Prompt) instead." #-} +defaultXPConfig = def +greenXPConfig = def { fgColor = "green", bgColor = "black", promptBorderWidth = 0 } +amberXPConfig = def { fgColor = "#ca8f2d", bgColor = "black", fgHLight = "#eaaf4c" } initState :: Display -> Window -> Window -> Rectangle -> XPOperationMode -> GC -> XMonadFont -> [String] -> XPConfig -> KeyMask -> XPState @@ -377,8 +381,7 @@ mkXPromptWithReturn t conf compl action = do -- -- * a prompt type, instance of the 'XPrompt' class. -- --- * a prompt configuration ('defaultXPConfig' can be used as a --- starting point) +-- * a prompt configuration ('def' can be used as a starting point) -- -- * a completion function ('mkComplFunFromList' can be used to -- create a completions function given a list of possible completions) @@ -1192,10 +1195,10 @@ historyNextMatching hm@(HistoryMatches ref) next = do -- > .. -- > ((modMask,xK_p), shellPrompt . myPrompt =<< initMatches) -- > .. --- > myPrompt ref = defaultPrompt +-- > myPrompt ref = def -- > { promptKeymap = M.union [((0,xK_Up), historyUpMatching ref) -- > ,((0,xK_Down), historyDownMatching ref)] --- > (promptKeymap defaultPrompt) +-- > (promptKeymap def) -- > , .. } -- historyUpMatching, historyDownMatching :: HistoryMatches -> XP () -- cgit v1.2.3