aboutsummaryrefslogtreecommitdiffstats
path: root/XMonad/Prompt
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--XMonad/Prompt.hs8
-rw-r--r--XMonad/Prompt/AppendFile.hs2
-rw-r--r--XMonad/Prompt/Man.hs5
3 files changed, 8 insertions, 7 deletions
diff --git a/XMonad/Prompt.hs b/XMonad/Prompt.hs
index d755501..850e0c7 100644
--- a/XMonad/Prompt.hs
+++ b/XMonad/Prompt.hs
@@ -89,7 +89,7 @@ import Data.Set (fromList, toList)
import System.Directory
import System.IO
import System.Posix.Files
-import Control.Exception hiding (handle)
+import Control.Exception.Extensible hiding (handle)
import qualified Data.Map as M
@@ -640,7 +640,7 @@ getCompletions :: XP [String]
getCompletions = do
s <- get
io $ completionFunction s (commandToComplete (xptype s) (command s))
- `catch` \_ -> return []
+ `catch` \(SomeException _) -> return []
setComplWin :: Window -> ComplWindowDim -> XP ()
setComplWin w wi =
@@ -758,7 +758,7 @@ getHistoryFile :: IO FilePath
getHistoryFile = fmap (++ "/history") $ getAppUserDataDirectory "xmonad"
readHistory :: IO History
-readHistory = catch readHist (const (return emptyHistory))
+readHistory = readHist `catch` \(SomeException _) -> return emptyHistory
where
readHist = do
path <- getHistoryFile
@@ -768,7 +768,7 @@ readHistory = catch readHist (const (return emptyHistory))
writeHistory :: History -> IO ()
writeHistory hist = do
path <- getHistoryFile
- catch (writeFile path (show hist)) $ const $ hPutStrLn stderr "error in writing"
+ writeFile path (show hist) `catch` \(SomeException _) -> hPutStrLn stderr "error in writing"
setFileMode path mode
where mode = ownerReadMode .|. ownerWriteMode
diff --git a/XMonad/Prompt/AppendFile.hs b/XMonad/Prompt/AppendFile.hs
index 47139db..74c4dad 100644
--- a/XMonad/Prompt/AppendFile.hs
+++ b/XMonad/Prompt/AppendFile.hs
@@ -29,7 +29,7 @@ import XMonad.Core
import XMonad.Prompt
import System.IO
-import Control.Exception
+import Control.Exception.Extensible (bracket)
-- $usage
--
diff --git a/XMonad/Prompt/Man.hs b/XMonad/Prompt/Man.hs
index c069226..aae6a33 100644
--- a/XMonad/Prompt/Man.hs
+++ b/XMonad/Prompt/Man.hs
@@ -31,7 +31,7 @@ import System.Directory
import System.Process
import System.IO
-import qualified Control.Exception as E
+import qualified Control.Exception.Extensible as E
import Control.Monad
import Data.List
import Data.Maybe
@@ -62,7 +62,8 @@ manPrompt c = do
getMans :: IO [String]
getMans = do
- paths <- getCommandOutput "manpath -g 2>/dev/null" `E.catch` \_ -> return []
+ paths <- getCommandOutput "manpath -g 2>/dev/null" `E.catch`
+ \(E.SomeException _) -> return []
let sects = ["man" ++ show n | n <- [1..9 :: Int]]
dirs = [d ++ "/" ++ s | d <- split ':' paths, s <- sects]
mans <- forM dirs $ \d -> do