From 754bbf7a25a8dda49b5d08ef0d0443bbf5af0e36 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Sun, 7 Apr 2024 13:41:34 -0500 Subject: new repository --- devdocs/elisp/variables-with-restricted-values.html | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 devdocs/elisp/variables-with-restricted-values.html (limited to 'devdocs/elisp/variables-with-restricted-values.html') diff --git a/devdocs/elisp/variables-with-restricted-values.html b/devdocs/elisp/variables-with-restricted-values.html new file mode 100644 index 00000000..a8743b03 --- /dev/null +++ b/devdocs/elisp/variables-with-restricted-values.html @@ -0,0 +1,15 @@ +

Variables with Restricted Values

Ordinary Lisp variables can be assigned any value that is a valid Lisp object. However, certain Lisp variables are not defined in Lisp, but in C. Most of these variables are defined in the C code using DEFVAR_LISP. Like variables defined in Lisp, these can take on any value. However, some variables are defined using DEFVAR_INT or DEFVAR_BOOL. See Writing Emacs Primitives, in particular the description of functions of the type syms_of_filename, for a brief discussion of the C implementation.

Variables of type DEFVAR_BOOL can only take on the values nil or t. Attempting to assign them any other value will set them to t:

(let ((display-hourglass 5))
+  display-hourglass)
+     ⇒ t
+
+
Variable: byte-boolean-vars +

This variable holds a list of all variables of type DEFVAR_BOOL.

+

Variables of type DEFVAR_INT can take on only integer values. Attempting to assign them any other value will result in an error:

(setq undo-limit 1000.0)
+error→ Wrong type argument: integerp, 1000.0
+
+
+

+ Copyright © 1990-1996, 1998-2022 Free Software Foundation, Inc.
Licensed under the GNU GPL license.
+ https://www.gnu.org/software/emacs/manual/html_node/elisp/Variables-with-Restricted-Values.html +

+
-- cgit v1.2.3