[Remind-Fans] Avoid type errors when using trigdatetime in msgprefix

Juan F. Meleiro juan at juanmeleiro.mat.br
Tue Mar 31 16:34:51 EDT 2020


Hi!

Some time ago, I wrote to this list asking for ways to make remind compatible
with a mobile enviroment. I managed to do it, and am currently using remind for
almost all my planning.

That was just an update. The real issue is the following: I use the function
msgprefix() as a way to add indentation and markers to reminders. It adds three
spaces of indentation, the middle of which is substituted by '*' or '>' if the
event is happening *now* or later today. So it may show something like:

   Wednesday 2020-04-01

      12:00 Lunch
    * 16:00 That class you should be attending
    > 18:00 That thing you'll do later

The problem is that doing that involves calling the function trigdatetime() for
every reminder, and making a comparison to a DATETIME. That causes an error if
the reminders does not have an AT-part, and so the whole functions evaluates to
nothing (I should've read the man-page with more attention).

Anyway, to fix that I figured I'd need a way to *stop* that comparison being
evaluate, but haven't found a way to test types. Another way would be to use
some thoughful combination of functions that give the same result as the above
but doesn't risk type-errors. I don't know how to do that either.

Is there a way to accomplish this? Alternatively, is there another function to
add prefixes that I won't be missusing? Finally, if nothing else is possible,
would it be too hard to fix it myself with a patch?

Thanks!

-- 
Juan Ferrer Meleiro

Sent via Migadu.com, world's easiest email hosting


More information about the Remind-fans mailing list