mirror of
https://github.com/xmonad/xmonad.git
synced 2025-08-01 12:41:53 -07:00
Replace unicode characters in ghc error messages
This commit is contained in:
@@ -487,7 +487,7 @@ recompile force = io $ do
|
|||||||
-- nb, the ordering of printing, then forking, is crucial due to
|
-- nb, the ordering of printing, then forking, is crucial due to
|
||||||
-- lazy evaluation
|
-- lazy evaluation
|
||||||
hPutStrLn stderr msg
|
hPutStrLn stderr msg
|
||||||
forkProcess $ executeFile "xmessage" True ["-default", "okay", msg] Nothing
|
forkProcess $ executeFile "xmessage" True ["-default", "okay", replaceUnicode msg] Nothing
|
||||||
return ()
|
return ()
|
||||||
return (status == ExitSuccess)
|
return (status == ExitSuccess)
|
||||||
else return True
|
else return True
|
||||||
@@ -498,6 +498,12 @@ recompile force = io $ do
|
|||||||
cs <- prep <$> E.catch (getDirectoryContents t) (\(SomeException _) -> return [])
|
cs <- prep <$> E.catch (getDirectoryContents t) (\(SomeException _) -> return [])
|
||||||
ds <- filterM doesDirectoryExist cs
|
ds <- filterM doesDirectoryExist cs
|
||||||
concat . ((cs \\ ds):) <$> mapM allFiles ds
|
concat . ((cs \\ ds):) <$> mapM allFiles ds
|
||||||
|
-- Replace some of the unicode symbols GHC uses in its output
|
||||||
|
replaceUnicode = map $ \c -> case c of
|
||||||
|
'\8226' -> '*' -- •
|
||||||
|
'\8216' -> '`' -- ‘
|
||||||
|
'\8217' -> '`' -- ’
|
||||||
|
_ -> c
|
||||||
|
|
||||||
-- | Conditionally run an action, using a @Maybe a@ to decide.
|
-- | Conditionally run an action, using a @Maybe a@ to decide.
|
||||||
whenJust :: Monad m => Maybe a -> (a -> m ()) -> m ()
|
whenJust :: Monad m => Maybe a -> (a -> m ()) -> m ()
|
||||||
|
Reference in New Issue
Block a user