[Remind-Fans] how to keep .reminders file clean?
David F. Skoll
dfs at roaringpenguin.com
Mon Jan 28 08:43:31 EST 2008
Daniel A Graham wrote:
> Running remind with the -n switch and an arbitrary date gives a list of
> the next occurrence of all reminders that occur or repeat after the
> given date. If it were possible to add the -l switch to get the
> associated file and line number information then it would be possible,
> by elimination, to get a list of the file and line numbers of reminders
> that do not occur or repeat after the given date.
Not really. Here is an admittedly contrived example:
SET code shell("some-magic-shell-command")
REM [code] MSG When does this expire??
As you see, in general, it's impossible for Remind to prove to itself
that a reminder will never again be triggered. However, a partial
solution is probably useful to many: If a reminder does not contain
any expression-substitutions, then we can know if it will never repeat.
So these examples are candidates for pruning:
REM 1 Jan 2008 MSG Easy to see this has expired
REM Tue UNTIL 15 Jan 2008 MSG Ditto
REM 2007 MSG 2007 is over, so expire this!
whereas these are not:
REM [a] Jan 2007 MSG Be conservative, unfortunately...
REM Mon SATISFY some_horrible_expression MSG Too complicated
IFTRIG 5 Jan 2008
# All of these lines *could* be eliminated...
# But I'm not sure it's worth handling this case.
ENDIF
Since I suspect most people don't do anything very fancy for non-repeating
reminders, the partial solution is probably good enough.
Also, spitting out file names and line numbers is tricky in the face
of backslash-continutation... it's probably better to have Remind itself
suppress expired reminders since it knows how to parse them already.
A simple script could then diff the original file and the pruned file
and figure out what lines to archive.
Regards,
David.
More information about the Remind-fans
mailing list