diff --git a/man/remind.1.in b/man/remind.1.in index 03e359bb..c61550b9 100644 --- a/man/remind.1.in +++ b/man/remind.1.in @@ -3027,10 +3027,10 @@ The value of \fB$SysInclude\fR is "@prefix@/share/remind" on this installation. .TP .B $T (read-only, DATE type) -Exactly equivalent to \fBtrigdate()\fR. (See BUILT-IN FUNCTIONS.) +Equivalent to \fBtrigdate()\fR. (See BUILT-IN FUNCTIONS.) .TP .B $Tb (read-only, DATE type) -Exactly equivalent to \fBtrigbase()\fR. (See BUILT-IN FUNCTIONS.) +Equivalent to \fBtrigbase()\fR. .TP .B $Td (read-only) Equivalent to \fBday(trigdate())\fR. @@ -3038,6 +3038,9 @@ Equivalent to \fBday(trigdate())\fR. .B $Tm (read-only) Equivalent to \fBmonnum(trigdate())\fR. .TP +.B $Tu (read-only) +Equivalent to \fBtriguntil()\fR. +.TP .B $Tw (read-only) Equivalent to \fBwkdaynum(trigdate())\fR. .TP diff --git a/src/var.c b/src/var.c index dd88bbb3..a3f035b8 100644 --- a/src/var.c +++ b/src/var.c @@ -270,6 +270,19 @@ static int trig_base_func(int do_set, Value *val) return OK; } +static int trig_until_func(int do_set, Value *val) +{ + UNUSED(do_set); + if (LastTrigger.until == NO_UNTIL) { + val->type = INT_TYPE; + val->v.val = -1; + } else { + val->type = DATE_TYPE; + val->v.val = LastTrigger.until; + } + return OK; +} + static int trig_day_func(int do_set, Value *val) { int y, m, d; @@ -1020,6 +1033,7 @@ static SysVar SysVarArr[] = { {"Today", 1, TRANS_TYPE, "today", 0, 0 }, {"Tomorrow", 1, TRANS_TYPE, "tomorrow", 0, 0 }, {"Tt", 0, SPECIAL_TYPE, trig_time_func, 0, 0 }, + {"Tu", 0, SPECIAL_TYPE, trig_until_func, 0, 0 }, {"Tuesday", 1, TRANS_TYPE, "Tuesday", 0, 0 }, {"Tw", 0, SPECIAL_TYPE, trig_wday_func, 0, 0 }, {"Ty", 0, SPECIAL_TYPE, trig_year_func, 0, 0 }, diff --git a/tests/test.cmp b/tests/test.cmp index 73ac586f..355e4786 100644 --- a/tests/test.cmp +++ b/tests/test.cmp @@ -2827,6 +2827,7 @@ $SuppressImplicitWarnings 0 [0, 1] $Today "today" $Tomorrow "tomorrow" $Tt 00:00 + $Tu -1 $Tuesday "Tuesday" $Tw -1 $Ty -1 @@ -24674,6 +24675,7 @@ $Tm $Today $Tomorrow $Tt +$Tu $Tuesday $Tw $Ty