aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuc Teirlinck2003-12-25 03:49:55 +0000
committerLuc Teirlinck2003-12-25 03:49:55 +0000
commit74ab3aa34adc0dc51e825e22fed1be7f89a09fbf (patch)
treebfb0db6c86871a9368f3af003703c741ed10b010
parentb51785c1212fceae6491be5e670dc4f935d91cde (diff)
downloademacs-74ab3aa34adc0dc51e825e22fed1be7f89a09fbf.tar.gz
emacs-74ab3aa34adc0dc51e825e22fed1be7f89a09fbf.zip
(Variables with Restricted Values): New node.
-rw-r--r--lispref/variables.texi47
1 files changed, 43 insertions, 4 deletions
diff --git a/lispref/variables.texi b/lispref/variables.texi
index 36cc2e47fe4..bbe7358b5d7 100644
--- a/lispref/variables.texi
+++ b/lispref/variables.texi
@@ -43,6 +43,8 @@ variable.
43* Future Local Variables:: New kinds of local values we might add some day. 43* Future Local Variables:: New kinds of local values we might add some day.
44* Variable Aliases:: Variables that are aliases for other variables. 44* Variable Aliases:: Variables that are aliases for other variables.
45* File Local Variables:: Handling local variable lists in files. 45* File Local Variables:: Handling local variable lists in files.
46* Variables with Restricted Values:: Non-constant variables whose value can
47 @emph{not} be an arbitrary Lisp object.
46@end menu 48@end menu
47 49
48@node Global Variables 50@node Global Variables
@@ -258,19 +260,21 @@ These kinds of bindings work somewhat like ordinary local bindings, but
258they are localized depending on ``where'' you are in Emacs, rather than 260they are localized depending on ``where'' you are in Emacs, rather than
259localized in time. 261localized in time.
260 262
263@anchor{Definition of max-specpdl-size}
261@defvar max-specpdl-size 264@defvar max-specpdl-size
262@cindex variable limit error 265@cindex variable limit error
263@cindex evaluation error 266@cindex evaluation error
264@cindex infinite recursion 267@cindex infinite recursion
265This variable defines the limit on the total number of local variable 268This variable defines the limit on the total number of local variable
266bindings and @code{unwind-protect} cleanups (@pxref{Nonlocal Exits}) 269bindings and @code{unwind-protect} cleanups (@pxref{Cleanups,,
267that are allowed before signaling an error (with data @code{"Variable 270Cleaning Up from Nonlocal Exits}) that are allowed before signaling an
268binding depth exceeds max-specpdl-size"}). 271error (with data @code{"Variable binding depth exceeds
272max-specpdl-size"}).
269 273
270This limit, with the associated error when it is exceeded, is one way 274This limit, with the associated error when it is exceeded, is one way
271that Lisp avoids infinite recursion on an ill-defined function. 275that Lisp avoids infinite recursion on an ill-defined function.
272@code{max-lisp-eval-depth} provides another limit on depth of nesting. 276@code{max-lisp-eval-depth} provides another limit on depth of nesting.
273@xref{Eval}. 277@xref{Definition of max-lisp-eval-depth,, Eval}.
274 278
275The default value is 600. Entry to the Lisp debugger increases the 279The default value is 600. Entry to the Lisp debugger increases the
276value, if there is little room left, to make sure the debugger itself 280value, if there is little room left, to make sure the debugger itself
@@ -1813,6 +1817,41 @@ could include functions to call. So Emacs discards all text
1813properties from string values specified in a file's local variables 1817properties from string values specified in a file's local variables
1814list. 1818list.
1815 1819
1820@node Variables with Restricted Values
1821@section Variables with Restricted Values
1822
1823 Ordinary Lisp variables can be assigned any value that is a valid
1824Lisp object. However, certain Lisp variables are not defined in Lisp,
1825but in C. Most of these variables are defined in the C code using
1826@code{DEFVAR_LISP}. Like variables defined in Lisp, these can take on
1827any value. However, some variables are defined using
1828@code{DEFVAR_INT} or @code{DEFVAR_BOOL}. @xref{Defining Lisp
1829variables in C,, Writing Emacs Primitives}, in particular the
1830description of functions of the type @code{syms_of_@var{filename}},
1831for a brief discussion of the C implementation.
1832
1833 Variables of type @code{DEFVAR_BOOL} can only take on the values
1834@code{nil} or @code{t}. Attempting to assign them any other value
1835will set them to @code{t}:
1836
1837@example
1838(let ((display-hourglass 5))
1839 display-hourglass)
1840 @result{} t
1841@end example
1842
1843@defvar byte-boolean-vars
1844This variable holds a list of all variables of type @code{DEFVAR_BOOL}.
1845@end defvar
1846
1847 Variables of type @code{DEFVAR_INT} can only take on integer values.
1848Attempting to assign them any other value will result in an error:
1849
1850@example
1851(setq window-min-height 5.0)
1852@error{} Wrong type argument: integerp, 5.0
1853@end example
1854
1816@ignore 1855@ignore
1817 arch-tag: 5ff62c44-2b51-47bb-99d4-fea5aeec5d3e 1856 arch-tag: 5ff62c44-2b51-47bb-99d4-fea5aeec5d3e
1818@end ignore 1857@end ignore