diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2015-04-03 06:22:16 +0900 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2015-04-03 17:18:43 +0900 |
commit | cf3d9fde2411f3a4e7e09cf2018d7f7c3aeaea00 (patch) | |
tree | 686d37718534b85e8872dc2b1c248c72959f5e24 | |
parent | a42d9f1234aa19cb880bcc05f03ea3a6955feeab (diff) | |
download | srem-cf3d9fde2411f3a4e7e09cf2018d7f7c3aeaea00.tar.gz |
hide Emacs stderr
-rw-r--r-- | src/Utility/Emacs.hs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/Utility/Emacs.hs b/src/Utility/Emacs.hs index 476e7c6..85a67a4 100644 --- a/src/Utility/Emacs.hs +++ b/src/Utility/Emacs.hs @@ -34,7 +34,7 @@ import Data.Maybe.Read import Data.Modular import System.Directory (getHomeDirectory) import System.FilePath ((</>)) -import System.Process (readProcess) +import System.Process (readProcessWithExitCode) import Text.Regex.Posix ((=~)) import Types.Reminder @@ -70,7 +70,11 @@ staggeredReminders r = sequence $ foldr step [] SremConfig.intervals getEmacsOutput :: IO String getEmacsOutput = do args <- makeEmacsArgs <$> getHomeDirectory - readProcess "emacs" args "" + + -- use 'readProcessWithExitCode' over 'readProcess' to avoid + -- printing Emacs startup verbose stderr to the user + (_, output, _) <- readProcessWithExitCode "emacs" args "" + return output makeEmacsArgs :: String -> [String] makeEmacsArgs home = [ "-batch" |