aboutsummaryrefslogtreecommitdiffstats
path: root/XMonad/Actions/Search.hs
diff options
context:
space:
mode:
authorgwern0 <gwern0@gmail.com>2008-12-20 16:33:02 +0100
committergwern0 <gwern0@gmail.com>2008-12-20 16:33:02 +0100
commit9ce28b7c28444b881bd7c195b4c2ace05950685e (patch)
tree7f25c0a5fb750b51eed109aceeafa7b58737af2c /XMonad/Actions/Search.hs
parent503a4f5977438a92ea2084685eaa02f2d66b9164 (diff)
downloadXMonadContrib-9ce28b7c28444b881bd7c195b4c2ace05950685e.tar.gz
XMonadContrib-9ce28b7c28444b881bd7c195b4c2ace05950685e.tar.xz
XMonadContrib-9ce28b7c28444b881bd7c195b4c2ace05950685e.zip
hlintify XUtils, XSelection, Search, WindowGo
Ignore-this: 7e877484e3cd8954b74232ea83180fa9 darcs-hash:20081220153302-f7719-750549ea12a24a7364f4be71894720700f98f6a7.gz
Diffstat (limited to 'XMonad/Actions/Search.hs')
-rw-r--r--XMonad/Actions/Search.hs10
1 files changed, 5 insertions, 5 deletions
diff --git a/XMonad/Actions/Search.hs b/XMonad/Actions/Search.hs
index 71d1945..456d3f7 100644
--- a/XMonad/Actions/Search.hs
+++ b/XMonad/Actions/Search.hs
@@ -188,14 +188,14 @@ escape = escapeURIString (\c -> isAlpha c || isDigit c || isMark c)
(Char -> Bool) -- a predicate which returns 'False' if should escape
-> String -- the string to process
-> String -- the resulting URI string
- escapeURIString p s = concatMap (escapeURIChar p) s
+ escapeURIString = concatMap . escapeURIChar
escapeURIChar :: (Char->Bool) -> Char -> String
escapeURIChar p c
| p c = [c]
| otherwise = '%' : myShowHex (ord c) ""
where
myShowHex :: Int -> ShowS
- myShowHex n r = case showIntAtBase 16 (toChrHex) n r of
+ myShowHex n r = case showIntAtBase 16 toChrHex n r of
[] -> "00"
[ch] -> ['0',ch]
cs -> cs
@@ -212,7 +212,7 @@ data SearchEngine = SearchEngine Name Site
-- | Given a browser, a search engine, and a search term, perform the
-- requested search in the browser.
search :: Browser -> Site -> Query -> X ()
-search browser site query = safeSpawn browser (site ++ (escape query))
+search browser site query = safeSpawn browser $ site ++ escape query
{- | Given a base URL, create the 'SearchEngine' that escapes the query and
appends it to the base. You can easily define a new engine locally using
@@ -227,7 +227,7 @@ search browser site query = safeSpawn browser (site ++ (escape query))
Generally, examining the resultant URL of a search will allow you to reverse-engineer
it if you can't find the necessary URL already described in other projects such as Surfraw. -}
searchEngine :: Name -> Site -> SearchEngine
-searchEngine name site = SearchEngine name site
+searchEngine = SearchEngine
-- The engines.
amazon, codesearch, deb, debbts, debpts, dictionary, google, hackage, hoogle, images,
@@ -260,7 +260,7 @@ wayback = searchEngine "wayback" "http://web.archive.org/"
Prompt's result, passes it to a given searchEngine and opens it in a given
browser. -}
promptSearchBrowser :: XPConfig -> Browser -> SearchEngine -> X ()
-promptSearchBrowser config browser (SearchEngine name site) = mkXPrompt (Search name) config (historyCompletion) $ search browser site
+promptSearchBrowser config browser (SearchEngine name site) = mkXPrompt (Search name) config historyCompletion $ search browser site
{- | Like 'search', but in this case, the string is not specified but grabbed
from the user's response to a prompt. Example: