aboutsummaryrefslogtreecommitdiffstats
path: root/XMonad/Actions/Search.hs
diff options
context:
space:
mode:
authorgwern0 <gwern0@gmail.com>2009-01-29 03:52:46 +0100
committergwern0 <gwern0@gmail.com>2009-01-29 03:52:46 +0100
commitdfb19cb1d3b03b605003958f9e884b6724470c99 (patch)
treecf6836977404ff8de5d272577211a6eb35d48c2e /XMonad/Actions/Search.hs
parent545d8169881dcbc3288aadc630c5e5a782681693 (diff)
downloadXMonadContrib-dfb19cb1d3b03b605003958f9e884b6724470c99.tar.gz
XMonadContrib-dfb19cb1d3b03b605003958f9e884b6724470c99.tar.xz
XMonadContrib-dfb19cb1d3b03b605003958f9e884b6724470c99.zip
XMonad.Actions.Search: fix whitespace & tabs
Ignore-this: 894e479ccc46160848c4d70c2361c929 darcs-hash:20090129025246-f7719-506048f42e66e4f0ecc52e3dd8dc5c9b8b29da56.gz
Diffstat (limited to 'XMonad/Actions/Search.hs')
-rw-r--r--XMonad/Actions/Search.hs89
1 files changed, 43 insertions, 46 deletions
diff --git a/XMonad/Actions/Search.hs b/XMonad/Actions/Search.hs
index 7dc9e03..d0928e1 100644
--- a/XMonad/Actions/Search.hs
+++ b/XMonad/Actions/Search.hs
@@ -11,48 +11,45 @@
Additional sites welcomed. -}
module XMonad.Actions.Search ( -- * Usage
- -- $usage
- search,
- SearchEngine(..),
- searchEngine,
- searchEngineF,
- promptSearch,
- promptSearchBrowser,
- selectSearch,
- selectSearchBrowser,
-
- hasPrefix,
- escape,
- use,
- intelligent,
- (!>),
- prefixAware,
- namedEngine,
-
- amazon,
- codesearch,
- deb,
- debbts,
- debpts,
- dictionary,
- google,
- hackage,
- hoogle,
- images,
- imdb,
- isohunt,
- maps,
- mathworld,
- scholar,
- thesaurus,
- wayback,
- wikipedia,
- youtube,
- multi
-
+ -- $usage
+ search,
+ SearchEngine(..),
+ searchEngine,
+ searchEngineF,
+ promptSearch,
+ promptSearchBrowser,
+ selectSearch,
+ selectSearchBrowser,
+ hasPrefix,
+ escape,
+ use,
+ intelligent,
+ (!>),
+ prefixAware,
+ namedEngine,
+
+ amazon,
+ codesearch,
+ deb,
+ debbts,
+ debpts,
+ dictionary,
+ google,
+ hackage,
+ hoogle,
+ images,
+ imdb,
+ isohunt,
+ maps,
+ mathworld,
+ scholar,
+ thesaurus,
+ wayback,
+ wikipedia,
+ youtube,
+ multi
-- * Use case: searching with a submap
-- $tip
-
) where
import Data.Char (chr, ord, isAlpha, isMark, isDigit)
@@ -304,8 +301,8 @@ multi = namedEngine "multi" $ foldr1 (!>) [amazon, codesearch, deb, debbts, debp
like the argument, but goes directly to a URL if one is given rather than
searching.
-> myIntelligentGoogleEngine = intelligent google
-
+> myIntelligentGoogleEngine = intelligent google
+
Now if you search for http:\/\/xmonad.org it will directly open in your browser-}
intelligent :: SearchEngine -> SearchEngine
intelligent (SearchEngine name site) = searchEngineF name (\s -> if (fst $ break (==':') s) `elem` ["http", "https", "ftp"] then s else (site s))
@@ -321,11 +318,11 @@ removeColonPrefix str = tail $ snd $ break (==':') str
{- | Connects a few search engines into one. If the search engines\' names are
\"s1\", \"s2\" and \"s3\", then the resulting engine will use s1 if the query
- is @s1:word@, s2 if you type @s2:word@ and s3 in all other cases.
-
+ is @s1:word@, s2 if you type @s2:word@ and s3 in all other cases.
+
Example:
-
-> multiEngine = intelligent (wikipedia !> mathworld !> (prefixAware google))
+
+> multiEngine = intelligent (wikipedia !> mathworld !> (prefixAware google))
Now if you type \"wiki:Haskell\" it will search for \"Haskell\" in Wikipedia,
\"mathworld:integral\" will search mathworld, and everything else will fall back to