Compare commits

..

10 Commits

Author SHA1 Message Date
Dianne Skoll
ae17834610 Commit before switching branches.
All checks were successful
Remind unit tests / tests (push) Successful in 52s
2025-02-10 13:49:50 -05:00
Dianne Skoll
5acbb907b4 Issue warning if a substitution sequence related to time is used without an AT clause.
All checks were successful
Remind unit tests / tests (push) Successful in 31s
2025-02-10 09:23:43 -05:00
Dianne Skoll
21ecc28ea4 Prep for 05.03.02 release.
All checks were successful
Remind unit tests / tests (push) Successful in 34s
2025-02-09 09:56:45 -05:00
Dianne Skoll
b37a7cd993 Revert change to how -y generates tags.
All checks were successful
Remind unit tests / tests (push) Successful in 48s
Commit e7ec975ff0 changed how the
MD5 sum was calculated to include the filename and line number.

This commit reverts that change; the tag is generated purely
on the REM command line.
2025-02-08 22:25:09 -05:00
Dianne Skoll
64679817ae Update WHATSNEW in preparation for release.
All checks were successful
Remind unit tests / tests (push) Successful in 52s
2025-02-07 13:08:20 -05:00
Dianne Skoll
1ef1033379 Add dependencies to Makefile.PL.in
All checks were successful
Remind unit tests / tests (push) Successful in 45s
2025-02-05 10:58:47 -05:00
Dianne Skoll
7d42750043 Better checks for Perl modules. 2025-02-05 10:57:28 -05:00
Dianne Skoll
1dc0afc0ca Improve small calendar display.
All checks were successful
Remind unit tests / tests (push) Successful in 26s
2025-02-04 22:27:32 -05:00
Dianne Skoll
a0aede4069 Add clickable URL in popup reminder if we have an INFO "Url: ..." string. 2025-02-04 13:58:23 -05:00
Dianne Skoll
a5a7637696 Bump version in preparation for next release. 2025-02-04 13:49:00 -05:00
14 changed files with 166 additions and 36 deletions

1
.gitignore vendored
View File

@@ -35,3 +35,4 @@ www/Makefile
gmon.out
tests/once.timestamp
src/xlat.c
cremind/Makefile.PL

21
configure vendored
View File

@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.71 for remind 05.03.00.
# Generated by GNU Autoconf 2.71 for remind 05.03.02.
#
#
# Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation,
@@ -608,8 +608,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='remind'
PACKAGE_TARNAME='remind'
PACKAGE_VERSION='05.03.00'
PACKAGE_STRING='remind 05.03.00'
PACKAGE_VERSION='05.03.02'
PACKAGE_STRING='remind 05.03.02'
PACKAGE_BUGREPORT=''
PACKAGE_URL='https://dianne.skoll.ca/projects/remind/'
@@ -1265,7 +1265,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures remind 05.03.00 to adapt to many kinds of systems.
\`configure' configures remind 05.03.02 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1327,7 +1327,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of remind 05.03.00:";;
short | recursive ) echo "Configuration of remind 05.03.02:";;
esac
cat <<\_ACEOF
@@ -1415,7 +1415,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
remind configure 05.03.00
remind configure 05.03.02
generated by GNU Autoconf 2.71
Copyright (C) 2021 Free Software Foundation, Inc.
@@ -1865,7 +1865,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by remind $as_me 05.03.00, which was
It was created by remind $as_me 05.03.02, which was
generated by GNU Autoconf 2.71. Invocation command line was
$ $0$ac_configure_args_raw
@@ -4209,7 +4209,7 @@ printf "%s\n" "#define CONFIG_CMD \"$CONFIG_CMD\"" >>confdefs.h
ac_config_files="$ac_config_files src/Makefile www/Makefile src/version.h rem2html/Makefile rem2html/rem2html rem2pdf/Makefile.PL rem2pdf/Makefile.top rem2pdf/bin/rem2pdf man/rem.1 man/rem2ps.1 man/remind.1 man/tkremind.1 scripts/tkremind"
ac_config_files="$ac_config_files src/Makefile www/Makefile src/version.h rem2html/Makefile rem2html/rem2html rem2pdf/Makefile.PL rem2pdf/Makefile.top rem2pdf/bin/rem2pdf man/rem.1 man/rem2ps.1 man/remind.1 man/tkremind.1 scripts/tkremind cremind/Makefile.PL"
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
@@ -4710,7 +4710,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by remind $as_me 05.03.00, which was
This file was extended by remind $as_me 05.03.02, which was
generated by GNU Autoconf 2.71. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -4775,7 +4775,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config='$ac_cs_config_escaped'
ac_cs_version="\\
remind config.status 05.03.00
remind config.status 05.03.02
configured by $0, generated by GNU Autoconf 2.71,
with options \\"\$ac_cs_config\\"
@@ -4911,6 +4911,7 @@ do
"man/remind.1") CONFIG_FILES="$CONFIG_FILES man/remind.1" ;;
"man/tkremind.1") CONFIG_FILES="$CONFIG_FILES man/tkremind.1" ;;
"scripts/tkremind") CONFIG_FILES="$CONFIG_FILES scripts/tkremind" ;;
"cremind/Makefile.PL") CONFIG_FILES="$CONFIG_FILES cremind/Makefile.PL" ;;
*) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
esac

View File

@@ -1,6 +1,6 @@
dnl Process this file with autoconf to produce a configure script.
AC_INIT(remind, 05.03.00, , , https://dianne.skoll.ca/projects/remind/)
AC_INIT(remind, 05.03.02, , , https://dianne.skoll.ca/projects/remind/)
AC_CONFIG_SRCDIR([src/queue.c])
cat <<'EOF'
@@ -95,7 +95,7 @@ AC_SUBST(VERSION)
AC_SUBST(PERL)
AC_SUBST(PERLARTIFACTS)
AC_SUBST(RELEASE_DATE)
AC_CONFIG_FILES([src/Makefile www/Makefile src/version.h rem2html/Makefile rem2html/rem2html rem2pdf/Makefile.PL rem2pdf/Makefile.top rem2pdf/bin/rem2pdf man/rem.1 man/rem2ps.1 man/remind.1 man/tkremind.1 scripts/tkremind])
AC_CONFIG_FILES([src/Makefile www/Makefile src/version.h rem2html/Makefile rem2html/rem2html rem2pdf/Makefile.PL rem2pdf/Makefile.top rem2pdf/bin/rem2pdf man/rem.1 man/rem2ps.1 man/remind.1 man/tkremind.1 scripts/tkremind cremind/Makefile.PL])
AC_OUTPUT
chmod a+x rem2pdf/bin/rem2pdf
chmod a+x scripts/tkremind

21
cremind/Makefile.PL.in Normal file
View File

@@ -0,0 +1,21 @@
use ExtUtils::MakeMaker;
{
# Override pod2man options
package MY;
sub manifypods {
my ($self,%attribs) = @_;
my $result = $self->SUPER::manifypods(%attribs);
$result =~ s/^(POD2MAN_EXE\s*=\s*)(.+)$/$1$2 --center 'VERSION @VERSION@' --date '@RELEASE_DATE@'/m;
return $result;
}
}
WriteMakefile(
NAME => 'cremind"
AUTHOR => q{Dianne Skoll <dianne@skoll.ca>},
VERSION => '@VERSION@',
PREREQ_PM => {
'Curses::UI' => 0,
},
EXE_FILES => [ 'bin/cremind' ]
);

43
cremind/bin/cremind Normal file
View File

@@ -0,0 +1,43 @@
#!/usr/bin/perl
use strict;
use warnings;
use Curses::UI;
my $panes;
my $cui = Curses::UI->new(
-clear_on_exit => 1,
-color_support => 1,
);
sub check_window_size {
if ($Curses::LINES < 24 || $Curses::COLS < 80) {
$cui->dialog("This program needs a terminal window at least 24 lines by 80 columns. This one is " . $Curses::LINES . " by " . $Curses::COLS);
exit(1);
}
}
sub create_panes {
$panes->{calendar} = $cui->add(
'calendar', 'Window',
-x => 0,
-y => 0,
-bfg => 'green',
-width => 23,
-border => 1,
-height => 10);
$panes->{calendar}->add('cal', 'TextViewer',
-text =>
" March 2025\n" .
"Su Mo Tu We Th Fr Sa\n" .
" 1 2 3 4 5 6 7\n" .
" 8 9 10 11 12 13 14\n" .
"15 16 17 18 19 20 21\n" .
"22 23 24 25 26 27 28\n" .
"29 30 31\n")
}
check_window_size();
create_panes();
alarm(3);
$cui->mainloop();

View File

@@ -1,5 +1,20 @@
CHANGES TO REMIND
* VERSION 5.3 Patch 2 - 2025-02-09
- CHANGE: remind: Revert a change to the way "-y" tags are generated that
was introduced in 05.03.01. The change broke a library that depended
on it being generated in the old way.
* VERSION 5.3 Patch 1 - 2025-02-07
- IMPROVEMENT: TkRemind: When we pop up a timed reminder, make any "Url:"
info string into a clickable link.
- IMPROVEMENT: rem2pdf: Improve the layout of the small monthly calendars.
- BUG FIX: rem2pdf: Add checks for all Perl dependencies.
* VERSION 5.3 Patch 0 - 2025-02-04
- NEW FEATURE: remind: Add the "INFO" clause to the REM command. This

View File

@@ -18,6 +18,8 @@ WriteMakefile(
'Getopt::Long' => 0,
'Cairo' => 0,
'Pango' => 0,
'JSON::MaybeXS' => 0,
'Encode' => 0,
},
EXE_FILES => [ 'bin/rem2pdf' ]
);

View File

@@ -7,16 +7,18 @@ bindir=@bindir@
datadir=@datadir@
datarootdir=@datarootdir@
PERL=@PERL@
PERLMODS_NEEDED=Getopt::Long Cairo Pango
PERLMODS_NEEDED=Cairo Encode ExtUtils::MakeMaker Getopt::Long JSON::MaybeXS Pango
all: Makefile
@if test "$(PERL)" = "" ; then \
echo "Not building rem2pdf; Perl is required"; exit 0; fi; \
OK=1; \
for m in $(PERLMODS_NEEDED) ; \
do \
$(PERL) -M$$m -e 1 > /dev/null 2>&1; \
if test $$? != 0 ; then echo "Not building rem2pdf; missing $$m"; exit 0; fi; \
if test $$? != 0 ; then echo "Missing Perl module: $$m"; OK=0; fi; \
done; \
if test "$$OK" != "1" ; then echo "Not building rem2pdf because of missing perl module(s)"; exit 0; fi; \
$(MAKE) all && exit 0; \
exit 1;

View File

@@ -821,7 +821,6 @@ sub draw_small_calendar
$layout->set_text('88 ');
my ($wid, $h) = $layout->get_pixel_size();
$h += 1;
# Month name
$layout = Pango::Cairo::create_layout($cr);
$desc = Pango::FontDescription->from_string($settings->{small_cal_font} . ' ' . $font_size . 'px');
@@ -835,6 +834,7 @@ sub draw_small_calendar
$y += $h;
# Day names
$wid = $width / 7;
for (my $col=0; $col <7; $col++) {
my $j;
if ($self->{mondayfirst}) {
@@ -860,7 +860,11 @@ sub draw_small_calendar
for (my $d=1; $d <= $days; $d++) {
$desc = Pango::FontDescription->from_string($settings->{small_cal_font} . ' ' . $font_size . 'px');
$layout->set_font_description($desc);
$layout->set_text($d);
my $dt = $d;
if (length($dt) < 2) {
$dt = ' ' . $dt;
}
$layout->set_text($dt);
$cr->save();
$cr->move_to($x + $col*$wid, $y);
Pango::Cairo::show_layout($cr, $layout);
@@ -892,20 +896,23 @@ sub calculate_small_calendar_font_size
my $font_size = int($scale * 10);
# Check
$desc = Pango::FontDescription->from_string($settings->{small_cal_font} . ' ' . $font_size . 'px');
$layout->set_font_description($desc);
$layout->set_text('88 88 88 88 88 88 88');
($wid, $h) = $layout->get_pixel_size();
$h += 1;
$h *= ($rows + 2); # row for month name; row for day names
while(1) {
$desc = Pango::FontDescription->from_string($settings->{small_cal_font} . ' ' . $font_size . 'px');
$layout->set_font_description($desc);
$layout->set_text('88 88 88 88 88 88 88');
($wid, $h) = $layout->get_pixel_size();
$h += 1;
$h *= ($rows + 2); # row for month name; row for day names
$scale = $width / $wid;
if (($height / $h) < $scale) {
$scale = $height / $h;
}
$scale = $width / $wid;
if (($height / $h) < $scale) {
$scale = $height / $h;
}
if ($scale < 1) { # Font size is too big
$font_size--;
if ($scale >= 1) { # Font size is OK
last;
}
$font_size -= 0.1;
}
return $font_size;
}

View File

@@ -3101,6 +3101,18 @@ proc IssueBackgroundReminder { body time now tag qid info } {
grid $w.f.m2 -row $row -column 1 -sticky new
incr row
}
if {[dict exists $info url]} {
set url [dict get $info url]
message $w.f.u -text $url -justify left -anchor w -aspect 2000 -padx 1 -pady 1 -highlightthickness 0 -relief flat -bd 0 -font {-weight normal -underline 0} -fg #0000F0
grid $w.f.u -row $row -column 0 -columnspan 2 -sticky new
bind $w.f.u <Button-1> [list exec xdg-open "$url"]
bind $w.f.u <Button-2> [list exec xdg-open "$url"]
bind $w.f.u <Button-3> [list exec xdg-open "$url"]
bind $w.f.u <Enter> [list $w.f.u configure -font {-weight normal -underline 1}]
bind $w.f.u <Leave> [list $w.f.u configure -font {-weight normal -underline 0}]
balloon_add_help $w.f.u "Click to open $url"
incr row
}
pack $w.b -side top
pack $w.ok -in $w.b -side left
if {$qid != "*"} {

View File

@@ -2944,9 +2944,6 @@ char const *SynthesizeTag(void)
static char out[128];
MD5Init(&ctx);
MD5Update(&ctx, (unsigned char *) CurLine, strlen(CurLine));
MD5Update(&ctx, (unsigned char *) FileName, strlen(FileName));
snprintf((char *) buf, sizeof(buf), "%d", LineNo);
MD5Update(&ctx, buf, strlen( (char *) buf));
MD5Final(buf, &ctx);
snprintf(out, sizeof(out), "__syn__%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x",
(unsigned int) buf[0], (unsigned int) buf[1],

View File

@@ -79,6 +79,7 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int dse,
int origLen = DBufLen(dbuf);
int altmode;
int r;
int origtime;
Value v;
UserFunc *func;
@@ -87,6 +88,7 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int dse,
if (tt) {
tim = tt->ttime;
}
origtime = tim;
if (tim == NO_TIME) tim = curtime;
tdiff = tim - curtime;
adiff = ABS(tdiff);
@@ -405,6 +407,12 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int dse,
Eprint("%s", GetErr(r));
}
}
if (origtime == NO_TIME) {
if ((c >= '0' && c <= '9') || (c == '!')) {
Wprint(tr("`%%%c' substitution sequence should not be used without an AT clause"), c);
}
}
switch(UPPER(c)) {
case 'A':
if (altmode == '*' || !strcmp(tr("on"), "")) {

View File

@@ -690,6 +690,11 @@ set a "\x0P"
set a "\x00P"
EOF
# Test diagnostics when using a timed substitution without an AT clause
../src/remind - 1 Feb 2024 1:00 <<EOF >> ../tests/test.out 2>&1
REM MSG %0 %1 %2 %3 %4 %5 %6 %7 %8 %9 %! hahaha
EOF
# Test translate table dumping
../src/remind - 1 Feb 2024 <<EOF >> ../tests/test.out 2>&1
TRANSLATE "\x03" "BREAK"

View File

@@ -1047,7 +1047,7 @@ set a057 value("a05"+"6")
"a05" + "6" => "a056"
value("a056") => "SDFJHSDF KSJDFH KJSDFH KSJDFH"
set a058 version()
version() => "05.03.00"
version() => "05.03.02"
set a059 wkday(today())
today() => 1991-02-16
wkday(1991-02-16) => "Saturday"
@@ -2611,7 +2611,7 @@ a056 "SDFJHSDF KSJDFH KJSDFH KSJDFH"
a007 "1991-02-16"
a057 "SDFJHSDF KSJDFH KJSDFH KSJDFH"
a008 "11:44"
a058 "05.03.00"
a058 "05.03.02"
a059 "Saturday"
a010 12
a060 6
@@ -5632,8 +5632,8 @@ REM SATISFY ""
REM SATISFY [version() > "01.00.00"]
../tests/test.rem(1050): SATISFY: expression has no reference to trigdate() or $T...
../tests/test.rem(1050): Trig = Saturday, 16 February, 1991
version() => "05.03.00"
"05.03.00" > "01.00.00" => 1
version() => "05.03.02"
"05.03.02" > "01.00.00" => 1
../tests/test.rem(1050): Trig(satisfied) = Saturday, 16 February, 1991
REM SATISFY [max(x, max(x, 1, 2, 3), 4, 5, 6) * 5]
../tests/test.rem(1051): SATISFY: expression has no reference to trigdate() or $T...
@@ -23200,7 +23200,7 @@ SECURITY: Won't read world-writable file or directory!
Error reading include_dir/ww: Can't open file
SECURITY: Won't read world-writable file or directory!
Error reading include_dir/ww: No files matching *.rem
05.03.00
05.03.02
Enabling test mode: This is meant for the acceptance test.
Do not use --test in production.
In test mode, the system time is fixed at 2025-01-06@19:00
@@ -24548,6 +24548,7 @@ TRANSLATE "Warning: Useless use of UNTIL with fully-specified date and no *rep"
TRANSLATE "Warning: Variable name `%.*s...' truncated to `%.*s'" ""
TRANSLATE "You have OMITted everything! The space-time continuum is at risk." ""
TRANSLATE "\\x00 is not a valid escape sequence" ""
TRANSLATE "`%%%c' substitution sequence should not be used without an AT clause" ""
TRANSLATE "did you mean" ""
TRANSLATE "here" ""
TRANSLATE "psmoon() is deprecated; use SPECIAL MOON instead." ""
@@ -24691,6 +24692,21 @@ a "xPOO"
-stdin-(24): \x00 is not a valid escape sequence
-stdin-(25): \x00 is not a valid escape sequence
-stdin-(26): \x00 is not a valid escape sequence
-stdin-(1): `%0' substitution sequence should not be used without an AT clause
-stdin-(1): `%1' substitution sequence should not be used without an AT clause
-stdin-(1): `%2' substitution sequence should not be used without an AT clause
-stdin-(1): `%3' substitution sequence should not be used without an AT clause
-stdin-(1): `%4' substitution sequence should not be used without an AT clause
-stdin-(1): `%5' substitution sequence should not be used without an AT clause
-stdin-(1): `%6' substitution sequence should not be used without an AT clause
-stdin-(1): `%7' substitution sequence should not be used without an AT clause
-stdin-(1): `%8' substitution sequence should not be used without an AT clause
-stdin-(1): `%9' substitution sequence should not be used without an AT clause
-stdin-(1): `%!' substitution sequence should not be used without an AT clause
Reminders for Thursday, 1st February, 2024:
s now at 1:00am at 01:00 0 0 from now 0 0 s is hahaha
# Translation table
TRANSLATE "LANGID" "en"
TRANSLATE "\x03" "BREAK"