[Remind-Fans] How to query the next 24 hours?

Dianne Skoll dianne at skoll.ca
Tue May 25 08:37:34 EDT 2021


On Tue, 25 May 2021 06:11:13 -0400
Allan Wind <allan_wind at lifeintegrity.com> wrote:

> I would like to run remind (3.1.16) every day at 20:00 via and
> have it tell me of me about any reminders that is coming up in the
> next 24 hours.  Here is what I tried so far:

Remind is not really designed to show events over a time period that
includes parts of days.  Your best bet is to show events for today or
tomorrow, which you can do as follows:

    remind -t1 ~/.reminders

The "-t1" option causes Remind to pretend that every REM command in
your file has a "+1" delta specification.

> 1. Includes reminders before 16:00 so it seems the time argument
> is being ignored.

Correct.  Remind is day-oriented at heart.

> 2. Does not tell me the time (AT value)

That needs to be somewhere in the reminder body using %1, %2, etc.

[...]

> Is it not possible?  Also what is the "*rep" argument?  It doesn't
> seem to be documented.

As per the man page:

    In addition, you can supply a repeat  parameter,  which  has  the  form
    *num.  This causes Remind to be run num times, with the date increment-
    ing on each iteration.  You may have to enclose the parameter in quotes
    to  avoid  shell expansion.  See the subsection "Repeated Execution" in
    the section "CALENDAR MODE" for more information.

so another option instead of "remind -t1" would be:

    remind ~/.reminders '*2'

> Looking at https://dianne.skoll.ca/wiki/Defs.rem, how come
> some of the US floating holidays have SCANBACK and others do not?

I suggest you watch the Introduction to Remind video:

https://www.youtube.com/watch?v=0SNgvsDvx7M

especially the first 10 minutes or so, which explain the Remind algorithm,
which is:

      Starting FROM TODAY, Remind checks every day, one day at a time,
      until it finds a date satisfying the date specification, or proves
      to itself that no such date exists.

The "Starting FROM TODAY" part of the algorithm is what confuses most
people.

If you have a floating holiday that you want to OMIT, you need to
tweak the Remind algorithm to start from a point in the past rather
than from today; otherwise, the holidya might float past the point
where the OMIT will function properly.  Here's an example

  REM Mon 1 Sep MSG Labor Day
  OMIT [trigdate()]
  REM Mon AFTER MSG Meeting

In 2021, Labor Day is Monday, September 6th.  You might expect the above
Reminder file to cause the meeting reminder to be issued on Tuesday,
September 7th, but it is not:

  $ remind /tmp/labor.rem 7 sep 2021
  No reminders.

The reason is that on September 7th, the trigger date for the labor
day reminder is actually Monday, September 5th, 2022 as debugging shows:

  $ remind -dte /tmp/labor.rem  7 sep 2021
  REM Mon 1 Sep MSG Labor Day
  /tmp/labor.rem(1): Trig = Monday, 5 September, 2022
  OMIT [trigdate()]
  REM Mon SKIP MSG Meeting
  /tmp/labor.rem(4): Trig = Monday, 13 September, 2021

So to get around the problem, we us SCANFROM.

  REM SCANFROM [today()-7] Mon 1 Sep MSG Labor Day
  OMIT [trigdate()]
  REM Mon AFTER MSG Meeting

The SCANFROM [today()-7] clause modifies the algorithm to start from 7
days ago rather than from today.

Now debugging output gives:

  $ remind -dte /tmp/labor2.rem  7 sep 2021
  REM SCANFROM [today()-7] Mon 1 Sep MSG Labor Day
  /tmp/labor2.rem(1): Trig = Monday, 6 September, 2021
  OMIT [trigdate()]
  REM Mon AFTER MSG Meeting
  /tmp/labor2.rem(3): Trig = Tuesday, 7 September, 2021
  Reminders for Tuesday, 7th September, 2021:

  Meeting

The SCANFROM [today()-7] makes sure that *this* year's Labor Day
is correctly omitted all the way up until September 13th.  The "7"
is usually a good enough compromise; reminders that depend on moveable
omitted days rarely occur more than a week after the omitted day.

Regards,

Dianne.


More information about the Remind-fans mailing list