diff options
| author | Joakim Verona | 2011-11-22 15:46:22 +0100 |
|---|---|---|
| committer | Joakim Verona | 2011-11-22 15:46:22 +0100 |
| commit | a9c1e05adddf6011c61c0df582c5f2ed423f35c8 (patch) | |
| tree | 489fac119296416ba2f3530fd3bcb70efbbbdaa6 /doc/lispref | |
| parent | 40bb789236e486a3f36eefb2840c293369ce2af3 (diff) | |
| parent | b5afc20930c91159a1cbf629bcaa7e251653dc74 (diff) | |
| download | emacs-a9c1e05adddf6011c61c0df582c5f2ed423f35c8.tar.gz emacs-a9c1e05adddf6011c61c0df582c5f2ed423f35c8.zip | |
upstream
Diffstat (limited to 'doc/lispref')
| -rw-r--r-- | doc/lispref/ChangeLog | 98 | ||||
| -rw-r--r-- | doc/lispref/compile.texi | 2 | ||||
| -rw-r--r-- | doc/lispref/display.texi | 26 | ||||
| -rw-r--r-- | doc/lispref/frames.texi | 2 | ||||
| -rw-r--r-- | doc/lispref/help.texi | 2 | ||||
| -rw-r--r-- | doc/lispref/searching.texi | 2 | ||||
| -rw-r--r-- | doc/lispref/spellfile | 4 | ||||
| -rw-r--r-- | doc/lispref/windows.texi | 1067 |
8 files changed, 547 insertions, 656 deletions
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index 0fa50492481..293f253c545 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog | |||
| @@ -1,3 +1,43 @@ | |||
| 1 | 2011-11-21 Martin Rudalics <rudalics@gmx.at> | ||
| 2 | |||
| 3 | * windows.texi (Windows and Frames, Splitting Windows): Fix | ||
| 4 | typos. | ||
| 5 | |||
| 6 | 2011-11-21 Chong Yidong <cyd@gnu.org> | ||
| 7 | |||
| 8 | * windows.texi (Splitting Windows): Fix error in documentation of | ||
| 9 | window-combination-limit. | ||
| 10 | (Cyclic Window Ordering): Minor fixes to next-window, | ||
| 11 | one-window-p, and get-lru-window docs. Don't document | ||
| 12 | window-list-1. | ||
| 13 | (Buffers and Windows): Copyedits. | ||
| 14 | (Choosing Window): Document special handling of special-display-*. | ||
| 15 | (Choosing Window Options): Fix display-buffer-reuse-frames doc. | ||
| 16 | Don't document even-window-heights, which is going away. Clarify | ||
| 17 | which options are obeyed by which action functions. | ||
| 18 | |||
| 19 | 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 20 | |||
| 21 | * display.texi (Invisible Text): Clarify point adjustment (bug#10072). | ||
| 22 | |||
| 23 | 2011-11-20 Martin Rudalics <rudalics@gmx.at> | ||
| 24 | |||
| 25 | * windows.texi (Resizing Windows, Splitting Windows): | ||
| 26 | Remove term "status" when talking about combination limits. | ||
| 27 | |||
| 28 | 2011-11-20 Juanma Barranquero <lekktu@gmail.com> | ||
| 29 | |||
| 30 | * compile.texi (Compiler Errors): | ||
| 31 | * help.texi (Help Functions): Fix typos. | ||
| 32 | |||
| 33 | 2011-11-19 Chong Yidong <cyd@gnu.org> | ||
| 34 | |||
| 35 | * windows.texi (Splitting Windows): Clarify role of window | ||
| 36 | parameters in split-window. Shorten the example. | ||
| 37 | (Deleting Windows): Rewrite intro to handle internal windows. | ||
| 38 | Fix delete-windows-on doc. | ||
| 39 | (Selecting Windows): Copyedits. | ||
| 40 | |||
| 1 | 2011-11-17 Martin Rudalics <rudalics@gmx.at> | 41 | 2011-11-17 Martin Rudalics <rudalics@gmx.at> |
| 2 | 42 | ||
| 3 | * windows.texi (Resizing Windows, Splitting Windows) | 43 | * windows.texi (Resizing Windows, Splitting Windows) |
| @@ -6,8 +46,8 @@ | |||
| 6 | 46 | ||
| 7 | 2011-11-16 Martin Rudalics <rudalics@gmx.at> | 47 | 2011-11-16 Martin Rudalics <rudalics@gmx.at> |
| 8 | 48 | ||
| 9 | * windows.texi (Resizing Windows, Splitting Windows): Rename | 49 | * windows.texi (Resizing Windows, Splitting Windows): |
| 10 | occurrences of window-nest to window-combination-limit. | 50 | Rename occurrences of window-nest to window-combination-limit. |
| 11 | 51 | ||
| 12 | 2011-11-14 Juanma Barranquero <lekktu@gmail.com> | 52 | 2011-11-14 Juanma Barranquero <lekktu@gmail.com> |
| 13 | 53 | ||
| @@ -15,8 +55,8 @@ | |||
| 15 | 55 | ||
| 16 | 2011-11-12 Martin Rudalics <rudalics@gmx.at> | 56 | 2011-11-12 Martin Rudalics <rudalics@gmx.at> |
| 17 | 57 | ||
| 18 | * windows.texi (Splitting Windows, Deleting Windows): Remove | 58 | * windows.texi (Splitting Windows, Deleting Windows): |
| 19 | references to splits status of windows. | 59 | Remove references to splits status of windows. |
| 20 | 60 | ||
| 21 | 2011-11-10 Glenn Morris <rgm@gnu.org> | 61 | 2011-11-10 Glenn Morris <rgm@gnu.org> |
| 22 | 62 | ||
| @@ -68,8 +108,8 @@ | |||
| 68 | (Windows and Frames): Various clarifications, e.g. non-live | 108 | (Windows and Frames): Various clarifications, e.g. non-live |
| 69 | windows also belong to frames. Fix window-list description. | 109 | windows also belong to frames. Fix window-list description. |
| 70 | Simplify window nesting example. | 110 | Simplify window nesting example. |
| 71 | (Splitting Windows, Window Configurations): Use | 111 | (Splitting Windows, Window Configurations): |
| 72 | split-window-below. | 112 | Use split-window-below. |
| 73 | 113 | ||
| 74 | 2011-11-04 Eli Zaretskii <eliz@gnu.org> | 114 | 2011-11-04 Eli Zaretskii <eliz@gnu.org> |
| 75 | 115 | ||
| @@ -119,8 +159,8 @@ | |||
| 119 | 159 | ||
| 120 | 2011-10-05 Chong Yidong <cyd@stupidchicken.com> | 160 | 2011-10-05 Chong Yidong <cyd@stupidchicken.com> |
| 121 | 161 | ||
| 122 | * display.texi (Low-Level Font, Face Attributes, Font Lookup): Fix | 162 | * display.texi (Low-Level Font, Face Attributes, Font Lookup): |
| 123 | Emacs manual xref (Bug#9675). | 163 | Fix Emacs manual xref (Bug#9675). |
| 124 | 164 | ||
| 125 | 2011-10-01 Chong Yidong <cyd@stupidchicken.com> | 165 | 2011-10-01 Chong Yidong <cyd@stupidchicken.com> |
| 126 | 166 | ||
| @@ -159,8 +199,8 @@ | |||
| 159 | * windows.texi (Window History): New node. Move text here from | 199 | * windows.texi (Window History): New node. Move text here from |
| 160 | Buffers and Windows. | 200 | Buffers and Windows. |
| 161 | (Switching Buffers): Rename from Displaying Buffers, since we | 201 | (Switching Buffers): Rename from Displaying Buffers, since we |
| 162 | don't document display-buffer here; callers changed. Document | 202 | don't document display-buffer here; callers changed. |
| 163 | FORCE-SAME-WINDOW arg to switch-to-buffer and | 203 | Document FORCE-SAME-WINDOW arg to switch-to-buffer and |
| 164 | switch-to-buffer-other-frame. Delete duplicate | 204 | switch-to-buffer-other-frame. Delete duplicate |
| 165 | replace-buffer-in-windows doc. | 205 | replace-buffer-in-windows doc. |
| 166 | (Choosing Window): Document display actions. | 206 | (Choosing Window): Document display actions. |
| @@ -191,10 +231,10 @@ | |||
| 191 | Provide examples. Describe window-nest and window-splits | 231 | Provide examples. Describe window-nest and window-splits |
| 192 | options. | 232 | options. |
| 193 | (Deleting Windows): Minor rewrite. | 233 | (Deleting Windows): Minor rewrite. |
| 194 | (Selecting Windows): Minor rewrite. Describe | 234 | (Selecting Windows): Minor rewrite. |
| 195 | frame-selected-window and set-frame-selected-window here. | 235 | Describe frame-selected-window and set-frame-selected-window here. |
| 196 | (Cyclic Window Ordering): Minor rewrite. Describe | 236 | (Cyclic Window Ordering): Minor rewrite. |
| 197 | window-list-1. | 237 | Describe window-list-1. |
| 198 | (Buffers and Windows): Rewrite. Explain a window's previous and | 238 | (Buffers and Windows): Rewrite. Explain a window's previous and |
| 199 | next buffers and the corresponding functions. | 239 | next buffers and the corresponding functions. |
| 200 | (Window Tree): Merge into Windows and Frames section. | 240 | (Window Tree): Merge into Windows and Frames section. |
| @@ -296,8 +336,8 @@ | |||
| 296 | 336 | ||
| 297 | * display.texi (Bidirectional Display): Document the pitfalls of | 337 | * display.texi (Bidirectional Display): Document the pitfalls of |
| 298 | concatenating strings with bidirectional content, with possible | 338 | concatenating strings with bidirectional content, with possible |
| 299 | solutions. Document bidi-string-mark-left-to-right. Mention | 339 | solutions. Document bidi-string-mark-left-to-right. |
| 300 | paragraph direction in modes that inherit from prog-mode. | 340 | Mention paragraph direction in modes that inherit from prog-mode. |
| 301 | Document use of `bidi-class' and `mirroring' properties as part of | 341 | Document use of `bidi-class' and `mirroring' properties as part of |
| 302 | reordering. | 342 | reordering. |
| 303 | 343 | ||
| @@ -353,8 +393,8 @@ | |||
| 353 | the next character, and doesn't affect longer sequences in | 393 | the next character, and doesn't affect longer sequences in |
| 354 | particular (bug#8935). | 394 | particular (bug#8935). |
| 355 | 395 | ||
| 356 | * debugging.texi (Using Debugger): Mention | 396 | * debugging.texi (Using Debugger): |
| 357 | @code{eval-expression-debug-on-error} (bug#8549). | 397 | Mention @code{eval-expression-debug-on-error} (bug#8549). |
| 358 | 398 | ||
| 359 | 2011-07-14 Eli Zaretskii <eliz@gnu.org> | 399 | 2011-07-14 Eli Zaretskii <eliz@gnu.org> |
| 360 | 400 | ||
| @@ -503,7 +543,7 @@ | |||
| 503 | 543 | ||
| 504 | 2011-06-15 Lars Magne Ingebrigtsen <larsi@gnus.org> | 544 | 2011-06-15 Lars Magne Ingebrigtsen <larsi@gnus.org> |
| 505 | 545 | ||
| 506 | * processes.texi (Process Information): Renamed `process-alive-p' | 546 | * processes.texi (Process Information): Rename `process-alive-p' |
| 507 | to `process-live-p' for consistency with other `-live-p' functions. | 547 | to `process-live-p' for consistency with other `-live-p' functions. |
| 508 | 548 | ||
| 509 | 2011-06-03 Paul Eggert <eggert@cs.ucla.edu> | 549 | 2011-06-03 Paul Eggert <eggert@cs.ucla.edu> |
| @@ -520,8 +560,8 @@ | |||
| 520 | 560 | ||
| 521 | 2011-05-31 Lars Magne Ingebrigtsen <larsi@gnus.org> | 561 | 2011-05-31 Lars Magne Ingebrigtsen <larsi@gnus.org> |
| 522 | 562 | ||
| 523 | * processes.texi (Process Information): Document | 563 | * processes.texi (Process Information): |
| 524 | `process-alive-p'. | 564 | Document `process-alive-p'. |
| 525 | 565 | ||
| 526 | 2011-05-29 Chong Yidong <cyd@stupidchicken.com> | 566 | 2011-05-29 Chong Yidong <cyd@stupidchicken.com> |
| 527 | 567 | ||
| @@ -1919,8 +1959,8 @@ | |||
| 1919 | 1959 | ||
| 1920 | 2009-05-09 Eli Zaretskii <eliz@gnu.org> | 1960 | 2009-05-09 Eli Zaretskii <eliz@gnu.org> |
| 1921 | 1961 | ||
| 1922 | * nonascii.texi (Default Coding Systems): Document | 1962 | * nonascii.texi (Default Coding Systems): |
| 1923 | find-auto-coding, set-auto-coding, and auto-coding-alist. | 1963 | Document find-auto-coding, set-auto-coding, and auto-coding-alist. |
| 1924 | Add indexing. | 1964 | Add indexing. |
| 1925 | (Lisp and Coding Systems): Add index entries. | 1965 | (Lisp and Coding Systems): Add index entries. |
| 1926 | 1966 | ||
| @@ -2237,7 +2277,7 @@ | |||
| 2237 | (Future Local Variables): Node deleted. | 2277 | (Future Local Variables): Node deleted. |
| 2238 | 2278 | ||
| 2239 | * objects.texi (General Escape Syntax): Update explanation of | 2279 | * objects.texi (General Escape Syntax): Update explanation of |
| 2240 | unicode escape syntax. | 2280 | Unicode escape syntax. |
| 2241 | 2281 | ||
| 2242 | 2009-02-23 Chong Yidong <cyd@stupidchicken.com> | 2282 | 2009-02-23 Chong Yidong <cyd@stupidchicken.com> |
| 2243 | 2283 | ||
| @@ -5151,8 +5191,8 @@ | |||
| 5151 | (Saving Buffers): Mention code and EOL conversions by file I/O | 5191 | (Saving Buffers): Mention code and EOL conversions by file I/O |
| 5152 | primitives and subroutines. | 5192 | primitives and subroutines. |
| 5153 | 5193 | ||
| 5154 | * nonascii.texi (Lisp and Coding Systems): Document | 5194 | * nonascii.texi (Lisp and Coding Systems): |
| 5155 | coding-system-eol-type. Add index entries for eol conversion. | 5195 | Document coding-system-eol-type. Add index entries for eol conversion. |
| 5156 | 5196 | ||
| 5157 | * display.texi (Defining Faces): Mention `mac', and add an xref to | 5197 | * display.texi (Defining Faces): Mention `mac', and add an xref to |
| 5158 | where window-system is described. | 5198 | where window-system is described. |
| @@ -9102,7 +9142,7 @@ | |||
| 9102 | 9142 | ||
| 9103 | * functions.texi (Defining Functions): Explain about redefining | 9143 | * functions.texi (Defining Functions): Explain about redefining |
| 9104 | primitives. | 9144 | primitives. |
| 9105 | (Function Safety): Renamed. Minor changes. | 9145 | (Function Safety): Rename. Minor changes. |
| 9106 | Comment out the detailed criteria for what is safe. | 9146 | Comment out the detailed criteria for what is safe. |
| 9107 | 9147 | ||
| 9108 | 2003-06-22 Andreas Schwab <schwab@suse.de> | 9148 | 2003-06-22 Andreas Schwab <schwab@suse.de> |
| @@ -9603,7 +9643,7 @@ | |||
| 9603 | 9643 | ||
| 9604 | * Makefile (infodir, prefix): New vars. | 9644 | * Makefile (infodir, prefix): New vars. |
| 9605 | (install): Use infodir. | 9645 | (install): Use infodir. |
| 9606 | (emacsinfodir): Deleted. | 9646 | (emacsinfodir): Delete. |
| 9607 | 9647 | ||
| 9608 | 1993-05-27 Richard Stallman (rms@mole.gnu.ai.mit.edu) | 9648 | 1993-05-27 Richard Stallman (rms@mole.gnu.ai.mit.edu) |
| 9609 | 9649 | ||
| @@ -9614,7 +9654,7 @@ | |||
| 9614 | 9654 | ||
| 9615 | 1993-05-16 Jim Blandy (jimb@wookumz.gnu.ai.mit.edu) | 9655 | 1993-05-16 Jim Blandy (jimb@wookumz.gnu.ai.mit.edu) |
| 9616 | 9656 | ||
| 9617 | * Makefile (dist): Changed to use Gzip instead of compress. | 9657 | * Makefile (dist): Change to use Gzip instead of compress. |
| 9618 | 9658 | ||
| 9619 | 1993-04-23 Eric S. Raymond (eric@mole.gnu.ai.mit.edu) | 9659 | 1993-04-23 Eric S. Raymond (eric@mole.gnu.ai.mit.edu) |
| 9620 | 9660 | ||
diff --git a/doc/lispref/compile.texi b/doc/lispref/compile.texi index fe5563370c4..372c041ab7a 100644 --- a/doc/lispref/compile.texi +++ b/doc/lispref/compile.texi | |||
| @@ -528,7 +528,7 @@ but the compiler does not issue warnings for anything that occurs | |||
| 528 | inside @var{body}. | 528 | inside @var{body}. |
| 529 | 529 | ||
| 530 | We recommend that you use this construct around the smallest | 530 | We recommend that you use this construct around the smallest |
| 531 | possible piece of code, to avoid missing possible warnings other than one | 531 | possible piece of code, to avoid missing possible warnings other than |
| 532 | one you intend to suppress. | 532 | one you intend to suppress. |
| 533 | @end defspec | 533 | @end defspec |
| 534 | 534 | ||
diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi index 034d92f78c3..9849420b1f5 100644 --- a/doc/lispref/display.texi +++ b/doc/lispref/display.texi | |||
| @@ -870,15 +870,21 @@ ignore invisible newlines if @code{line-move-ignore-invisible} is | |||
| 870 | non-@code{nil} (the default), but only because they are explicitly | 870 | non-@code{nil} (the default), but only because they are explicitly |
| 871 | programmed to do so. | 871 | programmed to do so. |
| 872 | 872 | ||
| 873 | However, if a command ends with point inside or immediately before | 873 | However, if a command ends with point inside or at the boundary of invisible |
| 874 | invisible text, the main editing loop moves point further forward or | 874 | text, the main editing loop moves point to one of the two ends of the invisible |
| 875 | further backward (in the same direction that the command already moved | 875 | text. Which end to move to is chosen based on the following factors: make sure |
| 876 | it) until that condition is no longer true. Thus, if the command | 876 | that the overall movement of the command is still in the same direction, and |
| 877 | moved point back into an invisible range, Emacs moves point back to | 877 | prefer a position where an inserted char would not inherit the @code{invisible} |
| 878 | the beginning of that range, and then back one more character. If the | 878 | property. Additionally, if the text is not replaced by an ellipsis and the |
| 879 | command moved point forward into an invisible range, Emacs moves point | 879 | command only moved within the invisible text, then point is moved one extra |
| 880 | forward up to the first visible character that follows the invisible | 880 | character so as to try and reflect the command's movement by a visible movement |
| 881 | text. | 881 | of the cursor. |
| 882 | |||
| 883 | Thus, if the command moved point back to an invisible range (with the usual | ||
| 884 | stickiness), Emacs moves point back to the beginning of that range. If the | ||
| 885 | command moved point forward into an invisible range, Emacs moves point forward | ||
| 886 | to the first visible character that follows the invisible text and then forward | ||
| 887 | one more character. | ||
| 882 | 888 | ||
| 883 | Incremental search can make invisible overlays visible temporarily | 889 | Incremental search can make invisible overlays visible temporarily |
| 884 | and/or permanently when a match includes invisible text. To enable | 890 | and/or permanently when a match includes invisible text. To enable |
| @@ -4546,7 +4552,7 @@ you may prefer to use a different one for a given image type (which | |||
| 4546 | @c FIXME how is this priority determined? | 4552 | @c FIXME how is this priority determined? |
| 4547 | loader will be used in practice depends on the priority of the loaders). | 4553 | loader will be used in practice depends on the priority of the loaders). |
| 4548 | @c FIXME why are these uppercase when image-types is lower-case? | 4554 | @c FIXME why are these uppercase when image-types is lower-case? |
| 4549 | @c FIXME what are the possibe options? Are these actually file extensions? | 4555 | @c FIXME what are the possible options? Are these actually file extensions? |
| 4550 | For example, if you never want to use the ImageMagick loader to use | 4556 | For example, if you never want to use the ImageMagick loader to use |
| 4551 | JPEG files, add @code{JPG} to this list. | 4557 | JPEG files, add @code{JPG} to this list. |
| 4552 | 4558 | ||
diff --git a/doc/lispref/frames.texi b/doc/lispref/frames.texi index d2e86a77112..dad1f28026e 100644 --- a/doc/lispref/frames.texi +++ b/doc/lispref/frames.texi | |||
| @@ -953,7 +953,7 @@ variable, Emacs uses the latter. By default, | |||
| 953 | The @code{alpha} frame parameter can also be a cons cell | 953 | The @code{alpha} frame parameter can also be a cons cell |
| 954 | @code{(@samp{active} . @samp{inactive})}, where @samp{active} is the | 954 | @code{(@samp{active} . @samp{inactive})}, where @samp{active} is the |
| 955 | opacity of the frame when it is selected, and @samp{inactive} is the | 955 | opacity of the frame when it is selected, and @samp{inactive} is the |
| 956 | opactity when it is not selected. | 956 | opacity when it is not selected. |
| 957 | @end table | 957 | @end table |
| 958 | 958 | ||
| 959 | The following frame parameters are semi-obsolete in that they are | 959 | The following frame parameters are semi-obsolete in that they are |
diff --git a/doc/lispref/help.texi b/doc/lispref/help.texi index 0ce05d55a07..3426e81cdb3 100644 --- a/doc/lispref/help.texi +++ b/doc/lispref/help.texi | |||
| @@ -653,7 +653,7 @@ buffer, which is used to regenerate the help information when the user | |||
| 653 | clicks on the @samp{Back} or @samp{Forward} buttons. Most commands | 653 | clicks on the @samp{Back} or @samp{Forward} buttons. Most commands |
| 654 | that use the @samp{*Help*} buffer should invoke this function before | 654 | that use the @samp{*Help*} buffer should invoke this function before |
| 655 | clearing the buffer. The @var{item} argument should have the form | 655 | clearing the buffer. The @var{item} argument should have the form |
| 656 | @code{(@var{funtion} . @var{args})}, where @var{funtion} is a function | 656 | @code{(@var{function} . @var{args})}, where @var{function} is a function |
| 657 | to call, with argument list @var{args}, to regenerate the help buffer. | 657 | to call, with argument list @var{args}, to regenerate the help buffer. |
| 658 | The @var{interactive-p} argument is non-@code{nil} if the calling | 658 | The @var{interactive-p} argument is non-@code{nil} if the calling |
| 659 | command was invoked interactively; in that case, the stack of items | 659 | command was invoked interactively; in that case, the stack of items |
diff --git a/doc/lispref/searching.texi b/doc/lispref/searching.texi index fe7c805c6f7..a601ed0c2c0 100644 --- a/doc/lispref/searching.texi +++ b/doc/lispref/searching.texi | |||
| @@ -1213,7 +1213,7 @@ match data around it, to prevent it from being overwritten. | |||
| 1213 | 1213 | ||
| 1214 | Notice that all functions are allowed to overwrite the match data | 1214 | Notice that all functions are allowed to overwrite the match data |
| 1215 | unless they're explicitly documented not to do so. A consequence is | 1215 | unless they're explicitly documented not to do so. A consequence is |
| 1216 | that functions that are run implictly in the background | 1216 | that functions that are run implicitly in the background |
| 1217 | (@pxref{Timers}, and @ref{Idle Timers}) should likely save and restore | 1217 | (@pxref{Timers}, and @ref{Idle Timers}) should likely save and restore |
| 1218 | the match data explicitly. | 1218 | the match data explicitly. |
| 1219 | 1219 | ||
diff --git a/doc/lispref/spellfile b/doc/lispref/spellfile index e66dcc88f71..5c0a6d0f5ea 100644 --- a/doc/lispref/spellfile +++ b/doc/lispref/spellfile | |||
| @@ -376,7 +376,6 @@ inserting' | |||
| 376 | integerp | 376 | integerp |
| 377 | intermixed | 377 | intermixed |
| 378 | ints | 378 | ints |
| 379 | inturned | ||
| 380 | irreversibly | 379 | irreversibly |
| 381 | jum | 380 | jum |
| 382 | keymapp | 381 | keymapp |
| @@ -530,7 +529,6 @@ pointer' | |||
| 530 | pointm | 529 | pointm |
| 531 | pos | 530 | pos |
| 532 | preallocate | 531 | preallocate |
| 533 | predicale | ||
| 534 | preload | 532 | preload |
| 535 | prepend | 533 | prepend |
| 536 | prepended | 534 | prepended |
| @@ -641,7 +639,7 @@ suspension' | |||
| 641 | symbolp | 639 | symbolp |
| 642 | symlink | 640 | symlink |
| 643 | syms | 641 | syms |
| 644 | syntatic | 642 | syntactic |
| 645 | tabname | 643 | tabname |
| 646 | temacs | 644 | temacs |
| 647 | temporarily' | 645 | temporarily' |
diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi index 8c99a06909b..bb1b0524689 100644 --- a/doc/lispref/windows.texi +++ b/doc/lispref/windows.texi | |||
| @@ -110,6 +110,7 @@ including for the case where @var{object} is a deleted window. | |||
| 110 | @end defun | 110 | @end defun |
| 111 | 111 | ||
| 112 | @cindex selected window | 112 | @cindex selected window |
| 113 | @cindex window selected within a frame | ||
| 113 | In each frame, at any time, exactly one Emacs window is designated | 114 | In each frame, at any time, exactly one Emacs window is designated |
| 114 | as @dfn{selected within the frame}. For the selected frame, that | 115 | as @dfn{selected within the frame}. For the selected frame, that |
| 115 | window is called the @dfn{selected window}---the one in which most | 116 | window is called the @dfn{selected window}---the one in which most |
| @@ -148,10 +149,10 @@ the minibuffer window in the returned list. If @var{minibuffer} is | |||
| 148 | active. If @var{minibuffer} is neither @code{nil} nor @code{t}, the | 149 | active. If @var{minibuffer} is neither @code{nil} nor @code{t}, the |
| 149 | minibuffer window is never included. | 150 | minibuffer window is never included. |
| 150 | 151 | ||
| 151 | The optional argument @var{window}, if non-@code{nil}, should be a | 152 | The optional argument @var{window}, if non-@code{nil}, should be a live |
| 152 | live window on the specified frame; then @var{window} will be the | 153 | window on the specified frame; then @var{window} will be the first |
| 153 | first element in the returned list. If @var{window} is omitted or | 154 | element in the returned list. If @var{window} is omitted or @code{nil}, |
| 154 | @code{nil}, the window selected within the frame is first element. | 155 | the window selected within the frame is the first element. |
| 155 | @end defun | 156 | @end defun |
| 156 | 157 | ||
| 157 | @cindex window tree | 158 | @cindex window tree |
| @@ -634,9 +635,9 @@ function @code{window-resizable} above. | |||
| 634 | 635 | ||
| 635 | The choice of which window edges this function alters depends on the | 636 | The choice of which window edges this function alters depends on the |
| 636 | values of the option @code{window-combination-resize} and the | 637 | values of the option @code{window-combination-resize} and the |
| 637 | combination-limit status of the involved windows; in some cases, it may | 638 | combination limits of the involved windows; in some cases, it may alter |
| 638 | alter both edges. @xref{Splitting Windows}. To resize by moving only | 639 | both edges. @xref{Splitting Windows}. To resize by moving only the |
| 639 | the bottom or right edge of a window, use the function | 640 | bottom or right edge of a window, use the function |
| 640 | @code{adjust-window-trailing-edge}, below. | 641 | @code{adjust-window-trailing-edge}, below. |
| 641 | @end defun | 642 | @end defun |
| 642 | 643 | ||
| @@ -774,22 +775,24 @@ properties from it, including margins and scroll bars. If | |||
| 774 | @var{window} is an internal window, the new window inherits the | 775 | @var{window} is an internal window, the new window inherits the |
| 775 | properties of the window selected within @var{window}'s frame. | 776 | properties of the window selected within @var{window}'s frame. |
| 776 | 777 | ||
| 777 | If the variable @code{ignore-window-parameters} is non-@code{nil} | 778 | The behavior of this function may be altered by the window parameters |
| 778 | (@pxref{Window Parameters}), this function ignores window parameters. | 779 | of @var{window}, so long as the variable |
| 779 | Otherwise, it consults the @code{split-window} parameter of | 780 | @code{ignore-window-parameters} is non-@code{nil}. If the value of |
| 780 | @var{window}; if this is @code{t}, it splits the window disregarding | 781 | the @code{split-window} window parameter is @code{t}, this function |
| 781 | any other window parameters. If the @code{split-window} parameter | 782 | ignores all other window parameters. Otherwise, if the value of the |
| 782 | specifies a function, that function is called with the arguments | 783 | @code{split-window} window parameter is a function, that function is |
| 783 | @var{window}, @var{size}, and @var{side} to split @var{window}, in | 784 | called with the arguments @var{window}, @var{size}, and @var{side}, in |
| 784 | lieu of the usual action of @code{split-window}. | 785 | lieu of the usual action of @code{split-window}. Otherwise, this |
| 786 | function obeys the @code{window-atom} or @code{window-side} window | ||
| 787 | parameter, if any. @xref{Window Parameters}. | ||
| 785 | @end deffn | 788 | @end deffn |
| 786 | 789 | ||
| 787 | As an example, we show a combination of @code{split-window} calls | 790 | As an example, here is a sequence of @code{split-window} calls that |
| 788 | that yields the window configuration discussed in @ref{Windows and | 791 | yields the window configuration discussed in @ref{Windows and Frames}. |
| 789 | Frames}. This example demonstrates splitting a live window as well as | 792 | This example demonstrates splitting a live window as well as splitting |
| 790 | splitting an internal window. We begin with a frame containing a | 793 | an internal window. We begin with a frame containing a single window |
| 791 | single window (a live root window), which we denote by @var{W4}. | 794 | (a live root window), which we denote by @var{W4}. Calling |
| 792 | Calling @code{(split-window W3)} yields this window configuration: | 795 | @code{(split-window W4)} yields this window configuration: |
| 793 | 796 | ||
| 794 | @smallexample | 797 | @smallexample |
| 795 | @group | 798 | @group |
| @@ -841,9 +844,6 @@ A new live window @var{W2} is created, to the left of the internal | |||
| 841 | window @var{W3}. A new internal window @var{W1} is created, becoming | 844 | window @var{W3}. A new internal window @var{W1} is created, becoming |
| 842 | the new root window. | 845 | the new root window. |
| 843 | 846 | ||
| 844 | The following two options can be used to modify the operation of | ||
| 845 | @code{split-window}. | ||
| 846 | |||
| 847 | @defopt window-combination-resize | 847 | @defopt window-combination-resize |
| 848 | If this variable is @code{nil}, @code{split-window} can only split a | 848 | If this variable is @code{nil}, @code{split-window} can only split a |
| 849 | window (denoted by @var{window}) if @var{window}'s screen area is | 849 | window (denoted by @var{window}) if @var{window}'s screen area is |
| @@ -854,18 +854,17 @@ If this variable is non-@code{nil}, @code{split-window} tries to | |||
| 854 | resize all windows that are part of the same combination as | 854 | resize all windows that are part of the same combination as |
| 855 | @var{window}, in order to accommodate the new window. In particular, | 855 | @var{window}, in order to accommodate the new window. In particular, |
| 856 | this may allow @code{split-window} to succeed even if @var{window} is | 856 | this may allow @code{split-window} to succeed even if @var{window} is |
| 857 | a fixed-size window or too small to ordinarily split. | 857 | a fixed-size window or too small to ordinarily split. Furthermore, |
| 858 | 858 | subsequently resizing or deleting @var{window} may resize all other | |
| 859 | Also if this variable is non-@code{nil}, subsequent resizing and | 859 | windows in its combination. |
| 860 | deleting @var{window} will usually affect @emph{all} windows in | ||
| 861 | @var{window}'s combination. | ||
| 862 | 860 | ||
| 863 | The setting of this variable has no effect if | 861 | This variable has no effect if @code{window-combination-limit} is |
| 864 | @code{window-combination-limit} (see below) is non-@code{nil}. | 862 | non-@code{nil} (see below). |
| 865 | @end defopt | 863 | @end defopt |
| 866 | 864 | ||
| 867 | To illustrate the use of @code{window-combination-resize} consider the | 865 | To illustrate the effect of @code{window-combination-resize}, |
| 868 | following window configuration: | 866 | consider the following window configuration: |
| 867 | |||
| 869 | @smallexample | 868 | @smallexample |
| 870 | @group | 869 | @group |
| 871 | ______________________________________ | 870 | ______________________________________ |
| @@ -886,9 +885,10 @@ following window configuration: | |||
| 886 | @end group | 885 | @end group |
| 887 | @end smallexample | 886 | @end smallexample |
| 888 | 887 | ||
| 889 | Splitting window @code{W3} with @code{window-combination-resize} | 888 | @noindent |
| 890 | @code{nil} produces a configuration where the size of @code{W2} remains | 889 | If @code{window-combination-resize} is @code{nil}, splitting window |
| 891 | unchanged: | 890 | @code{W3} leaves the size of @code{W2} unchanged: |
| 891 | |||
| 892 | @smallexample | 892 | @smallexample |
| 893 | @group | 893 | @group |
| 894 | ______________________________________ | 894 | ______________________________________ |
| @@ -909,8 +909,11 @@ unchanged: | |||
| 909 | @end group | 909 | @end group |
| 910 | @end smallexample | 910 | @end smallexample |
| 911 | 911 | ||
| 912 | Splitting @code{W3} with @code{window-combination-resize} non-@code{nil} | 912 | @noindent |
| 913 | instead steals the space for @code{W4} from both @code{W2} and @code{W3}: | 913 | If @code{window-combination-resize} is non-@code{nil}, splitting |
| 914 | @code{W3} instead leaves all three live windows with approximately the | ||
| 915 | same height: | ||
| 916 | |||
| 914 | @smallexample | 917 | @smallexample |
| 915 | @group | 918 | @group |
| 916 | ______________________________________ | 919 | ______________________________________ |
| @@ -932,53 +935,51 @@ instead steals the space for @code{W4} from both @code{W2} and @code{W3}: | |||
| 932 | @end smallexample | 935 | @end smallexample |
| 933 | 936 | ||
| 934 | @defopt window-combination-limit | 937 | @defopt window-combination-limit |
| 935 | If this variable is @code{nil}, @code{split-window} creates a new parent | 938 | If the value of this variable is @code{t}, the @code{split-window} |
| 936 | window if and only if the old window has no parent window or shall be | 939 | function always creates a new internal window. If the value is |
| 937 | split orthogonally to the combination it is part of. If this variable | 940 | @code{nil}, the new live window is allowed to share the existing |
| 938 | is @code{t}, @code{split-window} always creates a new parent window. If | 941 | parent window, if one exists, provided the split occurs in the same |
| 939 | this variable is always @code{t}, a frame's window tree is a binary tree | 942 | direction as the existing window combination (otherwise, a new |
| 940 | so every window but the frame's root window has exactly one sibling. | 943 | internal window is created anyway). The default is @code{nil}. Other |
| 941 | Other values are reserved for future use. | 944 | values are reserved for future use. |
| 942 | 945 | ||
| 943 | The value of this variable is also assigned to the combination-limit | 946 | Thus, if the value is always @code{t}, each window tree is a binary |
| 944 | status of the new parent window. The combination-limit status of any | 947 | tree: each window except the root window has exactly one sibling. |
| 945 | window can be retrieved via the function @code{window-combination-limit} | 948 | |
| 946 | and altered by the function @code{set-window-combination-limit}, see | 949 | Furthermore, @code{split-window} calls |
| 947 | below. | 950 | @code{set-window-combination-limit} on the newly-created internal |
| 951 | window, recording the current value of this variable. This affects | ||
| 952 | how the window tree is rearranged when the child windows are deleted | ||
| 953 | (see below). | ||
| 948 | @end defopt | 954 | @end defopt |
| 949 | 955 | ||
| 950 | @defun window-combination-limit &optional window | 956 | @cindex window combination limit |
| 951 | This function returns the combination-limit status of @var{window}. The | 957 | @defun set-window-combination-limit window limit |
| 952 | argument @var{window} can be any window and defaults to the selected | 958 | This functions sets the @dfn{combination limit} of the window |
| 953 | one. Note, however, that the combination-limit status is currently | 959 | @var{window} to @var{limit}. This value can be retrieved via the |
| 954 | meaningful for internal windows only. | 960 | function @code{window-combination-limit}. See below for its effects; |
| 955 | 961 | note that it is only meaningful for internal windows. The | |
| 956 | @cindex combination-limit status | 962 | @code{split-window} function automatically calls this function, passing |
| 957 | The @dfn{combination-limit status} of a window specifies whether that | 963 | the value of the variable @code{window-combination-limit} as |
| 958 | window may be removed and its child windows recombined with that | 964 | @var{limit}. |
| 959 | window's siblings when such a sibling's child window is deleted. The | 965 | @end defun |
| 960 | combination-limit status is initially assigned by @code{split-window} | 966 | |
| 961 | from the current value of the variable @code{window-combination-limit} | 967 | @defun window-combination-limit window |
| 962 | (see above) and can be reset by the function | 968 | This function returns the combination limit for @var{window}. |
| 963 | @code{set-window-combination-limit} (see below). | 969 | |
| 964 | 970 | The combination limit is meaningful only for an internal window. If | |
| 965 | If the return value is @code{nil}, child windows of @var{window} may be | 971 | it is @code{nil}, then Emacs is allowed to automatically delete |
| 966 | recombined with @var{window}'s siblings when a window gets deleted. A | 972 | @var{window}, in response to a window deletion, in order to group the |
| 967 | return value of @code{nil} means that child windows of @var{window} are | 973 | child windows of @var{window} with its sibling windows to form a new |
| 968 | never (re-)combined with @var{window}'s siblings in such a case. | 974 | window combination. If the combination limit is @code{t}, the child |
| 969 | @end defun | 975 | windows of @var{window} are never automatically re-combined with its |
| 970 | 976 | siblings. | |
| 971 | @defun set-window-combination-limit window &optional status | 977 | @end defun |
| 972 | This functions sets the combination-limit status (see above) of | 978 | |
| 973 | @var{window} to @var{status}. The argument @var{window} can be any | 979 | To illustrate the effect of @code{window-combination-limit}, |
| 974 | window and defaults to the selected one. Note that setting the | 980 | consider the following configuration (throughout this example, we will |
| 975 | combination-limit status is meaningful for internal windows only. The | 981 | assume that @code{window-combination-resize} is @code{nil}): |
| 976 | return value is @var{status}. | 982 | |
| 977 | @end defun | ||
| 978 | |||
| 979 | To illustrate the use of @code{window-combination-limit} consider the | ||
| 980 | following configuration (throughout the following examples we shall | ||
| 981 | assume that @code{window-combination-resize} invariantly is @code{nil}). | ||
| 982 | @smallexample | 983 | @smallexample |
| 983 | @group | 984 | @group |
| 984 | ______________________________________ | 985 | ______________________________________ |
| @@ -999,31 +1000,10 @@ assume that @code{window-combination-resize} invariantly is @code{nil}). | |||
| 999 | @end group | 1000 | @end group |
| 1000 | @end smallexample | 1001 | @end smallexample |
| 1001 | 1002 | ||
| 1002 | Splitting @code{W2} into two windows above each other with | 1003 | @noindent |
| 1003 | @code{window-combination-limit} equal @code{nil} will get you a | 1004 | If @code{window-combination-limit} is @code{nil}, splitting @code{W2} |
| 1004 | configuration like: | 1005 | into two windows, one above the other, yields |
| 1005 | @smallexample | ||
| 1006 | @group | ||
| 1007 | ______________________________________ | ||
| 1008 | | ____________________________________ | | ||
| 1009 | || || | ||
| 1010 | || || | ||
| 1011 | ||_________________W2_________________|| | ||
| 1012 | | ____________________________________ | | ||
| 1013 | || || | ||
| 1014 | || || | ||
| 1015 | ||_________________W4_________________|| | ||
| 1016 | | ____________________________________ | | ||
| 1017 | || || | ||
| 1018 | || || | ||
| 1019 | ||_________________W3_________________|| | ||
| 1020 | |__________________W1__________________| | ||
| 1021 | |||
| 1022 | @end group | ||
| 1023 | @end smallexample | ||
| 1024 | 1006 | ||
| 1025 | If you now enlarge window @code{W4}, Emacs steals the necessary space | ||
| 1026 | from window @code{W3} resulting in a configuration like: | ||
| 1027 | @smallexample | 1007 | @smallexample |
| 1028 | @group | 1008 | @group |
| 1029 | ______________________________________ | 1009 | ______________________________________ |
| @@ -1034,43 +1014,24 @@ from window @code{W3} resulting in a configuration like: | |||
| 1034 | | ____________________________________ | | 1014 | | ____________________________________ | |
| 1035 | || || | 1015 | || || |
| 1036 | || || | 1016 | || || |
| 1037 | || || | ||
| 1038 | ||_________________W4_________________|| | 1017 | ||_________________W4_________________|| |
| 1039 | | ____________________________________ | | 1018 | | ____________________________________ | |
| 1040 | || || | 1019 | || || |
| 1020 | || || | ||
| 1041 | ||_________________W3_________________|| | 1021 | ||_________________W3_________________|| |
| 1042 | |__________________W1__________________| | 1022 | |__________________W1__________________| |
| 1043 | 1023 | ||
| 1044 | @end group | 1024 | @end group |
| 1045 | @end smallexample | 1025 | @end smallexample |
| 1046 | 1026 | ||
| 1047 | Deleting window @code{W4}, will return its space to @code{W2} as | 1027 | @noindent |
| 1048 | follows: | 1028 | The newly-created window, @code{W4}, shares the same internal window |
| 1049 | @smallexample | 1029 | @code{W1}. If @code{W4} is resized, it is allowed to resize the other |
| 1050 | @group | 1030 | live window, @code{W3}. |
| 1051 | ______________________________________ | ||
| 1052 | | ____________________________________ | | ||
| 1053 | || || | ||
| 1054 | || || | ||
| 1055 | || || | ||
| 1056 | || || | ||
| 1057 | || || | ||
| 1058 | || || | ||
| 1059 | || || | ||
| 1060 | ||_________________W2_________________|| | ||
| 1061 | | ____________________________________ | | ||
| 1062 | || || | ||
| 1063 | ||_________________W3_________________|| | ||
| 1064 | |__________________W1__________________| | ||
| 1065 | 1031 | ||
| 1066 | @end group | 1032 | If @code{window-combination-limit} is @code{t}, splitting @code{W2} |
| 1067 | @end smallexample | 1033 | in the initial configuration would instead have produced this: |
| 1068 | 1034 | ||
| 1069 | Hence, with respect to the initial configuration, window @code{W2} has | ||
| 1070 | grown at the expense of window @code{W3}. If, however, in the initial | ||
| 1071 | configuration you had split @code{W2} with | ||
| 1072 | @code{window-combination-limit} bound to @code{t}, a new internal window | ||
| 1073 | @code{W5} would have been created as depicted below. | ||
| 1074 | @smallexample | 1035 | @smallexample |
| 1075 | @group | 1036 | @group |
| 1076 | ______________________________________ | 1037 | ______________________________________ |
| @@ -1091,143 +1052,110 @@ configuration you had split @code{W2} with | |||
| 1091 | @end group | 1052 | @end group |
| 1092 | @end smallexample | 1053 | @end smallexample |
| 1093 | 1054 | ||
| 1094 | Enlarging @code{W4} would now have stolen the necessary space from | 1055 | @noindent |
| 1095 | @code{W2} instead of @code{W3} as | 1056 | A new internal window @code{W5} has been created; its children are |
| 1096 | @smallexample | 1057 | @code{W2} and the new live window @code{W4}. Now, @code{W2} is the |
| 1097 | @group | 1058 | only sibling of @code{W4}, so resizing @code{W4} will resize |
| 1098 | ______________________________________ | 1059 | @code{W2}, leaving @code{W3} unaffected. |
| 1099 | | ____________________________________ | | ||
| 1100 | || __________________________________ || | ||
| 1101 | |||________________W2________________||| | ||
| 1102 | || __________________________________ || | ||
| 1103 | ||| ||| | ||
| 1104 | ||| ||| | ||
| 1105 | |||________________W4________________||| | ||
| 1106 | ||_________________W5_________________|| | ||
| 1107 | | ____________________________________ | | ||
| 1108 | || || | ||
| 1109 | || || | ||
| 1110 | ||_________________W3_________________|| | ||
| 1111 | |__________________W1__________________| | ||
| 1112 | |||
| 1113 | @end group | ||
| 1114 | @end smallexample | ||
| 1115 | 1060 | ||
| 1116 | and the subsequent deletion of @code{W4} would have restored the initial | 1061 | For interactive use, Emacs provides two commands which always split |
| 1117 | configuration. | 1062 | the selected window. These call @code{split-window} internally. |
| 1118 | 1063 | ||
| 1119 | For interactive use, Emacs provides two commands which always split the | 1064 | @deffn Command split-window-right &optional size |
| 1120 | selected window. | 1065 | This function splits the selected window into two side-by-side |
| 1066 | windows, putting the selected window on the left. If @var{size} is | ||
| 1067 | positive, the left window gets @var{size} columns; if @var{size} is | ||
| 1068 | negative, the right window gets @minus{}@var{size} columns. | ||
| 1069 | @end deffn | ||
| 1121 | 1070 | ||
| 1122 | @deffn Command split-window-below &optional size | 1071 | @deffn Command split-window-below &optional size |
| 1123 | This function splits the selected window into two windows, one above the | 1072 | This function splits the selected window into two windows, one above |
| 1124 | other, leaving the upper of the two windows selected, with @var{size} | 1073 | the other, leaving the upper window selected. If @var{size} is |
| 1125 | lines. (If @var{size} is negative, then the lower of the two windows | 1074 | positive, the upper window gets @var{size} lines; if @var{size} is |
| 1126 | gets @minus{}@var{size} lines and the upper window gets the rest, but | 1075 | negative, the lower window gets @minus{}@var{size} lines. |
| 1127 | the upper window is still the one selected.) However, if | ||
| 1128 | @code{split-window-keep-point} (see below) is @code{nil}, then either | ||
| 1129 | window can be selected. | ||
| 1130 | |||
| 1131 | In other respects, this function is similar to @code{split-window}. | ||
| 1132 | In particular, the upper window is the original one and the return value | ||
| 1133 | is the new, lower window. | ||
| 1134 | @end deffn | 1076 | @end deffn |
| 1135 | 1077 | ||
| 1136 | @defopt split-window-keep-point | 1078 | @defopt split-window-keep-point |
| 1137 | If this variable is non-@code{nil} (the default), then | 1079 | If the value of this variable is non-@code{nil} (the default), |
| 1138 | @code{split-window-below} behaves as described above. | 1080 | @code{split-window-below} behaves as described above. |
| 1139 | 1081 | ||
| 1140 | If it is @code{nil}, then @code{split-window-below} adjusts point | 1082 | If it is @code{nil}, @code{split-window-below} adjusts point in each |
| 1141 | in each of the two windows to avoid scrolling. (This is useful on | 1083 | of the two windows to minimize redisplay. (This is useful on slow |
| 1142 | slow terminals.) It selects whichever window contains the screen line | 1084 | terminals.) It selects whichever window contains the screen line that |
| 1143 | that point was previously on. Other functions are not affected by | 1085 | point was previously on. Note that this only affects |
| 1144 | this variable. | 1086 | @code{split-window-below}, not the lower-level @code{split-window} |
| 1087 | function. | ||
| 1145 | @end defopt | 1088 | @end defopt |
| 1146 | 1089 | ||
| 1147 | @deffn Command split-window-right &optional size | ||
| 1148 | This function splits the selected window into two windows | ||
| 1149 | side-by-side, leaving the selected window on the left with @var{size} | ||
| 1150 | columns. If @var{size} is negative, the rightmost window gets | ||
| 1151 | @minus{}@var{size} columns, but the leftmost window still remains | ||
| 1152 | selected. | ||
| 1153 | @end deffn | ||
| 1154 | |||
| 1155 | |||
| 1156 | @node Deleting Windows | 1090 | @node Deleting Windows |
| 1157 | @section Deleting Windows | 1091 | @section Deleting Windows |
| 1158 | @cindex deleting windows | 1092 | @cindex deleting windows |
| 1159 | 1093 | ||
| 1160 | A window remains visible on its frame unless you @dfn{delete} it by | 1094 | @dfn{Deleting} a window removes it from the frame's window tree. If |
| 1161 | calling certain functions that delete windows. A deleted window cannot | 1095 | the window is a live window, it disappears from the screen. If the |
| 1162 | appear on the screen, but continues to exist as a Lisp object until | 1096 | window is an internal window, its child windows are deleted too. |
| 1163 | there are no references to it. There is no way to cancel the deletion | ||
| 1164 | of a window aside from restoring a saved window configuration | ||
| 1165 | (@pxref{Window Configurations}). Restoring a window configuration also | ||
| 1166 | deletes any windows that aren't part of that configuration. Erroneous | ||
| 1167 | information may result from using a deleted window as if it were live. | ||
| 1168 | 1097 | ||
| 1169 | @deffn Command delete-window &optional window | 1098 | Even after a window is deleted, it continues to exist as a Lisp |
| 1170 | This function removes @var{window} from display and returns @code{nil}. | 1099 | object, until there are no more references to it. Window deletion can |
| 1171 | The argument @var{window} can denote any window and defaults to the | 1100 | be reversed, by restoring a saved window configuration (@pxref{Window |
| 1172 | selected one. An error is signaled if @var{window} is the only window | 1101 | Configurations}). |
| 1173 | on its frame. Hence @var{window} must have at least one sibling window | ||
| 1174 | (@pxref{Windows and Frames}) in order to get deleted. If @var{window} | ||
| 1175 | is the selected window on its frame, this function selects the most | ||
| 1176 | recently selected live window on that frame instead. | ||
| 1177 | |||
| 1178 | If the variable @code{ignore-window-parameters} (@pxref{Window | ||
| 1179 | Parameters}) is non-@code{nil}, this function ignores all parameters of | ||
| 1180 | @var{window}. Otherwise, if the @code{delete-window} parameter of | ||
| 1181 | @var{window} is @code{t}, it deletes the window disregarding other | ||
| 1182 | window parameters. If the @code{delete-window} parameter specifies a | ||
| 1183 | function, that function is called with @var{window} as its sole | ||
| 1184 | argument. | ||
| 1185 | 1102 | ||
| 1186 | If @code{window-combination-resize} (@pxref{Splitting Windows}) is | 1103 | @deffn Command delete-window &optional window |
| 1187 | @code{nil}, the space @var{window} took up is given to its left sibling | 1104 | This function removes @var{window} from display and returns |
| 1188 | if such a window exists and to its right sibling otherwise. If | 1105 | @code{nil}. If @var{window} is omitted or @code{nil}, it defaults to |
| 1189 | @code{window-combination-resize} is non-@code{nil}, the space of | 1106 | the selected window. If deleting the window would leave no more |
| 1190 | @var{window} is proportionally distributed among the remaining windows | 1107 | windows in the window tree (e.g. if it is the only live window in the |
| 1191 | in the same combination. | 1108 | frame), an error is signaled. |
| 1109 | |||
| 1110 | By default, the space taken up by @var{window} is given to one of its | ||
| 1111 | adjacent sibling windows, if any. However, if the variable | ||
| 1112 | @code{window-combination-resize} is non-@code{nil}, the space is | ||
| 1113 | proportionally distributed among any remaining windows in the window | ||
| 1114 | combination. @xref{Splitting Windows}. | ||
| 1115 | |||
| 1116 | The behavior of this function may be altered by the window parameters | ||
| 1117 | of @var{window}, so long as the variable | ||
| 1118 | @code{ignore-window-parameters} is non-@code{nil}. If the value of | ||
| 1119 | the @code{delete-window} window parameter is @code{t}, this function | ||
| 1120 | ignores all other window parameters. Otherwise, if the value of the | ||
| 1121 | @code{delete-window} window parameter is a function, that function is | ||
| 1122 | called with the argument @var{window}, in lieu of the usual action of | ||
| 1123 | @code{delete-window}. Otherwise, this function obeys the | ||
| 1124 | @code{window-atom} or @code{window-side} window parameter, if any. | ||
| 1125 | @xref{Window Parameters}. | ||
| 1192 | @end deffn | 1126 | @end deffn |
| 1193 | 1127 | ||
| 1194 | @deffn Command delete-other-windows &optional window | 1128 | @deffn Command delete-other-windows &optional window |
| 1195 | This function makes @var{window} fill its frame and returns @code{nil}. | 1129 | This function makes @var{window} fill its frame, by deleting other |
| 1196 | The argument @var{window} can denote an arbitrary window and defaults to | 1130 | windows as necessary. If @var{window} is omitted or @code{nil}, it |
| 1197 | the selected one. Upon exit, @var{window} will be the selected window | 1131 | defaults to the selected window. The return value is @code{nil}. |
| 1198 | on its frame. | 1132 | |
| 1199 | 1133 | The behavior of this function may be altered by the window parameters | |
| 1200 | If the variable @code{ignore-window-parameters} (@pxref{Window | 1134 | of @var{window}, so long as the variable |
| 1201 | Parameters}) is non-@code{nil}, this function ignores all parameters of | 1135 | @code{ignore-window-parameters} is non-@code{nil}. If the value of |
| 1202 | @var{window}. Otherwise, if the @code{delete-other-windows} parameter | 1136 | the @code{delete-other-windows} window parameter is @code{t}, this |
| 1203 | of @var{window} equals @code{t}, it deletes all other windows | 1137 | function ignores all other window parameters. Otherwise, if the value |
| 1204 | disregarding any remaining window parameters. If the | 1138 | of the @code{delete-other-windows} window parameter is a function, |
| 1205 | @code{delete-other-windows} parameter of @var{window} specifies a | 1139 | that function is called with the argument @var{window}, in lieu of the |
| 1206 | function, it calls that function with @var{window} as its sole argument. | 1140 | usual action of @code{delete-other-windows}. Otherwise, this function |
| 1141 | obeys the @code{window-atom} or @code{window-side} window parameter, | ||
| 1142 | if any. @xref{Window Parameters}. | ||
| 1207 | @end deffn | 1143 | @end deffn |
| 1208 | 1144 | ||
| 1209 | @deffn Command delete-windows-on &optional buffer-or-name frame | 1145 | @deffn Command delete-windows-on &optional buffer-or-name frame |
| 1210 | This function deletes all windows showing @var{buffer-or-name}. If | 1146 | This function deletes all windows showing @var{buffer-or-name}, by |
| 1211 | there are no windows showing @var{buffer-or-name}, it does nothing. | 1147 | calling @code{delete-window} on those windows. @var{buffer-or-name} |
| 1212 | The optional argument @var{buffer-or-name} may be a buffer or the name | 1148 | should be a buffer, or the name of a buffer; if omitted or @code{nil}, |
| 1213 | of an existing buffer and defaults to the current buffer. Invoking | 1149 | it defaults to the current buffer. If there are no windows showing |
| 1214 | this command on a minibuffer signals an error. | 1150 | the specified buffer, this function does nothing. If the specified |
| 1215 | 1151 | buffer is a minibuffer, an error is signaled. | |
| 1216 | The function @code{delete-windows-on} operates by calling | 1152 | |
| 1217 | @code{delete-window} for each window showing @var{buffer-or-name}. If a | 1153 | If there is a dedicated window showing the buffer, and that window is |
| 1218 | frame has several windows showing different buffers, then those showing | 1154 | the only one on its frame, this function also deletes that frame if it |
| 1219 | @var{buffer-or-name} are removed, and the other windows expand to fill | 1155 | is not the only frame on the terminal. |
| 1220 | the space. | 1156 | |
| 1221 | 1157 | The optional argument @var{frame} specifies which frames to operate | |
| 1222 | If all windows in some frame are showing @var{buffer-or-name} (including | 1158 | on: |
| 1223 | the case where there is only one window), then that frame is deleted | ||
| 1224 | provided there are other frames left. | ||
| 1225 | |||
| 1226 | The optional argument @var{frame} specifies which frames to operate on. | ||
| 1227 | This function does not use it in quite the same way as the other | ||
| 1228 | functions which scan all live windows (@pxref{Cyclic Window Ordering}); | ||
| 1229 | specifically, the values @code{t} and @code{nil} have the opposite of | ||
| 1230 | their meanings in the other functions. Here are the full details: | ||
| 1231 | 1159 | ||
| 1232 | @itemize @bullet | 1160 | @itemize @bullet |
| 1233 | @item @code{nil} | 1161 | @item @code{nil} |
| @@ -1241,34 +1169,37 @@ means operate on all visible or iconified frames. | |||
| 1241 | @item A frame | 1169 | @item A frame |
| 1242 | means operate on that frame. | 1170 | means operate on that frame. |
| 1243 | @end itemize | 1171 | @end itemize |
| 1244 | @end deffn | ||
| 1245 | 1172 | ||
| 1173 | Note that this argument does not have the same meaning as in other | ||
| 1174 | functions which scan all live windows (@pxref{Cyclic Window | ||
| 1175 | Ordering}). Specifically, the values @code{t} and @code{nil} have the | ||
| 1176 | opposite of their meanings in those other functions. | ||
| 1177 | @end deffn | ||
| 1246 | 1178 | ||
| 1247 | @node Selecting Windows | 1179 | @node Selecting Windows |
| 1248 | @section Selecting Windows | 1180 | @section Selecting Windows |
| 1249 | @cindex selecting a window | 1181 | @cindex selecting a window |
| 1250 | 1182 | ||
| 1251 | @defun select-window window &optional norecord | 1183 | @defun select-window window &optional norecord |
| 1252 | This function makes @var{window} the selected window, see @ref{Basic | 1184 | This function makes @var{window} the selected window, as well as the |
| 1253 | Windows}. Unless @var{window} already is the selected window, this also | 1185 | window selected within its frame (@pxref{Basic Windows}). |
| 1254 | makes @var{window}'s buffer (@pxref{Buffers and Windows}) the current | 1186 | @var{window} must be a live window. Unless @var{window} already is the |
| 1255 | buffer. Moreover, the cursor for selected windows will be displayed in | 1187 | selected window, its buffer becomes the current buffer (@pxref{Buffers |
| 1256 | @var{window} after the next redisplay. This function returns | 1188 | and Windows}). The return value is @var{window}. |
| 1257 | @var{window}. | ||
| 1258 | 1189 | ||
| 1259 | Normally, @var{window}'s selected buffer is moved to the front of the | 1190 | By default, this function also moves @var{window}'s selected buffer to |
| 1260 | buffer list (@pxref{The Buffer List}) and @var{window} becomes the most | 1191 | the front of the buffer list (@pxref{The Buffer List}), and makes |
| 1261 | recently selected window. But if the optional argument @var{norecord} | 1192 | @var{window} the most recently selected window. However, if the |
| 1262 | is non-@code{nil}, the buffer list remains unchanged and @var{window} | 1193 | optional argument @var{norecord} is non-@code{nil}, these additional |
| 1263 | does not become the most recently selected one. | 1194 | actions are omitted. |
| 1264 | @end defun | 1195 | @end defun |
| 1265 | 1196 | ||
| 1266 | @cindex most recently selected windows | 1197 | @cindex most recently selected windows |
| 1267 | The sequence of calls to @code{select-window} with a non-@code{nil} | 1198 | The sequence of calls to @code{select-window} with a non-@code{nil} |
| 1268 | @var{norecord} argument determines an ordering of windows by their | 1199 | @var{norecord} argument determines an ordering of windows by their |
| 1269 | selection time. The function @code{get-lru-window} can be used to | 1200 | selection time. The function @code{get-lru-window} can be used to |
| 1270 | retrieve the least recently selected live window in this ordering, see | 1201 | retrieve the least recently selected live window (@pxref{Cyclic Window |
| 1271 | @ref{Cyclic Window Ordering}. | 1202 | Ordering}). |
| 1272 | 1203 | ||
| 1273 | @defmac save-selected-window forms@dots{} | 1204 | @defmac save-selected-window forms@dots{} |
| 1274 | This macro records the selected frame, as well as the selected window | 1205 | This macro records the selected frame, as well as the selected window |
| @@ -1300,33 +1231,26 @@ The order of recently selected windows and the buffer list are not | |||
| 1300 | changed by this macro. | 1231 | changed by this macro. |
| 1301 | @end defmac | 1232 | @end defmac |
| 1302 | 1233 | ||
| 1303 | @cindex frame selected window | 1234 | @defun frame-selected-window &optional frame |
| 1304 | @cindex window selected within frame | 1235 | This function returns the window on @var{frame} that is selected |
| 1305 | Earlier (@pxref{Basic Windows}) we mentioned that at any time, exactly | 1236 | within that frame. @var{frame} should be a live frame; if omitted or |
| 1306 | one window on any frame is selected within the frame. The significance | 1237 | @code{nil}, it defaults to the selected frame. |
| 1307 | of this designation is that selecting the frame also selects this | ||
| 1308 | window. Conversely, selecting a window for Emacs with | ||
| 1309 | @code{select-window} also makes that window selected within its frame. | ||
| 1310 | |||
| 1311 | @defun frame-selected-window &optional frame | ||
| 1312 | This function returns the window on @var{frame} that is selected within | ||
| 1313 | @var{frame}. The optional argument @var{frame} must denote a live frame | ||
| 1314 | and defaults to the selected one. | ||
| 1315 | @end defun | 1238 | @end defun |
| 1316 | 1239 | ||
| 1317 | @defun set-frame-selected-window frame window &optional norecord | 1240 | @defun set-frame-selected-window frame window &optional norecord |
| 1318 | This function sets the selected window of frame @var{frame} to | 1241 | This function makes @code{window} the window selected within the frame |
| 1319 | @var{window}. The argument @var{frame} must denote a live frame and | 1242 | @var{frame}. @var{frame} should be a live frame; if omitted or |
| 1320 | defaults to the selected one. If @var{frame} is the selected frame, | 1243 | @code{nil}, it defaults to the selected frame. @var{window} should be |
| 1321 | this also makes @var{window} the selected window. The argument | 1244 | a live window; if omitted or @code{nil}, it defaults to the selected |
| 1322 | @var{window} must denote a live window. This function returns | 1245 | window. |
| 1323 | @var{window}. | ||
| 1324 | 1246 | ||
| 1325 | Optional argument @var{norecord} non-@code{nil} means to neither change | 1247 | If @var{frame} is the selected frame, this makes @var{window} the |
| 1326 | the list of most recently selected windows (@pxref{Selecting Windows}) | 1248 | selected window. |
| 1327 | nor the buffer list (@pxref{The Buffer List}). | ||
| 1328 | @end defun | ||
| 1329 | 1249 | ||
| 1250 | If the optional argument @var{norecord} is non-@code{nil}, this | ||
| 1251 | function does not alter the list of most recently selected windows, | ||
| 1252 | nor the buffer list. | ||
| 1253 | @end defun | ||
| 1330 | 1254 | ||
| 1331 | @node Cyclic Window Ordering | 1255 | @node Cyclic Window Ordering |
| 1332 | @section Cyclic Ordering of Windows | 1256 | @section Cyclic Ordering of Windows |
| @@ -1334,28 +1258,22 @@ nor the buffer list (@pxref{The Buffer List}). | |||
| 1334 | @cindex ordering of windows, cyclic | 1258 | @cindex ordering of windows, cyclic |
| 1335 | @cindex window ordering, cyclic | 1259 | @cindex window ordering, cyclic |
| 1336 | 1260 | ||
| 1337 | When you use the command @kbd{C-x o} (@code{other-window}) to select | 1261 | When you use the command @kbd{C-x o} (@code{other-window}) to select |
| 1338 | some other window, it moves through live windows in a specific order. | 1262 | some other window, it moves through live windows in a specific order. |
| 1339 | For any given configuration of windows, this order never varies. It is | 1263 | For any given configuration of windows, this order never varies. It |
| 1340 | called the @dfn{cyclic ordering of windows}. | 1264 | is called the @dfn{cyclic ordering of windows}. |
| 1341 | |||
| 1342 | For a particular frame, this ordering is determined by the window | ||
| 1343 | tree of that frame, see @ref{Windows and Frames}. More precisely, the | ||
| 1344 | ordering is obtained by a depth-first traversal of the frame's window | ||
| 1345 | tree supplemented, if requested, by the frame's minibuffer window. | ||
| 1346 | 1265 | ||
| 1347 | If there's just one live frame, the cyclic ordering is the ordering | 1266 | The ordering is determined by a depth-first traversal of the frame's |
| 1348 | for that frame. Otherwise, the cyclic ordering is obtained by appending | 1267 | window tree, retrieving the live windows which are the leaf nodes of |
| 1349 | the orderings for individual frames in order of the list of all live | 1268 | the tree (@pxref{Windows and Frames}). If the minibuffer is active, |
| 1350 | frames, @ref{Finding All Frames}. In any case, the ordering is made | 1269 | the minibuffer window is included too. The ordering is cyclic, so the |
| 1351 | ``cyclic'' by having the last window precede the first window in the | 1270 | last window in the sequence is followed by the first one. |
| 1352 | ordering. | ||
| 1353 | 1271 | ||
| 1354 | @defun next-window &optional window minibuf all-frames | 1272 | @defun next-window &optional window minibuf all-frames |
| 1355 | @cindex minibuffer window, and @code{next-window} | 1273 | @cindex minibuffer window, and @code{next-window} |
| 1356 | This function returns the window following @var{window} in the cyclic | 1274 | This function returns a live window, the one following @var{window} in |
| 1357 | ordering of windows. The argument @var{window} must specify a live | 1275 | the cyclic ordering of windows. @var{window} should be a live window; |
| 1358 | window and defaults to the selected one. | 1276 | if omitted or @code{nil}, it defaults to the selected window. |
| 1359 | 1277 | ||
| 1360 | The optional argument @var{minibuf} specifies whether minibuffer windows | 1278 | The optional argument @var{minibuf} specifies whether minibuffer windows |
| 1361 | shall be included in the cyclic ordering. Normally, when @var{minibuf} | 1279 | shall be included in the cyclic ordering. Normally, when @var{minibuf} |
| @@ -1369,139 +1287,100 @@ minibuffer windows. If @var{minibuf} is neither @code{t} nor | |||
| 1369 | @code{nil}, minibuffer windows are not included even if they are active. | 1287 | @code{nil}, minibuffer windows are not included even if they are active. |
| 1370 | 1288 | ||
| 1371 | The optional argument @var{all-frames} specifies which frames to | 1289 | The optional argument @var{all-frames} specifies which frames to |
| 1372 | consider. Here are the possible values and their meanings: | 1290 | consider: |
| 1373 | 1291 | ||
| 1374 | @itemize @bullet | 1292 | @itemize @bullet |
| 1375 | @item @code{nil} | 1293 | @item @code{nil} |
| 1376 | means consider all windows on @var{window}'s frame, plus the minibuffer | 1294 | means to consider windows on @var{window}'s frame. If the minibuffer |
| 1377 | window used by that frame even if it lies in some other frame. If the | 1295 | window is considered (as specified by the @var{minibuf} argument), |
| 1378 | minibuffer counts (as determined by @var{minibuf}), then all windows on | 1296 | then frames that share the minibuffer window are considered too. |
| 1379 | all frames that share that minibuffer count too. | ||
| 1380 | 1297 | ||
| 1381 | @item @code{t} | 1298 | @item @code{t} |
| 1382 | means consider all windows on all existing frames. | 1299 | means to consider windows on all existing frames. |
| 1383 | 1300 | ||
| 1384 | @item @code{visible} | 1301 | @item @code{visible} |
| 1385 | means consider all windows on all visible frames. (To get useful | 1302 | means to consider windows on all visible frames. |
| 1386 | results, ensure that @var{window} is on a visible frame.) | ||
| 1387 | 1303 | ||
| 1388 | @item 0 | 1304 | @item 0 |
| 1389 | means consider all windows on all visible or iconified frames. | 1305 | means to consider windows on all visible or iconified frames. |
| 1390 | 1306 | ||
| 1391 | @item A frame | 1307 | @item A frame |
| 1392 | means consider all windows on that frame. | 1308 | means to consider windows on that specific frame. |
| 1393 | 1309 | ||
| 1394 | @item Anything else | 1310 | @item Anything else |
| 1395 | means consider the windows on @var{window}'s frame, and no others. | 1311 | means to consider windows on @var{window}'s frame, and no others. |
| 1396 | @end itemize | 1312 | @end itemize |
| 1397 | 1313 | ||
| 1398 | This example assumes there are two windows, both displaying the | 1314 | If more than one frame is considered, the cyclic ordering is obtained |
| 1399 | buffer @samp{windows.texi}: | 1315 | by appending the orderings for those frames, in the same order as the |
| 1400 | 1316 | list of all live frames (@pxref{Finding All Frames}). | |
| 1401 | @example | ||
| 1402 | @group | ||
| 1403 | (selected-window) | ||
| 1404 | @result{} #<window 56 on windows.texi> | ||
| 1405 | @end group | ||
| 1406 | @group | ||
| 1407 | (next-window (selected-window)) | ||
| 1408 | @result{} #<window 52 on windows.texi> | ||
| 1409 | @end group | ||
| 1410 | @group | ||
| 1411 | (next-window (next-window (selected-window))) | ||
| 1412 | @result{} #<window 56 on windows.texi> | ||
| 1413 | @end group | ||
| 1414 | @end example | ||
| 1415 | @end defun | 1317 | @end defun |
| 1416 | 1318 | ||
| 1417 | @defun previous-window &optional window minibuf all-frames | 1319 | @defun previous-window &optional window minibuf all-frames |
| 1418 | This function returns the window preceding @var{window} in the cyclic | 1320 | This function returns a live window, the one preceding @var{window} in |
| 1419 | ordering of windows. The other arguments specify which windows to | 1321 | the cyclic ordering of windows. The other arguments are handled like |
| 1420 | consider as in @code{next-window}. | 1322 | in @code{next-window}. |
| 1421 | @end defun | 1323 | @end defun |
| 1422 | 1324 | ||
| 1423 | @deffn Command other-window count &optional all-frames | 1325 | @deffn Command other-window count &optional all-frames |
| 1424 | This function selects another window in the cyclic ordering of windows. | 1326 | This function selects a live window, one @var{count} places from the |
| 1425 | @var{count} specifies the number of windows to skip in the ordering, | 1327 | selected window in the cyclic ordering of windows. If @var{count} is |
| 1426 | starting with the selected window, before making the selection. If | 1328 | a positive number, it skips @var{count} windows forwards; if |
| 1427 | @var{count} is a positive number, it skips @var{count} windows forwards. | 1329 | @var{count} is negative, it skips @minus{}@var{count} windows |
| 1428 | @var{count} negative means skip @minus{}@var{count} windows backwards. | 1330 | backwards; if @var{count} is zero, that simply re-selects the selected |
| 1429 | If @var{count} is zero, it does not skip any window, thus re-selecting | 1331 | window. When called interactively, @var{count} is the numeric prefix |
| 1430 | the selected window. In an interactive call, @var{count} is the numeric | 1332 | argument. |
| 1431 | prefix argument. | ||
| 1432 | 1333 | ||
| 1433 | The optional argument @var{all-frames} has the same meaning as in | 1334 | The optional argument @var{all-frames} has the same meaning as in |
| 1434 | @code{next-window}, but the @var{minibuf} argument of @code{next-window} | 1335 | @code{next-window}, like a @code{nil} @var{minibuf} argument to |
| 1435 | is always effectively @code{nil}. This function returns @code{nil}. | 1336 | @code{next-window}. |
| 1436 | 1337 | ||
| 1437 | This function does not select a window that has a non-@code{nil} | 1338 | This function does not select a window that has a non-@code{nil} |
| 1438 | @code{no-other-window} window parameter (@pxref{Window Parameters}). | 1339 | @code{no-other-window} window parameter (@pxref{Window Parameters}). |
| 1439 | @end deffn | 1340 | @end deffn |
| 1440 | 1341 | ||
| 1441 | The following function returns a copy of the list of windows in the | 1342 | @defun walk-windows fun &optional minibuf all-frames |
| 1442 | cyclic ordering. | 1343 | This function calls the function @var{fun} once for each live window, |
| 1344 | with the window as the argument. | ||
| 1443 | 1345 | ||
| 1444 | @defun window-list-1 &optional window &optional minibuf &optional all_frames | 1346 | It follows the cyclic ordering of windows. The optional arguments |
| 1445 | This function returns a list of live windows. The optional arguments | 1347 | @var{minibuf} and @var{all-frames} specify the set of windows |
| 1446 | @var{minibuf} and @var{all-frames} specify the set of windows to include | 1348 | included; these have the same arguments as in @code{next-window}. If |
| 1447 | in the list. See the description of @code{next-window} for details. | 1349 | @var{all-frames} specifies a frame, the first window walked is the |
| 1350 | first window on that frame (the one returned by | ||
| 1351 | @code{frame-first-window}), not necessarily the selected window. | ||
| 1448 | 1352 | ||
| 1449 | The optional argument @var{window} specifies the first window to list | 1353 | If @var{fun} changes the window configuration by splitting or deleting |
| 1450 | and defaults to the selected window. If @var{window} is not on the list | 1354 | windows, that does not alter the set of windows walked, which is |
| 1451 | of windows returned, some other window will be listed first but no error | 1355 | determined prior to calling @var{fun} for the first time. |
| 1452 | is signaled. | ||
| 1453 | @end defun | 1356 | @end defun |
| 1454 | 1357 | ||
| 1455 | The functions described below use @code{window-list-1} for generating a | ||
| 1456 | copy of the list of all relevant windows. Hence, any change of the | ||
| 1457 | window configuration that occurs while one of these functions is | ||
| 1458 | executed is @emph{not} reflected in the list of windows investigated. | ||
| 1459 | |||
| 1460 | @defun walk-windows proc &optional minibuf all-frames | ||
| 1461 | This function cycles through live windows. It calls the function | ||
| 1462 | @var{proc} once for each window, with the window as its sole argument. | ||
| 1463 | |||
| 1464 | The optional arguments @var{minibuf} and @var{all-frames} specify the | ||
| 1465 | set of windows to include in the walk, see @code{next-window} above. If | ||
| 1466 | @var{all-frames} specifies a frame, the first window walked is the first | ||
| 1467 | window on that frame as returned by @code{frame-first-window} and not | ||
| 1468 | necessarily the selected window. | ||
| 1469 | |||
| 1470 | If @var{proc} changes the window configuration by splitting or deleting | ||
| 1471 | windows, that change is not reflected in the set of windows walked. | ||
| 1472 | That set is determined entirely by the set of live windows at the time | ||
| 1473 | this function was invoked. | ||
| 1474 | @end defun | ||
| 1475 | |||
| 1476 | The following function allows to determine whether a specific window is | ||
| 1477 | the only live window. | ||
| 1478 | |||
| 1479 | @defun one-window-p &optional no-mini all-frames | 1358 | @defun one-window-p &optional no-mini all-frames |
| 1480 | This function returns non-@code{nil} if the selected window is the only | 1359 | This function returns @code{t} if the selected window is the only live |
| 1481 | window. | 1360 | window, and @code{nil} otherwise. |
| 1482 | 1361 | ||
| 1483 | The optional argument @var{no-mini}, if non-@code{nil}, means don't | 1362 | If the minibuffer window is active, it is normally considered (so that |
| 1484 | count the minibuffer even if it is active; otherwise, the minibuffer | 1363 | this function returns @code{nil}). However, if the optional argument |
| 1485 | window is counted when it is active. The optional argument | 1364 | @var{no-mini} is non-@code{nil}, the minibuffer window is ignored even |
| 1486 | @var{all-frames} has the same meaning as for @code{next-window}, see | 1365 | if active. The optional argument @var{all-frames} has the same |
| 1487 | above. | 1366 | meaning as for @code{next-window}. |
| 1488 | @end defun | 1367 | @end defun |
| 1489 | 1368 | ||
| 1490 | @cindex finding windows | 1369 | @cindex finding windows |
| 1491 | The following functions choose (but do not select) one of the windows | 1370 | The following functions return a window which satisfies some |
| 1492 | on the screen, offering various criteria for the choice. | 1371 | criterion, without selecting it: |
| 1493 | 1372 | ||
| 1494 | @cindex least recently used window | 1373 | @cindex least recently used window |
| 1495 | @defun get-lru-window &optional all-frames dedicated | 1374 | @defun get-lru-window &optional all-frames dedicated |
| 1496 | This function returns the window least recently ``used'' (that is, | 1375 | This function returns a live window which is heuristically the ``least |
| 1497 | selected). If any full-width windows are present, it only considers | 1376 | recently used'' window. The optional argument @var{all-frames} has |
| 1498 | these. The optional argument @var{all-frames} has the same meaning as | 1377 | the same meaning as in @code{next-window}. |
| 1499 | in @code{next-window}. | ||
| 1500 | 1378 | ||
| 1501 | The selected window is returned if it is the only candidate. A | 1379 | If any full-width windows are present, only those windows are |
| 1502 | minibuffer window is never a candidate. A dedicated window | 1380 | considered. The selected window is never returned, unless it is the |
| 1503 | (@pxref{Dedicated Windows}) is never a candidate unless the optional | 1381 | only candidate. A minibuffer window is never a candidate. A |
| 1504 | argument @var{dedicated} is non-@code{nil}. | 1382 | dedicated window (@pxref{Dedicated Windows}) is never a candidate |
| 1383 | unless the optional argument @var{dedicated} is non-@code{nil}. | ||
| 1505 | @end defun | 1384 | @end defun |
| 1506 | 1385 | ||
| 1507 | @cindex largest window | 1386 | @cindex largest window |
| @@ -1515,22 +1394,23 @@ If there are two candidate windows of the same size, this function | |||
| 1515 | prefers the one that comes first in the cyclic ordering of windows, | 1394 | prefers the one that comes first in the cyclic ordering of windows, |
| 1516 | starting from the selected window. | 1395 | starting from the selected window. |
| 1517 | 1396 | ||
| 1518 | The optional argument @var{all-frames} specifies which set of windows to | 1397 | The optional argument @var{all-frames} specifies the windows to |
| 1519 | consider as with @code{next-window}, see above. | 1398 | search, and has the same meaning as in @code{next-window}. |
| 1520 | @end defun | 1399 | @end defun |
| 1521 | 1400 | ||
| 1522 | @cindex window that satisfies a predicate | 1401 | @cindex window that satisfies a predicate |
| 1523 | @cindex conditional selection of windows | 1402 | @cindex conditional selection of windows |
| 1524 | @defun get-window-with-predicate predicate &optional minibuf all-frames default | 1403 | @defun get-window-with-predicate predicate &optional minibuf all-frames default |
| 1525 | This function returns a window satisfying @var{predicate}. It cycles | 1404 | This function calls the function @var{predicate} for each of the |
| 1526 | through all visible windows calling @var{predicate} on each one of them | 1405 | windows in the cyclic order of windows in turn, passing it the window |
| 1527 | with that window as its argument. The function returns the first window | 1406 | as an argument. If the predicate returns non-@code{nil} for any |
| 1528 | for which @var{predicate} returns a non-@code{nil} value; if that never | 1407 | window, this function stops and returns that window. If no such |
| 1529 | happens, it returns @var{default} (which defaults to @code{nil}). | 1408 | window is found, the return value is @var{default} (which defaults to |
| 1409 | @code{nil}). | ||
| 1530 | 1410 | ||
| 1531 | The optional arguments @var{minibuf} and @var{all-frames} specify the | 1411 | The optional arguments @var{minibuf} and @var{all-frames} specify the |
| 1532 | set of windows to investigate. See the description of | 1412 | windows to search, and have the same meanings as in |
| 1533 | @code{next-window} for details. | 1413 | @code{next-window}. |
| 1534 | @end defun | 1414 | @end defun |
| 1535 | 1415 | ||
| 1536 | @node Buffers and Windows | 1416 | @node Buffers and Windows |
| @@ -1539,47 +1419,41 @@ set of windows to investigate. See the description of | |||
| 1539 | @cindex windows, controlling precisely | 1419 | @cindex windows, controlling precisely |
| 1540 | @cindex buffers, controlled in windows | 1420 | @cindex buffers, controlled in windows |
| 1541 | 1421 | ||
| 1542 | To find out which buffer is displayed in a given window the following | 1422 | This section describes low-level functions for examining and setting |
| 1543 | function is used. | 1423 | the contents of windows. @xref{Switching Buffers}, for higher-level |
| 1424 | functions for displaying a specific buffer in a window. | ||
| 1544 | 1425 | ||
| 1545 | @defun window-buffer &optional window | 1426 | @defun window-buffer &optional window |
| 1546 | This function returns the buffer that @var{window} is displaying. The | 1427 | This function returns the buffer that @var{window} is displaying. If |
| 1547 | argument @var{window} can be any window and defaults to the selected | 1428 | @var{window} is omitted or @code{nil} it defaults to the selected |
| 1548 | one. If @var{window} is an internal window, this function returns | 1429 | window. If @var{window} is an internal window, this function returns |
| 1549 | @code{nil}. | 1430 | @code{nil}. |
| 1550 | @end defun | 1431 | @end defun |
| 1551 | 1432 | ||
| 1552 | The basic, low-level function to associate a window with a buffer is | ||
| 1553 | @code{set-window-buffer}. Higher-level functions like | ||
| 1554 | @code{switch-to-buffer} and @code{display-buffer} try to obey a number | ||
| 1555 | of user customizations regulating which windows are supposed to | ||
| 1556 | display which buffers. @xref{Switching Buffers}. When writing an | ||
| 1557 | application, you should avoid using @code{set-window-buffer} unless | ||
| 1558 | you are sure you need it. | ||
| 1559 | |||
| 1560 | @defun set-window-buffer window buffer-or-name &optional keep-margins | 1433 | @defun set-window-buffer window buffer-or-name &optional keep-margins |
| 1561 | This function makes @var{window} display @var{buffer-or-name} and | 1434 | This function makes @var{window} display @var{buffer-or-name}. |
| 1562 | returns @code{nil}. The argument @var{window} has to denote a live | 1435 | @var{window} should be a live window; if @code{nil}, it defaults to |
| 1563 | window and defaults to the selected one. The argument | 1436 | the selected window. @var{buffer-or-name} should be a buffer, or the |
| 1564 | @var{buffer-or-name} must specify a buffer or the name of an existing | 1437 | name of an existing buffer. This function does not change which |
| 1565 | buffer. An error is signaled when @var{window} is @dfn{strongly} | 1438 | window is selected, nor does it directly change which buffer is |
| 1566 | dedicated to its buffer (@pxref{Dedicated Windows}) and does not already | 1439 | current (@pxref{Current Buffer}). Its return value is @code{nil}. |
| 1567 | display @var{buffer-or-name}. | ||
| 1568 | |||
| 1569 | Normally, displaying @var{buffer-or-name} in @var{window} resets the | ||
| 1570 | window's position, display margins, fringe widths, and scroll bar | ||
| 1571 | settings based on the local variables of the specified buffer. However, | ||
| 1572 | if the optional argument @var{keep-margins} is non-@code{nil}, display | ||
| 1573 | margins and fringe widths of @var{window} remain unchanged. | ||
| 1574 | @xref{Fringes}. | ||
| 1575 | |||
| 1576 | This function is the fundamental primitive for changing which buffer is | ||
| 1577 | displayed in a window, and all ways of doing that call this function. | ||
| 1578 | Neither the selected window nor the current buffer are changed by this | ||
| 1579 | function. | ||
| 1580 | 1440 | ||
| 1581 | This function runs @code{window-scroll-functions} before running | 1441 | If @var{window} is @dfn{strongly dedicated} to a buffer and |
| 1582 | @code{window-configuration-change-hook}, see @ref{Window Hooks}. | 1442 | @var{buffer-or-name} does not specify that buffer, this function |
| 1443 | signals an error. @xref{Dedicated Windows}. | ||
| 1444 | |||
| 1445 | By default, this function resets @var{window}'s position, display | ||
| 1446 | margins, fringe widths, and scroll bar settings, based on the local | ||
| 1447 | variables in the specified buffer. However, if the optional argument | ||
| 1448 | @var{keep-margins} is non-@code{nil}, it leaves the display margins | ||
| 1449 | and fringe widths unchanged. | ||
| 1450 | |||
| 1451 | When writing an application, you should normally use the higher-level | ||
| 1452 | functions described in @ref{Switching Buffers}, instead of calling | ||
| 1453 | @code{set-window-buffer} directly. | ||
| 1454 | |||
| 1455 | This function runs @code{window-scroll-functions}, followed by | ||
| 1456 | @code{window-configuration-change-hook}. @xref{Window Hooks}. | ||
| 1583 | @end defun | 1457 | @end defun |
| 1584 | 1458 | ||
| 1585 | @defvar buffer-display-count | 1459 | @defvar buffer-display-count |
| @@ -1589,28 +1463,26 @@ displayed in a window. It is incremented each time | |||
| 1589 | @end defvar | 1463 | @end defvar |
| 1590 | 1464 | ||
| 1591 | @defvar buffer-display-time | 1465 | @defvar buffer-display-time |
| 1592 | This variable records the time at which a buffer was last made visible | 1466 | This buffer-local variable records the time at which a buffer was last |
| 1593 | in a window. It is always local in each buffer; each time | 1467 | displayed in a window. The value is @code{nil} if the buffer has |
| 1594 | @code{set-window-buffer} is called, it sets this variable to | 1468 | never been displayed. It is updated each time |
| 1595 | @code{(current-time)} in the specified buffer (@pxref{Time of Day}). | 1469 | @code{set-window-buffer} is called for the buffer, with the value |
| 1596 | When a buffer is first created, @code{buffer-display-time} starts out | 1470 | returned by @code{current-time} (@pxref{Time of Day}). |
| 1597 | with the value @code{nil}. | ||
| 1598 | @end defvar | 1471 | @end defvar |
| 1599 | 1472 | ||
| 1600 | @defun get-buffer-window &optional buffer-or-name all-frames | 1473 | @defun get-buffer-window &optional buffer-or-name all-frames |
| 1601 | This function returns a window displaying @var{buffer-or-name}, or | 1474 | This function returns the first window displaying @var{buffer-or-name} |
| 1602 | @code{nil} if there is none. If there are several such windows, then | 1475 | in the cyclic ordering of windows, starting from the selected window |
| 1603 | the function returns the first one in the cyclic ordering of windows, | 1476 | (@pxref{Cyclic Window Ordering}). If no such window exists, the |
| 1604 | starting from the selected window, @xref{Cyclic Window Ordering}. | 1477 | return value is @code{nil}. |
| 1605 | 1478 | ||
| 1606 | The argument @var{buffer-or-name} may be a buffer or a buffer name and | 1479 | @var{buffer-or-name} should be a buffer or the name of a buffer; if |
| 1607 | defaults to the current buffer. The optional argument @var{all-frames} | 1480 | omitted or @code{nil}, it defaults to the current buffer. The |
| 1608 | specifies which windows to consider: | 1481 | optional argument @var{all-frames} specifies which windows to |
| 1482 | consider: | ||
| 1609 | 1483 | ||
| 1610 | @itemize @bullet | 1484 | @itemize @bullet |
| 1611 | @item | 1485 | @item |
| 1612 | @code{nil} means consider windows on the selected frame. | ||
| 1613 | @item | ||
| 1614 | @code{t} means consider windows on all existing frames. | 1486 | @code{t} means consider windows on all existing frames. |
| 1615 | @item | 1487 | @item |
| 1616 | @code{visible} means consider windows on all visible frames. | 1488 | @code{visible} means consider windows on all visible frames. |
| @@ -1618,44 +1490,45 @@ specifies which windows to consider: | |||
| 1618 | 0 means consider windows on all visible or iconified frames. | 1490 | 0 means consider windows on all visible or iconified frames. |
| 1619 | @item | 1491 | @item |
| 1620 | A frame means consider windows on that frame only. | 1492 | A frame means consider windows on that frame only. |
| 1493 | @item | ||
| 1494 | Any other value means consider windows on the selected frame. | ||
| 1621 | @end itemize | 1495 | @end itemize |
| 1622 | 1496 | ||
| 1623 | Observe that the behavior of @code{get-buffer-window} may differ from | 1497 | Note that these meanings differ slightly from those of the |
| 1624 | that of @code{next-window} (@pxref{Cyclic Window Ordering}) when | 1498 | @var{all-frames} argument to @code{next-window} (@pxref{Cyclic Window |
| 1625 | @var{all-frames} equals @code{nil} or any value not listed here. | 1499 | Ordering}). This function may be changed in a future version of Emacs |
| 1626 | Perhaps we will change @code{get-buffer-window} in the future to make it | 1500 | to eliminate this discrepancy. |
| 1627 | compatible with the other functions. | ||
| 1628 | @end defun | 1501 | @end defun |
| 1629 | 1502 | ||
| 1630 | @defun get-buffer-window-list &optional buffer-or-name minibuf all-frames | 1503 | @defun get-buffer-window-list &optional buffer-or-name minibuf all-frames |
| 1631 | This function returns a list of all windows currently displaying | 1504 | This function returns a list of all windows currently displaying |
| 1632 | @var{buffer-or-name}. The argument @var{buffer-or-name} may be a buffer | 1505 | @var{buffer-or-name}. @var{buffer-or-name} should be a buffer or the |
| 1633 | or the name of an existing buffer and defaults to the current buffer. | 1506 | name of an existing buffer. If omitted or @code{nil}, it defaults to |
| 1507 | the current buffer. | ||
| 1634 | 1508 | ||
| 1635 | The two remaining arguments work like the same-named arguments of | 1509 | The arguments @var{minibuf} and @var{all-frames} have the same |
| 1636 | @code{next-window} (@pxref{Cyclic Window Ordering}); they are @emph{not} | 1510 | meanings as in the function @code{next-window} (@pxref{Cyclic Window |
| 1637 | like the optional arguments of @code{get-buffer-window}. | 1511 | Ordering}). Note that the @var{all-frames} argument does @emph{not} |
| 1512 | behave exactly like in @code{get-buffer-window}. | ||
| 1638 | @end defun | 1513 | @end defun |
| 1639 | 1514 | ||
| 1640 | @deffn Command replace-buffer-in-windows &optional buffer-or-name | 1515 | @deffn Command replace-buffer-in-windows &optional buffer-or-name |
| 1641 | This command replaces @var{buffer-or-name} with some other buffer, in | 1516 | This command replaces @var{buffer-or-name} with some other buffer, in |
| 1642 | all windows displaying it. For each such window, it choose another | 1517 | all windows displaying it. @var{buffer-or-name} should be a buffer, |
| 1643 | buffer using @code{switch-to-prev-buffer} (@pxref{Window History}). | 1518 | or the name of an existing buffer; if omitted or @code{nil}, it |
| 1644 | 1519 | defaults to the current buffer. | |
| 1645 | The argument @var{buffer-or-name} may be a buffer, or the name of an | 1520 | |
| 1646 | existing buffer; it defaults to the current buffer. | 1521 | The replacement buffer in each window is chosen via |
| 1647 | 1522 | @code{switch-to-prev-buffer} (@pxref{Window History}). Any dedicated | |
| 1648 | If a window displaying @var{buffer-or-name} is dedicated | 1523 | window displaying @var{buffer-or-name} is deleted (@pxref{Dedicated |
| 1649 | (@pxref{Dedicated Windows}) and is not the only window on its frame, | 1524 | Windows}), unless it is the only window on its frame---if it is the |
| 1650 | that window is deleted. If that window is the only window on its frame | 1525 | only window, and that frame is not the only frame on its terminal, the |
| 1651 | and there are other frames on the frame's terminal, that frame is dealt | 1526 | frame is ``dismissed'' by calling the function specified by |
| 1652 | with by the function specified by @code{frame-auto-hide-function} | 1527 | @code{frame-auto-hide-function} (@pxref{Quitting Windows}). If the |
| 1653 | (@pxref{Quitting Windows}). Otherwise, the buffer provided by the | 1528 | dedicated window is the only window on the only frame on its terminal, |
| 1654 | function @code{switch-to-prev-buffer} (@pxref{Window History}) is | 1529 | the buffer is replaced anyway. |
| 1655 | displayed in the window instead. | ||
| 1656 | @end deffn | 1530 | @end deffn |
| 1657 | 1531 | ||
| 1658 | |||
| 1659 | @node Switching Buffers | 1532 | @node Switching Buffers |
| 1660 | @section Switching to a Buffer in a Window | 1533 | @section Switching to a Buffer in a Window |
| 1661 | @cindex switching to a buffer | 1534 | @cindex switching to a buffer |
| @@ -1731,9 +1604,12 @@ The @var{buffer-or-name} and @var{norecord} arguments have the same | |||
| 1731 | meanings as in @code{switch-to-buffer}. | 1604 | meanings as in @code{switch-to-buffer}. |
| 1732 | @end deffn | 1605 | @end deffn |
| 1733 | 1606 | ||
| 1734 | The above commands use @code{pop-to-buffer}, which is the function | 1607 | The above commands use the function @code{pop-to-buffer}, which |
| 1735 | used by Lisp programs to flexibly display a buffer in some window and | 1608 | flexibly displays a buffer in some window and selects that window for |
| 1736 | select that window for editing: | 1609 | editing. In turn, @code{pop-to-buffer} uses @code{display-buffer} for |
| 1610 | displaying the buffer. Hence, all the variables affecting | ||
| 1611 | @code{display-buffer} will affect it as well. @xref{Choosing Window}, | ||
| 1612 | for the documentation of @code{display-buffer}. | ||
| 1737 | 1613 | ||
| 1738 | @defun pop-to-buffer buffer-or-name &optional action norecord | 1614 | @defun pop-to-buffer buffer-or-name &optional action norecord |
| 1739 | This function makes @var{buffer-or-name} the current buffer and | 1615 | This function makes @var{buffer-or-name} the current buffer and |
| @@ -1743,10 +1619,6 @@ on a different graphical frame, that frame is given input focus if | |||
| 1743 | possible (@pxref{Input Focus}). The return value is the buffer that | 1619 | possible (@pxref{Input Focus}). The return value is the buffer that |
| 1744 | was switched to. | 1620 | was switched to. |
| 1745 | 1621 | ||
| 1746 | This function uses @code{display-buffer} to display the buffer, so all | ||
| 1747 | the variables affecting @code{display-buffer} will affect it as well. | ||
| 1748 | @xref{Choosing Window}. | ||
| 1749 | |||
| 1750 | If @var{buffer-or-name} is @code{nil}, it defaults to the buffer | 1622 | If @var{buffer-or-name} is @code{nil}, it defaults to the buffer |
| 1751 | returned by @code{other-buffer} (@pxref{The Buffer List}). If | 1623 | returned by @code{other-buffer} (@pxref{The Buffer List}). If |
| 1752 | @var{buffer-or-name} is a string that is not the name of any existing | 1624 | @var{buffer-or-name} is a string that is not the name of any existing |
| @@ -1775,8 +1647,8 @@ used as a subroutine by many functions and commands, including | |||
| 1775 | Buffers}). | 1647 | Buffers}). |
| 1776 | 1648 | ||
| 1777 | @cindex display action | 1649 | @cindex display action |
| 1778 | @cindex action function, for display-buffer | 1650 | @cindex action function, for @code{display-buffer} |
| 1779 | @cindex action alist, for display-buffer | 1651 | @cindex action alist, for @code{display-buffer} |
| 1780 | This command performs several complex steps to find a window to | 1652 | This command performs several complex steps to find a window to |
| 1781 | display in. These steps are described by means of @dfn{display | 1653 | display in. These steps are described by means of @dfn{display |
| 1782 | actions}, which have the form @code{(@var{function} . @var{alist})}. | 1654 | actions}, which have the form @code{(@var{function} . @var{alist})}. |
| @@ -1815,6 +1687,11 @@ The variable @code{display-buffer-overriding-action}. | |||
| 1815 | The user option @code{display-buffer-alist}. | 1687 | The user option @code{display-buffer-alist}. |
| 1816 | 1688 | ||
| 1817 | @item | 1689 | @item |
| 1690 | A special action for handling @code{special-display-buffer-names} and | ||
| 1691 | @code{special-display-regexps}, if either of those variables is | ||
| 1692 | non-@code{nil}. @xref{Choosing Window Options}. | ||
| 1693 | |||
| 1694 | @item | ||
| 1818 | The @var{action} argument. | 1695 | The @var{action} argument. |
| 1819 | 1696 | ||
| 1820 | @item | 1697 | @item |
| @@ -1886,10 +1763,9 @@ This function tries to ``display'' @var{buffer} by finding a window | |||
| 1886 | that is already displaying it. | 1763 | that is already displaying it. |
| 1887 | 1764 | ||
| 1888 | If @var{alist} has a non-@code{nil} @code{inhibit-same-window} entry, | 1765 | If @var{alist} has a non-@code{nil} @code{inhibit-same-window} entry, |
| 1889 | the selected window is not eligible for reuse. | 1766 | the selected window is not eligible for reuse. If @var{alist} |
| 1890 | 1767 | contains a @code{reusable-frames} entry, its value determines which | |
| 1891 | If @var{alist} contains a @code{reusable-frames} entry, its value | 1768 | frames to search for a reusable window: |
| 1892 | determines which frames to search for a reusable window: | ||
| 1893 | 1769 | ||
| 1894 | @itemize @bullet | 1770 | @itemize @bullet |
| 1895 | @item | 1771 | @item |
| @@ -1910,17 +1786,28 @@ normally searches just the selected frame; however, if either the | |||
| 1910 | variable @code{display-buffer-reuse-frames} or the variable | 1786 | variable @code{display-buffer-reuse-frames} or the variable |
| 1911 | @code{pop-up-frames} is non-@code{nil}, it searches all frames on the | 1787 | @code{pop-up-frames} is non-@code{nil}, it searches all frames on the |
| 1912 | current terminal. @xref{Choosing Window Options}. | 1788 | current terminal. @xref{Choosing Window Options}. |
| 1789 | |||
| 1790 | If this function chooses a window on another frame, it makes that | ||
| 1791 | frame visible and raises it if necessary. | ||
| 1913 | @end defun | 1792 | @end defun |
| 1914 | 1793 | ||
| 1915 | @defun display-buffer-pop-up-frame buffer alist | 1794 | @defun display-buffer-pop-up-frame buffer alist |
| 1916 | This function creates a new frame, and displays the buffer in that | 1795 | This function creates a new frame, and displays the buffer in that |
| 1917 | frame's window. | 1796 | frame's window. It actually performs the frame creation by calling |
| 1797 | the function specified in @code{pop-up-frame-function} | ||
| 1798 | (@pxref{Choosing Window Options}). | ||
| 1918 | @end defun | 1799 | @end defun |
| 1919 | 1800 | ||
| 1920 | @defun display-buffer-pop-up-window buffer alist | 1801 | @defun display-buffer-pop-up-window buffer alist |
| 1921 | This function tries to display @var{buffer} by splitting the largest | 1802 | This function tries to display @var{buffer} by splitting the largest |
| 1922 | or least recently-used window. It uses @code{split-window-sensibly} | 1803 | or least recently-used window (typically one on the selected frame). |
| 1923 | as a subroutine (@pxref{Choosing Window Options}). | 1804 | It actually performs the split by calling the function specified in |
| 1805 | @code{split-window-preferred-function} (@pxref{Choosing Window | ||
| 1806 | Options}). | ||
| 1807 | |||
| 1808 | It can fail if no window splitting can be performed for some reason | ||
| 1809 | (e.g. if there is just one frame and it has an @code{unsplittable} | ||
| 1810 | frame parameter; @pxref{Buffer Parameters}). | ||
| 1924 | @end defun | 1811 | @end defun |
| 1925 | 1812 | ||
| 1926 | @defun display-buffer-use-some-window buffer alist | 1813 | @defun display-buffer-use-some-window buffer alist |
| @@ -1937,142 +1824,108 @@ The behavior of the standard display actions of @code{display-buffer} | |||
| 1937 | options. | 1824 | options. |
| 1938 | 1825 | ||
| 1939 | @defopt display-buffer-reuse-frames | 1826 | @defopt display-buffer-reuse-frames |
| 1940 | If this variable is non-@code{nil}, @code{display-buffer} searches | 1827 | If the value of this variable is non-@code{nil}, @code{display-buffer} |
| 1941 | visible and iconified frames for a window displaying | 1828 | may search all frames on the current terminal when looking for a |
| 1942 | @var{buffer-or-name}. If there is such a window, @code{display-buffer} | 1829 | window already displaying the specified buffer. The default is |
| 1943 | makes that window's frame visible and raises it if necessary, and | 1830 | @code{nil}. This variable is consulted by the action function |
| 1944 | returns the window. If there is no such window or | 1831 | @code{display-buffer-reuse-window} (@pxref{Display Action Functions}). |
| 1945 | @code{display-buffer-reuse-frames} is @code{nil}, the behavior of | ||
| 1946 | @code{display-buffer} is determined by the variables described next. | ||
| 1947 | @end defopt | 1832 | @end defopt |
| 1948 | 1833 | ||
| 1949 | @defopt pop-up-windows | 1834 | @defopt pop-up-windows |
| 1950 | This variable specifies whether @code{display-buffer} is allowed to | 1835 | If the value of this variable is non-@code{nil}, @code{display-buffer} |
| 1951 | split (@pxref{Splitting Windows}) an existing window. If this variable | 1836 | is allowed to split an existing window to make a new window for |
| 1952 | is non-@code{nil}, @code{display-buffer} tries to split the largest or | 1837 | displaying in. This is the default. |
| 1953 | least recently used window on the selected frame. (If the selected | 1838 | |
| 1954 | frame is a minibuffer-only frame, @code{display-buffer} tries to split a | 1839 | This variable is provided mainly for backward compatibility. It is |
| 1955 | window on another frame instead.) If this variable is @code{nil} or the | 1840 | obeyed by @code{display-buffer} via a special mechanism in |
| 1956 | variable @code{pop-up-frames} (see below) is non-@code{nil}, | 1841 | @code{display-buffer-fallback-action}, which only calls the action |
| 1957 | @code{display-buffer} does not split any window. | 1842 | function @code{display-buffer-pop-up-window} (@pxref{Display Action |
| 1843 | Functions}) when the value is @code{nil}. It is not consulted by | ||
| 1844 | @code{display-buffer-pop-up-window} itself, which the user may specify | ||
| 1845 | directly in @code{display-buffer-alist} etc. | ||
| 1958 | @end defopt | 1846 | @end defopt |
| 1959 | 1847 | ||
| 1960 | @defopt split-window-preferred-function | 1848 | @defopt split-window-preferred-function |
| 1961 | This variable must specify a function with one argument, which is a | 1849 | This variable specifies a function for splitting a window, in order to |
| 1962 | window. The @code{display-buffer} routines will call this function with | 1850 | make a new window for displaying a buffer. It is used by the |
| 1963 | one or more candidate windows when they look for a window to split. The | 1851 | @code{display-buffer-pop-up-window} action function to actually split |
| 1964 | function is expected to split that window and return the new window. If | 1852 | the window (@pxref{Display Action Functions}). |
| 1965 | the function returns @code{nil}, this means that the argument window | 1853 | |
| 1966 | cannot (or shall not) be split. | 1854 | The default value is @code{split-window-sensibly}, which is documented |
| 1967 | 1855 | below. The value must be a function that takes one argument, a | |
| 1968 | The default value of @code{split-window-preferred-function} is the | 1856 | window, and return either a new window (which is used to display the |
| 1969 | function @code{split-window-sensibly} described below. If you | 1857 | desired buffer) or @code{nil} (which means the splitting failed). |
| 1970 | customize this option, bear in mind that the @code{display-buffer} | ||
| 1971 | routines may call your function up to two times when trying to split a | ||
| 1972 | window. The argument of the first call is the largest window on the | ||
| 1973 | chosen frame (as returned by @code{get-largest-window}). If that call | ||
| 1974 | fails to return a live window, your function is called a second time | ||
| 1975 | with the least recently used window on that frame (as returned by | ||
| 1976 | @code{get-lru-window}). | ||
| 1977 | |||
| 1978 | The function specified by this option may try to split any other window | ||
| 1979 | instead of the argument window. Note that the window selected at the | ||
| 1980 | time @code{display-buffer} was invoked is still selected when your | ||
| 1981 | function is called. Hence, you can split the selected window (instead | ||
| 1982 | of the largest or least recently used one) by simply ignoring the window | ||
| 1983 | argument in the body of your function. You can even choose to not split | ||
| 1984 | any window as long as the return value of your function specifies a live | ||
| 1985 | window or @code{nil}, but you are not encouraged to do so | ||
| 1986 | unconditionally. If you want @code{display-buffer} to never split any | ||
| 1987 | windows, set @code{pop-up-windows} to @code{nil}. | ||
| 1988 | @end defopt | 1858 | @end defopt |
| 1989 | 1859 | ||
| 1990 | @defun split-window-sensibly window | 1860 | @defun split-window-sensibly window |
| 1991 | This function takes a window as argument and tries to split that window | 1861 | This function tries to split @code{window}, and return the newly |
| 1992 | in a suitable way. The two variables described next are useful for | 1862 | created window. If @code{window} cannot be split, it returns |
| 1993 | tuning the behavior of this function. | 1863 | @code{nil}. |
| 1864 | |||
| 1865 | This function obeys the usual rules that determine when a window may | ||
| 1866 | be split (@pxref{Splitting Windows}). It first tries to split by | ||
| 1867 | placing the new window below, subject to the restriction imposed by | ||
| 1868 | @code{split-height-threshold} (see below) in addition to any other | ||
| 1869 | restrictions. If that fails, it tries to split by placing the new | ||
| 1870 | window to the right, subject to @code{split-width-threshold} (see | ||
| 1871 | below). If that fails, and the window is the only window on its | ||
| 1872 | frame, this function again tries to split and place the new window | ||
| 1873 | below, disregarding @code{split-height-threshold}. If this fails as | ||
| 1874 | well, this function gives up and returns @code{nil}. | ||
| 1994 | @end defun | 1875 | @end defun |
| 1995 | 1876 | ||
| 1996 | @defopt split-height-threshold | 1877 | @defopt split-height-threshold |
| 1997 | This variable specifies whether @code{split-window-sensibly} may split | 1878 | This variable, used by @code{split-window-sensibly}, specifies whether |
| 1998 | windows vertically. If it is an integer, @code{split-window-sensibly} | 1879 | to split the window placing the new window below. If it is an |
| 1999 | tries to vertically split a window only if it has at least this many | 1880 | integer, that means to split only if the original window has at least |
| 2000 | lines. If the window has less lines, splitting fails, or the value of | 1881 | that many lines. If it is @code{nil}, that means not to split this |
| 2001 | this variable is @code{nil}, @code{split-window-sensibly} will try to | 1882 | way. |
| 2002 | split the window horizontally, subject to restrictions of | ||
| 2003 | @code{split-width-threshold} (see below). If splitting horizontally | ||
| 2004 | fails too and the window is the only window on its frame, | ||
| 2005 | @code{split-window-sensibly} will try to split the window vertically | ||
| 2006 | disregarding the value of @code{split-height-threshold}. If this fails | ||
| 2007 | as well, @code{split-window-sensibly} returns @code{nil}. | ||
| 2008 | |||
| 2009 | @code{split-window-sensibly} does not split vertically a window whose | ||
| 2010 | height is fixed (@pxref{Resizing Windows}). Also, it vertically splits | ||
| 2011 | a window only if the space taken up by that window can accommodate two | ||
| 2012 | windows one above the other that are both at least | ||
| 2013 | @code{window-min-height} lines tall. Moreover, if the window that shall | ||
| 2014 | be split has a mode line, @code{split-window-sensibly} does not split | ||
| 2015 | the window unless the new window can accommodate a mode line too. | ||
| 2016 | @end defopt | 1883 | @end defopt |
| 2017 | 1884 | ||
| 2018 | @defopt split-width-threshold | 1885 | @defopt split-width-threshold |
| 2019 | This variable specifies whether @code{split-window-sensibly} may split | 1886 | This variable, used by @code{split-window-sensibly}, specifies whether |
| 2020 | windows horizontally. If it is an integer, @code{split-window-sensibly} | 1887 | to split the window placing the new window to the right. If the value |
| 2021 | tries to horizontally split a window only if it has at least this many | 1888 | is an integer, that means to split only if the original window has at |
| 2022 | columns. If it is @code{nil}, @code{split-window-sensibly} will not | 1889 | least that many columns. If the value is @code{nil}, that means not |
| 2023 | split the window horizontally. (It still might split the window | 1890 | to split this way. |
| 2024 | vertically, though, see above.) | ||
| 2025 | |||
| 2026 | @code{split-window-sensibly} does not split horizontally a window if | ||
| 2027 | that window's width is fixed (@pxref{Resizing Windows}). Also, it | ||
| 2028 | horizontally splits a window only if the space that window takes up can | ||
| 2029 | accommodate two windows side by side that are both at least | ||
| 2030 | @code{window-min-width} columns wide. | ||
| 2031 | @end defopt | 1891 | @end defopt |
| 2032 | 1892 | ||
| 2033 | @defopt even-window-heights | ||
| 2034 | This variable specifies whether @code{display-buffer} should even out | ||
| 2035 | window heights if the buffer gets displayed in an existing window, above | ||
| 2036 | or beneath another window. If @code{even-window-heights} is | ||
| 2037 | non-@code{nil}, the default, window heights will be evened out. If | ||
| 2038 | either of the involved window has fixed height (@pxref{Resizing | ||
| 2039 | Windows}) or @code{even-window-heights} is @code{nil}, the original | ||
| 2040 | window heights will be left alone. | ||
| 2041 | @end defopt | ||
| 2042 | |||
| 2043 | @c Emacs 19 feature | ||
| 2044 | @defopt pop-up-frames | 1893 | @defopt pop-up-frames |
| 2045 | This variable specifies whether @code{display-buffer} should make new | 1894 | If the value of this variable is non-@code{nil}, that means |
| 2046 | frames. If it is non-@code{nil}, @code{display-buffer} looks for a | 1895 | @code{display-buffer} may display buffers by making new frames. The |
| 2047 | window already displaying @var{buffer-or-name} on any visible or | 1896 | default is @code{nil}. |
| 2048 | iconified frame. If it finds such a window, it makes that window's | 1897 | |
| 2049 | frame visible and raises it if necessary, and returns the window. | 1898 | A non-@code{nil} value also means that when @code{display-buffer} is |
| 2050 | Otherwise it makes a new frame, unless the variable's value is | 1899 | looking for a window already displaying @var{buffer-or-name}, it can |
| 2051 | @code{graphic-only} and the selected frame is not on a graphic display. | 1900 | search any visible or iconified frame, not just the selected frame. |
| 2052 | @xref{Frames}, for more information. | 1901 | |
| 2053 | 1902 | This variable is provided mainly for backward compatibility. It is | |
| 2054 | Note that the value of @code{pop-up-windows} does not matter if | 1903 | obeyed by @code{display-buffer} via a special mechanism in |
| 2055 | @code{pop-up-frames} is non-@code{nil}. If @code{pop-up-frames} is | 1904 | @code{display-buffer-fallback-action}, which calls the action function |
| 2056 | @code{nil}, then @code{display-buffer} either splits a window or reuses | 1905 | @code{display-buffer-pop-up-frame} (@pxref{Display Action Functions}) |
| 2057 | one. | 1906 | if the value is non-@code{nil}. (This is done before attempting to |
| 1907 | split a window.) This variable is not consulted by | ||
| 1908 | @code{display-buffer-pop-up-frame} itself, which the user may specify | ||
| 1909 | directly in @code{display-buffer-alist} etc. | ||
| 2058 | @end defopt | 1910 | @end defopt |
| 2059 | 1911 | ||
| 2060 | @c Emacs 19 feature | ||
| 2061 | @defopt pop-up-frame-function | 1912 | @defopt pop-up-frame-function |
| 2062 | This variable specifies how to make a new frame if @code{pop-up-frames} | 1913 | This variable specifies a function for creating a new frame, in order |
| 2063 | is non-@code{nil}. | 1914 | to make a new window for displaying a buffer. It is used by the |
| 2064 | 1915 | @code{display-buffer-pop-up-frame} action function (@pxref{Display | |
| 2065 | The value of this variable must be a function of no arguments. When | 1916 | Action Functions}). |
| 2066 | @code{display-buffer} makes a new frame, it does so by calling that | 1917 | |
| 2067 | function, which should return a frame. The default value of this | 1918 | The value should be a function that takes no arguments and returns a |
| 2068 | variable is a function that creates a frame using the parameters | 1919 | frame, or @code{nil} if no frame could be created. The default value |
| 2069 | specified by @code{pop-up-frame-alist} described next. | 1920 | is a function that creates a frame using the parameters specified by |
| 1921 | @code{pop-up-frame-alist} (see below). | ||
| 2070 | @end defopt | 1922 | @end defopt |
| 2071 | 1923 | ||
| 2072 | @defopt pop-up-frame-alist | 1924 | @defopt pop-up-frame-alist |
| 2073 | This variable holds an alist specifying frame parameters used by the | 1925 | This variable holds an alist of frame parameters (@pxref{Frame |
| 2074 | default value of @code{pop-up-frame-function} for making new frames. | 1926 | Parameters}), which is used by the default function in |
| 2075 | @xref{Frame Parameters}, for more information about frame parameters. | 1927 | @code{pop-up-frame-function} to make a new frame. The default is |
| 1928 | @code{nil}. | ||
| 2076 | @end defopt | 1929 | @end defopt |
| 2077 | 1930 | ||
| 2078 | @defopt special-display-buffer-names | 1931 | @defopt special-display-buffer-names |
| @@ -2193,12 +2046,6 @@ This variable takes precedence over all the other options described | |||
| 2193 | above. | 2046 | above. |
| 2194 | @end defopt | 2047 | @end defopt |
| 2195 | 2048 | ||
| 2196 | If all options described above fail to produce a suitable window, | ||
| 2197 | @code{display-buffer} tries to reuse an existing window. As a last | ||
| 2198 | resort, it will try to display @var{buffer-or-name} on a separate frame. | ||
| 2199 | In that case, the value of @code{pop-up-frames} is disregarded. | ||
| 2200 | |||
| 2201 | |||
| 2202 | @node Window History | 2049 | @node Window History |
| 2203 | @section Window History | 2050 | @section Window History |
| 2204 | @cindex window history | 2051 | @cindex window history |