Launch editor after entry command
[xyz.git] / app / Main.hs
index 0146ae9..d68cc4c 100644 (file)
@@ -14,6 +14,7 @@ import Data.Text hiding (intercalate, unlines, init, length)
 import Data.Time.Clock.POSIX
 import System.File.Tree hiding (mapM, mapM_)
 import System.Directory (doesFileExist)
+import System.Process
 
 main :: IO ()
 main = getArgs >>= parse
@@ -65,6 +66,7 @@ entry = do
   let filename = "entries/" ++ (show entryNum) ++ "-" ++ (unpack . (toLower. replace " " "-") $ pack entryName) ++ ".txt"
   writeFile filename (show stamp ++ "::" ++ entryName ++ "\n")
   putStrLn $ "Created " ++ filename
+  callCommand $ "emacsclient " ++ filename ++ " &"
 
 usage :: IO ()
 usage =  putStr . ununlines $ [