diff options
author | Spencer Janssen <sjanssen@cse.unl.edu> | 2007-10-12 03:42:17 +0200 |
---|---|---|
committer | Spencer Janssen <sjanssen@cse.unl.edu> | 2007-10-12 03:42:17 +0200 |
commit | 6c6b541ef1e74fc7f0905fd0d39d5fe867c22a6f (patch) | |
tree | 8f21050abd58a0c407b0253aa9bff3115dec2c8d /XMonad.hs | |
parent | d4a3b83436bcc22be93b8084a52a898b952ee94f (diff) | |
download | metatile-6c6b541ef1e74fc7f0905fd0d39d5fe867c22a6f.tar metatile-6c6b541ef1e74fc7f0905fd0d39d5fe867c22a6f.zip |
Add userCode function for the popular m `catchX` return ()
darcs-hash:20071012014217-a5988-06b6f1519b5f87fcbc8220ad5bd69181c721635a
Diffstat (limited to 'XMonad.hs')
-rw-r--r-- | XMonad.hs | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -18,7 +18,7 @@ module XMonad ( X, WindowSet, WindowSpace, WorkspaceId, ScreenId(..), ScreenDetail(..), XState(..), XConf(..), LayoutClass(..), Layout(..), ReadableLayout(..), Typeable, Message, SomeMessage(..), fromMessage, runLayout, - runX, catchX, io, catchIO, withDisplay, withWindowSet, isRoot, getAtom, spawn, restart, trace, whenJust, whenX, + runX, catchX, userCode, io, catchIO, withDisplay, withWindowSet, isRoot, getAtom, spawn, restart, trace, whenJust, whenX, atom_WM_STATE, atom_WM_PROTOCOLS, atom_WM_DELETE_WINDOW ) where @@ -95,6 +95,11 @@ catchX (X job) (X errcase) = do put s' return a +-- | Execute the argument, catching all exceptions. Either this function or +-- catchX should be used at all callsites of user customized code. +userCode :: X () -> X () +userCode a = catchX a (return ()) + -- --------------------------------------------------------------------- -- Convenient wrappers to state |