[Remind-Fans] reverse OMITFUNC?

Tim Chase remind at tim.thechases.com
Thu Apr 25 12:48:33 EDT 2019


On 2019-04-25 14:54, Matthias Teege wrote:
> I'm using OMITFUNC to remove reccuring meetings from my calendar
> during vacation like this:
>
>  FSET vac(x) isomitted (x) || \
>    (evaltrig("2019-01-01 *1 UNTIL 2019-01-04", x) == x) || \
>    (evaltrig("2019-02-01 *1 UNTIL 2019-02-04", x) == x)
>
>  REM Wed SKIP OMITFUNC vac MSG Meeting%
>
> How do I add a new entry ("vacation") to my calendar using the dates
> from the function? I would like to avoid writing the dates again.

[direct'ish answer first, better answer further down]

Assuming you want to see "Vacation" on all of those vacation days,
not just the Wed where you have your meetings:

  # Note: only finds vacation days, not isomitted()
  FSET vac(x) \
    (evaltrig("2019-01-01 *1 UNTIL 2019-01-04", x) == x) || \
    (evaltrig("2019-02-01 *1 UNTIL 2019-02-04", x) == x)
  
  IF vac($U)
    REM MSG Vacation%
  ELSE
    REM Wed SKIP MSG Meeting%
  ENDIF

I'm not sure why it works with "$U" but not with "$T" but I tried

  $ for dt in {2018,2019}-{01..12}-01 ; do rem -c $dt ; done | less

to see the full-year calendar for both years and using "$T" failed to
produce the results I wanted, while "$U" gave me the output I
wanted/expected from "$T".  :shrug:

However, I'd say that this might be even better and more
readable/extensible/understandable:

  PUSH
    OMIT Jan 1 2019 THROUGH Jan 4 2019 MSG %"Vacation%" in DC%
    OMIT Feb 1 2019 THROUGH Feb 4 2019 MSG %"Vacation%" in TX%
    REM Wed SKIP MSG Meeting%
  POP

No extra functions, complex evaltrig(), or the like, and it lets you
customize the vacation message for each vacation.

-Tim









More information about the Remind-fans mailing list