diff options
| author | Miles Bader | 2007-10-27 09:07:17 +0000 |
|---|---|---|
| committer | Miles Bader | 2007-10-27 09:07:17 +0000 |
| commit | fdc9061358d3654e14bfc1419632e1d6c6c5c13e (patch) | |
| tree | 00f5484d576513deddd938a9a277d0db860b9a5b /doc | |
| parent | ebe4c71027cd6ec8583631e895e7fdd3decfc099 (diff) | |
| parent | b6ff295c434269fe824ec47cbfc87c6a02dfd94d (diff) | |
| download | emacs-fdc9061358d3654e14bfc1419632e1d6c6c5c13e.tar.gz emacs-fdc9061358d3654e14bfc1419632e1d6c6c5c13e.zip | |
Merge from emacs--rel--22
Patches applied:
* emacs--rel--22 (patch 131-137)
- Update from CVS
- Merge from gnus--rel--5.10
* gnus--rel--5.10 (patch 261-262)
- Update from CVS
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-908
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/emacs/ChangeLog | 4 | ||||
| -rw-r--r-- | doc/emacs/misc.texi | 4 | ||||
| -rw-r--r-- | doc/lispref/ChangeLog | 16 | ||||
| -rw-r--r-- | doc/lispref/elisp.texi | 1 | ||||
| -rw-r--r-- | doc/lispref/frames.texi | 2 | ||||
| -rw-r--r-- | doc/lispref/functions.texi | 5 | ||||
| -rw-r--r-- | doc/lispref/loading.texi | 27 | ||||
| -rw-r--r-- | doc/lispref/os.texi | 11 | ||||
| -rw-r--r-- | doc/lispref/variables.texi | 141 |
9 files changed, 63 insertions, 148 deletions
diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog index 3b92f150f59..1d1ba11ef6f 100644 --- a/doc/emacs/ChangeLog +++ b/doc/emacs/ChangeLog | |||
| @@ -2,6 +2,10 @@ | |||
| 2 | 2 | ||
| 3 | * fortran-xtra.texi (Fortran): F90 mode handles F2003. | 3 | * fortran-xtra.texi (Fortran): F90 mode handles F2003. |
| 4 | 4 | ||
| 5 | 2007-10-24 Richard Stallman <rms@gnu.org> | ||
| 6 | |||
| 7 | * misc.texi (Interactive Shell): Cleanup last change. | ||
| 8 | |||
| 5 | 2007-10-22 Juri Linkov <juri@jurta.org> | 9 | 2007-10-22 Juri Linkov <juri@jurta.org> |
| 6 | 10 | ||
| 7 | * mini.texi (Minibuffer History): Add text about a list of minibuffer | 11 | * mini.texi (Minibuffer History): Add text about a list of minibuffer |
diff --git a/doc/emacs/misc.texi b/doc/emacs/misc.texi index 83fc1617066..82e48bfe13b 100644 --- a/doc/emacs/misc.texi +++ b/doc/emacs/misc.texi | |||
| @@ -488,8 +488,8 @@ also change the coding system for a running subshell by typing | |||
| 488 | Coding}. | 488 | Coding}. |
| 489 | 489 | ||
| 490 | @cindex @env{INSIDE_EMACS} environment variable | 490 | @cindex @env{INSIDE_EMACS} environment variable |
| 491 | Emacs sets the environment variable @env{INSIDE_EMACS} (to a | 491 | Emacs sets the environment variable @env{INSIDE_EMACS} in the |
| 492 | comma-separated list including the Emacs version) in the subshell. | 492 | subshell to a comma-separated list including the Emacs version. |
| 493 | Programs can check this variable to determine whether they are running | 493 | Programs can check this variable to determine whether they are running |
| 494 | inside an Emacs subshell. | 494 | inside an Emacs subshell. |
| 495 | 495 | ||
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index e74d8889e01..282fa19bfa1 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog | |||
| @@ -8,6 +8,22 @@ | |||
| 8 | 8 | ||
| 9 | * customize.texi (Variable Definitions): Add :risky and :safe keywords. | 9 | * customize.texi (Variable Definitions): Add :risky and :safe keywords. |
| 10 | 10 | ||
| 11 | 2007-10-24 Richard Stallman <rms@gnu.org> | ||
| 12 | |||
| 13 | * elisp.texi (Top): Delete Frame-Local Variables from subnode menu. | ||
| 14 | |||
| 15 | * variables.texi (Frame-Local Variables): Node deleted. | ||
| 16 | (Variables): Delete Frame-Local Variables from menu. | ||
| 17 | (Local Variables, Buffer-Local Variables, Intro to Buffer-Local) | ||
| 18 | (Default Value): Don't mention frame-local vars. | ||
| 19 | |||
| 20 | * os.texi (Idle Timers): current-idle-time returns nil if not idle. | ||
| 21 | |||
| 22 | * loading.texi (Unloading): Document FEATURE-unload-function | ||
| 23 | instead of FEATURE-unload-hook. | ||
| 24 | |||
| 25 | * frames.texi (Multiple Displays): Don't mention frame-local vars. | ||
| 26 | |||
| 11 | 2007-10-22 Juri Linkov <juri@jurta.org> | 27 | 2007-10-22 Juri Linkov <juri@jurta.org> |
| 12 | 28 | ||
| 13 | * minibuf.texi (Text from Minibuffer, Minibuffer Completion) | 29 | * minibuf.texi (Text from Minibuffer, Minibuffer Completion) |
diff --git a/doc/lispref/elisp.texi b/doc/lispref/elisp.texi index 8cd25ed59d3..695144738fc 100644 --- a/doc/lispref/elisp.texi +++ b/doc/lispref/elisp.texi | |||
| @@ -421,7 +421,6 @@ Variables | |||
| 421 | * Setting Variables:: Storing new values in variables. | 421 | * Setting Variables:: Storing new values in variables. |
| 422 | * Variable Scoping:: How Lisp chooses among local and global values. | 422 | * Variable Scoping:: How Lisp chooses among local and global values. |
| 423 | * Buffer-Local Variables:: Variable values in effect only in one buffer. | 423 | * Buffer-Local Variables:: Variable values in effect only in one buffer. |
| 424 | * Frame-Local Variables:: Variable values in effect only in one frame. | ||
| 425 | * Future Local Variables:: New kinds of local values we might add some day. | 424 | * Future Local Variables:: New kinds of local values we might add some day. |
| 426 | * File Local Variables:: Handling local variable lists in files. | 425 | * File Local Variables:: Handling local variable lists in files. |
| 427 | * Variable Aliases:: Variables that are aliases for other variables. | 426 | * Variable Aliases:: Variables that are aliases for other variables. |
diff --git a/doc/lispref/frames.texi b/doc/lispref/frames.texi index ee07302d76b..cd29d44ab76 100644 --- a/doc/lispref/frames.texi +++ b/doc/lispref/frames.texi | |||
| @@ -141,7 +141,7 @@ is the one for the terminal that the currently selected frame belongs | |||
| 141 | to. These variables include @code{default-minibuffer-frame}, | 141 | to. These variables include @code{default-minibuffer-frame}, |
| 142 | @code{defining-kbd-macro}, @code{last-kbd-macro}, and | 142 | @code{defining-kbd-macro}, @code{last-kbd-macro}, and |
| 143 | @code{system-key-alist}. They are always terminal-local, and can never | 143 | @code{system-key-alist}. They are always terminal-local, and can never |
| 144 | be buffer-local (@pxref{Buffer-Local Variables}) or frame-local. | 144 | be buffer-local (@pxref{Buffer-Local Variables}). |
| 145 | 145 | ||
| 146 | A single X server can handle more than one screen. A display name | 146 | A single X server can handle more than one screen. A display name |
| 147 | @samp{@var{host}:@var{server}.@var{screen}} has three parts; the last | 147 | @samp{@var{host}:@var{server}.@var{screen}} has three parts; the last |
diff --git a/doc/lispref/functions.texi b/doc/lispref/functions.texi index 111edb7afc0..601644629e5 100644 --- a/doc/lispref/functions.texi +++ b/doc/lispref/functions.texi | |||
| @@ -1326,6 +1326,9 @@ See @ref{Autoload}. | |||
| 1326 | @item call-interactively | 1326 | @item call-interactively |
| 1327 | See @ref{Interactive Call}. | 1327 | See @ref{Interactive Call}. |
| 1328 | 1328 | ||
| 1329 | @item called-interactively-p | ||
| 1330 | See @ref{Distinguish Interactive}. | ||
| 1331 | |||
| 1329 | @item commandp | 1332 | @item commandp |
| 1330 | See @ref{Interactive Call}. | 1333 | See @ref{Interactive Call}. |
| 1331 | 1334 | ||
| @@ -1351,7 +1354,7 @@ See @ref{Function Indirection}. | |||
| 1351 | See @ref{Using Interactive}. | 1354 | See @ref{Using Interactive}. |
| 1352 | 1355 | ||
| 1353 | @item interactive-p | 1356 | @item interactive-p |
| 1354 | See @ref{Interactive Call}. | 1357 | See @ref{Distinguish Interactive}. |
| 1355 | 1358 | ||
| 1356 | @item mapatoms | 1359 | @item mapatoms |
| 1357 | See @ref{Creating Symbols}. | 1360 | See @ref{Creating Symbols}. |
diff --git a/doc/lispref/loading.texi b/doc/lispref/loading.texi index 9b582fe5cf8..cbea262cc45 100644 --- a/doc/lispref/loading.texi +++ b/doc/lispref/loading.texi | |||
| @@ -862,24 +862,27 @@ library with @code{defun}, @code{defalias}, @code{defsubst}, | |||
| 862 | It then restores any autoloads formerly associated with those symbols. | 862 | It then restores any autoloads formerly associated with those symbols. |
| 863 | (Loading saves these in the @code{autoload} property of the symbol.) | 863 | (Loading saves these in the @code{autoload} property of the symbol.) |
| 864 | 864 | ||
| 865 | @vindex unload-feature-special-hooks | ||
| 866 | Before restoring the previous definitions, @code{unload-feature} runs | 865 | Before restoring the previous definitions, @code{unload-feature} runs |
| 867 | @code{remove-hook} to remove functions in the library from certain | 866 | @code{remove-hook} to remove functions in the library from certain |
| 868 | hooks. These hooks include variables whose names end in @samp{hook} | 867 | hooks. These hooks include variables whose names end in @samp{hook} |
| 869 | or @samp{-hooks}, plus those listed in | 868 | or @samp{-hooks}, plus those listed in |
| 870 | @code{unload-feature-special-hooks}. This is to prevent Emacs from | 869 | @code{unload-feature-special-hooks}, as well as |
| 871 | ceasing to function because important hooks refer to functions that | 870 | @code{auto-mode-alist}. This is to prevent Emacs from ceasing to |
| 872 | are no longer defined. | 871 | function because important hooks refer to functions that are no longer |
| 872 | defined. | ||
| 873 | 873 | ||
| 874 | @vindex @var{feature}-unload-hook | 874 | Standard unloading activities also undoes ELP profiling of functions |
| 875 | in that library, unprovides any features provided by the library, and | ||
| 876 | cancels timers held in variables defined by the library. | ||
| 877 | |||
| 878 | @vindex @var{feature}-unload-function | ||
| 875 | If these measures are not sufficient to prevent malfunction, a library | 879 | If these measures are not sufficient to prevent malfunction, a library |
| 876 | can define an explicit unload hook. If @code{@var{feature}-unload-hook} | 880 | can define an explicit unloader named @code{@var{feature}-unload-function}. |
| 877 | is defined, it is run as a normal hook before restoring the previous | 881 | If that symbol is defined as a function, @code{unload-feature} calls |
| 878 | definitions, @emph{instead of} the usual hook-removing actions. The | 882 | it with no arguments before doing anything else. It can do whatever |
| 879 | unload hook ought to undo all the global state changes made by the | 883 | is appropriate to unload the library. If it returns @code{nil}, |
| 880 | library that might cease to work once the library is unloaded. | 884 | @code{unload-feature} proceeds to take the normal unload actions. |
| 881 | @code{unload-feature} can cause problems with libraries that fail to do | 885 | Otherwise it considers the job to be done. |
| 882 | this, so it should be used with caution. | ||
| 883 | 886 | ||
| 884 | Ordinarily, @code{unload-feature} refuses to unload a library on which | 887 | Ordinarily, @code{unload-feature} refuses to unload a library on which |
| 885 | other loaded libraries depend. (A library @var{a} depends on library | 888 | other loaded libraries depend. (A library @var{a} depends on library |
diff --git a/doc/lispref/os.texi b/doc/lispref/os.texi index 68fba8d9774..bff759215da 100644 --- a/doc/lispref/os.texi +++ b/doc/lispref/os.texi | |||
| @@ -1561,10 +1561,10 @@ set up to repeat will subsequently run another time, one by one. | |||
| 1561 | 1561 | ||
| 1562 | @c Emacs 19 feature | 1562 | @c Emacs 19 feature |
| 1563 | @defun current-idle-time | 1563 | @defun current-idle-time |
| 1564 | This function returns the length of time Emacs has been idle, as a | 1564 | If Emacs is idle, this function returns the length of time Emacs has |
| 1565 | list of three integers: @code{(@var{high} @var{low} @var{microsec})}. | 1565 | been idle, as a list of three integers: @code{(@var{high} @var{low} |
| 1566 | The integers @var{high} and @var{low} combine to give the number of | 1566 | @var{microsec})}. The integers @var{high} and @var{low} combine to |
| 1567 | seconds of idleness, which is | 1567 | give the number of seconds of idleness, which is |
| 1568 | @ifnottex | 1568 | @ifnottex |
| 1569 | @var{high} * 2**16 + @var{low}. | 1569 | @var{high} * 2**16 + @var{low}. |
| 1570 | @end ifnottex | 1570 | @end ifnottex |
| @@ -1576,6 +1576,9 @@ The third element, @var{microsec}, gives the microseconds since the | |||
| 1576 | start of the current second (or 0 for systems that return time with | 1576 | start of the current second (or 0 for systems that return time with |
| 1577 | the resolution of only one second). | 1577 | the resolution of only one second). |
| 1578 | 1578 | ||
| 1579 | When Emacs is not idle, @code{current-idle-time} returns @code{nil}. | ||
| 1580 | This is a convenient way to test whether Emacs is idle. | ||
| 1581 | |||
| 1579 | The main use of this function is when an idle timer function wants to | 1582 | The main use of this function is when an idle timer function wants to |
| 1580 | ``take a break'' for a while. It can set up another idle timer to | 1583 | ``take a break'' for a while. It can set up another idle timer to |
| 1581 | call the same function again, after a few seconds more idleness. | 1584 | call the same function again, after a few seconds more idleness. |
diff --git a/doc/lispref/variables.texi b/doc/lispref/variables.texi index d5f1035c169..0ca217dbe47 100644 --- a/doc/lispref/variables.texi +++ b/doc/lispref/variables.texi | |||
| @@ -39,7 +39,6 @@ variable. | |||
| 39 | * Setting Variables:: Storing new values in variables. | 39 | * Setting Variables:: Storing new values in variables. |
| 40 | * Variable Scoping:: How Lisp chooses among local and global values. | 40 | * Variable Scoping:: How Lisp chooses among local and global values. |
| 41 | * Buffer-Local Variables:: Variable values in effect only in one buffer. | 41 | * Buffer-Local Variables:: Variable values in effect only in one buffer. |
| 42 | * Frame-Local Variables:: Variable values in effect only in one frame. | ||
| 43 | * Future Local Variables:: New kinds of local values we might add some day. | 42 | * Future Local Variables:: New kinds of local values we might add some day. |
| 44 | * File Local Variables:: Handling local variable lists in files. | 43 | * File Local Variables:: Handling local variable lists in files. |
| 45 | * Variable Aliases:: Variables that are aliases for other variables. | 44 | * Variable Aliases:: Variables that are aliases for other variables. |
| @@ -255,11 +254,10 @@ Macro calls (@pxref{Macros}). | |||
| 255 | @end itemize | 254 | @end itemize |
| 256 | 255 | ||
| 257 | Variables can also have buffer-local bindings (@pxref{Buffer-Local | 256 | Variables can also have buffer-local bindings (@pxref{Buffer-Local |
| 258 | Variables}) and frame-local bindings (@pxref{Frame-Local Variables}); a | 257 | Variables}); a few variables have terminal-local bindings |
| 259 | few variables have terminal-local bindings (@pxref{Multiple Displays}). | 258 | (@pxref{Multiple Displays}). These kinds of bindings work somewhat |
| 260 | These kinds of bindings work somewhat like ordinary local bindings, but | 259 | like ordinary local bindings, but they are localized depending on |
| 261 | they are localized depending on ``where'' you are in Emacs, rather than | 260 | ``where'' you are in Emacs, rather than localized in time. |
| 262 | localized in time. | ||
| 263 | 261 | ||
| 264 | @defvar max-specpdl-size | 262 | @defvar max-specpdl-size |
| 265 | @anchor{Definition of max-specpdl-size} | 263 | @anchor{Definition of max-specpdl-size} |
| @@ -1085,16 +1083,12 @@ use short names like @code{x}. | |||
| 1085 | @cindex buffer-local variables | 1083 | @cindex buffer-local variables |
| 1086 | 1084 | ||
| 1087 | Global and local variable bindings are found in most programming | 1085 | Global and local variable bindings are found in most programming |
| 1088 | languages in one form or another. Emacs, however, also supports additional, | 1086 | languages in one form or another. Emacs, however, also supports |
| 1089 | unusual kinds of variable binding: @dfn{buffer-local} bindings, which | 1087 | additional, unusual kinds of variable binding, such as |
| 1090 | apply only in one buffer, and @dfn{frame-local} bindings, which apply only in | 1088 | @dfn{buffer-local} bindings, which apply only in one buffer. Having |
| 1091 | one frame. Having different values for a variable in different buffers | 1089 | different values for a variable in different buffers is an important |
| 1092 | and/or frames is an important customization method. | 1090 | customization method. (A few variables have bindings that are local |
| 1093 | 1091 | to each terminal; see @ref{Multiple Displays}.) | |
| 1094 | This section describes buffer-local bindings; for frame-local | ||
| 1095 | bindings, see the following section, @ref{Frame-Local Variables}. (A few | ||
| 1096 | variables have bindings that are local to each terminal; see | ||
| 1097 | @ref{Multiple Displays}.) | ||
| 1098 | 1092 | ||
| 1099 | @menu | 1093 | @menu |
| 1100 | * Intro to Buffer-Local:: Introduction and concepts. | 1094 | * Intro to Buffer-Local:: Introduction and concepts. |
| @@ -1121,8 +1115,7 @@ this is the global binding. | |||
| 1121 | other buffers. The default binding is shared by all the buffers that | 1115 | other buffers. The default binding is shared by all the buffers that |
| 1122 | don't have their own bindings for the variable. (This includes all | 1116 | don't have their own bindings for the variable. (This includes all |
| 1123 | newly-created buffers.) If you set the variable in a buffer that does | 1117 | newly-created buffers.) If you set the variable in a buffer that does |
| 1124 | not have a buffer-local binding for it, this sets the default binding | 1118 | not have a buffer-local binding for it, this sets the default binding, |
| 1125 | (assuming there are no frame-local bindings to complicate the matter), | ||
| 1126 | so the new value is visible in all the buffers that see the default | 1119 | so the new value is visible in all the buffers that see the default |
| 1127 | binding. | 1120 | binding. |
| 1128 | 1121 | ||
| @@ -1153,11 +1146,11 @@ the default binding untouched. This means that the default value cannot | |||
| 1153 | be changed with @code{setq} in any buffer; the only way to change it is | 1146 | be changed with @code{setq} in any buffer; the only way to change it is |
| 1154 | with @code{setq-default}. | 1147 | with @code{setq-default}. |
| 1155 | 1148 | ||
| 1156 | @strong{Warning:} When a variable has buffer-local or frame-local | 1149 | @strong{Warning:} When a variable has buffer-local |
| 1157 | bindings in one or more buffers, @code{let} rebinds the binding that's | 1150 | bindings in one or more buffers, @code{let} rebinds the binding that's |
| 1158 | currently in effect. For instance, if the current buffer has a | 1151 | currently in effect. For instance, if the current buffer has a |
| 1159 | buffer-local value, @code{let} temporarily rebinds that. If no | 1152 | buffer-local value, @code{let} temporarily rebinds that. If no |
| 1160 | buffer-local or frame-local bindings are in effect, @code{let} rebinds | 1153 | buffer-local bindings are in effect, @code{let} rebinds |
| 1161 | the default value. If inside the @code{let} you then change to a | 1154 | the default value. If inside the @code{let} you then change to a |
| 1162 | different current buffer in which a different binding is in effect, | 1155 | different current buffer in which a different binding is in effect, |
| 1163 | you won't see the @code{let} binding any more. And if you exit the | 1156 | you won't see the @code{let} binding any more. And if you exit the |
| @@ -1421,7 +1414,7 @@ this variable. | |||
| 1421 | @c Emacs 19 feature | 1414 | @c Emacs 19 feature |
| 1422 | The special forms @code{defvar} and @code{defconst} also set the | 1415 | The special forms @code{defvar} and @code{defconst} also set the |
| 1423 | default value (if they set the variable at all), rather than any | 1416 | default value (if they set the variable at all), rather than any |
| 1424 | buffer-local or frame-local value. | 1417 | buffer-local value. |
| 1425 | 1418 | ||
| 1426 | @defun default-value symbol | 1419 | @defun default-value symbol |
| 1427 | This function returns @var{symbol}'s default value. This is the value | 1420 | This function returns @var{symbol}'s default value. This is the value |
| @@ -1520,112 +1513,6 @@ an ordinary evaluated argument. | |||
| 1520 | @end example | 1513 | @end example |
| 1521 | @end defun | 1514 | @end defun |
| 1522 | 1515 | ||
| 1523 | @node Frame-Local Variables | ||
| 1524 | @section Frame-Local Variables | ||
| 1525 | @cindex frame-local variables | ||
| 1526 | |||
| 1527 | Just as variables can have buffer-local bindings, they can also have | ||
| 1528 | frame-local bindings. These bindings belong to one frame, and are in | ||
| 1529 | effect when that frame is selected. Frame-local bindings are actually | ||
| 1530 | frame parameters: you create a frame-local binding in a specific frame | ||
| 1531 | by calling @code{modify-frame-parameters} and specifying the variable | ||
| 1532 | name as the parameter name. | ||
| 1533 | |||
| 1534 | To enable frame-local bindings for a certain variable, call the function | ||
| 1535 | @code{make-variable-frame-local}. | ||
| 1536 | |||
| 1537 | @deffn Command make-variable-frame-local variable | ||
| 1538 | Enable the use of frame-local bindings for @var{variable}. This does | ||
| 1539 | not in itself create any frame-local bindings for the variable; however, | ||
| 1540 | if some frame already has a value for @var{variable} as a frame | ||
| 1541 | parameter, that value automatically becomes a frame-local binding. | ||
| 1542 | |||
| 1543 | If @var{variable} does not have a default value, then calling this | ||
| 1544 | command will give it a default value of @code{nil}. If @var{variable} | ||
| 1545 | already has a default value, that value remains unchanged. | ||
| 1546 | |||
| 1547 | If the variable is terminal-local, this function signals an error, | ||
| 1548 | because such variables cannot have frame-local bindings as well. | ||
| 1549 | @xref{Multiple Displays}. A few variables that are implemented | ||
| 1550 | specially in Emacs can be buffer-local, but can never be frame-local. | ||
| 1551 | |||
| 1552 | This command returns @var{variable}. | ||
| 1553 | @end deffn | ||
| 1554 | |||
| 1555 | Buffer-local bindings take precedence over frame-local bindings. Thus, | ||
| 1556 | consider a variable @code{foo}: if the current buffer has a buffer-local | ||
| 1557 | binding for @code{foo}, that binding is active; otherwise, if the | ||
| 1558 | selected frame has a frame-local binding for @code{foo}, that binding is | ||
| 1559 | active; otherwise, the default binding of @code{foo} is active. | ||
| 1560 | |||
| 1561 | Here is an example. First we prepare a few bindings for @code{foo}: | ||
| 1562 | |||
| 1563 | @example | ||
| 1564 | (setq f1 (selected-frame)) | ||
| 1565 | (make-variable-frame-local 'foo) | ||
| 1566 | |||
| 1567 | ;; @r{Make a buffer-local binding for @code{foo} in @samp{b1}.} | ||
| 1568 | (set-buffer (get-buffer-create "b1")) | ||
| 1569 | (make-local-variable 'foo) | ||
| 1570 | (setq foo '(b 1)) | ||
| 1571 | |||
| 1572 | ;; @r{Make a frame-local binding for @code{foo} in a new frame.} | ||
| 1573 | ;; @r{Store that frame in @code{f2}.} | ||
| 1574 | (setq f2 (make-frame)) | ||
| 1575 | (modify-frame-parameters f2 '((foo . (f 2)))) | ||
| 1576 | @end example | ||
| 1577 | |||
| 1578 | Now we examine @code{foo} in various contexts. Whenever the | ||
| 1579 | buffer @samp{b1} is current, its buffer-local binding is in effect, | ||
| 1580 | regardless of the selected frame: | ||
| 1581 | |||
| 1582 | @example | ||
| 1583 | (select-frame f1) | ||
| 1584 | (set-buffer (get-buffer-create "b1")) | ||
| 1585 | foo | ||
| 1586 | @result{} (b 1) | ||
| 1587 | |||
| 1588 | (select-frame f2) | ||
| 1589 | (set-buffer (get-buffer-create "b1")) | ||
| 1590 | foo | ||
| 1591 | @result{} (b 1) | ||
| 1592 | @end example | ||
| 1593 | |||
| 1594 | @noindent | ||
| 1595 | Otherwise, the frame gets a chance to provide the binding; when frame | ||
| 1596 | @code{f2} is selected, its frame-local binding is in effect: | ||
| 1597 | |||
| 1598 | @example | ||
| 1599 | (select-frame f2) | ||
| 1600 | (set-buffer (get-buffer "*scratch*")) | ||
| 1601 | foo | ||
| 1602 | @result{} (f 2) | ||
| 1603 | @end example | ||
| 1604 | |||
| 1605 | @noindent | ||
| 1606 | When neither the current buffer nor the selected frame provides | ||
| 1607 | a binding, the default binding is used: | ||
| 1608 | |||
| 1609 | @example | ||
| 1610 | (select-frame f1) | ||
| 1611 | (set-buffer (get-buffer "*scratch*")) | ||
| 1612 | foo | ||
| 1613 | @result{} nil | ||
| 1614 | @end example | ||
| 1615 | |||
| 1616 | @noindent | ||
| 1617 | When the active binding of a variable is a frame-local binding, setting | ||
| 1618 | the variable changes that binding. You can observe the result with | ||
| 1619 | @code{frame-parameters}: | ||
| 1620 | |||
| 1621 | @example | ||
| 1622 | (select-frame f2) | ||
| 1623 | (set-buffer (get-buffer "*scratch*")) | ||
| 1624 | (setq foo 'nobody) | ||
| 1625 | (assq 'foo (frame-parameters f2)) | ||
| 1626 | @result{} (foo . nobody) | ||
| 1627 | @end example | ||
| 1628 | |||
| 1629 | @node Future Local Variables | 1516 | @node Future Local Variables |
| 1630 | @section Possible Future Local Variables | 1517 | @section Possible Future Local Variables |
| 1631 | 1518 | ||