xmonad-contrib 0.9.1 → 0.9.2
raw patch · 9 files changed
+32/−20 lines, 9 filesdep +extensible-exceptionsdep ~basedep ~mtlnew-uploader
Dependencies added: extensible-exceptions
Dependency ranges changed: base, mtl
Files
- XMonad/Layout/HintedGrid.hs +1/−1
- XMonad/Prompt.hs +4/−4
- XMonad/Prompt/AppendFile.hs +1/−1
- XMonad/Prompt/Man.hs +3/−2
- XMonad/Util/CustomKeys.hs +1/−1
- XMonad/Util/NamedWindows.hs +3/−3
- XMonad/Util/Run.hs +5/−2
- XMonad/Util/XSelection.hs +3/−3
- xmonad-contrib.cabal +11/−3
XMonad/Layout/HintedGrid.hs view
@@ -65,7 +65,7 @@ doLayout (GridRatio d m) r w = flip (,) Nothing . arrange d m r (integrate w) replicateS :: Int -> (a -> (b, a)) -> a -> ([b], a)-replicateS n = runState . replicateM n . State+replicateS n f = runState . replicateM n $ do (a,s) <- gets f; put s; return a doColumn :: Dimension -> Dimension -> Dimension -> [(D -> D)] -> [D] doColumn width height k adjs =
XMonad/Prompt.hs view
@@ -82,7 +82,7 @@ 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 @@ -627,7 +627,7 @@ 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 = 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 @@ 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
XMonad/Prompt/AppendFile.hs view
@@ -29,7 +29,7 @@ import XMonad.Prompt import System.IO-import Control.Exception+import Control.Exception.Extensible (bracket) -- $usage --
XMonad/Prompt/Man.hs view
@@ -31,7 +31,7 @@ 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 @@ 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
XMonad/Util/CustomKeys.hs view
@@ -77,7 +77,7 @@ -> (XConfig Layout -> [(KeyMask, KeySym)]) -> (XConfig Layout -> [((KeyMask, KeySym), X ())]) -> Reader (XConfig Layout) (M.Map (KeyMask, KeySym) (X ()))-customize conf ds is = Reader (keys conf) >>= delete ds >>= insert is+customize conf ds is = asks (keys conf) >>= delete ds >>= insert is delete :: (MonadReader r m, Ord a) => (r -> [a]) -> M.Map a b -> m (M.Map a b) delete dels kmap = asks dels >>= return . foldr M.delete kmap
XMonad/Util/NamedWindows.hs view
@@ -24,7 +24,7 @@ import Prelude hiding ( catch ) import Control.Applicative ( (<$>) )-import Control.Exception ( bracket, catch )+import Control.Exception.Extensible ( bracket, catch, SomeException(..) ) import Data.Maybe ( fromMaybe, listToMaybe ) import qualified XMonad.StackSet as W ( peek )@@ -50,11 +50,11 @@ let getIt = bracket getProp (xFree . tp_value) (fmap (`NW` w) . copy) getProp = (internAtom d "_NET_WM_NAME" False >>= getTextProperty d w)- `catch` \_ -> getTextProperty d w wM_NAME+ `catch` \(SomeException _) -> getTextProperty d w wM_NAME copy prop = fromMaybe "" . listToMaybe <$> wcTextPropertyToTextList d prop - io $ getIt `catch` \_ -> ((`NW` w) . resName) `fmap` getClassHint d w+ io $ getIt `catch` \(SomeException _) -> ((`NW` w) . resName) `fmap` getClassHint d w unName :: NamedWindow -> Window unName (NW _ w) = w
XMonad/Util/Run.hs view
@@ -33,8 +33,9 @@ import System.Posix.IO import System.Posix.Process (executeFile, forkProcess, createSession)+import System.Posix.Types (ProcessID) import Control.Concurrent (threadDelay)-import Control.Exception (try) -- use OldException with base 4+import Control.Exception.Extensible (try,SomeException) import System.IO import System.Process (runInteractiveProcess) import XMonad@@ -107,7 +108,9 @@ interpolation, whereas the safeSpawn example can be safe because Firefox doesn't need any arguments if it is just being started. -} safeSpawn :: MonadIO m => FilePath -> [String] -> m ()-safeSpawn prog args = liftIO (try (forkProcess $ executeFile prog True args Nothing) >> return ())+safeSpawn prog args = liftIO $ do+ try $ forkProcess $ executeFile prog True args Nothing :: IO (Either SomeException ProcessID)+ return () -- | Like 'safeSpawn', but only takes a program (and no arguments for it). eg. --
XMonad/Util/XSelection.hs view
@@ -24,7 +24,7 @@ putSelection) where import Control.Concurrent (forkIO)-import Control.Exception as E (catch)+import Control.Exception.Extensible as E (catch,SomeException(..)) import Control.Monad(Monad (return, (>>)), Functor(..), liftM, join) import Data.Char (ord) import Data.Maybe (fromMaybe)@@ -69,8 +69,8 @@ ty <- E.catch (E.catch (internAtom dpy "UTF8_STRING" False)- (\_ -> internAtom dpy "COMPOUND_TEXT" False))- (\_ -> internAtom dpy "sTring" False)+ (\(E.SomeException _) -> internAtom dpy "COMPOUND_TEXT" False))+ (\(E.SomeException _) -> internAtom dpy "sTring" False) clp <- internAtom dpy "BLITZ_SEL_STRING" False xConvertSelection dpy p ty clp win currentTime allocaXEvent $ \e -> do
xmonad-contrib.cabal view
@@ -1,5 +1,5 @@ name: xmonad-contrib-version: 0.9.1+version: 0.9.2 homepage: http://xmonad.org/ synopsis: Third party extensions for xmonad description:@@ -27,6 +27,7 @@ tests/test_XPrompt.hs cabal-version: >= 1.2.1 build-type: Simple+tested-with: GHC == 6.12.4, GHC == 7.0.1 flag small_base description: Choose the new smaller, split-up base package.@@ -40,7 +41,14 @@ library if flag(small_base)- build-depends: base >= 3 && < 4, containers, directory, process, random, old-time, old-locale+ build-depends: base >= 3 && < 5,+ containers,+ directory,+ extensible-exceptions,+ old-locale,+ old-time,+ process,+ random else build-depends: base < 3 @@ -49,7 +57,7 @@ extensions: ForeignFunctionInterface cpp-options: -DXFT - build-depends: mtl, unix, X11>=1.5.0.0 && < 1.6, xmonad>=0.9.1, xmonad<0.10, utf8-string+ build-depends: mtl >= 1 && < 3, unix, X11>=1.5.0.0 && < 1.6, xmonad>=0.9.1, xmonad<0.10, utf8-string ghc-options: -fwarn-tabs -Wall extensions: ForeignFunctionInterface