[Remind-Fans] Daemon mode seems to incorrectly evaluate msgprefix(x)

Alexander Möller alexander-moeller at posteo.de
Fri Feb 2 13:26:51 EST 2024


Hi,

it seems to me that the -z flag changes behaviour in an undocumented way
- or I misunderstand what behaviour is expected.

Here is what I'm trying to do: I have a `msgprefix(x)` defined that is
properly evaluated when running `rem` and I would like to get it
properly displayed in my notifications as well. This however doesn't
work for every component of the `msgprefix(x)` when using daemon mode.

In detail: The relevant part of my `~/.reminders` is
    FSET fileprefix() upper(substr(filename(),strlen(remind_dir)+2,strlen(filename())-4))
    FSET msgprefix(x) iif(trigtime() == 0, "", trigtime() + " ") \
        + fileprefix() + ": " \
        + iif(x == 0, "(IMPORTANT) ", x == 9999, "(Only FYI) ", "")
    SET remind_dir getenv("HOME") + "/.config/remind/"
    INCLUDE [remind_dir]/private.rem
    INCLUDE [remind_dir]/training.rem
    INCLUDE [remind_dir]/work.rem

This means that e.g. the following `~/.config/remind/private.rem`
    rem at 12:00 priority 0 msg Some reminder
    rem at 12:05 priority 9999 msg Some other reminder
    rem msg Some third reminder

would result in:
    $ rem
    12:00 PRIVATE: (IMPORTANT) Some reminder
    12:05 PRIVATE: (Only FYI) Some other reminder
    PRIVATE: Some third reminder

Fortunately, that is also what happens. But using
`remind -z -k"<notification service> %s &" ~/.reminders` would
create the following notifications:
    12:00 : (IMPORTANT) Some reminder
    12:05 : (IMPORTANT) Some other reminder

So, using -z seems to drop `fileprefix()` and evaluate the priority to
always be equal to 0 which to me looks like a bug. Is that correct or
did I miss something?
Using only `-k"..."` without the -z produces the (in my opinion) correct
behaviour again. I've also tested this on different OSs and with
multiple <notification service> and I can reliably produce this
behaviour.
But please let me know if I should test something else.

Cheers,
Alexander


More information about the Remind-fans mailing list