[Remind-Fans] Adding blank lines before banner when showing more than one date?

Tim Chase remind at tim.thechases.com
Thu Aug 22 12:22:18 EDT 2019


I finally figured this one out in case it helps anybody else.
Towards the top of my .reminders I added the following:

  IF defined("subsequent_iteration")
    BANNER =====================%_Reminders for %w, %d%s %m, %y%o:%
  ELSE
    BANNER Reminders for %w, %d%s %m, %y%o:%
    set subsequent_iteration 1
    preserve subsequent_iteration
  ENDIF

On the first iteration/repeat, "subsequent_iteration" isn't set, so
it uses the BANNER without all the "="s in it (note the "%" at the
end to prevent the extra newline I wanted to get rid of).

On subsequent iterations, this value is now defined, so the BANNER
gets set to a visual divider of "="s followed by a newline ("%_") and
the (customizable) BANNER string for subequent days.

Hopefully this is useful to someone else too.

-tim


On 2019-05-30 19:27, Tim Chase wrote:
> Currently, when I do
> 
>   ###########################
>   $ rem '*3'
>   Reminders for Thursday, 30th May, 2019 (today):
> 
>   GLOBAL: Ascension Day
>   MANPAGES: man 1 rcsclean
>   Reminders for Friday, 31st May, 2019:
> 
>   MANPAGES: man 1 intro
>   HOUSEHOLD: Garbage day (Delayed) today
>   Reminders for Saturday, 1st June, 2019:
> 
>   MANPAGES: man 1 from
>   BIRTHDAYS: Graham C.
>   ###########################
> 
> the "Reminders for {date}" text doesn't have a blank line before it.
> I'd prefer not to have one emitted before the first one, but would
> like to have a blank line appear before the subsequent ones.
> 
> Ideally, it would look like
> 
>   ###########################
>   $ rem '*3'
>   Reminders for Thursday, 30th May, 2019 (today):
>   GLOBAL: Ascension Day
>   MANPAGES: man 1 rcsclean
> 
>   Reminders for Friday, 31st May, 2019:
>   MANPAGES: man 1 intro
>   HOUSEHOLD: Garbage day (Delayed) today
> 
>   Reminders for Saturday, 1st June, 2019:
>   MANPAGES: man 1 from
>   BIRTHDAYS: Graham C.
>   ###########################
> 
> also removing the blank line *after* the banner, but that's a lesser
> concern than adding a blank line before the banner for >1 output.
> 
> I've read up in the man-pages on the BANNER command but am unable to
> figure out if it's capable of what I want.
> 
> Thanks for any tips or ideas you might have,
> 
> -Tim
> 
> 
> PS: feel free to ignore the leading msgprefix which prepends the
> filename of each particular calendar file:
> 
> FSET msgprefix(x)=upper(substr(filename(), strlen(remind_dir)+1,
> strlen(filename())-4) + ": ")
> 
> so my "manpages.rem" file becomes a prefix of "MANPAGES: " which is
> helpful since I currently have 27 different calendar files for
> various contexts that all get INCLUDEd into my master reminder file.
> 
> 
> PPS: the manpages.rem is a fun addition, doing a daily manpage as
> scraped from my OpenBSD box, in case anybody else wants to do
> similarly.
> 
> 
> 
> 
> _______________________________________________
> 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