From dfb19cb1d3b03b605003958f9e884b6724470c99 Mon Sep 17 00:00:00 2001 From: gwern0 Date: Thu, 29 Jan 2009 03:52:46 +0100 Subject: XMonad.Actions.Search: fix whitespace & tabs Ignore-this: 894e479ccc46160848c4d70c2361c929 darcs-hash:20090129025246-f7719-506048f42e66e4f0ecc52e3dd8dc5c9b8b29da56.gz --- XMonad/Actions/Search.hs | 89 +++++++++++++++++++++++------------------------- 1 file changed, 43 insertions(+), 46 deletions(-) (limited to 'XMonad/Actions/Search.hs') 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 -- cgit v1.2.3