More work on purge mode.

This commit is contained in:
David F. Skoll
2010-04-20 11:34:07 -04:00
parent 31f90b6c53
commit d294e62be1
7 changed files with 64 additions and 55 deletions
+13 -4
View File
@@ -58,7 +58,10 @@ int DoRem(ParsePtr p)
/* Parse the trigger date and time */
if ( (r=ParseRem(p, &trig, &tim, 1)) ) return r;
if (trig.typ == NO_TYPE) return E_EOLN;
if (trig.typ == NO_TYPE) {
PurgeEchoLine("%s\n%s\n", "#!PURGE Cannot parse next line", CurLine);
return E_EOLN;
}
if (trig.typ == SAT_TYPE) {
PurgeEchoLine("%s\n", "#!PURGE Cannot purge SATISFY-type reminders");
PurgeEchoLine("%s\n", CurLine);
@@ -94,14 +97,20 @@ int DoRem(ParsePtr p)
} else {
/* Calculate the trigger date */
jul = ComputeTrigger(trig.scanfrom, &trig, &r, 1);
if (r) return r;
if (r) {
if (PurgeMode) {
PurgeEchoLine("%s: %s\n", "#!PURGE Problem calculating trigger date", ErrMsg[r]);
PurgeEchoLine("%s\n", CurLine);
}
return r;
}
}
if (PurgeMode) {
if (trig.expired) {
if (trig.expired || jul < JulianToday) {
if (p->expr_happened) {
PurgeEchoLine("%s\n", "#!PURGE Next line may have expired, but contains expression");
PurgeEchoLine("%s\n", CurLine);
PurgeEchoLine("%s\n", CurLine);
} else {
PurgeEchoLine("#!PURGE EXPIRED: %s\n", CurLine);
}