[Remind-Fans] Bug in msgprefix() + calculated PRIORITY? (was "Filtering output by priority?")
Tim Chase
remind at tim.thechases.com
Sat Aug 24 17:49:09 EDT 2019
Running with our conversation about post-processing with awk, I think
I may have found a bug:
---------------------------------------------------
$ cat ~/.reminders
FSET msgprefix(x)=x + " " + $DefaultPrio + " "
REM 10 PRIORITY [(($Tm == 7) * 1000) + $DefaultPrio] \
MSG %"Our [iif($Tm == 7, "anniversary", "mesaversary")]%" \
[(($Tm == 7) * 1000) + $DefaultPrio]%"%
$ for m in 6 7 8; do rem 2019-${m}-10 ; done
Reminders for Monday, 10th June, 2019:
5000 5000 Our mesaversary 5000
Reminders for Wednesday, 10th July, 2019:
5000 5000 Our anniversary 6000
Reminders for Saturday, 10th August, 2019:
5000 5000 Our mesaversary 5000
---------------------------------------------------
I was expecting to see that 2nd one as
6000 5000 Our anniversary 6000
Note that the
[(($Tm == 7) * 1000) + $DefaultPrio]
is correctly calculated as part of the MSG (5000 = $DefaultPrio on
June 10 and Aug 10; and 6000 on July 10) but that same expression's
result doesn't seem to get properly passed to msgprefix() to get
tacked on as the first value.
[context: We do a small "mesaversary" celebration each month on the
day we were married, but when it's a full anniversary, we celebrate
bigger. So I wanted to bump the PRIOIRTY to 6000 for the actual
anniversary, while the "mesaversary" is a more mundane $DefaultPrio]
Is expression-pasting allowed in a PRIORITY clause or is this a bug?
Thanks!
-tim
On 2019-08-24 10:23, Dianne Skoll wrote:
> H
> Hi,
>
> On 8/24/19 9:09 AM, Tim Chase wrote:
>
> > Is there a way to tell remind that I only want to output items of
> > a certain priority (or above a certain priority)? Preferably
> > without touching every one of my 1500+ reminders to add some sort
> > of filter to them?
>
> Remind doesn't have that built-in. Your solution using an external
> filter is best. You can define variables and functions on the
> command-line, so you could make a wrapper script so you don't need
> to define msgprefix() in your actual .rem files.
>
> Regards,
>
> Dianne.
> _______________________________________________
> Remind-fans mailing list
> Remind-fans at lists.skoll.ca
> https://dianne.skoll.ca/mailman/listinfo/remind-fans
> Remind is at https://dianne.skoll.ca/projects/remind/
More information about the Remind-fans
mailing list