mirror of
https://salsa.debian.org/dskoll/remind.git
synced 2026-04-17 14:59:20 +02:00
Compare commits
13 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e268bbf31d | ||
|
|
5863404de6 | ||
|
|
2de5996f4e | ||
|
|
695e79602a | ||
|
|
cf0d958da5 | ||
|
|
85b0348fa7 | ||
|
|
15a5d9a876 | ||
|
|
1baa6dab0c | ||
|
|
34bb250ba3 | ||
|
|
598b1b7464 | ||
|
|
e63d4be4e8 | ||
|
|
65561e7f34 | ||
|
|
da31dadb71 |
12
configure.in
12
configure.in
@@ -1,6 +1,7 @@
|
|||||||
dnl Process this file with autoconf to produce a configure script.
|
dnl Process this file with autoconf to produce a configure script.
|
||||||
|
|
||||||
AC_INIT(src/queue.c)
|
AC_INIT
|
||||||
|
AC_CONFIG_SRCDIR([src/queue.c])
|
||||||
|
|
||||||
cat <<'EOF'
|
cat <<'EOF'
|
||||||
|
|
||||||
@@ -12,7 +13,7 @@ cat <<'EOF'
|
|||||||
|
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
AC_CONFIG_HEADER(src/config.h)
|
AC_CONFIG_HEADERS([src/config.h])
|
||||||
|
|
||||||
AC_ARG_ENABLE(perl-build-artifacts,
|
AC_ARG_ENABLE(perl-build-artifacts,
|
||||||
[ --disable-perl-build-artifacts
|
[ --disable-perl-build-artifacts
|
||||||
@@ -42,7 +43,7 @@ AC_STRUCT_TM
|
|||||||
|
|
||||||
dnl Checks for library functions.
|
dnl Checks for library functions.
|
||||||
AC_FUNC_UTIME_NULL
|
AC_FUNC_UTIME_NULL
|
||||||
AC_HEADER_TIME
|
AC_CHECK_HEADERS_ONCE([sys/time.h])
|
||||||
|
|
||||||
if test "$GCC" = yes; then
|
if test "$GCC" = yes; then
|
||||||
CFLAGS="$CFLAGS -Wall -Wextra -Wstrict-prototypes"
|
CFLAGS="$CFLAGS -Wall -Wextra -Wstrict-prototypes"
|
||||||
@@ -80,10 +81,11 @@ if test "$?" != 0 ; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
AC_CHECK_FUNCS(setenv unsetenv glob mbstowcs setlocale initgroups)
|
AC_CHECK_FUNCS(setenv unsetenv glob mbstowcs setlocale initgroups)
|
||||||
VERSION=04.02.05
|
VERSION=04.02.06
|
||||||
AC_SUBST(VERSION)
|
AC_SUBST(VERSION)
|
||||||
AC_SUBST(PERL)
|
AC_SUBST(PERL)
|
||||||
AC_SUBST(PERLARTIFACTS)
|
AC_SUBST(PERLARTIFACTS)
|
||||||
AC_SUBST(RELEASE_DATE)
|
AC_SUBST(RELEASE_DATE)
|
||||||
AC_OUTPUT(src/Makefile www/Makefile src/version.h rem2html/Makefile rem2pdf/Makefile.PL rem2pdf/Makefile.top rem2pdf/bin/rem2pdf man/rem.1 man/rem2ps.1 man/remind.1 man/tkremind.1)
|
AC_CONFIG_FILES([src/Makefile www/Makefile src/version.h rem2html/Makefile rem2pdf/Makefile.PL rem2pdf/Makefile.top rem2pdf/bin/rem2pdf man/rem.1 man/rem2ps.1 man/remind.1 man/tkremind.1])
|
||||||
|
AC_OUTPUT
|
||||||
chmod a+x rem2pdf/bin/rem2pdf
|
chmod a+x rem2pdf/bin/rem2pdf
|
||||||
|
|||||||
@@ -1,5 +1,36 @@
|
|||||||
CHANGES TO REMIND
|
CHANGES TO REMIND
|
||||||
|
|
||||||
|
* VERSION 4.2 Patch 6 - 2023-09-12
|
||||||
|
|
||||||
|
- NEW FEATURE: remind: The "nonomitted()" function takes an optional
|
||||||
|
extra INT argument called "step". See man page for details. Also
|
||||||
|
allows the "start" argument to be greater than the "end" argument,
|
||||||
|
in which case they are effectively swapped.
|
||||||
|
|
||||||
|
- NEW FEATURE: remind: The "slide()" function takes an optional extra
|
||||||
|
INT argument called "step", similar to "nonomitted()". See man page
|
||||||
|
for details.
|
||||||
|
|
||||||
|
- NEW FEATURE: remind: Added the $ParseUntriggered system variable;
|
||||||
|
see the man page for details. You almost certainly will never need
|
||||||
|
to use this.
|
||||||
|
|
||||||
|
- NEW FILE: holidays/ie.rem: Added Irish holidays, courtesy of
|
||||||
|
Amy de Buitléir.
|
||||||
|
|
||||||
|
- CHANGE: remind: The "-tn" option sets all REM statement deltas to
|
||||||
|
++n rather than adding n to any existing REM statement's delta.
|
||||||
|
Additionally, the corresponding system variable $DeltaOffset has
|
||||||
|
been renamed to $DeltaOverride.
|
||||||
|
|
||||||
|
- NEW OPTION: remind: Add the "-tz" option to explicitly set all
|
||||||
|
REM statement deltas to zero.
|
||||||
|
|
||||||
|
- DOCUMENTATION FIX: remind: various documentation improvements.
|
||||||
|
|
||||||
|
- BUG FIX: Correct some errors in Italian localization, courtesy of
|
||||||
|
Emanuele Torre
|
||||||
|
|
||||||
* VERSION 4.2 Patch 5 - 2023-04-11
|
* VERSION 4.2 Patch 5 - 2023-04-11
|
||||||
|
|
||||||
- MINOR IMPROVEMENT: remind: If someone uses OMIT yyyy-mm-dd UNTIL yyyy-mm-dd
|
- MINOR IMPROVEMENT: remind: If someone uses OMIT yyyy-mm-dd UNTIL yyyy-mm-dd
|
||||||
|
|||||||
42
include/holidays/ie.rem
Normal file
42
include/holidays/ie.rem
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
;
|
||||||
|
; Irish Holidays
|
||||||
|
;
|
||||||
|
; The dates for the Public ("bank") holidays are taken from the following site:
|
||||||
|
; https://www.citizensinformation.ie/en/employment/employment-rights-and-conditions/leave-and-holidays/public-holidays/
|
||||||
|
;
|
||||||
|
; This file was derived from:
|
||||||
|
; https://github.com/mhwombat/dotWombat/blob/master/.config/remind/IrishHolidays.rem
|
||||||
|
; by Amy de Buitléir.
|
||||||
|
|
||||||
|
; fixed dates
|
||||||
|
OMIT 31 December MSG New Year's Eve (Oíche Chinn Bliana) Public Holiday
|
||||||
|
OMIT 1 January MSG New Year's Day (Lá Caille, Lá Bliana Nua) Public Holiday
|
||||||
|
OMIT 17 March MSG Saint Patrick's Day (Lá Fhéile Pádraig) Public Holiday
|
||||||
|
OMIT 24 December MSG Christmas Eve (Oíche Nollag) Public Holiday
|
||||||
|
OMIT 25 December MSG Christmas Day (Lá Nollag) Public Holiday
|
||||||
|
OMIT 26 December MSG Saint Stephen's Day, Wren Day (Lá Fhéile Stiofáin, Lá an Dreoilín) Public Holiday
|
||||||
|
|
||||||
|
; moving dates
|
||||||
|
|
||||||
|
; First Monday in May
|
||||||
|
REM Monday 1 May SCANFROM -7 ADDOMIT MSG May Day (Lá Bealtaine) Public Holiday
|
||||||
|
|
||||||
|
; First Monday in June
|
||||||
|
REM Monday 1 June SCANFROM -7 ADDOMIT MSG June Public Holiday
|
||||||
|
|
||||||
|
; First Monday in August
|
||||||
|
REM Monday 1 August SCANFROM -7 ADDOMIT MSG August Public Holiday
|
||||||
|
|
||||||
|
; Last Monday in October
|
||||||
|
REM Monday 1 -7 November SCANFROM -7 ADDOMIT MSG October Public Holiday
|
||||||
|
|
||||||
|
; Easter
|
||||||
|
SET easter easterdate(today())
|
||||||
|
REM [TRIGGER(easter-2)] MSG Good Friday (Aoine an Chéasta)
|
||||||
|
REM [TRIGGER(easter)] MSG Easter Sunday (Domhnach Cásca)
|
||||||
|
OMIT [TRIGGER(easter+1)] MSG Easter Monday (Luan Cásca) Public Holiday
|
||||||
|
|
||||||
|
; St. Brigid's Day
|
||||||
|
REM 1 February MSG Saint Brigid's Day (Lá Fhéile Bríde or Imbolc)
|
||||||
|
; The public holiday is the first Monday in February, or 1 February if the date falls on a Friday
|
||||||
|
REM February SCANFROM -7 ADDOMIT SATISFY [($Td==1 && $Tw==5) || ($Td<8 && $Tw==1 && $Td!=4)] MSG Public Holiday
|
||||||
@@ -4,11 +4,11 @@
|
|||||||
# This file is derived from a translation by Valerio Aimale
|
# This file is derived from a translation by Valerio Aimale
|
||||||
|
|
||||||
SET $Sunday "Domenica"
|
SET $Sunday "Domenica"
|
||||||
SET $Monday "Lunedí"
|
SET $Monday "Lunedì"
|
||||||
SET $Tuesday "Martedí"
|
SET $Tuesday "Martedì"
|
||||||
SET $Wednesday "Mercoledí"
|
SET $Wednesday "Mercoledì"
|
||||||
SET $Thursday "Giovedí"
|
SET $Thursday "Giovedì"
|
||||||
SET $Friday "Venerdí"
|
SET $Friday "Venerdì"
|
||||||
SET $Saturday "Sabato"
|
SET $Saturday "Sabato"
|
||||||
|
|
||||||
SET $January "Gennaio"
|
SET $January "Gennaio"
|
||||||
@@ -40,7 +40,7 @@ SET $Now "ora"
|
|||||||
SET $At "alle"
|
SET $At "alle"
|
||||||
SET $Minute "minuto"
|
SET $Minute "minuto"
|
||||||
SET $Hour "ora"
|
SET $Hour "ora"
|
||||||
SET $Is "é"
|
SET $Is "è"
|
||||||
SET $Was "era"
|
SET $Was "era"
|
||||||
SET $And "e"
|
SET $And "e"
|
||||||
SET $Hplu "a"
|
SET $Hplu "a"
|
||||||
|
|||||||
101
man/remind.1.in
101
man/remind.1.in
@@ -60,7 +60,9 @@ weeks to be produced.
|
|||||||
.B 'a'
|
.B 'a'
|
||||||
causes \fBRemind\fR to display reminders on the calendar on the
|
causes \fBRemind\fR to display reminders on the calendar on the
|
||||||
day they actually occur \fIas well as\fR on any preceding days
|
day they actually occur \fIas well as\fR on any preceding days
|
||||||
specified by the reminder's \fIdelta\fR.
|
specified by the reminder's \fIdelta\fR. This \fIalso\fR causes
|
||||||
|
\fBRemind\fR to include text outside %"...%" sequences that would
|
||||||
|
otherwise be removed (though the actual %" markers themseves are removed.)
|
||||||
.TP
|
.TP
|
||||||
.B 'l'
|
.B 'l'
|
||||||
causes \fBRemind\fR to use VT100 line-drawing characters to draw
|
causes \fBRemind\fR to use VT100 line-drawing characters to draw
|
||||||
@@ -222,8 +224,14 @@ regardless of the \fIdelta\fR supplied for each reminder.
|
|||||||
.TP
|
.TP
|
||||||
.B \-t\fR\fIn\fR
|
.B \-t\fR\fIn\fR
|
||||||
If you supply a number \fIn\fR after the \fB\-t\fR option, then
|
If you supply a number \fIn\fR after the \fB\-t\fR option, then
|
||||||
\fBRemind\fR pretends that each non-expired reminder has a \fIdelta\fR
|
\fBRemind\fR pretends that echo \fBREM\fR command has a delta
|
||||||
of \fIn\fR days and triggers reminders accordingly.
|
of \+\+\fIn\fR, regardles of any existing delta.
|
||||||
|
.TP
|
||||||
|
.B \-tz\fR
|
||||||
|
If you supply the letter \fBz\fR after the \fB\-t\fR option, then
|
||||||
|
\fBRemind\fR sets all REM statements' deltas to zero, regardless of the
|
||||||
|
value supplied in the REM statement itself. In effect, this disables
|
||||||
|
all deltas of the form \fB\+\fIn\fR and \fB\+\+\fIn\fR.
|
||||||
.TP
|
.TP
|
||||||
.B \-tt\fR[\fIn\fR]
|
.B \-tt\fR[\fIn\fR]
|
||||||
The \fB-tt\fR option causes \fBRemind\fR to assume a default delta of
|
The \fB-tt\fR option causes \fBRemind\fR to assume a default delta of
|
||||||
@@ -2577,6 +2585,28 @@ by \fBREM\fR commands; triggers in \fBIFTRIG\fR commands do
|
|||||||
not affect it.
|
not affect it.
|
||||||
.RE
|
.RE
|
||||||
.TP
|
.TP
|
||||||
|
.B $ParseUntriggered
|
||||||
|
A flag indicating whether or not \fBRemind\fR should fully parse \fBREM\fR
|
||||||
|
statements that are not triggered. 0 means to skip parsing them and 1
|
||||||
|
(the default) means to parse them.
|
||||||
|
.PP
|
||||||
|
.RS
|
||||||
|
For example, if we have the following \fBREM\fR statement:
|
||||||
|
.PP
|
||||||
|
.nf
|
||||||
|
REM 2020-01-01 MSG ["bad_expression" * 2]
|
||||||
|
.fi
|
||||||
|
.PP
|
||||||
|
Then by default, \fBRemind\fR will fully parse the line and issue
|
||||||
|
a "Type mismatch" error even if the reminder is not triggered. However,
|
||||||
|
if \fB$ParseUntriggered\fR is set to 0, then \fBRemind\fR will not
|
||||||
|
issue the error except on 2020-01-01, when the reminder is triggered.
|
||||||
|
.PP
|
||||||
|
Setting \fB$ParseUntriggered\fR to 0 may in some cases slightly
|
||||||
|
improve performance, at the risk of not catching errors until a
|
||||||
|
reminder is triggered.
|
||||||
|
.RE
|
||||||
|
.TP
|
||||||
.B $PrefixLineNo (read-only)
|
.B $PrefixLineNo (read-only)
|
||||||
If non-zero, then the \fB\-l\fR option was supplied on the command line.
|
If non-zero, then the \fB\-l\fR option was supplied on the command line.
|
||||||
.TP
|
.TP
|
||||||
@@ -3258,14 +3288,31 @@ is supplied, only the date component is used.
|
|||||||
Returns the time of "nautical twilight" on the specified \fIdate\fR. If
|
Returns the time of "nautical twilight" on the specified \fIdate\fR. If
|
||||||
\fIdate\fR is omitted, defaults to \fBtoday()\fR.
|
\fIdate\fR is omitted, defaults to \fBtoday()\fR.
|
||||||
.TP
|
.TP
|
||||||
.B nonomitted(dq_start, dq_end [,s_wkday...])
|
.B nonomitted(dq_start, dq_end [, i_step] [,s_wkday...])
|
||||||
This function returns the number of \fInon-\fRomitted days between
|
This function returns the number of \fInon-\fRomitted days between
|
||||||
\fIstart\fR and \fIend\fR. If \fIstart\fR is non-omitted, then it is
|
\fIstart\fR and \fIend\fR. If \fIstart\fR is non-omitted, then it is
|
||||||
counted. \fIend\fR is never counted.
|
counted. \fIend\fR is never counted.
|
||||||
.RS
|
.RS
|
||||||
.PP
|
.PP
|
||||||
Note that \fIend\fR must be greater than or equal to \fIstart\fR or an
|
Note that if \fIend\fR is less than \ffIstart\fR, the arguments
|
||||||
error is reported. In addition to using the global OMIT context, you
|
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
|
||||||
|
\fBnonomitted\fR counts. For example the following expression:
|
||||||
|
.PP
|
||||||
|
.nf
|
||||||
|
nonomitted('2023-07-01', '2023-07-29', 7)
|
||||||
|
.fi
|
||||||
|
.PP
|
||||||
|
returns the number of non-omitted Saturdays from 2023-07-01 up to
|
||||||
|
(but not including) 2023-07-29. (Both 2023-07-01 and 2023-07-29 are
|
||||||
|
Saturdays.)
|
||||||
|
.PP
|
||||||
|
If no \fIstep\fR argument is supplied, then a step of 1 is used.
|
||||||
|
.PP
|
||||||
|
In addition to using the global OMIT context, you
|
||||||
can supply additional arguments that are names of weekdays to be
|
can supply additional arguments that are names of weekdays to be
|
||||||
omitted. However, in a \fBREM\fR command, any local \fBOMITFUNC\fR
|
omitted. However, in a \fBREM\fR command, any local \fBOMITFUNC\fR
|
||||||
clause is \fInot\fR taken into account by this function.
|
clause is \fInot\fR taken into account by this function.
|
||||||
@@ -3486,10 +3533,13 @@ will set \fBa\fR to:
|
|||||||
.fi
|
.fi
|
||||||
|
|
||||||
.TP
|
.TP
|
||||||
.B slide(d_start, i_amt [,s_wkday...])
|
.B slide(d_start, i_amt [, i_step] [,s_wkday...])
|
||||||
This function is the inverse of \fBnonomitted\fR. It adds \fIamt\fR
|
This function is the inverse of \fBnonomitted\fR. It adds \fIamt\fR
|
||||||
days (which can be negative) to \fIstart\fR, \fInot counting omitted days\fR.
|
(which can be negative) chunks of \fIstep\fR days to \fIstart\fR,
|
||||||
The optional \fIwkday\fR arguments are additional weekday names to omit.
|
\fInot counting omitted days\fR. If \fIstep\fR is not supplied, then
|
||||||
|
it is assumed to be 1. Note that only every \fIstep\fRth day is
|
||||||
|
tested to see if it is omitted. The optional \fIwkday\fR arguments
|
||||||
|
are additional weekday names to omit.
|
||||||
.RS
|
.RS
|
||||||
.PP
|
.PP
|
||||||
Consider this example:
|
Consider this example:
|
||||||
@@ -3509,6 +3559,26 @@ May 16 and 17. You can go backwards, too, so:
|
|||||||
.fi
|
.fi
|
||||||
.PP
|
.PP
|
||||||
takes \fIa\fR back to 2009-05-13.
|
takes \fIa\fR back to 2009-05-13.
|
||||||
|
.PP
|
||||||
|
Now consider this example:
|
||||||
|
.PP
|
||||||
|
.nf
|
||||||
|
OMIT 14 May 2009
|
||||||
|
SET a slide('2009-05-07', 2, 7)
|
||||||
|
.fi
|
||||||
|
.PP
|
||||||
|
This sets \fIa\fR to '2009-05-28' because we skip ahead two weeks, not
|
||||||
|
counting a week where the day we land on happens to be omitted. Contrast with
|
||||||
|
this:
|
||||||
|
.PP
|
||||||
|
.nf
|
||||||
|
OMIT 13 May 2009
|
||||||
|
SET a slide('2009-05-07', 2, 7)
|
||||||
|
.fi
|
||||||
|
.PP
|
||||||
|
which sets \fIa\fR to '2009-05-21'. Although 2009-05-13 is omitted, we
|
||||||
|
don't "land" on it as we step forward in chunks of 7 days, so we never
|
||||||
|
see that it is omitted.
|
||||||
.RE
|
.RE
|
||||||
.TP
|
.TP
|
||||||
.B soleq(i_which [, dqi_start])
|
.B soleq(i_which [, dqi_start])
|
||||||
@@ -4216,7 +4286,7 @@ you define a function taking no parameters. Here are some examples:
|
|||||||
.nf
|
.nf
|
||||||
FSET double(x) 2*x
|
FSET double(x) 2*x
|
||||||
FSET yeardiff(date1, date2) year(date1) - year(date2)
|
FSET yeardiff(date1, date2) year(date1) - year(date2)
|
||||||
FSET since(x) ord(year(trigdate())\-x)
|
FSET since(x) ord($Ty \- x)
|
||||||
.fi
|
.fi
|
||||||
.PP
|
.PP
|
||||||
The last function is useful in birthday reminders. For example:
|
The last function is useful in birthday reminders. For example:
|
||||||
@@ -4231,6 +4301,12 @@ Dean was born in 1984. The above example, on 1 November 1992, would print:
|
|||||||
Dean's 8th birthday is today.
|
Dean's 8th birthday is today.
|
||||||
.fi
|
.fi
|
||||||
.PP
|
.PP
|
||||||
|
Similarly, the function is useful in anniversary reminders. For example:
|
||||||
|
.PP
|
||||||
|
.nf
|
||||||
|
REM 4 June MSG [since(1989)] anniversary of the Tiananmen Square massacre
|
||||||
|
.fi
|
||||||
|
.PP
|
||||||
Notes:
|
Notes:
|
||||||
.TP
|
.TP
|
||||||
o
|
o
|
||||||
@@ -5538,7 +5614,7 @@ after the WEEK keyword.
|
|||||||
.PP
|
.PP
|
||||||
.SH MISCELLANEOUS
|
.SH MISCELLANEOUS
|
||||||
.PP
|
.PP
|
||||||
.B COMMAND ABBREVIATIONS
|
.B COMMAND AND KEYWORD ABBREVIATIONS
|
||||||
.PP
|
.PP
|
||||||
The following tokens can be abbreviated:
|
The following tokens can be abbreviated:
|
||||||
.TP
|
.TP
|
||||||
@@ -5565,6 +5641,9 @@ o
|
|||||||
\fBINCLUDE\fR --> \fBINC\fR
|
\fBINCLUDE\fR --> \fBINC\fR
|
||||||
.TP
|
.TP
|
||||||
o
|
o
|
||||||
|
\fBMAYBE-UNCOMPUTABLE\fR --> \fBMAYBE\fR
|
||||||
|
.TP
|
||||||
|
o
|
||||||
\fBSCANFROM\fR --> \fBSCAN\fR
|
\fBSCANFROM\fR --> \fBSCAN\fR
|
||||||
.PP
|
.PP
|
||||||
.B NIFTY EXAMPLES
|
.B NIFTY EXAMPLES
|
||||||
|
|||||||
29
src/dorem.c
29
src/dorem.c
@@ -199,9 +199,11 @@ int DoRem(ParsePtr p)
|
|||||||
} else {
|
} else {
|
||||||
/* Parse the rest of the line to catch any potential
|
/* Parse the rest of the line to catch any potential
|
||||||
expression-pasting errors */
|
expression-pasting errors */
|
||||||
while (ParseChar(p, &r, 0)) {
|
if (ParseUntriggered) {
|
||||||
if (r != 0) {
|
while (ParseChar(p, &r, 0)) {
|
||||||
break;
|
if (r != 0) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1200,19 +1202,28 @@ int ShouldTriggerReminder(Trigger *t, TimeTrig *tim, int dse, int *err)
|
|||||||
/* If "infinite delta" option is chosen, always trigger future reminders */
|
/* If "infinite delta" option is chosen, always trigger future reminders */
|
||||||
if (InfiniteDelta || NextMode) return 1;
|
if (InfiniteDelta || NextMode) return 1;
|
||||||
|
|
||||||
/* If there's a "warn" function, it overrides any deltas */
|
/* If there's a "warn" function, it overrides any deltas except
|
||||||
|
* DeltaOverride*/
|
||||||
if (t->warn[0] != 0) {
|
if (t->warn[0] != 0) {
|
||||||
if (DeltaOffset) {
|
if (DeltaOverride > 0) {
|
||||||
if (dse <= DSEToday + DeltaOffset) {
|
if (dse <= DSEToday + DeltaOverride) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return ShouldTriggerBasedOnWarn(t, dse, err);
|
return ShouldTriggerBasedOnWarn(t, dse, err);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Zero delta */
|
||||||
|
if (DeltaOverride < 0) {
|
||||||
|
return dse == DSEToday;
|
||||||
|
}
|
||||||
|
|
||||||
/* Move back by delta days, if any */
|
/* Move back by delta days, if any */
|
||||||
if (t->delta != NO_DELTA) {
|
if (DeltaOverride) {
|
||||||
if (t->delta < 0)
|
/* A positive DeltaOverride takes precedence over everything */
|
||||||
|
dse = dse - DeltaOverride;
|
||||||
|
} else if (t->delta != NO_DELTA) {
|
||||||
|
if (t->delta < 0)
|
||||||
dse = dse + t->delta;
|
dse = dse + t->delta;
|
||||||
else {
|
else {
|
||||||
int iter = 0;
|
int iter = 0;
|
||||||
@@ -1237,7 +1248,7 @@ int ShouldTriggerReminder(Trigger *t, TimeTrig *tim, int dse, int *err)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Should we trigger the reminder? */
|
/* Should we trigger the reminder? */
|
||||||
return (dse <= DSEToday + DeltaOffset);
|
return (dse <= DSEToday);
|
||||||
}
|
}
|
||||||
|
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
|
|||||||
32
src/funcs.c
32
src/funcs.c
@@ -3290,6 +3290,8 @@ FSlide(func_info *info)
|
|||||||
{
|
{
|
||||||
int r, omit, d, i, localomit, amt;
|
int r, omit, d, i, localomit, amt;
|
||||||
Token tok;
|
Token tok;
|
||||||
|
int step = 1;
|
||||||
|
int localargs = 2;
|
||||||
|
|
||||||
if (!HASDATE(ARG(0))) return E_BAD_TYPE;
|
if (!HASDATE(ARG(0))) return E_BAD_TYPE;
|
||||||
ASSERT_TYPE(1, INT_TYPE);
|
ASSERT_TYPE(1, INT_TYPE);
|
||||||
@@ -3299,8 +3301,13 @@ FSlide(func_info *info)
|
|||||||
if (amt > 1000000) return E_2HIGH;
|
if (amt > 1000000) return E_2HIGH;
|
||||||
if (amt < -1000000) return E_2LOW;
|
if (amt < -1000000) return E_2LOW;
|
||||||
|
|
||||||
|
if (Nargs > 2 && ARG(2).type == INT_TYPE) {
|
||||||
|
step = ARGV(2);
|
||||||
|
if (step < 1) return E_2LOW;
|
||||||
|
localargs++;
|
||||||
|
}
|
||||||
localomit = 0;
|
localomit = 0;
|
||||||
for (i=2; i<Nargs; i++) {
|
for (i=localargs; i<Nargs; i++) {
|
||||||
if (ARG(i).type != STR_TYPE) return E_BAD_TYPE;
|
if (ARG(i).type != STR_TYPE) return E_BAD_TYPE;
|
||||||
FindToken(ARG(i).v.str, &tok);
|
FindToken(ARG(i).v.str, &tok);
|
||||||
if (tok.type != T_WkDay) return E_UNKNOWN_TOKEN;
|
if (tok.type != T_WkDay) return E_UNKNOWN_TOKEN;
|
||||||
@@ -3311,14 +3318,14 @@ FSlide(func_info *info)
|
|||||||
if ((WeekdayOmits | localomit) == 0x7F && amt != 0) return E_2MANY_LOCALOMIT;
|
if ((WeekdayOmits | localomit) == 0x7F && amt != 0) return E_2MANY_LOCALOMIT;
|
||||||
if (amt > 0) {
|
if (amt > 0) {
|
||||||
while(amt) {
|
while(amt) {
|
||||||
d++;
|
d += step;
|
||||||
r = IsOmitted(d, localomit, NULL, &omit);
|
r = IsOmitted(d, localomit, NULL, &omit);
|
||||||
if (r) return r;
|
if (r) return r;
|
||||||
if (!omit) amt--;
|
if (!omit) amt--;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
while(amt) {
|
while(amt) {
|
||||||
d--;
|
d -= step;
|
||||||
if (d < 0) return E_DATE_OVER;
|
if (d < 0) return E_DATE_OVER;
|
||||||
r = IsOmitted(d, localomit, NULL, &omit);
|
r = IsOmitted(d, localomit, NULL, &omit);
|
||||||
if (r) return r;
|
if (r) return r;
|
||||||
@@ -3335,6 +3342,8 @@ FNonomitted(func_info *info)
|
|||||||
{
|
{
|
||||||
int d1, d2, ans, localomit, i;
|
int d1, d2, ans, localomit, i;
|
||||||
int omit, r;
|
int omit, r;
|
||||||
|
int step = 1;
|
||||||
|
int localargs = 2;
|
||||||
Token tok;
|
Token tok;
|
||||||
|
|
||||||
if (!HASDATE(ARG(0)) ||
|
if (!HASDATE(ARG(0)) ||
|
||||||
@@ -3343,10 +3352,20 @@ FNonomitted(func_info *info)
|
|||||||
}
|
}
|
||||||
d1 = DATEPART(ARG(0));
|
d1 = DATEPART(ARG(0));
|
||||||
d2 = DATEPART(ARG(1));
|
d2 = DATEPART(ARG(1));
|
||||||
if (d2 < d1) return E_2LOW;
|
if (d2 < d1) {
|
||||||
|
i = d1;
|
||||||
|
d1 = d2;
|
||||||
|
d2 = i;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Check for a "step" argument - it's an INT */
|
||||||
|
if (Nargs > 2 && ARG(2).type == INT_TYPE) {
|
||||||
|
step = ARGV(2);
|
||||||
|
if (step < 1) return E_2LOW;
|
||||||
|
localargs++;
|
||||||
|
}
|
||||||
localomit = 0;
|
localomit = 0;
|
||||||
for (i=2; i<Nargs; i++) {
|
for (i=localargs; i<Nargs; i++) {
|
||||||
if (ARG(i).type != STR_TYPE) return E_BAD_TYPE;
|
if (ARG(i).type != STR_TYPE) return E_BAD_TYPE;
|
||||||
FindToken(ARG(i).v.str, &tok);
|
FindToken(ARG(i).v.str, &tok);
|
||||||
if (tok.type != T_WkDay) return E_UNKNOWN_TOKEN;
|
if (tok.type != T_WkDay) return E_UNKNOWN_TOKEN;
|
||||||
@@ -3355,11 +3374,12 @@ FNonomitted(func_info *info)
|
|||||||
|
|
||||||
ans = 0;
|
ans = 0;
|
||||||
while (d1 < d2) {
|
while (d1 < d2) {
|
||||||
r = IsOmitted(d1++, localomit, NULL, &omit);
|
r = IsOmitted(d1, localomit, NULL, &omit);
|
||||||
if (r) return r;
|
if (r) return r;
|
||||||
if (!omit) {
|
if (!omit) {
|
||||||
ans++;
|
ans++;
|
||||||
}
|
}
|
||||||
|
d1 += step;
|
||||||
}
|
}
|
||||||
RetVal.type = INT_TYPE;
|
RetVal.type = INT_TYPE;
|
||||||
RETVAL = ans;
|
RETVAL = ans;
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ EXTERN INIT( int Hush, 0);
|
|||||||
EXTERN INIT( int NextMode, 0);
|
EXTERN INIT( int NextMode, 0);
|
||||||
EXTERN INIT( int InfiniteDelta, 0);
|
EXTERN INIT( int InfiniteDelta, 0);
|
||||||
EXTERN INIT( int DefaultTDelta, 0);
|
EXTERN INIT( int DefaultTDelta, 0);
|
||||||
EXTERN INIT( int DeltaOffset, 0);
|
EXTERN INIT( int DeltaOverride, 0);
|
||||||
EXTERN INIT( int RunDisabled, 0);
|
EXTERN INIT( int RunDisabled, 0);
|
||||||
EXTERN INIT( int IgnoreOnce, 0);
|
EXTERN INIT( int IgnoreOnce, 0);
|
||||||
EXTERN INIT( int SortByTime, 0);
|
EXTERN INIT( int SortByTime, 0);
|
||||||
@@ -79,6 +79,7 @@ EXTERN INIT( int SortByPrio, 0);
|
|||||||
EXTERN INIT( int UntimedBeforeTimed, 0);
|
EXTERN INIT( int UntimedBeforeTimed, 0);
|
||||||
EXTERN INIT( int DefaultPrio, NO_PRIORITY);
|
EXTERN INIT( int DefaultPrio, NO_PRIORITY);
|
||||||
EXTERN INIT( long SysTime, -1L);
|
EXTERN INIT( long SysTime, -1L);
|
||||||
|
EXTERN INIT( int ParseUntriggered, 1);
|
||||||
|
|
||||||
EXTERN char const *InitialFile;
|
EXTERN char const *InitialFile;
|
||||||
EXTERN int FileAccessDate;
|
EXTERN int FileAccessDate;
|
||||||
|
|||||||
13
src/init.c
13
src/init.c
@@ -341,10 +341,15 @@ void InitRemind(int argc, char const *argv[])
|
|||||||
} else if (!*arg) {
|
} else if (!*arg) {
|
||||||
InfiniteDelta = 1;
|
InfiniteDelta = 1;
|
||||||
} else {
|
} else {
|
||||||
PARSENUM(DeltaOffset, arg);
|
if (*arg == 'z') {
|
||||||
if (DeltaOffset < 0) {
|
DeltaOverride = -1;
|
||||||
DeltaOffset = 0;
|
arg++;
|
||||||
}
|
} else {
|
||||||
|
PARSENUM(DeltaOverride, arg);
|
||||||
|
if (DeltaOverride < 0) {
|
||||||
|
DeltaOverride = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'e':
|
case 'e':
|
||||||
|
|||||||
@@ -17,11 +17,11 @@
|
|||||||
|
|
||||||
/* Day names */
|
/* Day names */
|
||||||
#define L_SUNDAY "Domenica"
|
#define L_SUNDAY "Domenica"
|
||||||
#define L_MONDAY "Lunedí"
|
#define L_MONDAY "Lunedì"
|
||||||
#define L_TUESDAY "Martedí"
|
#define L_TUESDAY "Martedì"
|
||||||
#define L_WEDNESDAY "Mercoledí"
|
#define L_WEDNESDAY "Mercoledì"
|
||||||
#define L_THURSDAY "Giovedí"
|
#define L_THURSDAY "Giovedì"
|
||||||
#define L_FRIDAY "Venerdí"
|
#define L_FRIDAY "Venerdì"
|
||||||
#define L_SATURDAY "Sabato"
|
#define L_SATURDAY "Sabato"
|
||||||
|
|
||||||
/* Month names */
|
/* Month names */
|
||||||
@@ -68,7 +68,7 @@
|
|||||||
#define L_AT "alle"
|
#define L_AT "alle"
|
||||||
#define L_MINUTE "minut"
|
#define L_MINUTE "minut"
|
||||||
#define L_HOUR "or"
|
#define L_HOUR "or"
|
||||||
#define L_IS "é"
|
#define L_IS "è"
|
||||||
#define L_WAS "era"
|
#define L_WAS "era"
|
||||||
#define L_AND "e"
|
#define L_AND "e"
|
||||||
/* What to add to make "hour" plural */
|
/* What to add to make "hour" plural */
|
||||||
|
|||||||
10
src/main.c
10
src/main.c
@@ -26,16 +26,10 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#ifdef TIME_WITH_SYS_TIME
|
#if defined(HAVE_SYS_TIME_H)
|
||||||
#include <time.h>
|
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#else
|
#endif
|
||||||
#if defined(HAVE_SYS_TIME_H) || defined (TIME_WITH_SYS_TIME)
|
|
||||||
#include <sys/time.h>
|
|
||||||
#else
|
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#ifdef REM_USE_WCHAR
|
#ifdef REM_USE_WCHAR
|
||||||
|
|||||||
@@ -792,7 +792,7 @@ static SysVar SysVarArr[] = {
|
|||||||
{"DefaultColor", 1, SPECIAL_TYPE, default_color_func, 0, 0 },
|
{"DefaultColor", 1, SPECIAL_TYPE, default_color_func, 0, 0 },
|
||||||
{"DefaultPrio", 1, INT_TYPE, &DefaultPrio, 0, 9999 },
|
{"DefaultPrio", 1, INT_TYPE, &DefaultPrio, 0, 9999 },
|
||||||
{"DefaultTDelta", 1, INT_TYPE, &DefaultTDelta, 0, 1440 },
|
{"DefaultTDelta", 1, INT_TYPE, &DefaultTDelta, 0, 1440 },
|
||||||
{"DeltaOffset", 0, INT_TYPE, &DeltaOffset, 0, 0 },
|
{"DeltaOverride", 0, INT_TYPE, &DeltaOverride, 0, 0 },
|
||||||
{"DontFork", 0, INT_TYPE, &DontFork, 0, 0 },
|
{"DontFork", 0, INT_TYPE, &DontFork, 0, 0 },
|
||||||
{"DontQueue", 0, INT_TYPE, &DontQueue, 0, 0 },
|
{"DontQueue", 0, INT_TYPE, &DontQueue, 0, 0 },
|
||||||
{"DontTrigAts", 0, INT_TYPE, &DontIssueAts, 0, 0 },
|
{"DontTrigAts", 0, INT_TYPE, &DontIssueAts, 0, 0 },
|
||||||
@@ -839,6 +839,7 @@ static SysVar SysVarArr[] = {
|
|||||||
{"NumTrig", 0, INT_TYPE, &NumTriggered, 0, 0 },
|
{"NumTrig", 0, INT_TYPE, &NumTriggered, 0, 0 },
|
||||||
{"October", 1, STR_TYPE, &DynamicMonthName[9], 0, 0 },
|
{"October", 1, STR_TYPE, &DynamicMonthName[9], 0, 0 },
|
||||||
{"On", 1, STR_TYPE, &DynamicOn, 0, 0 },
|
{"On", 1, STR_TYPE, &DynamicOn, 0, 0 },
|
||||||
|
{"ParseUntriggered", 1, INT_TYPE, &ParseUntriggered, 0, 1 },
|
||||||
{"Pm", 1, STR_TYPE, &DynamicPm, 0, 0 },
|
{"Pm", 1, STR_TYPE, &DynamicPm, 0, 0 },
|
||||||
{"PrefixLineNo", 0, INT_TYPE, &DoPrefixLineNo, 0, 0 },
|
{"PrefixLineNo", 0, INT_TYPE, &DoPrefixLineNo, 0, 0 },
|
||||||
{"PSCal", 0, INT_TYPE, &PsCal, 0, 0 },
|
{"PSCal", 0, INT_TYPE, &PsCal, 0, 0 },
|
||||||
|
|||||||
@@ -408,6 +408,18 @@ TZ=Europe/Berlin ../src/remind -dxe ../tests/tz.rem >> ../tests/test.out 2>&1
|
|||||||
# Test that banner is printed on every iteration
|
# Test that banner is printed on every iteration
|
||||||
echo "MSG Should be three banners." | ../src/remind - 2022-10-20 '*3' >> ../tests/test.out 2>&1
|
echo "MSG Should be three banners." | ../src/remind - 2022-10-20 '*3' >> ../tests/test.out 2>&1
|
||||||
|
|
||||||
|
# Test the -tn option
|
||||||
|
echo "REM May 23 +10 MSG Orange %b" | ../src/remind - 2023-05-21 >> ../tests/test.out 2>&1
|
||||||
|
echo "REM May 23 +10 MSG Quux %b" | ../src/remind -t1 - 2023-05-21 >> ../tests/test.out 2>&1
|
||||||
|
echo "REM May 23 +10 MSG Cabbage %b" | ../src/remind -t2 - 2023-05-21 >> ../tests/test.out 2>&1
|
||||||
|
echo "REM May 23 MSG Banana %b" | ../src/remind - 2023-05-21 >> ../tests/test.out 2>&1
|
||||||
|
echo "REM May 23 MSG Carrot %b" | ../src/remind -t1 - 2023-05-21 >> ../tests/test.out 2>&1
|
||||||
|
echo "REM May 23 MSG Apple %b" | ../src/remind -t2 - 2023-05-21 >> ../tests/test.out 2>&1
|
||||||
|
|
||||||
|
# Test the -tz option
|
||||||
|
echo "REM May 22 +10 MSG Foo %b" | ../src/remind - 2023-05-21 >> ../tests/test.out 2>&1
|
||||||
|
echo "REM May 22 +10 MSG Bar %b" | ../src/remind -tz - 2023-05-21 >> ../tests/test.out 2>&1
|
||||||
|
|
||||||
# World-writable file
|
# World-writable file
|
||||||
rm -rf include_dir/ww
|
rm -rf include_dir/ww
|
||||||
touch include_dir/ww
|
touch include_dir/ww
|
||||||
|
|||||||
1169
tests/test.cmp
1169
tests/test.cmp
File diff suppressed because it is too large
Load Diff
@@ -482,7 +482,7 @@ msg [$December]%
|
|||||||
msg [$DefaultColor]%
|
msg [$DefaultColor]%
|
||||||
msg [$DefaultPrio]%
|
msg [$DefaultPrio]%
|
||||||
msg [$DefaultTDelta]%
|
msg [$DefaultTDelta]%
|
||||||
msg [$DeltaOffset]%
|
msg [$DeltaOverride]%
|
||||||
msg [$DontFork]%
|
msg [$DontFork]%
|
||||||
msg [$DontQueue]%
|
msg [$DontQueue]%
|
||||||
msg [$DontTrigAts]%
|
msg [$DontTrigAts]%
|
||||||
@@ -881,6 +881,12 @@ set a htmlstriptags("This is <unclosed whut?")
|
|||||||
set a htmlstriptags("this is > whut <b>foo</b>")
|
set a htmlstriptags("this is > whut <b>foo</b>")
|
||||||
set a htmlstriptags("<img src=\"foo\">")
|
set a htmlstriptags("<img src=\"foo\">")
|
||||||
|
|
||||||
|
# $ParseUntriggered
|
||||||
|
REM 2 Jan 1990 MSG ["bad_expr" * 2]
|
||||||
|
SET $ParseUntriggered 0
|
||||||
|
REM 2 Jan 1990 MSG ["bad_expr" * 2]
|
||||||
|
SET $ParseUntriggered 1
|
||||||
|
|
||||||
# Don't want Remind to queue reminders
|
# Don't want Remind to queue reminders
|
||||||
EXIT
|
EXIT
|
||||||
|
|
||||||
|
|||||||
@@ -26,6 +26,25 @@ REM 12 AUG SPECIAL MOON 0
|
|||||||
# Test nonomitted
|
# Test nonomitted
|
||||||
REM MSG [nonomitted('2007-08-01', today())] NonOmit-1
|
REM MSG [nonomitted('2007-08-01', today())] NonOmit-1
|
||||||
REM MSG [nonomitted('2007-08-01', today(), "Sat", "Sun")] NonOmit-2
|
REM MSG [nonomitted('2007-08-01', today(), "Sat", "Sun")] NonOmit-2
|
||||||
|
REM MSG [nonomitted('2007-08-01', '2007-08-30', 7)]
|
||||||
|
REM MSG [nonomitted('2007-08-01', '2007-08-29', 7)]
|
||||||
|
REM MSG [nonomitted('2007-08-28', '2007-08-01', 7)]
|
||||||
|
|
||||||
|
PUSH-OMIT-CONTEXT
|
||||||
|
OMIT 2007-08-15
|
||||||
|
REM MSG [nonomitted('2007-08-01', '2007-08-30', 7)]
|
||||||
|
REM MSG [nonomitted('2007-08-01', '2007-08-29', 7)]
|
||||||
|
REM MSG [nonomitted('2007-08-01', '2007-08-28', 7)]
|
||||||
|
POP-OMIT-CONTEXT
|
||||||
|
|
||||||
|
# Test slide
|
||||||
|
REM MSG [slide('2007-08-03', 4)]
|
||||||
|
REM MSG [slide('2007-08-03', 4, 7)]
|
||||||
|
|
||||||
|
PUSH-OMIT-CONTEXT
|
||||||
|
OMIT 2007-08-17
|
||||||
|
REM MSG [slide('2007-08-03', 4, 7)]
|
||||||
|
POP-OMIT-CONTEXT
|
||||||
|
|
||||||
# Test SPECIAL COLOR with an AT clause
|
# Test SPECIAL COLOR with an AT clause
|
||||||
REM 20 AUG AT 13:45 SPECIAL COLOR 6 7 8 Mooo!
|
REM 20 AUG AT 13:45 SPECIAL COLOR 6 7 8 Mooo!
|
||||||
|
|||||||
Reference in New Issue
Block a user