aboutsummaryrefslogtreecommitdiffstats
path: root/XMonad/Util
diff options
context:
space:
mode:
authorgwern0 <gwern0@gmail.com>2009-06-22 22:14:23 +0200
committergwern0 <gwern0@gmail.com>2009-06-22 22:14:23 +0200
commitb1bf3fafa40b1aec6886fb6f91f18676403efc46 (patch)
tree16f4792f5646f9fe58fc5bee583a89f32fc37d98 /XMonad/Util
parenta728e9831a5cd78dae9c2b81925d2d91294f0892 (diff)
downloadXMonadContrib-b1bf3fafa40b1aec6886fb6f91f18676403efc46.tar.gz
XMonadContrib-b1bf3fafa40b1aec6886fb6f91f18676403efc46.tar.xz
XMonadContrib-b1bf3fafa40b1aec6886fb6f91f18676403efc46.zip
update callers of safeSpawn
Ignore-this: 484eca17b9877f7d587fc5bce8c5ae8a darcs-hash:20090622201423-f7719-e2e02429f80ee2ef794680ebbffda67f1847835c.gz
Diffstat (limited to 'XMonad/Util')
-rw-r--r--XMonad/Util/XSelection.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/XMonad/Util/XSelection.hs b/XMonad/Util/XSelection.hs
index 14cfcac..c08e092 100644
--- a/XMonad/Util/XSelection.hs
+++ b/XMonad/Util/XSelection.hs
@@ -129,12 +129,12 @@ shell using 'safeSpawn' from "XMonad.Util.Run"; see its documentation for more
details on the advantages and disadvantages of using safeSpawn. -}
promptSelection, safePromptSelection, unsafePromptSelection :: String -> X ()
promptSelection = unsafePromptSelection
-safePromptSelection app = join $ io $ liftM (safeSpawn app) getSelection
+safePromptSelection app = join $ io $ liftM (safeSpawn app . return) getSelection
unsafePromptSelection app = join $ io $ liftM unsafeSpawn $ fmap (\x -> app ++ " " ++ x) getSelection
{- | A wrapper around 'promptSelection' and its safe variant. They take two parameters, the first is a function that transforms strings, and the second is the application to run. The transformer essentially transforms the selection in X.
One example is to wrap code, such as a command line action copied out of the browser to be run as '"sudo" ++ cmd' or '"su - -c \"" ++ cmd ++ "\"".
-}
transformPromptSelection, transformSafePromptSelection :: (String -> String) -> String -> X ()
-transformPromptSelection f app = join $ io $ liftM (safeSpawn app) (fmap f getSelection)
+transformPromptSelection f app = join $ io $ liftM (safeSpawn app . return) (fmap f getSelection)
transformSafePromptSelection f app = join $ io $ liftM unsafeSpawn $ fmap (\x -> app ++ " " ++ x) (fmap f getSelection)