summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin McCarthy <kevin@8t8.us>2022-12-07 12:53:51 -0800
committerKevin McCarthy <kevin@8t8.us>2022-12-07 12:53:51 -0800
commitba5e0dc2bcadd9cb60a5ea06acbee5e353c87d39 (patch)
treed555f98080fe7062ebd78d0f5fc27efe030ff943
parent2f35d2fdb99de2f35453a2f73a64a8702f35640a (diff)
Add doc note to MuttLisp about boolean config vars.
They evaluate to "yes" and "no", and so need an explicit comparison to those values when using the equal function.
-rw-r--r--doc/manual.xml.head19
1 files changed, 19 insertions, 0 deletions
diff --git a/doc/manual.xml.head b/doc/manual.xml.head
index 5d325f40..dea8eeaa 100644
--- a/doc/manual.xml.head
+++ b/doc/manual.xml.head
@@ -7767,6 +7767,25 @@ echo (equal "one two" "`echo one two`")
==> "t"
note: backticks inside double quotes generates a single argument: "one two"
</screen>
+ <para>
+ Note that boolean configuration variables evaluate to the strings
+ &quot;yes&quot; or &quot;no&quot;. You can see the value of other
+ kinds of configuration variables using the
+ <link linkend="echo">echo</link> command.
+ </para>
+<screen>
+unset allow_ansi
+echo $allow_ansi
+ ===> "no"
+
+# the correct way to test a boolean:
+echo (if (equal $allow_ansi "yes") "set" "unset")
+ ===> "unset"
+
+# the incorrect way to test a boolean:
+echo (if $allow_ansi "set" "unset")
+ ===> "set"
+</screen>
</sect3>
<sect3 id="muttlisp-not">