@c -*-texinfo-*-
@c This is part of the XEmacs Lisp Reference Manual.
-@c Copyright (C) 1990, 1991, 1992, 1993, 1994 Free Software Foundation, Inc.
+@c Copyright (C) 1990, 1991, 1992, 1993, 1994 Free Software Foundation, Inc.
@c See the file lispref.texi for copying conditions.
@setfilename ../../info/variables.info
@node Variables, Functions, Control Structures, Top
@vindex t
@kindex setting-constant
- XEmacs Lisp has two special symbols, @code{nil} and @code{t}, that
-always evaluate to themselves. These symbols cannot be rebound, nor can
-their value cells be changed. An attempt to change the value of
-@code{nil} or @code{t} signals a @code{setting-constant} error.
+In XEmacs Lisp, some symbols always evaluate to themselves: the two
+special symbols @code{nil} and @code{t}, as well as @dfn{keyword
+symbols}, that is, symbols whose name begins with the character
+@samp{@code{:}}. These symbols cannot be rebound, nor can their value
+cells be changed. An attempt to change the value of @code{nil} or
+@code{t} signals a @code{setting-constant} error.
@example
@group
@result{} 2
@end group
@group
-(let ((Y 1)
+(let ((Y 1)
(Z Y))
(list Y Z))
@result{} (1 2)
If the first character of @var{doc-string} is @samp{*}, it means that
this variable is considered a user option. This lets users set the
-variable conventiently using the commands @code{set-variable} and
+variable conveniently using the commands @code{set-variable} and
@code{edit-options}.
For example, this form defines @code{foo} but does not set its value:
x ; @r{@code{x} now has a global value.}
@result{} 3
@group
-(let ((x 5))
+(let ((x 5))
(setq x 6) ; @r{The local binding of @code{x} is set.}
x)
@result{} 6
@group
(setq x 10 ; @r{Notice that @code{x} is set before}
y (1+ x)) ; @r{the value of @code{y} is computed.}
- @result{} 11
+ @result{} 11
@end group
@end example
@end defspec
The value returned is @var{variable}.
@end deffn
-@defun local-variable-p variable &optional buffer
+@defun local-variable-p variable buffer &optional after-set
This returns @code{t} if @var{variable} is buffer-local in buffer
-@var{buffer} (which defaults to the current buffer); otherwise,
-@code{nil}.
+@var{buffer}; else @code{nil}.
+
+If optional third arg @var{after-set} is non-@code{nil}, return @code{t}
+if @var{symbol} would be buffer-local after it is set, regardless of
+whether it is so presently.
+
+A @code{nil} value for @var{buffer} is @emph{not} the same as
+@code{(current-buffer)}, but means "no buffer". Specifically:
+
+If @var{buffer} is @code{nil} and @var{after-set} is @code{nil}, a
+return value of @code{t} indicates that the variable is one of the
+special built-in variables that is always buffer-local. (This includes
+@code{buffer-file-name}, @code{buffer-read-only},
+@code{buffer-undo-list}, and others.)
+
+If @var{buffer} is @code{nil} and @var{after-set} is @code{t}, a return
+value of @code{t} indicates that the variable has had
+@code{make-variable-buffer-local} applied to it.
@end defun
@defun buffer-local-variables &optional buffer
(mode-name . "Fundamental")
@dots{}
@group
- ;; @r{Next, non-built-in local variables.}
+ ;; @r{Next, non-built-in local variables.}
;; @r{This one is local and void:}
foobar
;; @r{This one is local and nonvoid:}
in any buffer, or the symbols @code{nil} or @code{t}.
@end defun
-@defun variable-alias variable
+@defun variable-alias variable &optional follow-past-lisp-magic
If @var{variable} is aliased to another variable, this function returns
that variable. @var{variable} should be a symbol. If @var{variable} is
not aliased, this function returns @code{nil}.
@end defun
-@defun indirect-variable object
+@defun indirect-variable object &optional follow-past-lisp-magic
This function returns the variable at the end of @var{object}'s
variable-alias chain. If @var{object} is a symbol, follow all variable
aliases and return the final (non-aliased) symbol. If @var{object} is