Mercurial > hg > xemacs-beta
comparison man/lispref/variables.texi @ 444:576fb035e263 r21-2-37
Import from CVS: tag r21-2-37
author | cvs |
---|---|
date | Mon, 13 Aug 2007 11:36:19 +0200 |
parents | 3ecd8885ac67 |
children | c33ae14dd6d0 |
comparison
equal
deleted
inserted
replaced
443:a8296e22da4e | 444:576fb035e263 |
---|---|
1 @c -*-texinfo-*- | 1 @c -*-texinfo-*- |
2 @c This is part of the XEmacs Lisp Reference Manual. | 2 @c This is part of the XEmacs Lisp Reference Manual. |
3 @c Copyright (C) 1990, 1991, 1992, 1993, 1994 Free Software Foundation, Inc. | 3 @c Copyright (C) 1990, 1991, 1992, 1993, 1994 Free Software Foundation, Inc. |
4 @c See the file lispref.texi for copying conditions. | 4 @c See the file lispref.texi for copying conditions. |
5 @setfilename ../../info/variables.info | 5 @setfilename ../../info/variables.info |
6 @node Variables, Functions, Control Structures, Top | 6 @node Variables, Functions, Control Structures, Top |
7 @chapter Variables | 7 @chapter Variables |
8 @cindex variable | 8 @cindex variable |
188 @group | 188 @group |
189 (setq Y 2) | 189 (setq Y 2) |
190 @result{} 2 | 190 @result{} 2 |
191 @end group | 191 @end group |
192 @group | 192 @group |
193 (let ((Y 1) | 193 (let ((Y 1) |
194 (Z Y)) | 194 (Z Y)) |
195 (list Y Z)) | 195 (list Y Z)) |
196 @result{} (1 2) | 196 @result{} (1 2) |
197 @end group | 197 @end group |
198 @end example | 198 @end example |
633 @result{} 3 | 633 @result{} 3 |
634 @end group | 634 @end group |
635 x ; @r{@code{x} now has a global value.} | 635 x ; @r{@code{x} now has a global value.} |
636 @result{} 3 | 636 @result{} 3 |
637 @group | 637 @group |
638 (let ((x 5)) | 638 (let ((x 5)) |
639 (setq x 6) ; @r{The local binding of @code{x} is set.} | 639 (setq x 6) ; @r{The local binding of @code{x} is set.} |
640 x) | 640 x) |
641 @result{} 6 | 641 @result{} 6 |
642 @end group | 642 @end group |
643 x ; @r{The global value is unchanged.} | 643 x ; @r{The global value is unchanged.} |
650 | 650 |
651 @example | 651 @example |
652 @group | 652 @group |
653 (setq x 10 ; @r{Notice that @code{x} is set before} | 653 (setq x 10 ; @r{Notice that @code{x} is set before} |
654 y (1+ x)) ; @r{the value of @code{y} is computed.} | 654 y (1+ x)) ; @r{the value of @code{y} is computed.} |
655 @result{} 11 | 655 @result{} 11 |
656 @end group | 656 @end group |
657 @end example | 657 @end example |
658 @end defspec | 658 @end defspec |
659 | 659 |
660 @defun set symbol value | 660 @defun set symbol value |
1099 local to the current buffer at the time. | 1099 local to the current buffer at the time. |
1100 | 1100 |
1101 The value returned is @var{variable}. | 1101 The value returned is @var{variable}. |
1102 @end deffn | 1102 @end deffn |
1103 | 1103 |
1104 @defun local-variable-p variable &optional buffer | 1104 @defun local-variable-p variable buffer &optional after-set |
1105 This returns @code{t} if @var{variable} is buffer-local in buffer | 1105 This returns @code{t} if @var{variable} is buffer-local in buffer |
1106 @var{buffer} (which defaults to the current buffer); otherwise, | 1106 @var{buffer}; else @code{nil}. |
1107 @code{nil}. | 1107 |
1108 If optional third arg @var{after-set} is non-@code{nil}, return @code{t} | |
1109 if @var{symbol} would be buffer-local after it is set, regardless of | |
1110 whether it is so presently. | |
1111 | |
1112 A @code{nil} value for @var{buffer} is @emph{not} the same as | |
1113 @code{(current-buffer)}, but means "no buffer". Specifically: | |
1114 | |
1115 If @var{buffer} is @code{nil} and @var{after-set} is @code{nil}, a | |
1116 return value of @code{t} indicates that the variable is one of the | |
1117 special built-in variables that is always buffer-local. (This includes | |
1118 @code{buffer-file-name}, @code{buffer-read-only}, | |
1119 @code{buffer-undo-list}, and others.) | |
1120 | |
1121 If @var{buffer} is @code{nil} and @var{after-set} is @code{t}, a return | |
1122 value of @code{t} indicates that the variable has had | |
1123 @code{make-variable-buffer-local} applied to it. | |
1108 @end defun | 1124 @end defun |
1109 | 1125 |
1110 @defun buffer-local-variables &optional buffer | 1126 @defun buffer-local-variables &optional buffer |
1111 This function returns a list describing the buffer-local variables in | 1127 This function returns a list describing the buffer-local variables in |
1112 buffer @var{buffer}. It returns an association list (@pxref{Association | 1128 buffer @var{buffer}. It returns an association list (@pxref{Association |
1127 @result{} ((mark-active . nil) | 1143 @result{} ((mark-active . nil) |
1128 (buffer-undo-list nil) | 1144 (buffer-undo-list nil) |
1129 (mode-name . "Fundamental") | 1145 (mode-name . "Fundamental") |
1130 @dots{} | 1146 @dots{} |
1131 @group | 1147 @group |
1132 ;; @r{Next, non-built-in local variables.} | 1148 ;; @r{Next, non-built-in local variables.} |
1133 ;; @r{This one is local and void:} | 1149 ;; @r{This one is local and void:} |
1134 foobar | 1150 foobar |
1135 ;; @r{This one is local and nonvoid:} | 1151 ;; @r{This one is local and nonvoid:} |
1136 (bind-me . 69)) | 1152 (bind-me . 69)) |
1137 @end group | 1153 @end group |
1328 removed, at which point it will be restored. Currently @var{variable} | 1344 removed, at which point it will be restored. Currently @var{variable} |
1329 cannot be a built-in variable, a variable that has a buffer-local value | 1345 cannot be a built-in variable, a variable that has a buffer-local value |
1330 in any buffer, or the symbols @code{nil} or @code{t}. | 1346 in any buffer, or the symbols @code{nil} or @code{t}. |
1331 @end defun | 1347 @end defun |
1332 | 1348 |
1333 @defun variable-alias variable | 1349 @defun variable-alias variable &optional follow-past-lisp-magic |
1334 If @var{variable} is aliased to another variable, this function returns | 1350 If @var{variable} is aliased to another variable, this function returns |
1335 that variable. @var{variable} should be a symbol. If @var{variable} is | 1351 that variable. @var{variable} should be a symbol. If @var{variable} is |
1336 not aliased, this function returns @code{nil}. | 1352 not aliased, this function returns @code{nil}. |
1337 @end defun | 1353 @end defun |
1338 | 1354 |
1339 @defun indirect-variable object | 1355 @defun indirect-variable object &optional follow-past-lisp-magic |
1340 This function returns the variable at the end of @var{object}'s | 1356 This function returns the variable at the end of @var{object}'s |
1341 variable-alias chain. If @var{object} is a symbol, follow all variable | 1357 variable-alias chain. If @var{object} is a symbol, follow all variable |
1342 aliases and return the final (non-aliased) symbol. If @var{object} is | 1358 aliases and return the final (non-aliased) symbol. If @var{object} is |
1343 not a symbol, just return it. Signal a | 1359 not a symbol, just return it. Signal a |
1344 @code{cyclic-variable-indirection} error if there is a loop in the | 1360 @code{cyclic-variable-indirection} error if there is a loop in the |