From 2075209956b31a2aeac4acacc2d49c3d963b9d15 Mon Sep 17 00:00:00 2001 From: Spencer Janssen Date: Fri, 12 Oct 2007 03:42:17 +0200 Subject: Add userCode function for the popular m `catchX` return () darcs-hash:20071012014217-a5988-06b6f1519b5f87fcbc8220ad5bd69181c721635a.gz --- XMonad.hs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'XMonad.hs') diff --git a/XMonad.hs b/XMonad.hs index 4cc4607..cf72908 100644 --- a/XMonad.hs +++ b/XMonad.hs @@ -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 -- cgit v1.2.3