Document and test overriding of %: %! %? %@ %#

This commit is contained in:
Dianne Skoll
2025-08-15 15:28:23 -04:00
parent b770676cb6
commit 5f9e227dc8
3 changed files with 25 additions and 1 deletions

View File

@@ -6469,6 +6469,20 @@ as:
FSET subst_bx(a,d,t) iif(d==today()+2, "the day after tomorrow", 0)
.fi
.PP
You can override substitution sequences that are not alphanumeric as follows:
.RS
.PP
Override %: with \fBsubst_colon\fR
.PP
Override %! with \fBsubst_bang\fR
.PP
Override %? with \fBsubst_question\fR
.PP
Override %@ with \fBsubst_at\fR
.PP
Override %# with \fBsubst_hash\fR
.RE
.PP
You can define your own substitution sequences in addition to the built-in
ones as follows: If you define a function named \fBsubst_\fIname\fB(alt, date, time)\fR, then the sequence \fB%{name}\fR calls the function with \fBalt\fR
set to 0 and \fBdate\fR and \fBtime\fR to the trigger date and time,

View File

@@ -16580,12 +16580,13 @@ Entering UserFN c()
Leaving UserFN c() => 33
DEBUG -xe
Overridden: subst_colon subst_bang subst_question subst_at subst_hash
Variable hash table statistics:
Entries: 100144; Buckets: 87719; Non-empty Buckets: 66301
Maxlen: 5; Minlen: 0; Avglen: 1.142; Stddev: 0.878; Avg nonempty len: 1.510
Growths: 13; Shrinks: 0
Function hash table statistics:
Entries: 100018; Buckets: 87719; Non-empty Buckets: 63574
Entries: 100023; Buckets: 87719; Non-empty Buckets: 63576
Maxlen: 5; Minlen: 0; Avglen: 1.140; Stddev: 0.934; Avg nonempty len: 1.573
Growths: 13; Shrinks: 0
Dedupe hash table statistics:

View File

@@ -1707,6 +1707,15 @@ set a c()
DEBUG -xe
fset subst_colon(a, b, c) "subst_colon"
fset subst_bang(a, b, c) "subst_bang"
fset subst_question(a, b, c) "subst_question"
fset subst_at(a, b, c) "subst_at"
fset subst_hash(a, b, c) "subst_hash"
REM MSG Overridden: %: %! %? %@ %#
# Don't want Remind to queue reminders
EXIT