aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/Utility/Emacs.hs8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/Utility/Emacs.hs b/src/Utility/Emacs.hs
index 85a67a4..b5ac09f 100644
--- a/src/Utility/Emacs.hs
+++ b/src/Utility/Emacs.hs
@@ -46,17 +46,21 @@ parseEmacsOutput = foldr step [] . drop 2 . lines
parseLine :: String -> Maybe [Reminder]
parseLine line = do
when (not lineMatch) $ fail ""
- let hStr:mStr:s:[] = drop 1 . concat $ lineMatchStrings
+ let hStr:mStr:sStr:[] = drop 1 . concat $ lineMatchStrings
h <- readMaybe hStr
m <- readMaybe mStr
+ let s = snip sStr
staggeredReminders =<< makeReminder h m s
where
apptRegexp = " ([0-9]{1,2}):([0-9][0-9])[-]{0,1}[0-9:]{0,5}[.]* (.*)$"
- snipRegexp = "[ ]{2,}:.*:*$"
+ snipRegexp = "[ ]{1,}:.*:*$"
lineMatch = line =~ apptRegexp :: Bool
lineMatchStrings = line =~ apptRegexp :: [[String]]
+ fst3 (x, _, _) = x
+ snip s = fst3 (s =~ snipRegexp :: (String, String, String))
+
staggeredReminders :: Reminder -> Maybe [Reminder]
staggeredReminders r = sequence $ foldr step [] SremConfig.intervals
where