mirror of
https://salsa.debian.org/dskoll/remind.git
synced 2026-04-16 22:38:37 +02:00
Compare commits
24 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
143ad08b3f | ||
|
|
44afdfcb44 | ||
|
|
4b905dbc02 | ||
|
|
0f76750e05 | ||
|
|
b32f56134e | ||
|
|
60b0b468df | ||
|
|
52ce99af80 | ||
|
|
5915eb4973 | ||
|
|
aa8d23fd87 | ||
|
|
917d943953 | ||
|
|
9ade3876b2 | ||
|
|
471ecff267 | ||
|
|
762bf97473 | ||
|
|
563f3ea088 | ||
|
|
939078428f | ||
|
|
5acbb907b4 | ||
|
|
21ecc28ea4 | ||
|
|
b37a7cd993 | ||
|
|
64679817ae | ||
|
|
1ef1033379 | ||
|
|
7d42750043 | ||
|
|
1dc0afc0ca | ||
|
|
a0aede4069 | ||
|
|
a5a7637696 |
2
.github/FUNDING.yml
vendored
2
.github/FUNDING.yml
vendored
@@ -1,2 +0,0 @@
|
||||
|
||||
liberapay: dskoll
|
||||
7
.github/README.md
vendored
7
.github/README.md
vendored
@@ -1,7 +0,0 @@
|
||||
# Remind has moved
|
||||
|
||||
For various reasons, I have decided to move Remind off GitHub. This repo
|
||||
will be archived. To create merge requests or issues, please visit
|
||||
Remind's new home at https://salsa.debian.org/dskoll/remind
|
||||
|
||||
-- Dianne Skoll
|
||||
29
.github/workflows/github-action.yml
vendored
29
.github/workflows/github-action.yml
vendored
@@ -1,29 +0,0 @@
|
||||
# language: bash
|
||||
---
|
||||
|
||||
name: Remind unit tests
|
||||
|
||||
on:
|
||||
push
|
||||
|
||||
jobs:
|
||||
tests:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Remind
|
||||
uses: actions/checkout@v2
|
||||
- name: Add test user
|
||||
run: |
|
||||
sudo adduser --home /home/testuser --gecos 'Test User' --disabled-password testuser
|
||||
- name: Fix ownership
|
||||
run: |
|
||||
sudo chown -R testuser .
|
||||
- name: Build
|
||||
run: |
|
||||
sudo su -c './configure && make' testuser
|
||||
- name: Run Tests
|
||||
run: |
|
||||
sudo su -c 'make test' testuser
|
||||
- name: Fix up permissions so GitHub does not complain
|
||||
run: |
|
||||
sudo chmod -R a+rwX .
|
||||
18
configure
vendored
18
configure
vendored
@@ -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.04.
|
||||
#
|
||||
#
|
||||
# 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.04'
|
||||
PACKAGE_STRING='remind 05.03.04'
|
||||
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.04 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.04:";;
|
||||
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.04
|
||||
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.04, which was
|
||||
generated by GNU Autoconf 2.71. Invocation command line was
|
||||
|
||||
$ $0$ac_configure_args_raw
|
||||
@@ -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.04, 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.04
|
||||
configured by $0, generated by GNU Autoconf 2.71,
|
||||
with options \\"\$ac_cs_config\\"
|
||||
|
||||
|
||||
@@ -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.04, , , https://dianne.skoll.ca/projects/remind/)
|
||||
AC_CONFIG_SRCDIR([src/queue.c])
|
||||
|
||||
cat <<'EOF'
|
||||
|
||||
@@ -1,5 +1,46 @@
|
||||
CHANGES TO REMIND
|
||||
|
||||
* VERSION 5.3 Patch 4 - 2025-03-09
|
||||
|
||||
- BUG FIX: remind: "make test" could fail if Remind was built in a locale
|
||||
other than "C". This has been fixed.
|
||||
|
||||
- BUG FIX: Fix a typo in the remind man page.
|
||||
|
||||
* VERSION 5.3 Patch 3 - 2025-03-03
|
||||
|
||||
- NEW FEATURE: remind: If a command spans more than one line (because of
|
||||
backslash line continuation) output both the starting and ending line
|
||||
number in error messages.
|
||||
|
||||
- NEW FEATURE: remind: In the JSON -pp and -ppp output, include a new key
|
||||
lineno_start to specify the starting line of a multi-line reminder.
|
||||
The existing lineno key specifies the ending line; this is maintained
|
||||
for backward-compatibility.
|
||||
|
||||
- MINOR IMPROVEMENT: include/holidays/misc.rem: Add a few new holidays and
|
||||
URL INFO strings.
|
||||
|
||||
- CHANGE: remind: Issue a warning if a time-related subsitution sequence
|
||||
is used with a non-timed REM command.
|
||||
|
||||
- BUG FIX: remind: Fix a memory leak.
|
||||
|
||||
* 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
|
||||
|
||||
9
include/holidays/misc.rem
Normal file
9
include/holidays/misc.rem
Normal file
@@ -0,0 +1,9 @@
|
||||
# Miscellaneous holidays
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
REM 1 February INFO "Url: https://en.wikipedia.org/wiki/Black_History_Month" MSG Start of Black History Month
|
||||
REM 1 March INFO "Url: https://en.wikipedia.org/wiki/Women%27s_History_Month" MSG Start of Women's History Month
|
||||
REM 8 March INFO "Url: https://en.wikipedia.org/wiki/International_Women%27s_Day" MSG International Women's Day
|
||||
REM Thu 1 May INFO "Url: https://en.wikipedia.org/wiki/National_Day_of_Reason" MSG National Day of Reason
|
||||
REM 23 March INFO "Url: https://www.atheistrepublic.com/atheist-day" MSG Atheist Day
|
||||
@@ -86,3 +86,6 @@ TRANSLATE "Sunrise" "Zonsopgang"
|
||||
TRANSLATE "Sunset" "Zonsondergang"
|
||||
|
||||
TRANSLATE "No reminders." "Geen herinneringen."
|
||||
|
||||
TRANSLATE "Daylight Saving Time Begins" "Daglicht-sparende tijd begint"
|
||||
TRANSLATE "Daylight Saving Time Ends" "Daglicht-sparende tijd eindigt"
|
||||
|
||||
@@ -492,6 +492,13 @@ The filename in which the reminder was found.
|
||||
.B lineno \fIn\fR
|
||||
The line number within the file on which the reminder was found.
|
||||
.TP
|
||||
.B lineno_start \fIn\fR
|
||||
If a reminder spans multiple lines because of backslash
|
||||
line-continuation, then the \fBlineno\fR entry is the \fIlast\fR line
|
||||
of the reminder; the \fBlineno_start\fR entry is the \fIfirst\fR line. If
|
||||
a reminder does \fInot\fR span multiple lines, then only the \fBlineno\fR
|
||||
entry is present; the \fBlineno_start\fR entry is absent in that case.
|
||||
.TP
|
||||
.B nonconst_expr 1
|
||||
If the reminder contained a non-constant expression that had to be evaluated
|
||||
to determine the trigger date, this key will be present with the value 1.
|
||||
|
||||
@@ -3787,7 +3787,7 @@ are effectively swapped, so counting always begins from the older
|
||||
date.
|
||||
.PP
|
||||
If the third argument to \fBnonomitted\fR is an \fBINT\fR, then it must
|
||||
be greater than zero, and is consider to be the \fIstep\fR by which
|
||||
be greater than zero, and is considered to be the \fIstep\fR by which
|
||||
\fBnonomitted\fR counts. For example the following expression:
|
||||
.PP
|
||||
.nf
|
||||
|
||||
@@ -18,6 +18,8 @@ WriteMakefile(
|
||||
'Getopt::Long' => 0,
|
||||
'Cairo' => 0,
|
||||
'Pango' => 0,
|
||||
'JSON::MaybeXS' => 0,
|
||||
'Encode' => 0,
|
||||
},
|
||||
EXE_FILES => [ 'bin/rem2pdf' ]
|
||||
);
|
||||
|
||||
@@ -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; \
|
||||
$(PERL) -M$$m -e 1 ; \
|
||||
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;
|
||||
|
||||
@@ -25,7 +27,7 @@ install:
|
||||
echo "Not installing rem2pdf; Perl is required"; exit 0; fi; \
|
||||
for m in $(PERLMODS_NEEDED) ; \
|
||||
do \
|
||||
$(PERL) -M$$m -e 1 > /dev/null 2>&1; \
|
||||
$(PERL) -M$$m -e 1 ; \
|
||||
if test $$? != 0 ; then echo "Not installing rem2pdf; missing $$m"; exit 0; fi; \
|
||||
done; \
|
||||
echo "Installing rem2pdf"; \
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -1212,7 +1212,12 @@ proc FillCalWindow {} {
|
||||
set fname [dict get $obj filename]
|
||||
# Don't make INCLUDECMD output editable
|
||||
if {![string match "*|" $fname]} {
|
||||
set fntag [string cat "FILE_" [dict get $obj lineno] "_" $fname]
|
||||
if {[dict exists $obj lineno_start]} {
|
||||
set l [dict get $obj lineno_start]
|
||||
} else {
|
||||
set l [dict get $obj lineno]
|
||||
}
|
||||
set fntag [string cat "FILE_" $l "_" $fname]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2867,7 +2872,11 @@ proc ShowQueue { queue } {
|
||||
set fntag ""
|
||||
catch {
|
||||
set fname [dict get $q filename]
|
||||
set lineno [dict get $q lineno]
|
||||
if {[dict exists $obj lineno_start]} {
|
||||
set lineno [dict get $obj lineno_start]
|
||||
} else {
|
||||
set lineno [dict get $obj lineno]
|
||||
}
|
||||
set fntag [string cat "FILE_" $lineno "_" $fname]
|
||||
}
|
||||
if { "$fntag" != "" } {
|
||||
@@ -3101,6 +3110,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 != "*"} {
|
||||
@@ -4612,7 +4633,7 @@ proc ShowErrors {} {
|
||||
set l [split $RemindErrors "\n"]
|
||||
set i 0
|
||||
foreach line $l {
|
||||
if {[regexp {^(.*)\(([0-9]+)\)} $line dummy fname lineno]} {
|
||||
if {[regexp {^(.*)\(([0-9]+)} $line dummy fname lineno]} {
|
||||
incr i
|
||||
set fntag [string cat "FILE_" $lineno "_" $fname]
|
||||
$w.t insert end $line [list ERR "ERR$i" $fntag]
|
||||
|
||||
@@ -48,7 +48,7 @@ test: all
|
||||
xlat.c: $(REMINDSRCS)
|
||||
@echo "#include <stddef.h>" > xlat.c
|
||||
@echo "char const *translatables[] = {" >> xlat.c
|
||||
@cat $(REMINDSRCS) | grep 'tr(".*")' | sed -e 's/.*tr."/"/' -e 's/").*/"/' | sort | uniq | grep -E -v '^"(am|at|from now|hour|minute|now|on|pm|today|tomorrow|was)"$$' | sed -e 's/^/ /' -e 's/$$/,/' >> xlat.c
|
||||
@cat $(REMINDSRCS) | grep 'tr(".*")' | sed -e 's/.*tr."/"/' -e 's/").*/"/' | LANG=C LC_ALL=C sort | uniq | grep -E -v '^"(am|at|from now|hour|minute|now|on|pm|today|tomorrow|was)"$$' | sed -e 's/^/ /' -e 's/$$/,/' >> xlat.c
|
||||
@echo " NULL" >> xlat.c
|
||||
@echo "};" >> xlat.c
|
||||
|
||||
|
||||
@@ -57,6 +57,7 @@ typedef struct cal_entry {
|
||||
int duration;
|
||||
char *filename;
|
||||
int lineno;
|
||||
int lineno_start;
|
||||
Trigger trig;
|
||||
TimeTrig tt;
|
||||
int nonconst_expr;
|
||||
@@ -2327,6 +2328,7 @@ static int DoCalRem(ParsePtr p, int col)
|
||||
return E_NO_MEM;
|
||||
}
|
||||
e->lineno = LineNo;
|
||||
e->lineno_start = LineNoStart;
|
||||
|
||||
if (trig.typ == PASSTHRU_TYPE || is_color) {
|
||||
StrnCpy(e->passthru, trig.passthru, PASSTHRU_LEN);
|
||||
@@ -2528,6 +2530,9 @@ static void WriteSimpleEntryProtocol2(CalEntry *e, int today)
|
||||
if (DoPrefixLineNo) {
|
||||
PrintJSONKeyPairString("filename", e->filename);
|
||||
PrintJSONKeyPairInt("lineno", e->lineno);
|
||||
if (e->lineno != e->lineno_start) {
|
||||
PrintJSONKeyPairInt("lineno_start", e->lineno_start);
|
||||
}
|
||||
}
|
||||
PrintJSONKeyPairString("passthru", e->passthru);
|
||||
PrintJSONKeyPairString("tags", DBufValue(&(e->tags)));
|
||||
@@ -2944,9 +2949,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],
|
||||
|
||||
@@ -72,13 +72,13 @@ check_trigger_function(char const *fname, char const *type)
|
||||
return;
|
||||
}
|
||||
if (f->nargs != 1) {
|
||||
Wprint(tr("%s function `%s' defined at %s:%d should take 1 argument but actually takes %d"), type, fname, f->filename, f->lineno, f->nargs);
|
||||
Wprint(tr("%s function `%s' defined at %s(%s) should take 1 argument but actually takes %d"), type, fname, f->filename, line_range(f->lineno_start, f->lineno), f->nargs);
|
||||
return;
|
||||
}
|
||||
if (ensure_expr_references_first_local_arg(f->node)) {
|
||||
return;
|
||||
}
|
||||
Wprint(tr("%s function `%s' defined at %s:%d does not use its argument"), type, fname, f->filename, f->lineno);
|
||||
Wprint(tr("%s function `%s' defined at %s(%s) does not use its argument"), type, fname, f->filename, line_range(f->lineno_start, f->lineno));
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -1558,8 +1558,8 @@ int DoSatRemind(Trigger *trig, TimeTrig *tt, ParsePtr p)
|
||||
if (DebugFlag & DB_PRTTRIG) {
|
||||
int y, m, d;
|
||||
FromDSE(LastTriggerDate, &y, &m, &d);
|
||||
fprintf(ErrFp, "%s(%d): Trig(satisfied) = %s, %d %s, %d",
|
||||
FileName, LineNo,
|
||||
fprintf(ErrFp, "%s(%s): Trig(satisfied) = %s, %d %s, %d",
|
||||
FileName, line_range(LineNoStart, LineNo),
|
||||
get_day_name(LastTriggerDate % 7),
|
||||
d,
|
||||
get_month_name(m),
|
||||
|
||||
@@ -40,8 +40,8 @@ check_subst_args(UserFunc *f, int n)
|
||||
if (f->nargs == n) {
|
||||
return 1;
|
||||
}
|
||||
Wprint(tr("Function `%s' defined at %s:%d should take %d argument%s, but actually takes %d"),
|
||||
f->name, f->filename, f->lineno, n, (n == 1 ? "" : "s"), f->nargs);
|
||||
Wprint(tr("Function `%s' defined at %s(%s) should take %d argument%s, but actually takes %d"),
|
||||
f->name, f->filename, line_range(f->lineno_start, f->lineno), n, (n == 1 ? "" : "s"), f->nargs);
|
||||
return 0;
|
||||
}
|
||||
/***************************************************************/
|
||||
@@ -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"), "")) {
|
||||
|
||||
@@ -723,7 +723,7 @@ eval_userfunc(expr_node *node, Value *locals, Value *ans, int *nonconst)
|
||||
FuncRecursionLevel++;
|
||||
|
||||
/* Add a call to the call stack for better error messages */
|
||||
pushed = push_call(f->filename, f->name, f->lineno);
|
||||
pushed = push_call(f->filename, f->name, f->lineno, f->lineno_start);
|
||||
|
||||
DBG(debug_enter_userfunc(node, new_locals, f->nargs));
|
||||
|
||||
@@ -1130,7 +1130,7 @@ static int add(expr_node *node, Value *locals, Value *ans, int *nonconst)
|
||||
|
||||
/* If either is a string, coerce them both to strings and concatenate */
|
||||
if (v1.type == STR_TYPE || v2.type == STR_TYPE) {
|
||||
/* Skanky... copy the values shallowly fode debug */
|
||||
/* Skanky... copy the values shallowly for debug */
|
||||
Value o1 = v1;
|
||||
Value o2 = v2;
|
||||
if ( (r = DoCoerce(STR_TYPE, &v1)) ) {
|
||||
@@ -1164,6 +1164,8 @@ static int add(expr_node *node, Value *locals, Value *ans, int *nonconst)
|
||||
strcpy(ans->v.str, v1.v.str);
|
||||
strcpy(ans->v.str+l1, v2.v.str);
|
||||
DBG(debug_evaluation_binop(ans, OK, &o1, &o2, "+"));
|
||||
DestroyValue(v1);
|
||||
DestroyValue(v2);
|
||||
return OK;
|
||||
}
|
||||
|
||||
|
||||
14
src/files.c
14
src/files.c
@@ -50,6 +50,7 @@ typedef struct cache {
|
||||
struct cache *next;
|
||||
char const *text;
|
||||
int LineNo;
|
||||
int LineNoStart;
|
||||
} CachedLine;
|
||||
|
||||
typedef struct cheader {
|
||||
@@ -77,6 +78,7 @@ typedef struct {
|
||||
char const *filename;
|
||||
FilenameChain *chain;
|
||||
int LineNo;
|
||||
int LineNoStart;
|
||||
unsigned int IfFlags;
|
||||
int NumIfs;
|
||||
int IfLinenos[IF_NEST];
|
||||
@@ -189,6 +191,7 @@ int ReadLine(void)
|
||||
if (CLine) {
|
||||
CurLine = CLine->text;
|
||||
LineNo = CLine->LineNo;
|
||||
LineNoStart = CLine->LineNoStart;
|
||||
CLine = CLine->next;
|
||||
got_a_fresh_line();
|
||||
clear_callstack();
|
||||
@@ -218,6 +221,7 @@ static int ReadLineFromFile(int use_pclose)
|
||||
DBufInit(&buf);
|
||||
DBufFree(&LineBuffer);
|
||||
|
||||
LineNoStart = LineNo+1;
|
||||
while(fp) {
|
||||
if (DBufGets(&buf, fp) != OK) {
|
||||
DBufFree(&LineBuffer);
|
||||
@@ -332,6 +336,7 @@ int OpenFile(char const *fname)
|
||||
CLine = h->cache;
|
||||
STRSET(FileName, fname);
|
||||
LineNo = 0;
|
||||
LineNoStart = 0;
|
||||
if (!h->ownedByMe) {
|
||||
RunDisabled |= RUN_NOTOWNER;
|
||||
} else {
|
||||
@@ -367,6 +372,7 @@ int OpenFile(char const *fname)
|
||||
CLine = NULL;
|
||||
if (ShouldCache) {
|
||||
LineNo = 0;
|
||||
LineNoStart = 0;
|
||||
r = CacheFile(fname, 0);
|
||||
if (r == OK) {
|
||||
fp = NULL;
|
||||
@@ -385,6 +391,7 @@ int OpenFile(char const *fname)
|
||||
}
|
||||
STRSET(FileName, fname);
|
||||
LineNo = 0;
|
||||
LineNoStart = 0;
|
||||
if (FileName) return OK; else return E_NO_MEM;
|
||||
}
|
||||
|
||||
@@ -487,6 +494,7 @@ static int CacheFile(char const *fname, int use_pclose)
|
||||
}
|
||||
cl->next = NULL;
|
||||
cl->LineNo = LineNo;
|
||||
cl->LineNoStart = LineNoStart;
|
||||
cl->text = StrDup(s);
|
||||
DBufFree(&LineBuffer);
|
||||
if (!cl->text) {
|
||||
@@ -565,6 +573,7 @@ static int PopFile(void)
|
||||
IStackPtr--;
|
||||
|
||||
LineNo = i->LineNo;
|
||||
LineNoStart = i->LineNoStart;
|
||||
IfFlags = i->IfFlags;
|
||||
memcpy(IfLinenos, i->IfLinenos, IF_NEST);
|
||||
NumIfs = i->NumIfs;
|
||||
@@ -906,6 +915,7 @@ static int IncludeCmd(char const *cmd)
|
||||
}
|
||||
i->ownedByMe = 1;
|
||||
i->LineNo = LineNo;
|
||||
i->LineNoStart = LineNo;
|
||||
i->NumIfs = NumIfs;
|
||||
i->IfFlags = IfFlags;
|
||||
memcpy(i->IfLinenos, IfLinenos, IF_NEST);
|
||||
@@ -932,6 +942,7 @@ static int IncludeCmd(char const *cmd)
|
||||
STRSET(FileName, fname);
|
||||
DBufFree(&buf);
|
||||
LineNo = 0;
|
||||
LineNoStart = 0;
|
||||
if (!h->ownedByMe) {
|
||||
RunDisabled |= RUN_NOTOWNER;
|
||||
} else {
|
||||
@@ -963,6 +974,7 @@ static int IncludeCmd(char const *cmd)
|
||||
}
|
||||
fp = fp2;
|
||||
LineNo = 0;
|
||||
LineNoStart = 0;
|
||||
|
||||
/* Temporarily turn of file tracing */
|
||||
old_flag = DebugFlag;
|
||||
@@ -978,6 +990,7 @@ static int IncludeCmd(char const *cmd)
|
||||
fp = NULL;
|
||||
CLine = CachedFiles->cache;
|
||||
LineNo = 0;
|
||||
LineNoStart = 0;
|
||||
STRSET(FileName, fname);
|
||||
DBufFree(&buf);
|
||||
return OK;
|
||||
@@ -1014,6 +1027,7 @@ int IncludeFile(char const *fname)
|
||||
i->filename = NULL;
|
||||
}
|
||||
i->LineNo = LineNo;
|
||||
i->LineNoStart = LineNoStart;
|
||||
i->NumIfs = NumIfs;
|
||||
i->IfFlags = IfFlags;
|
||||
memcpy(i->IfLinenos, IfLinenos, IF_NEST);
|
||||
|
||||
@@ -47,6 +47,7 @@ EXTERN int CurDay;
|
||||
EXTERN int CurMon;
|
||||
EXTERN int CurYear;
|
||||
EXTERN int LineNo;
|
||||
EXTERN int LineNoStart;
|
||||
EXTERN int FreshLine;
|
||||
EXTERN int WarnedAboutImplicit;
|
||||
EXTERN uid_t TrustedUsers[MAX_TRUSTED_USERS];
|
||||
@@ -119,7 +120,7 @@ EXTERN INIT( int PurgeIncludeDepth, 0);
|
||||
EXTERN INIT( FILE *PurgeFP, NULL);
|
||||
EXTERN INIT( int NumIfs, 0);
|
||||
EXTERN INIT( unsigned int IfFlags, 0);
|
||||
EXTERN INIT( int IfLinenos[IF_NEST], {0});
|
||||
EXTERN INIT( int IfLinenos[IF_NEST], {0});
|
||||
EXTERN INIT( int LastTrigValid, 0);
|
||||
EXTERN Trigger LastTrigger;
|
||||
EXTERN TimeTrig LastTimeTrig;
|
||||
|
||||
25
src/main.c
25
src/main.c
@@ -897,11 +897,21 @@ void Wprint(char const *fmt, ...)
|
||||
va_list argptr;
|
||||
|
||||
|
||||
/* We can't use line_range because caller might have used it */
|
||||
if (FileName) {
|
||||
if (strcmp(FileName, "-"))
|
||||
(void) fprintf(ErrFp, "%s(%d): ", FileName, LineNo);
|
||||
else
|
||||
(void) fprintf(ErrFp, "-stdin-(%d): ", LineNo);
|
||||
if (strcmp(FileName, "-")) {
|
||||
if (LineNoStart == LineNo) {
|
||||
(void) fprintf(ErrFp, "%s(%d): ", FileName, LineNo);
|
||||
} else {
|
||||
(void) fprintf(ErrFp, "%s(%d:%d): ", FileName, LineNoStart, LineNo);
|
||||
}
|
||||
} else {
|
||||
if (LineNoStart == LineNo) {
|
||||
(void) fprintf(ErrFp, "-stdin-(%d): ", LineNo);
|
||||
} else {
|
||||
(void) fprintf(ErrFp, "-stdin-(%d:%d): ", LineNoStart, LineNo);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
va_start(argptr, fmt);
|
||||
@@ -933,7 +943,12 @@ void Eprint(char const *fmt, ...)
|
||||
fname = "-stdin-";
|
||||
}
|
||||
if (FreshLine) {
|
||||
(void) fprintf(ErrFp, "%s(%d): ", fname, LineNo);
|
||||
/* We can't use line_range because caller might have used it */
|
||||
if (LineNo == LineNoStart) {
|
||||
(void) fprintf(ErrFp, "%s(%d): ", fname, LineNo);
|
||||
} else {
|
||||
(void) fprintf(ErrFp, "%s(%d:%d): ", fname, LineNoStart, LineNo);
|
||||
}
|
||||
} else {
|
||||
fprintf(ErrFp, " ");
|
||||
}
|
||||
|
||||
@@ -226,7 +226,7 @@ char const *get_day_name(int wkday);
|
||||
char const *get_month_name(int mon);
|
||||
|
||||
void set_cloexec(FILE *fp);
|
||||
int push_call(char const *filename, char const *func, int lineno);
|
||||
int push_call(char const *filename, char const *func, int lineno, int lineno_start);
|
||||
void clear_callstack(void);
|
||||
int print_callstack(FILE *fp);
|
||||
void pop_call(void);
|
||||
@@ -284,3 +284,4 @@ int TrigInfoHeadersAreTheSame(char const *i1, char const *i2);
|
||||
int TrigInfoIsValid(char const *info);
|
||||
char const *FindTrigInfo(Trigger *t, char const *header);
|
||||
void WriteJSONInfoChain(TrigInfo *ti);
|
||||
char const *line_range(int lineno_start, int lineno);
|
||||
|
||||
@@ -61,6 +61,7 @@ typedef struct queuedrem {
|
||||
char const *text;
|
||||
char const *fname;
|
||||
int lineno;
|
||||
int lineno_start;
|
||||
char passthru[PASSTHRU_LEN+1];
|
||||
char sched[VAR_NAME_LEN+1];
|
||||
Trigger t;
|
||||
@@ -224,6 +225,7 @@ int QueueReminder(ParsePtr p, Trigger *trig,
|
||||
}
|
||||
|
||||
qelem->lineno = LineNo;
|
||||
qelem->lineno_start = LineNoStart;
|
||||
NumQueued++;
|
||||
qelem->typ = trig->typ;
|
||||
strcpy(qelem->passthru, trig->passthru);
|
||||
@@ -784,6 +786,9 @@ json_queue(QueuedRem const *q)
|
||||
PrintJSONKeyPairInt("ntrig", q->ntrig);
|
||||
PrintJSONKeyPairString("filename", q->fname);
|
||||
PrintJSONKeyPairInt("lineno", q->lineno);
|
||||
if (q->lineno_start != q->lineno) {
|
||||
PrintJSONKeyPairInt("lineno_start", q->lineno_start);
|
||||
}
|
||||
switch(q->typ) {
|
||||
case NO_TYPE: PrintJSONKeyPairString("type", "NO_TYPE"); break;
|
||||
case MSG_TYPE: PrintJSONKeyPairString("type", "MSG_TYPE"); break;
|
||||
|
||||
@@ -452,8 +452,8 @@ AdjustTriggerForDuration(int today, int r, Trigger *trig, TimeTrig *tim, int sav
|
||||
r = today;
|
||||
if (DebugFlag & DB_PRTTRIG) {
|
||||
FromDSE(r, &y, &m, &d);
|
||||
fprintf(ErrFp, "%s(%d): Trig(adj) = %s, %d %s, %d",
|
||||
FileName, LineNo,
|
||||
fprintf(ErrFp, "%s(%s): Trig(adj) = %s, %d %s, %d",
|
||||
FileName, line_range(LineNoStart, LineNo),
|
||||
get_day_name(r % 7),
|
||||
d,
|
||||
get_month_name(m),
|
||||
@@ -580,8 +580,8 @@ int ComputeTriggerNoAdjustDuration(int today, Trigger *trig, TimeTrig *tim,
|
||||
if (result == -1) {
|
||||
trig->expired = 1;
|
||||
if (DebugFlag & DB_PRTTRIG) {
|
||||
fprintf(ErrFp, "%s(%d): %s\n",
|
||||
FileName, LineNo, GetErr(E_EXPIRED));
|
||||
fprintf(ErrFp, "%s(%s): %s\n",
|
||||
FileName, line_range(LineNoStart, LineNo), GetErr(E_EXPIRED));
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
@@ -603,8 +603,8 @@ int ComputeTriggerNoAdjustDuration(int today, Trigger *trig, TimeTrig *tim,
|
||||
}
|
||||
if (DebugFlag & DB_PRTTRIG) {
|
||||
FromDSE(result, &y, &m, &d);
|
||||
fprintf(ErrFp, "%s(%d): Trig = %s, %d %s, %d",
|
||||
FileName, LineNo,
|
||||
fprintf(ErrFp, "%s(%s): Trig = %s, %d %s, %d",
|
||||
FileName, line_range(LineNoStart, LineNo),
|
||||
get_day_name(result % 7),
|
||||
d,
|
||||
get_month_name(m),
|
||||
@@ -630,8 +630,8 @@ int ComputeTriggerNoAdjustDuration(int today, Trigger *trig, TimeTrig *tim,
|
||||
trig->rep == NO_REP) {
|
||||
trig->expired = 1;
|
||||
if (DebugFlag & DB_PRTTRIG) {
|
||||
fprintf(ErrFp, "%s(%d): %s\n",
|
||||
FileName, LineNo, GetErr(E_EXPIRED));
|
||||
fprintf(ErrFp, "%s(%s): %s\n",
|
||||
FileName, line_range(LineNoStart, LineNo), GetErr(E_EXPIRED));
|
||||
}
|
||||
if (save_in_globals) {
|
||||
LastTriggerDate = result;
|
||||
@@ -655,8 +655,8 @@ int ComputeTriggerNoAdjustDuration(int today, Trigger *trig, TimeTrig *tim,
|
||||
}
|
||||
trig->expired = 1;
|
||||
if (DebugFlag & DB_PRTTRIG) {
|
||||
fprintf(ErrFp, "%s(%d): %s\n",
|
||||
FileName, LineNo, GetErr(E_EXPIRED));
|
||||
fprintf(ErrFp, "%s(%s): %s\n",
|
||||
FileName, line_range(LineNoStart, LineNo), GetErr(E_EXPIRED));
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -308,5 +308,6 @@ typedef struct udf_struct {
|
||||
int nargs;
|
||||
char const *filename;
|
||||
int lineno;
|
||||
int lineno_start;
|
||||
int recurse_flag;
|
||||
} UserFunc;
|
||||
|
||||
@@ -208,8 +208,8 @@ int DoFset(ParsePtr p)
|
||||
return OK;
|
||||
}
|
||||
/* Warn about redefinition */
|
||||
Wprint(tr("Function `%s' redefined (previously defined at %s:%d)"),
|
||||
existing->name, existing->filename, existing->lineno);
|
||||
Wprint(tr("Function `%s' redefined: previously defined at %s(%s)"),
|
||||
existing->name, existing->filename, line_range(existing->lineno_start, existing->lineno));
|
||||
}
|
||||
|
||||
/* Should be followed by '(' */
|
||||
@@ -238,6 +238,7 @@ int DoFset(ParsePtr p)
|
||||
return E_NO_MEM;
|
||||
}
|
||||
func->lineno = LineNo;
|
||||
func->lineno_start = LineNoStart;
|
||||
func->recurse_flag = 0;
|
||||
StrnCpy(func->name, DBufValue(&buf), VAR_NAME_LEN);
|
||||
DBufFree(&buf);
|
||||
|
||||
18
src/utils.c
18
src/utils.c
@@ -192,6 +192,7 @@ typedef struct cs_s {
|
||||
char const *filename;
|
||||
char const *func;
|
||||
int lineno;
|
||||
int lineno_start;
|
||||
} cs;
|
||||
|
||||
static cs *callstack = NULL;
|
||||
@@ -206,7 +207,7 @@ destroy_cs(cs *entry)
|
||||
|
||||
|
||||
int
|
||||
push_call(char const *filename, char const *func, int lineno)
|
||||
push_call(char const *filename, char const *func, int lineno, int lineno_start)
|
||||
{
|
||||
cs *entry;
|
||||
if (freecs) {
|
||||
@@ -222,6 +223,7 @@ push_call(char const *filename, char const *func, int lineno)
|
||||
entry->filename = filename;
|
||||
entry->func = func;
|
||||
entry->lineno = lineno;
|
||||
entry->lineno_start = lineno_start;
|
||||
entry->next = callstack;
|
||||
callstack = entry;
|
||||
return OK;
|
||||
@@ -255,7 +257,7 @@ print_callstack_aux(FILE *fp, cs *entry)
|
||||
fprintf(fp, "\n");
|
||||
}
|
||||
fprintf(fp, " ");
|
||||
fprintf(fp, tr("%s(%d): [#%d] %s function `%s'"), entry->filename, entry->lineno, i, in, entry->func);
|
||||
fprintf(fp, tr("%s(%s): [#%d] %s function `%s'"), entry->filename, line_range(entry->lineno_start, entry->lineno), i, in, entry->func);
|
||||
}
|
||||
prev = entry;
|
||||
entry = entry->next;
|
||||
@@ -289,3 +291,15 @@ pop_call(void)
|
||||
destroy_cs(entry);
|
||||
}
|
||||
}
|
||||
|
||||
char const *
|
||||
line_range(int lineno_start, int lineno)
|
||||
{
|
||||
static char buf[128];
|
||||
if (lineno_start == lineno) {
|
||||
snprintf(buf, sizeof(buf), "%d", lineno);
|
||||
} else {
|
||||
snprintf(buf, sizeof(buf), "%d:%d", lineno_start, lineno);
|
||||
}
|
||||
return buf;
|
||||
}
|
||||
|
||||
@@ -181,11 +181,13 @@ EOF
|
||||
../src/remind -pppq - 1 Jan 2012 9:00 <<'EOF' >> ../tests/test.out 2>&1
|
||||
REM 2 MSG Normal
|
||||
SET $DefaultColor "255 0 0"
|
||||
REM 3 MSG %"Red%" on the calendar!
|
||||
REM 3 \
|
||||
MSG %"Red%" on the calendar!
|
||||
SET $DefaultColor "-1 -1 -1"
|
||||
REM 4 MSG Normal
|
||||
# Should give an error
|
||||
SET $DefaultColor "256 0 0"
|
||||
# Should give an error - split on two lines to test line number reporting
|
||||
SET $DefaultColor \
|
||||
"256 0 0"
|
||||
EOF
|
||||
|
||||
# Test default color with weekly calendar
|
||||
@@ -690,6 +692,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"
|
||||
|
||||
146
tests/test.cmp
146
tests/test.cmp
@@ -801,12 +801,12 @@ Leaving UserFN _ofunc(1991-02-28) => 0
|
||||
|
||||
# omitfunc ignores local/global omits
|
||||
fset _ofunc(x) 0
|
||||
../tests/test.rem(227): Function `_ofunc' redefined (previously defined at ../tests/test.rem:222)
|
||||
../tests/test.rem(227): Function `_ofunc' redefined: previously defined at ../tests/test.rem(222)
|
||||
OMIT 1 March
|
||||
OMIT 2 March 1991
|
||||
REM 1 March OMIT Sun OMITFUNC _ofunc AFTER MSG Should trigger 1 March
|
||||
../tests/test.rem(230): Warning: OMIT is ignored if you use OMITFUNC
|
||||
../tests/test.rem(230): OMITFUNC function `_ofunc' defined at ../tests/test.rem:227 does not use its argument
|
||||
../tests/test.rem(230): OMITFUNC function `_ofunc' defined at ../tests/test.rem(227) does not use its argument
|
||||
Entering UserFN _ofunc(1991-02-15)
|
||||
Leaving UserFN _ofunc(1991-02-15) => 0
|
||||
Entering UserFN _ofunc(1991-03-01)
|
||||
@@ -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.04"
|
||||
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.04"
|
||||
a059 "Saturday"
|
||||
a010 12
|
||||
a060 6
|
||||
@@ -4004,7 +4004,7 @@ psmoon(0) => ../tests/test.rem(813): psmoon() is deprecated; use SPECIAL MOON in
|
||||
FSET _f(x) 0
|
||||
SET tmp evaltrig("Wed SKIP OMITFUNC _f",date(1992,1,8))
|
||||
date(1992, 1, 8) => 1992-01-08
|
||||
evaltrig("Wed SKIP OMITFUNC _f", 1992-01-08) => ../tests/test.rem(817): OMITFUNC function `_f' defined at ../tests/test.rem:816 does not use its argument
|
||||
evaltrig("Wed SKIP OMITFUNC _f", 1992-01-08) => ../tests/test.rem(817): OMITFUNC function `_f' defined at ../tests/test.rem(816) does not use its argument
|
||||
Entering UserFN _f(1992-01-08)
|
||||
Leaving UserFN _f(1992-01-08) => 0
|
||||
../tests/test.rem(817): Trig = Wednesday, 8 January, 1992
|
||||
@@ -4050,7 +4050,7 @@ ENDIF
|
||||
|
||||
# Trig with a good warnfunc
|
||||
FSET w(x) choose(x, 5, 3, 1, 0)
|
||||
../tests/test.rem(832): Function `w' redefined (previously defined at ../tests/test.rem:826)
|
||||
../tests/test.rem(832): Function `w' redefined: previously defined at ../tests/test.rem(826)
|
||||
|
||||
# Short-circuit operators
|
||||
IF trig("sun warn w") || trig("thu warn w")
|
||||
@@ -4998,7 +4998,7 @@ Undefined:
|
||||
FSET subst_bad() "foo"
|
||||
REM MSG %{bad}
|
||||
../tests/test.rem(933): Trig = Saturday, 16 February, 1991
|
||||
../tests/test.rem(933): Function `subst_bad' defined at ../tests/test.rem:932 should take 3 arguments, but actually takes 0
|
||||
../tests/test.rem(933): Function `subst_bad' defined at ../tests/test.rem(932) should take 3 arguments, but actually takes 0
|
||||
|
||||
|
||||
|
||||
@@ -5006,8 +5006,8 @@ FSET subst_ampm(a, b, c, d, e, f, g) "wookie"
|
||||
|
||||
REM AT 11:00 MSG %2
|
||||
../tests/test.rem(937): Trig = Saturday, 16 February, 1991 AT 11:00
|
||||
../tests/test.rem(937): Function `subst_ampm' defined at ../tests/test.rem:935 should take 1 argument, but actually takes 7
|
||||
../tests/test.rem(937): Function `subst_ampm' defined at ../tests/test.rem:935 should take 1 argument, but actually takes 7
|
||||
../tests/test.rem(937): Function `subst_ampm' defined at ../tests/test.rem(935) should take 1 argument, but actually takes 7
|
||||
../tests/test.rem(937): Function `subst_ampm' defined at ../tests/test.rem(935) should take 1 argument, but actually takes 7
|
||||
at 11:00am
|
||||
|
||||
FUNSET subst_ampm
|
||||
@@ -5182,7 +5182,7 @@ FSET f(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a1
|
||||
|
||||
# This should give an error
|
||||
FSET f(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20, a21, a22, a23, a24, a25, a26, a27, a28, a29, a30, a31, a32, a33, a34, a35, a36, a37, a38, a39, a40, a41, a42, a43, a44, a45, a46, a47, a48, a49, a50, a51, a52, a53, a54, a55, a56, a57, a58, a59, a60, a61, a62, a63, a64) 3
|
||||
../tests/test.rem(1023): Function `f' redefined (previously defined at ../tests/test.rem:1020)
|
||||
../tests/test.rem(1023): Function `f' redefined: previously defined at ../tests/test.rem(1020)
|
||||
../tests/test.rem(1023): Too many arguments
|
||||
|
||||
# Check that SATISFY expressions that don't reference trigdate are diagnosed
|
||||
@@ -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.04"
|
||||
"05.03.04" > "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...
|
||||
@@ -5647,63 +5647,63 @@ max(3, 3, 4, 5, 6) => 6
|
||||
|
||||
FSET gg(x) 0
|
||||
REM WARN gg MSG Wookie
|
||||
../tests/test.rem(1054): WARN function `gg' defined at ../tests/test.rem:1053 does not use its argument
|
||||
../tests/test.rem(1054): WARN function `gg' defined at ../tests/test.rem(1053) does not use its argument
|
||||
../tests/test.rem(1054): Trig = Saturday, 16 February, 1991
|
||||
Entering UserFN gg(1)
|
||||
Leaving UserFN gg(1) => 0
|
||||
Wookie
|
||||
|
||||
REM AT 11:00 SCHED gg MSG blork
|
||||
../tests/test.rem(1055): SCHED function `gg' defined at ../tests/test.rem:1053 does not use its argument
|
||||
../tests/test.rem(1055): SCHED function `gg' defined at ../tests/test.rem(1053) does not use its argument
|
||||
../tests/test.rem(1055): Trig = Saturday, 16 February, 1991 AT 11:00
|
||||
blork
|
||||
|
||||
REM OMITFUNC gg MSG hehe
|
||||
../tests/test.rem(1056): OMITFUNC function `gg' defined at ../tests/test.rem:1053 does not use its argument
|
||||
../tests/test.rem(1056): OMITFUNC function `gg' defined at ../tests/test.rem(1053) does not use its argument
|
||||
../tests/test.rem(1056): Trig = Saturday, 16 February, 1991
|
||||
hehe
|
||||
|
||||
|
||||
FSET gg(x,y,z) 0
|
||||
../tests/test.rem(1058): Function `gg' redefined (previously defined at ../tests/test.rem:1053)
|
||||
../tests/test.rem(1058): Function `gg' redefined: previously defined at ../tests/test.rem(1053)
|
||||
REM WARN gg MSG Wookie
|
||||
../tests/test.rem(1059): WARN function `gg' defined at ../tests/test.rem:1058 should take 1 argument but actually takes 3
|
||||
../tests/test.rem(1059): WARN function `gg' defined at ../tests/test.rem(1058) should take 1 argument but actually takes 3
|
||||
../tests/test.rem(1059): Trig = Saturday, 16 February, 1991
|
||||
../tests/test.rem(1059): Undefined WARN function: `gg'
|
||||
Wookie
|
||||
|
||||
REM AT 11:00 SCHED gg MSG blork
|
||||
../tests/test.rem(1060): SCHED function `gg' defined at ../tests/test.rem:1058 should take 1 argument but actually takes 3
|
||||
../tests/test.rem(1060): SCHED function `gg' defined at ../tests/test.rem(1058) should take 1 argument but actually takes 3
|
||||
../tests/test.rem(1060): Trig = Saturday, 16 February, 1991 AT 11:00
|
||||
blork
|
||||
|
||||
REM OMITFUNC gg MSG hehe
|
||||
../tests/test.rem(1061): OMITFUNC function `gg' defined at ../tests/test.rem:1058 should take 1 argument but actually takes 3
|
||||
../tests/test.rem(1061): OMITFUNC function `gg' defined at ../tests/test.rem(1058) should take 1 argument but actually takes 3
|
||||
../tests/test.rem(1061): Trig = Saturday, 16 February, 1991
|
||||
hehe
|
||||
|
||||
|
||||
FSET gg() 0
|
||||
../tests/test.rem(1063): Function `gg' redefined (previously defined at ../tests/test.rem:1058)
|
||||
../tests/test.rem(1063): Function `gg' redefined: previously defined at ../tests/test.rem(1058)
|
||||
REM WARN gg MSG Wookie
|
||||
../tests/test.rem(1064): WARN function `gg' defined at ../tests/test.rem:1063 should take 1 argument but actually takes 0
|
||||
../tests/test.rem(1064): WARN function `gg' defined at ../tests/test.rem(1063) should take 1 argument but actually takes 0
|
||||
../tests/test.rem(1064): Trig = Saturday, 16 February, 1991
|
||||
../tests/test.rem(1064): Undefined WARN function: `gg'
|
||||
Wookie
|
||||
|
||||
REM AT 11:00 SCHED gg MSG blork
|
||||
../tests/test.rem(1065): SCHED function `gg' defined at ../tests/test.rem:1063 should take 1 argument but actually takes 0
|
||||
../tests/test.rem(1065): SCHED function `gg' defined at ../tests/test.rem(1063) should take 1 argument but actually takes 0
|
||||
../tests/test.rem(1065): Trig = Saturday, 16 February, 1991 AT 11:00
|
||||
blork
|
||||
|
||||
REM OMITFUNC gg MSG hehe
|
||||
../tests/test.rem(1066): OMITFUNC function `gg' defined at ../tests/test.rem:1063 should take 1 argument but actually takes 0
|
||||
../tests/test.rem(1066): OMITFUNC function `gg' defined at ../tests/test.rem(1063) should take 1 argument but actually takes 0
|
||||
../tests/test.rem(1066): Trig = Saturday, 16 February, 1991
|
||||
hehe
|
||||
|
||||
|
||||
FSET gg(x) x-x
|
||||
../tests/test.rem(1068): Function `gg' redefined (previously defined at ../tests/test.rem:1063)
|
||||
../tests/test.rem(1068): Function `gg' redefined: previously defined at ../tests/test.rem(1063)
|
||||
REM WARN gg MSG Wookie
|
||||
../tests/test.rem(1069): Trig = Saturday, 16 February, 1991
|
||||
Entering UserFN gg(1)
|
||||
@@ -5973,7 +5973,7 @@ Hello
|
||||
On the next line
|
||||
|
||||
FSET msgsuffix(x) char(8) + " on the same line"
|
||||
../tests/test.rem(1184): Function `msgsuffix' redefined (previously defined at ../tests/test.rem:1181)
|
||||
../tests/test.rem(1184): Function `msgsuffix' redefined: previously defined at ../tests/test.rem(1181)
|
||||
REM MSG Hello
|
||||
../tests/test.rem(1185): Trig = Saturday, 16 February, 1991
|
||||
Entering UserFN msgsuffix(5000)
|
||||
@@ -22389,44 +22389,44 @@ February 29
|
||||
{"date":"2012-01-23","filename":"-","lineno":1,"wd":["Monday"],"priority":5000,"omitfunc":"foo","nonconst_expr":1,"body":"bar"}
|
||||
{"date":"2012-01-30","filename":"-","lineno":1,"wd":["Monday"],"priority":5000,"omitfunc":"foo","nonconst_expr":1,"body":"bar"}
|
||||
# rem2ps2 end
|
||||
-stdin-(7): Number too high
|
||||
-stdin-(7): Number too high
|
||||
-stdin-(7): Number too high
|
||||
-stdin-(7): Number too high
|
||||
-stdin-(7): Number too high
|
||||
-stdin-(7): Number too high
|
||||
-stdin-(7): Number too high
|
||||
-stdin-(7): Number too high
|
||||
-stdin-(7): Number too high
|
||||
-stdin-(7): Number too high
|
||||
-stdin-(7): Number too high
|
||||
-stdin-(7): Number too high
|
||||
-stdin-(7): Number too high
|
||||
-stdin-(7): Number too high
|
||||
-stdin-(7): Number too high
|
||||
-stdin-(7): Number too high
|
||||
-stdin-(7): Number too high
|
||||
-stdin-(7): Number too high
|
||||
-stdin-(7): Number too high
|
||||
-stdin-(7): Number too high
|
||||
-stdin-(7): Number too high
|
||||
-stdin-(7): Number too high
|
||||
-stdin-(7): Number too high
|
||||
-stdin-(7): Number too high
|
||||
-stdin-(7): Number too high
|
||||
-stdin-(7): Number too high
|
||||
-stdin-(7): Number too high
|
||||
-stdin-(7): Number too high
|
||||
-stdin-(7): Number too high
|
||||
-stdin-(7): Number too high
|
||||
-stdin-(7): Number too high
|
||||
-stdin-(7): Number too high
|
||||
-stdin-(8:9): Number too high
|
||||
-stdin-(8:9): Number too high
|
||||
-stdin-(8:9): Number too high
|
||||
-stdin-(8:9): Number too high
|
||||
-stdin-(8:9): Number too high
|
||||
-stdin-(8:9): Number too high
|
||||
-stdin-(8:9): Number too high
|
||||
-stdin-(8:9): Number too high
|
||||
-stdin-(8:9): Number too high
|
||||
-stdin-(8:9): Number too high
|
||||
-stdin-(8:9): Number too high
|
||||
-stdin-(8:9): Number too high
|
||||
-stdin-(8:9): Number too high
|
||||
-stdin-(8:9): Number too high
|
||||
-stdin-(8:9): Number too high
|
||||
-stdin-(8:9): Number too high
|
||||
-stdin-(8:9): Number too high
|
||||
-stdin-(8:9): Number too high
|
||||
-stdin-(8:9): Number too high
|
||||
-stdin-(8:9): Number too high
|
||||
-stdin-(8:9): Number too high
|
||||
-stdin-(8:9): Number too high
|
||||
-stdin-(8:9): Number too high
|
||||
-stdin-(8:9): Number too high
|
||||
-stdin-(8:9): Number too high
|
||||
-stdin-(8:9): Number too high
|
||||
-stdin-(8:9): Number too high
|
||||
-stdin-(8:9): Number too high
|
||||
-stdin-(8:9): Number too high
|
||||
-stdin-(8:9): Number too high
|
||||
-stdin-(8:9): Number too high
|
||||
-stdin-(8:9): Number too high
|
||||
[
|
||||
{
|
||||
"translations":{"LANGID":"en"},"caltype":"monthly","monthname":"January","year":2012,"daysinmonth":31,"firstwkday":0,"mondayfirst":0,"daynames":["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],"prevmonthname":"December","daysinprevmonth":31,"prevmonthyear":2011,"nextmonthname":"February","daysinnextmonth":29,"nextmonthyear":2012,"entries":[
|
||||
{"date":"2012-01-02","filename":"-","lineno":1,"d":2,"priority":5000,"body":"Normal"},
|
||||
{"date":"2012-01-03","filename":"-","lineno":3,"passthru":"COLOR","d":3,"priority":5000,"r":255,"g":0,"b":0,"rawbody":"%\"Red%\" on the calendar!","calendar_body":"Red","plain_body":"Red on the calendar!","body":"255 0 0 %\"Red%\" on the calendar!"},
|
||||
{"date":"2012-01-04","filename":"-","lineno":5,"d":4,"priority":5000,"body":"Normal"}
|
||||
{"date":"2012-01-03","filename":"-","lineno":4,"lineno_start":3,"passthru":"COLOR","d":3,"priority":5000,"r":255,"g":0,"b":0,"rawbody":"%\"Red%\" on the calendar!","calendar_body":"Red","plain_body":"Red on the calendar!","body":"255 0 0 %\"Red%\" on the calendar!"},
|
||||
{"date":"2012-01-04","filename":"-","lineno":6,"d":4,"priority":5000,"body":"Normal"}
|
||||
]
|
||||
}
|
||||
]
|
||||
@@ -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.04
|
||||
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
|
||||
@@ -24491,11 +24491,11 @@ TRANSLATE "Expression evaluation is disabled" ""
|
||||
TRANSLATE "Time limit for expression evaluation exceeded" ""
|
||||
|
||||
# Other Messages
|
||||
TRANSLATE "%s function `%s' defined at %s:%d does not use its argument" ""
|
||||
TRANSLATE "%s function `%s' defined at %s:%d should take 1 argument but actually takes %d" ""
|
||||
TRANSLATE "%s function `%s' defined at %s(%s) does not use its argument" ""
|
||||
TRANSLATE "%s function `%s' defined at %s(%s) should take 1 argument but actually takes %d" ""
|
||||
TRANSLATE "%s is deprecated; use %s instead" ""
|
||||
TRANSLATE "%s(%d): IF without ENDIF" ""
|
||||
TRANSLATE "%s(%d): ["["]#%d] %s function `%s'" ""
|
||||
TRANSLATE "%s(%s): ["["]#%d] %s function `%s'" ""
|
||||
TRANSLATE "(Security note: $RunOff variable tested.)" ""
|
||||
TRANSLATE "Accepting \"%s\" for $Latitude/$Longitude, but you should use the \"C\" locale decimal separator \".\" instead" ""
|
||||
TRANSLATE "Caching directory `%s' listing" ""
|
||||
@@ -24509,8 +24509,8 @@ TRANSLATE "Duplicate INFO headers are not permitted" ""
|
||||
TRANSLATE "Error: THROUGH date earlier than start date" ""
|
||||
TRANSLATE "Executing `%s' for INCLUDECMD and caching as `%s'" ""
|
||||
TRANSLATE "Found cached directory listing for `%s'" ""
|
||||
TRANSLATE "Function `%s' defined at %s:%d should take %d argument%s, but actually takes %d" ""
|
||||
TRANSLATE "Function `%s' redefined (previously defined at %s:%d)" ""
|
||||
TRANSLATE "Function `%s' defined at %s(%s) should take %d argument%s, but actually takes %d" ""
|
||||
TRANSLATE "Function `%s' redefined: previously defined at %s(%s)" ""
|
||||
TRANSLATE "GetValidHebDate: Bad adarbehave value %d" ""
|
||||
TRANSLATE "In" ""
|
||||
TRANSLATE "Invalid INFO string: Must be of the form \"Header: Value\"" ""
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user