mirror of
https://salsa.debian.org/dskoll/remind.git
synced 2026-04-16 14:28:40 +02:00
Add $ParseUntriggered system variable.
This commit is contained in:
@@ -2585,6 +2585,28 @@ by \fBREM\fR commands; triggers in \fBIFTRIG\fR commands do
|
||||
not affect it.
|
||||
.RE
|
||||
.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)
|
||||
If non-zero, then the \fB\-l\fR option was supplied on the command line.
|
||||
.TP
|
||||
|
||||
@@ -199,9 +199,11 @@ int DoRem(ParsePtr p)
|
||||
} else {
|
||||
/* Parse the rest of the line to catch any potential
|
||||
expression-pasting errors */
|
||||
while (ParseChar(p, &r, 0)) {
|
||||
if (r != 0) {
|
||||
break;
|
||||
if (ParseUntriggered) {
|
||||
while (ParseChar(p, &r, 0)) {
|
||||
if (r != 0) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -79,6 +79,7 @@ EXTERN INIT( int SortByPrio, 0);
|
||||
EXTERN INIT( int UntimedBeforeTimed, 0);
|
||||
EXTERN INIT( int DefaultPrio, NO_PRIORITY);
|
||||
EXTERN INIT( long SysTime, -1L);
|
||||
EXTERN INIT( int ParseUntriggered, 1);
|
||||
|
||||
EXTERN char const *InitialFile;
|
||||
EXTERN int FileAccessDate;
|
||||
|
||||
@@ -839,6 +839,7 @@ static SysVar SysVarArr[] = {
|
||||
{"NumTrig", 0, INT_TYPE, &NumTriggered, 0, 0 },
|
||||
{"October", 1, STR_TYPE, &DynamicMonthName[9], 0, 0 },
|
||||
{"On", 1, STR_TYPE, &DynamicOn, 0, 0 },
|
||||
{"ParseUntriggered", 1, INT_TYPE, &ParseUntriggered, 0, 1 },
|
||||
{"Pm", 1, STR_TYPE, &DynamicPm, 0, 0 },
|
||||
{"PrefixLineNo", 0, INT_TYPE, &DoPrefixLineNo, 0, 0 },
|
||||
{"PSCal", 0, INT_TYPE, &PsCal, 0, 0 },
|
||||
|
||||
@@ -2803,6 +2803,7 @@ Variable Value
|
||||
$NumTrig 41
|
||||
$October "October"
|
||||
$On "on"
|
||||
$ParseUntriggered 1 [0, 1]
|
||||
$Pm "pm"
|
||||
$PrefixLineNo 0
|
||||
$PSCal 0
|
||||
@@ -4821,6 +4822,16 @@ htmlstriptags("this is > whut <b>foo</b>") => "this is > whut foo"
|
||||
set a htmlstriptags("<img src=\"foo\">")
|
||||
htmlstriptags("<img src=\"foo\">") => ""
|
||||
|
||||
# $ParseUntriggered
|
||||
REM 2 Jan 1990 MSG ["bad_expr" * 2]
|
||||
../tests/test.rem(885): Expired
|
||||
"bad_expr" * 2 => Type mismatch
|
||||
../tests/test.rem(885): `*': Type mismatch
|
||||
SET $ParseUntriggered 0
|
||||
REM 2 Jan 1990 MSG ["bad_expr" * 2]
|
||||
../tests/test.rem(887): Expired
|
||||
SET $ParseUntriggered 1
|
||||
|
||||
# Don't want Remind to queue reminders
|
||||
EXIT
|
||||
|
||||
|
||||
@@ -881,6 +881,12 @@ set a htmlstriptags("This is <unclosed whut?")
|
||||
set a htmlstriptags("this is > whut <b>foo</b>")
|
||||
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
|
||||
EXIT
|
||||
|
||||
|
||||
Reference in New Issue
Block a user