[Remind-Fans] Changes coming to Remind...

Dianne Skoll dianne at skoll.ca
Mon Jan 13 18:35:39 EST 2020


On 2020-01-13 18:07, Jochen Sprickerhof wrote:

> $ echo "REM Jan 13 2020 AT 20:00 MSG %\"bar%\" Foo %a" | ./src/remind -pp -
> # rem2ps2 begin
> January 2020 31 3 0
> Sunday Monday Tuesday Wednesday Thursday Friday Saturday
> December 31
> February 29
> {"date":"2020-01-13", "time":1200, "d":13, "m":1, "y":2020,
> "eventstart":"2020-01-13T20:00", "priority":5000, "rawbody":"%\"bar%\" Foo %a",
> "body":"8:00pm bar"}
> # rem2ps2 end

> I have same proposals:

> - Drop the time from the body as it is in the time element already.

That can be done by invoking Remind with the "-b2" option:
echo "REM Jan 13 2020 AT 20:00 MSG %\"bar%\" Foo %a" | ./src/remind -pp -b2 -
[...] "rawbody":"%\"bar%\" Foo %a", "body":"bar"

> - Add an element with the complete body, i.e. %\"bar%\" Foo today,
> or maybe two elements one with the calendar mode entry (bar) and one
> with the rest (Foo today)

Hmm, that's tricky.  I have to think about that.

> - Why is there date, time, d, m, y and eventstart? Shoudn't one
> format be enough?

No, they all mean different things:

date is the trigger date
d, m and y are present ONLY if the corresponding part is present in the
REM command.  Have a look:

$ echo "REM 13 AT 20:00 MSG test" | ./src/remind -pp -b2 -
{"date":"2020-01-13", "time":1200, "d":13, "eventstart":"2020-01-13T20:00",
"priority":5000, "body":"test"}

There are no "y" and "m" elements because those were missing.  So the back-end
can know that this reminder will trigger on the 13th of every month.

time and eventstart can differ for multi-day events, as in:

$ echo "REM 12 AT 20:00 DURATION 24:00 MSG test" | ./src/remind -pp -b2 -
{"date":"2020-01-12", "duration":1440, "time":1200, "eventduration":1440,
"d":12, "eventstart":"2020-01-12T20:00", "priority":5000, "body":"test"}
{"date":"2020-01-13", "duration":1200, "time":0, "eventduration":1440, "d":12,
"eventstart":"2020-01-12T20:00", "priority":5000, "body":"test"}

See the man page under MULTI-DAY EVENTS for more details.

> - Have a pure json output without the rem2ps2 lines wrapped in a
> json array [].

I was thinking of doing that, but didn't because it reduces the amount of
memory you need for parsing JSON, especially in C code like rem2ps.  It
is a little bit ugly, I admit, and I might be persuaded to change that. :)

Regards,

Dianne.


More information about the Remind-fans mailing list