Add $CalType system variable.

This commit is contained in:
Dianne Skoll
2024-12-24 14:45:57 -05:00
parent 35c16a060a
commit 34c513ba3b
6 changed files with 21 additions and 6 deletions

View File

@@ -130,8 +130,8 @@
(defconst remind-builtin-variables
(sort
(list " $AddBlankLines" "$Ago" "$Am" "$And" "$April" "$At" "$August"
"$CalcUTC" "$CalMode" "$Daemon" "$DateSep" "$DateTimeSep" "$December"
"$DedupeReminders" "$DefaultColor" "$DefaultDelta"
"$CalcUTC" "$CalMode" "$CalType" "$Daemon" "$DateSep" "$DateTimeSep"
"$December" "$DedupeReminders" "$DefaultColor" "$DefaultDelta"
"$DefaultPrio" "$DefaultTDelta" "$DeltaOverride"
"$DontFork" "$DontQueue" "$DontTrigAts" "$EndSent" "$EndSentIg"
"$ExpressionTimeLimit" "$February" "$FirstIndent" "$FoldYear"

View File

@@ -2518,7 +2518,7 @@ The following system variables are defined. Those marked
All system variables hold values of type \fBINT\fR, unless otherwise
specified.
.TP
.B $AddBlankLines
.B $AddBlankLines
If set to 1 (the default), then \fBRemind\fR normally prints a blank
line after the banner and each reminder. (This can be suppressed by
ending the reminder or banner with a single percent sign.) If
@@ -2539,12 +2539,17 @@ Universal Time Coordinated in the \fB$MinsFromUTC\fR system variable.
.B $CalMode (read-only)
If non-zero, then the \fB\-c\fR option was supplied on the command line.
.TP
.B $CalType (read-only, STRING type)
If the \fB\-c\fR, \fB\-s\fR or \fB\-p\fR command-line options were
used, then this variable has the value "monthly". If \fB\-c+\fR,
\fB\-s+\fR or \fB\-p+\fR were used, then "weekly". Otherwise, "none".
.TP
.B $Daemon (read-only)
If "daemon mode" \fB\-z\fR was invoked, contains the number of
minutes between wakeups. If not running in daemon mode, contains
0. In server mode (either \fB-z0\fR or \fB-zj\fR), contains -1.
.TP
.B $DateSep
.B $DateSep (STRING type)
This variable can be set only to "/" or "-". It holds the character
used to separate portions of a date when \fBRemind\fR prints a DATE or
DATETIME value.
@@ -2599,7 +2604,7 @@ print "bar". The third will not trigger because it's a duplicate of the
first "foo".
.RE
.TP
.B $DefaultColor
.B $DefaultColor (STRING type)
This variable can be set to a string that has the form of three
space-separated numbers. Each number must be an integer from 0 to
255, or all three numbers must be -1. The default value of
@@ -2976,7 +2981,7 @@ Equivalent to \fByear(trigdate())\fR.
.B $Tt (read-only, TIME type)
Equivalent to \fBtrigtime()\fR.
.TP
.B $TimeSep
.B $TimeSep (STRING type)
This variable can be set only to ":" or ".". It holds the character
used to separate portions of a time when \fBRemind\fR prints a TIME or
DATETIME value.

View File

@@ -68,6 +68,7 @@ EXTERN INIT( int PsCal, 0);
EXTERN INIT( int CalWidth, 80);
EXTERN INIT( int CalWeeks, 0);
EXTERN INIT( int CalMonths, 0);
EXTERN INIT( char const *CalType, "none");
EXTERN INIT( int Hush, 0);
EXTERN INIT( int NextMode, 0);
EXTERN INIT( int InfiniteDelta, 0);

View File

@@ -501,9 +501,11 @@ void InitRemind(int argc, char const *argv[])
break;
}
if (weeks) {
CalType = "weekly";
PARSENUM(CalWeeks, arg);
if (!CalWeeks) CalWeeks = 1;
} else {
CalType = "monthly";
PARSENUM(CalMonths, arg);
if (!CalMonths) CalMonths = 1;
}
@@ -528,9 +530,11 @@ void InitRemind(int argc, char const *argv[])
break;
}
if (weeks) {
CalType = "weekly";
PARSENUM(CalWeeks, arg);
if (!CalWeeks) CalWeeks = 1;
} else {
CalType = "monthly";
PARSENUM(CalMonths, arg);
if (!CalMonths) CalMonths = 1;
}
@@ -565,10 +569,12 @@ void InitRemind(int argc, char const *argv[])
arg++;
}
if (weeks) {
CalType = "weekly";
PARSENUM(CalWeeks, arg);
if (!CalWeeks) CalWeeks = 1;
PsCal = PSCAL_LEVEL3;
} else {
CalType = "monthly";
PARSENUM(CalMonths, arg);
if (!CalMonths) CalMonths = 1;
}

View File

@@ -853,6 +853,7 @@ static SysVar SysVarArr[] = {
{"August", 1, TRANS_TYPE, "August", 0, 0 },
{"CalcUTC", 1, INT_TYPE, &CalculateUTC, 0, 1 },
{"CalMode", 0, INT_TYPE, &DoCalendar, 0, 0 },
{"CalType", 0, STR_TYPE, &CalType, 0, 0 },
{"Daemon", 0, INT_TYPE, &Daemon, 0, 0 },
{"DateSep", 1, SPECIAL_TYPE, date_sep_func, 0, 0 },
{"DateTimeSep", 1, SPECIAL_TYPE, datetime_sep_func, 0, 0 },

View File

@@ -2743,6 +2743,7 @@ Variable Value
$August "August"
$CalcUTC 0 [0, 1]
$CalMode 0
$CalType "none"
$Daemon 0
$DateSep "-"
$DateTimeSep "@"
@@ -24170,6 +24171,7 @@ $At
$August
$CalcUTC
$CalMode
$CalType
$Daemon
$DateSep
$DateTimeSep