[Remind-Fans] New stuff in master (was Re: Repeat every six months)

Dianne Skoll dianne at skoll.ca
Fri Mar 4 15:51:56 EST 2022


Hi, all,

Earlier, I wrote:

> Yeah, I was thinking about that.  Ideally, you should be able to do:
>     REM 1 5 10 March September 2020 2022 MSG event
> and have it trigger on the Cartesian product of the D/M/Y options.

And that's too much work.  But I'm making changes (which you can
preview at git master) that add a "trig" function.  So
for the every-six-months case, you can write:

   REM [trig("1 --1 April", "1 --1 October")] MSG Last day of March/Sep
   REM [trig("Mon June", "Mon July")] MSG Mondays in June and July
   REM [trig("Jan", "Feb", "Mar")] MSG Every day in January through March
   REM [trig("Jan", "Mar") && trig("1", "5", "15")] MSG 1st, 5th, 15th of Jan and Mar

Basically: trig() takes any number of arguments.  It evaluates each of
them as a trigger, and returns the trigger date of the *first* one that
would trigger today.  If none of them would trigger today, returns the
zero-day of the epoch, which is 1990-01-01.

The last example relies on another change that lets the logical
operators take any non-string type and return a more meaningful value
than 0 or 1; see the updated man page for details.

This is experimental.  But it's a way to let you write more-or-less
unrelated triggers in a single REM in a way that is reasonably
readable, depending on your definition of "readable".

Regards,

Dianne.


More information about the Remind-fans mailing list