<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Digging into this a bit further, I think there's some additional
context I was missing before. Sharing this in case it is helpful
to other people...</p>
<p>In my first examination of these two commands, I thought they
were a single REM command, but they aren't, they're actually two
separate commands. Note that there's no backslash at the end of
the first line:<br>
</p>
REM Mon Sep [Week_1] SCANFROM [_back(7)] SATISFY 1
<br>
OMIT [_trig()] MSG %"Labor Day%"%
<p>So the purpose of the first line above is to calculate the
correct date for Labor Day so that the second command above can
retrieve that date using trigdate(). The second command, the OMIT,
is doing double-duty as both a global omit and a reminder. From
the man page: "For convenience, you can use a delta and MSG or RUN
keyword in the OMIT command."</p>
<p>Since I didn't initially realize that the two commands above were
separate commands, I didn't realize that the second one was
establishing a global omit, so I didn't understand why the Labor
Day code was affecting my Rosh Hashanah candle-lighting code.
Dianne's explanation about global omits prompted me to dig deeper
and understand better.<br>
</p>
<p>Thanks for the explanation, Dianne.</p>
<p> jik<br>
</p>
<div class="moz-cite-prefix">On 9/8/21 1:32 PM, Dianne Skoll via
Remind-fans wrote:<br>
</div>
<blockquote type="cite"
cite="mid:20210908133227.58f73b3d@ollie.skoll.ca">
<pre class="moz-quote-pre" wrap="">On Wed, 8 Sep 2021 12:24:43 -0400
Jonathan Kamens via Remind-fans <a class="moz-txt-link-rfc2396E" href="mailto:remind-fans@lists.skoll.ca"><remind-fans@lists.skoll.ca></a> wrote:
</pre>
<blockquote type="cite">
<pre class="moz-quote-pre" wrap="">My holidays.rem which I snarfed from somewhere semi-official long,
long ago has this in it:
SET Week_1 1
...
FSET _back(days) TRIGGER(TODAY()-days)
FSET _trig() TRIGGER(TRIGDATE())
...
REM Mon Sep [Week_1] SCANFROM [_back(7)] SATISFY 1
OMIT [_trig()] MSG %"Labor Day%"%
</pre>
</blockquote>
<pre class="moz-quote-pre" wrap="">
[...]
</pre>
<blockquote type="cite">
<pre class="moz-quote-pre" wrap="">So does this even simpler version [calculate Labor Day Correctly]
</pre>
</blockquote>
<pre class="moz-quote-pre" wrap="">
</pre>
<blockquote type="cite">
<pre class="moz-quote-pre" wrap="">REM Mon Sep 1 MSG %"Labor Day%"%
</pre>
</blockquote>
<pre class="moz-quote-pre" wrap="">
The simpler version is fine if you don't want to OMIT labor day.
The reason for the baroque mechanism is as follows. Consider this
Reminder file example.rem:
REM Mon Sep 1 MSG Labor Day
OMIT [trigdate()]
REM 6 Sep AFTER MSG Something
Let's run it through "remind -dtxe example.rem 7 Sep 2021"
REM Mon Sep 1 MSG Labor Day
example.rem(1): Trig = Monday, 5 September, 2022
OMIT [trigdate()]
trigdate() => 2022-09-05
REM 6 Sep AFTER MSG Something
example.rem(3): Trig = Tuesday, 6 September, 2022
As you see, running it the day after Labor Day made Remind find *next year's*
labor day and OMIT that one. The "Something" reminder should have triggered
on 7 Sep, but didn't because 6 Sep was not OMITted.
Now let's try this one:
REM Mon Sep 1 SCANFROM [today()-7] MSG Labor Day
OMIT [trigdate()]
REM 6 Sep AFTER MSG Something
$ remind -dtxe example.rem 7 Sep 2021
REM Mon Sep 1 SCANFROM [today()-7] MSG Labor Day
today() => 2021-09-07
2021-09-07 - 7 => 2021-08-31
example.rem(1): Trig = Monday, 6 September, 2021
OMIT [trigdate()]
trigdate() => 2021-09-06
REM 6 Sep AFTER MSG Something
example.rem(3): Trig = Tuesday, 7 September, 2021
Reminders for Tuesday, 7th September, 2021:
Something
Notice how we found *this* year's Labor Day, which was correctly
OMITted, causing the reminder on line 3 to trigger.
</pre>
<blockquote type="cite">
<pre class="moz-quote-pre" wrap="">Why do I care? Because, separately, I have something in my own
reminders to show me candle-lighting time for the first night of Rosh
Hashanah:
</pre>
</blockquote>
<pre class="moz-quote-pre" wrap="">
[...]
</pre>
<blockquote type="cite">
<pre class="moz-quote-pre" wrap="">It malfunctioned this year and didn't put the candle-lighting time on
my calendar, I think because Erev Rosh Hashanah was Labor Day and
therefore the SKIP my rule caused the reminder to be omitted because
of the OMIT [_trig()] in the Labor Day rule.
</pre>
</blockquote>
<pre class="moz-quote-pre" wrap="">
Yep. If you have a SKIP that you don't want affected by global OMITs,
you can do this:
PUSH-OMIT-CONTEXT
CLEAR-OMIT-CONTEXT
# Here goes your REM that is sensitive to OMIT context
POP-OMIT-CONTEXT
Regards,
Dianne.
_______________________________________________
Remind-fans mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Remind-fans@lists.skoll.ca">Remind-fans@lists.skoll.ca</a>
<a class="moz-txt-link-freetext" href="https://dianne.skoll.ca/mailman/listinfo/remind-fans">https://dianne.skoll.ca/mailman/listinfo/remind-fans</a>
Remind is at <a class="moz-txt-link-freetext" href="https://dianne.skoll.ca/projects/remind/">https://dianne.skoll.ca/projects/remind/</a>
</pre>
</blockquote>
</body>
</html>