mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-05-19 11:30:22 -07:00
Removes warnings, adds a browser value for LauncherConfig in haddock comments
This commit is contained in:
parent
3c74148a2f
commit
96ab91fcfa
@ -50,7 +50,7 @@ import XMonad.Util.Run
|
|||||||
|
|
||||||
A LauncherConfig contains settings for the default modes, modify them accordingly.
|
A LauncherConfig contains settings for the default modes, modify them accordingly.
|
||||||
|
|
||||||
> launcherConfig = LauncherConfig { pathToHoogle = "/home/YOU/.cabal/bin/hoogle" , actionsByExtension = extensionActions }
|
> launcherConfig = LauncherConfig { pathToHoogle = "/home/YOU/.cabal/bin/hoogle" , browser = "firefox" , actionsByExtension = extensionActions }
|
||||||
|
|
||||||
@extensionActions :: M.Map String (String -> X())
|
@extensionActions :: M.Map String (String -> X())
|
||||||
extensionActions = M.fromList $ [
|
extensionActions = M.fromList $ [
|
||||||
@ -103,14 +103,14 @@ instance XPrompt HoogleMode where
|
|||||||
commandToComplete _ = id
|
commandToComplete _ = id
|
||||||
completionFunction (HMode pathToHoogleBin' _) = \s -> completionFunctionWith pathToHoogleBin' ["--count","5",s]
|
completionFunction (HMode pathToHoogleBin' _) = \s -> completionFunctionWith pathToHoogleBin' ["--count","5",s]
|
||||||
-- This action calls hoogle again to find the URL corresponding to the autocompleted item
|
-- This action calls hoogle again to find the URL corresponding to the autocompleted item
|
||||||
modeAction (HMode pathToHoogleBin'' browser) query result = do
|
modeAction (HMode pathToHoogleBin'' browser') query result = do
|
||||||
completionsWithLink <- liftIO $ completionFunctionWith pathToHoogleBin'' ["--count","5","--link",query]
|
completionsWithLink <- liftIO $ completionFunctionWith pathToHoogleBin'' ["--count","5","--link",query]
|
||||||
let link = do
|
let link = do
|
||||||
s <- find (isJust . \c -> findSeqIndex c result) completionsWithLink
|
s <- find (isJust . \c -> findSeqIndex c result) completionsWithLink
|
||||||
i <- findSeqIndex s "http://"
|
i <- findSeqIndex s "http://"
|
||||||
return $ drop i s
|
return $ drop i s
|
||||||
case link of
|
case link of
|
||||||
Just l -> spawn $ browser ++ " " ++ l
|
Just l -> spawn $ browser' ++ " " ++ l
|
||||||
_ -> return ()
|
_ -> return ()
|
||||||
where
|
where
|
||||||
-- | Receives a sublist and a list. It returns the index where the sublist appears in the list.
|
-- | Receives a sublist and a list. It returns the index where the sublist appears in the list.
|
||||||
@ -141,7 +141,7 @@ locateMode, locateRegexMode :: ExtensionActions -> XPMode
|
|||||||
locateMode actions = XPT $ LMode actions
|
locateMode actions = XPT $ LMode actions
|
||||||
locateRegexMode actions = XPT $ LRMode actions
|
locateRegexMode actions = XPT $ LRMode actions
|
||||||
hoogleMode :: FilePath -> String -> XPMode
|
hoogleMode :: FilePath -> String -> XPMode
|
||||||
hoogleMode pathToHoogleBin browser = XPT $ HMode pathToHoogleBin browser
|
hoogleMode pathToHoogleBin browser' = XPT $ HMode pathToHoogleBin browser'
|
||||||
calcMode :: XPMode
|
calcMode :: XPMode
|
||||||
calcMode = XPT CalcMode
|
calcMode = XPT CalcMode
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user