aboutsummaryrefslogtreecommitdiffstats
path: root/doc/lispref
diff options
context:
space:
mode:
authorJoakim Verona2011-11-22 15:46:22 +0100
committerJoakim Verona2011-11-22 15:46:22 +0100
commita9c1e05adddf6011c61c0df582c5f2ed423f35c8 (patch)
tree489fac119296416ba2f3530fd3bcb70efbbbdaa6 /doc/lispref
parent40bb789236e486a3f36eefb2840c293369ce2af3 (diff)
parentb5afc20930c91159a1cbf629bcaa7e251653dc74 (diff)
downloademacs-a9c1e05adddf6011c61c0df582c5f2ed423f35c8.tar.gz
emacs-a9c1e05adddf6011c61c0df582c5f2ed423f35c8.zip
upstream
Diffstat (limited to 'doc/lispref')
-rw-r--r--doc/lispref/ChangeLog98
-rw-r--r--doc/lispref/compile.texi2
-rw-r--r--doc/lispref/display.texi26
-rw-r--r--doc/lispref/frames.texi2
-rw-r--r--doc/lispref/help.texi2
-rw-r--r--doc/lispref/searching.texi2
-rw-r--r--doc/lispref/spellfile4
-rw-r--r--doc/lispref/windows.texi1067
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 @@
12011-11-21 Martin Rudalics <rudalics@gmx.at>
2
3 * windows.texi (Windows and Frames, Splitting Windows): Fix
4 typos.
5
62011-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
192011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
20
21 * display.texi (Invisible Text): Clarify point adjustment (bug#10072).
22
232011-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
282011-11-20 Juanma Barranquero <lekktu@gmail.com>
29
30 * compile.texi (Compiler Errors):
31 * help.texi (Help Functions): Fix typos.
32
332011-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
12011-11-17 Martin Rudalics <rudalics@gmx.at> 412011-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
72011-11-16 Martin Rudalics <rudalics@gmx.at> 472011-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
122011-11-14 Juanma Barranquero <lekktu@gmail.com> 522011-11-14 Juanma Barranquero <lekktu@gmail.com>
13 53
@@ -15,8 +55,8 @@
15 55
162011-11-12 Martin Rudalics <rudalics@gmx.at> 562011-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
212011-11-10 Glenn Morris <rgm@gnu.org> 612011-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
742011-11-04 Eli Zaretskii <eliz@gnu.org> 1142011-11-04 Eli Zaretskii <eliz@gnu.org>
75 115
@@ -119,8 +159,8 @@
119 159
1202011-10-05 Chong Yidong <cyd@stupidchicken.com> 1602011-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
1252011-10-01 Chong Yidong <cyd@stupidchicken.com> 1652011-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
3592011-07-14 Eli Zaretskii <eliz@gnu.org> 3992011-07-14 Eli Zaretskii <eliz@gnu.org>
360 400
@@ -503,7 +543,7 @@
503 543
5042011-06-15 Lars Magne Ingebrigtsen <larsi@gnus.org> 5442011-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
5092011-06-03 Paul Eggert <eggert@cs.ucla.edu> 5492011-06-03 Paul Eggert <eggert@cs.ucla.edu>
@@ -520,8 +560,8 @@
520 560
5212011-05-31 Lars Magne Ingebrigtsen <larsi@gnus.org> 5612011-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
5262011-05-29 Chong Yidong <cyd@stupidchicken.com> 5662011-05-29 Chong Yidong <cyd@stupidchicken.com>
527 567
@@ -1919,8 +1959,8 @@
1919 1959
19202009-05-09 Eli Zaretskii <eliz@gnu.org> 19602009-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
22422009-02-23 Chong Yidong <cyd@stupidchicken.com> 22822009-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
91082003-06-22 Andreas Schwab <schwab@suse.de> 91482003-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
96081993-05-27 Richard Stallman (rms@mole.gnu.ai.mit.edu) 96481993-05-27 Richard Stallman (rms@mole.gnu.ai.mit.edu)
9609 9649
@@ -9614,7 +9654,7 @@
9614 9654
96151993-05-16 Jim Blandy (jimb@wookumz.gnu.ai.mit.edu) 96551993-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
96191993-04-23 Eric S. Raymond (eric@mole.gnu.ai.mit.edu) 96591993-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
528inside @var{body}. 528inside @var{body}.
529 529
530We recommend that you use this construct around the smallest 530We recommend that you use this construct around the smallest
531possible piece of code, to avoid missing possible warnings other than one 531possible piece of code, to avoid missing possible warnings other than
532one you intend to suppress. 532one 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
870non-@code{nil} (the default), but only because they are explicitly 870non-@code{nil} (the default), but only because they are explicitly
871programmed to do so. 871programmed 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
874invisible text, the main editing loop moves point further forward or 874text, the main editing loop moves point to one of the two ends of the invisible
875further backward (in the same direction that the command already moved 875text. Which end to move to is chosen based on the following factors: make sure
876it) until that condition is no longer true. Thus, if the command 876that the overall movement of the command is still in the same direction, and
877moved point back into an invisible range, Emacs moves point back to 877prefer a position where an inserted char would not inherit the @code{invisible}
878the beginning of that range, and then back one more character. If the 878property. Additionally, if the text is not replaced by an ellipsis and the
879command moved point forward into an invisible range, Emacs moves point 879command only moved within the invisible text, then point is moved one extra
880forward up to the first visible character that follows the invisible 880character so as to try and reflect the command's movement by a visible movement
881text. 881of the cursor.
882
883 Thus, if the command moved point back to an invisible range (with the usual
884stickiness), Emacs moves point back to the beginning of that range. If the
885command moved point forward into an invisible range, Emacs moves point forward
886to the first visible character that follows the invisible text and then forward
887one more character.
882 888
883 Incremental search can make invisible overlays visible temporarily 889 Incremental search can make invisible overlays visible temporarily
884and/or permanently when a match includes invisible text. To enable 890and/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?
4547loader will be used in practice depends on the priority of the loaders). 4553loader 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?
4550For example, if you never want to use the ImageMagick loader to use 4556For example, if you never want to use the ImageMagick loader to use
4551JPEG files, add @code{JPG} to this list. 4557JPEG 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,
953The @code{alpha} frame parameter can also be a cons cell 953The @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
955opacity of the frame when it is selected, and @samp{inactive} is the 955opacity of the frame when it is selected, and @samp{inactive} is the
956opactity when it is not selected. 956opacity when it is not selected.
957@end table 957@end table
958 958
959The following frame parameters are semi-obsolete in that they are 959The 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
653clicks on the @samp{Back} or @samp{Forward} buttons. Most commands 653clicks on the @samp{Back} or @samp{Forward} buttons. Most commands
654that use the @samp{*Help*} buffer should invoke this function before 654that use the @samp{*Help*} buffer should invoke this function before
655clearing the buffer. The @var{item} argument should have the form 655clearing 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
657to call, with argument list @var{args}, to regenerate the help buffer. 657to call, with argument list @var{args}, to regenerate the help buffer.
658The @var{interactive-p} argument is non-@code{nil} if the calling 658The @var{interactive-p} argument is non-@code{nil} if the calling
659command was invoked interactively; in that case, the stack of items 659command 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
1215unless they're explicitly documented not to do so. A consequence is 1215unless they're explicitly documented not to do so. A consequence is
1216that functions that are run implictly in the background 1216that 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
1218the match data explicitly. 1218the 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'
376integerp 376integerp
377intermixed 377intermixed
378ints 378ints
379inturned
380irreversibly 379irreversibly
381jum 380jum
382keymapp 381keymapp
@@ -530,7 +529,6 @@ pointer'
530pointm 529pointm
531pos 530pos
532preallocate 531preallocate
533predicale
534preload 532preload
535prepend 533prepend
536prepended 534prepended
@@ -641,7 +639,7 @@ suspension'
641symbolp 639symbolp
642symlink 640symlink
643syms 641syms
644syntatic 642syntactic
645tabname 643tabname
646temacs 644temacs
647temporarily' 645temporarily'
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
114as @dfn{selected within the frame}. For the selected frame, that 115as @dfn{selected within the frame}. For the selected frame, that
115window is called the @dfn{selected window}---the one in which most 116window 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
148active. If @var{minibuffer} is neither @code{nil} nor @code{t}, the 149active. If @var{minibuffer} is neither @code{nil} nor @code{t}, the
149minibuffer window is never included. 150minibuffer window is never included.
150 151
151The optional argument @var{window}, if non-@code{nil}, should be a 152The optional argument @var{window}, if non-@code{nil}, should be a live
152live window on the specified frame; then @var{window} will be the 153window on the specified frame; then @var{window} will be the first
153first element in the returned list. If @var{window} is omitted or 154element in the returned list. If @var{window} is omitted or @code{nil},
154@code{nil}, the window selected within the frame is first element. 155the 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
635The choice of which window edges this function alters depends on the 636The choice of which window edges this function alters depends on the
636values of the option @code{window-combination-resize} and the 637values of the option @code{window-combination-resize} and the
637combination-limit status of the involved windows; in some cases, it may 638combination limits of the involved windows; in some cases, it may alter
638alter both edges. @xref{Splitting Windows}. To resize by moving only 639both edges. @xref{Splitting Windows}. To resize by moving only the
639the bottom or right edge of a window, use the function 640bottom 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
775properties of the window selected within @var{window}'s frame. 776properties of the window selected within @var{window}'s frame.
776 777
777If the variable @code{ignore-window-parameters} is non-@code{nil} 778The behavior of this function may be altered by the window parameters
778(@pxref{Window Parameters}), this function ignores window parameters. 779of @var{window}, so long as the variable
779Otherwise, 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 781the @code{split-window} window parameter is @code{t}, this function
781any other window parameters. If the @code{split-window} parameter 782ignores all other window parameters. Otherwise, if the value of the
782specifies 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 784called with the arguments @var{window}, @var{size}, and @var{side}, in
784lieu of the usual action of @code{split-window}. 785lieu of the usual action of @code{split-window}. Otherwise, this
786function obeys the @code{window-atom} or @code{window-side} window
787parameter, 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
788that yields the window configuration discussed in @ref{Windows and 791yields the window configuration discussed in @ref{Windows and Frames}.
789Frames}. This example demonstrates splitting a live window as well as 792This example demonstrates splitting a live window as well as splitting
790splitting an internal window. We begin with a frame containing a 793an internal window. We begin with a frame containing a single window
791single window (a live root window), which we denote by @var{W4}. 794(a live root window), which we denote by @var{W4}. Calling
792Calling @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
841window @var{W3}. A new internal window @var{W1} is created, becoming 844window @var{W3}. A new internal window @var{W1} is created, becoming
842the new root window. 845the 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
848If this variable is @code{nil}, @code{split-window} can only split a 848If this variable is @code{nil}, @code{split-window} can only split a
849window (denoted by @var{window}) if @var{window}'s screen area is 849window (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
854resize all windows that are part of the same combination as 854resize 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,
856this may allow @code{split-window} to succeed even if @var{window} is 856this may allow @code{split-window} to succeed even if @var{window} is
857a fixed-size window or too small to ordinarily split. 857a fixed-size window or too small to ordinarily split. Furthermore,
858 858subsequently resizing or deleting @var{window} may resize all other
859Also if this variable is non-@code{nil}, subsequent resizing and 859windows in its combination.
860deleting @var{window} will usually affect @emph{all} windows in
861@var{window}'s combination.
862 860
863The setting of this variable has no effect if 861This variable has no effect if @code{window-combination-limit} is
864@code{window-combination-limit} (see below) is non-@code{nil}. 862non-@code{nil} (see below).
865@end defopt 863@end defopt
866 864
867To illustrate the use of @code{window-combination-resize} consider the 865 To illustrate the effect of @code{window-combination-resize},
868following window configuration: 866consider 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
889Splitting window @code{W3} with @code{window-combination-resize} 888@noindent
890@code{nil} produces a configuration where the size of @code{W2} remains 889If @code{window-combination-resize} is @code{nil}, splitting window
891unchanged: 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
912Splitting @code{W3} with @code{window-combination-resize} non-@code{nil} 912@noindent
913instead steals the space for @code{W4} from both @code{W2} and @code{W3}: 913If @code{window-combination-resize} is non-@code{nil}, splitting
914@code{W3} instead leaves all three live windows with approximately the
915same 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
935If this variable is @code{nil}, @code{split-window} creates a new parent 938If the value of this variable is @code{t}, the @code{split-window}
936window if and only if the old window has no parent window or shall be 939function always creates a new internal window. If the value is
937split orthogonally to the combination it is part of. If this variable 940@code{nil}, the new live window is allowed to share the existing
938is @code{t}, @code{split-window} always creates a new parent window. If 941parent window, if one exists, provided the split occurs in the same
939this variable is always @code{t}, a frame's window tree is a binary tree 942direction as the existing window combination (otherwise, a new
940so every window but the frame's root window has exactly one sibling. 943internal window is created anyway). The default is @code{nil}. Other
941Other values are reserved for future use. 944values are reserved for future use.
942 945
943The value of this variable is also assigned to the combination-limit 946Thus, if the value is always @code{t}, each window tree is a binary
944status of the new parent window. The combination-limit status of any 947tree: each window except the root window has exactly one sibling.
945window can be retrieved via the function @code{window-combination-limit} 948
946and altered by the function @code{set-window-combination-limit}, see 949Furthermore, @code{split-window} calls
947below. 950@code{set-window-combination-limit} on the newly-created internal
951window, recording the current value of this variable. This affects
952how 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
951This function returns the combination-limit status of @var{window}. The 957@defun set-window-combination-limit window limit
952argument @var{window} can be any window and defaults to the selected 958This functions sets the @dfn{combination limit} of the window
953one. Note, however, that the combination-limit status is currently 959@var{window} to @var{limit}. This value can be retrieved via the
954meaningful for internal windows only. 960function @code{window-combination-limit}. See below for its effects;
955 961note that it is only meaningful for internal windows. The
956@cindex combination-limit status 962@code{split-window} function automatically calls this function, passing
957The @dfn{combination-limit status} of a window specifies whether that 963the value of the variable @code{window-combination-limit} as
958window may be removed and its child windows recombined with that 964@var{limit}.
959window's siblings when such a sibling's child window is deleted. The 965@end defun
960combination-limit status is initially assigned by @code{split-window} 966
961from 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 968This function returns the combination limit for @var{window}.
963@code{set-window-combination-limit} (see below). 969
964 970The combination limit is meaningful only for an internal window. If
965If the return value is @code{nil}, child windows of @var{window} may be 971it is @code{nil}, then Emacs is allowed to automatically delete
966recombined 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
967return value of @code{nil} means that child windows of @var{window} are 973child windows of @var{window} with its sibling windows to form a new
968never (re-)combined with @var{window}'s siblings in such a case. 974window combination. If the combination limit is @code{t}, the child
969@end defun 975windows of @var{window} are never automatically re-combined with its
970 976siblings.
971@defun set-window-combination-limit window &optional status 977@end defun
972This 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},
974window and defaults to the selected one. Note that setting the 980consider the following configuration (throughout this example, we will
975combination-limit status is meaningful for internal windows only. The 981assume that @code{window-combination-resize} is @code{nil}):
976return value is @var{status}. 982
977@end defun
978
979To illustrate the use of @code{window-combination-limit} consider the
980following configuration (throughout the following examples we shall
981assume 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
1002Splitting @code{W2} into two windows above each other with 1003@noindent
1003@code{window-combination-limit} equal @code{nil} will get you a 1004If @code{window-combination-limit} is @code{nil}, splitting @code{W2}
1004configuration like: 1005into 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
1025If you now enlarge window @code{W4}, Emacs steals the necessary space
1026from 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
1047Deleting window @code{W4}, will return its space to @code{W2} as 1027@noindent
1048follows: 1028The 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 1030live 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 1033in the initial configuration would instead have produced this:
1068 1034
1069Hence, with respect to the initial configuration, window @code{W2} has
1070grown at the expense of window @code{W3}. If, however, in the initial
1071configuration 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
1094Enlarging @code{W4} would now have stolen the necessary space from 1055@noindent
1095@code{W2} instead of @code{W3} as 1056A 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 1058only 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
1116and the subsequent deletion of @code{W4} would have restored the initial 1061 For interactive use, Emacs provides two commands which always split
1117configuration. 1062the selected window. These call @code{split-window} internally.
1118 1063
1119For interactive use, Emacs provides two commands which always split the 1064@deffn Command split-window-right &optional size
1120selected window. 1065This function splits the selected window into two side-by-side
1066windows, putting the selected window on the left. If @var{size} is
1067positive, the left window gets @var{size} columns; if @var{size} is
1068negative, 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
1123This function splits the selected window into two windows, one above the 1072This function splits the selected window into two windows, one above
1124other, leaving the upper of the two windows selected, with @var{size} 1073the other, leaving the upper window selected. If @var{size} is
1125lines. (If @var{size} is negative, then the lower of the two windows 1074positive, the upper window gets @var{size} lines; if @var{size} is
1126gets @minus{}@var{size} lines and the upper window gets the rest, but 1075negative, the lower window gets @minus{}@var{size} lines.
1127the upper window is still the one selected.) However, if
1128@code{split-window-keep-point} (see below) is @code{nil}, then either
1129window can be selected.
1130
1131 In other respects, this function is similar to @code{split-window}.
1132In particular, the upper window is the original one and the return value
1133is the new, lower window.
1134@end deffn 1076@end deffn
1135 1077
1136@defopt split-window-keep-point 1078@defopt split-window-keep-point
1137If this variable is non-@code{nil} (the default), then 1079If 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 1082If it is @code{nil}, @code{split-window-below} adjusts point in each
1141in each of the two windows to avoid scrolling. (This is useful on 1083of the two windows to minimize redisplay. (This is useful on slow
1142slow terminals.) It selects whichever window contains the screen line 1084terminals.) It selects whichever window contains the screen line that
1143that point was previously on. Other functions are not affected by 1085point was previously on. Note that this only affects
1144this variable. 1086@code{split-window-below}, not the lower-level @code{split-window}
1087function.
1145@end defopt 1088@end defopt
1146 1089
1147@deffn Command split-window-right &optional size
1148This function splits the selected window into two windows
1149side-by-side, leaving the selected window on the left with @var{size}
1150columns. If @var{size} is negative, the rightmost window gets
1151@minus{}@var{size} columns, but the leftmost window still remains
1152selected.
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
1160A 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
1161calling certain functions that delete windows. A deleted window cannot 1095the window is a live window, it disappears from the screen. If the
1162appear on the screen, but continues to exist as a Lisp object until 1096window is an internal window, its child windows are deleted too.
1163there are no references to it. There is no way to cancel the deletion
1164of a window aside from restoring a saved window configuration
1165(@pxref{Window Configurations}). Restoring a window configuration also
1166deletes any windows that aren't part of that configuration. Erroneous
1167information 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
1170This function removes @var{window} from display and returns @code{nil}. 1099object, until there are no more references to it. Window deletion can
1171The argument @var{window} can denote any window and defaults to the 1100be reversed, by restoring a saved window configuration (@pxref{Window
1172selected one. An error is signaled if @var{window} is the only window 1101Configurations}).
1173on 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}
1175is the selected window on its frame, this function selects the most
1176recently selected live window on that frame instead.
1177
1178If the variable @code{ignore-window-parameters} (@pxref{Window
1179Parameters}) 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
1182window parameters. If the @code{delete-window} parameter specifies a
1183function, that function is called with @var{window} as its sole
1184argument.
1185 1102
1186If @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 1104This function removes @var{window} from display and returns
1188if 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 1106the selected window. If deleting the window would leave no more
1190@var{window} is proportionally distributed among the remaining windows 1107windows in the window tree (e.g. if it is the only live window in the
1191in the same combination. 1108frame), an error is signaled.
1109
1110By default, the space taken up by @var{window} is given to one of its
1111adjacent sibling windows, if any. However, if the variable
1112@code{window-combination-resize} is non-@code{nil}, the space is
1113proportionally distributed among any remaining windows in the window
1114combination. @xref{Splitting Windows}.
1115
1116The behavior of this function may be altered by the window parameters
1117of @var{window}, so long as the variable
1118@code{ignore-window-parameters} is non-@code{nil}. If the value of
1119the @code{delete-window} window parameter is @code{t}, this function
1120ignores all other window parameters. Otherwise, if the value of the
1121@code{delete-window} window parameter is a function, that function is
1122called 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
1195This function makes @var{window} fill its frame and returns @code{nil}. 1129This function makes @var{window} fill its frame, by deleting other
1196The argument @var{window} can denote an arbitrary window and defaults to 1130windows as necessary. If @var{window} is omitted or @code{nil}, it
1197the selected one. Upon exit, @var{window} will be the selected window 1131defaults to the selected window. The return value is @code{nil}.
1198on its frame. 1132
1199 1133The behavior of this function may be altered by the window parameters
1200If the variable @code{ignore-window-parameters} (@pxref{Window 1134of @var{window}, so long as the variable
1201Parameters}) 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 1136the @code{delete-other-windows} window parameter is @code{t}, this
1203of @var{window} equals @code{t}, it deletes all other windows 1137function ignores all other window parameters. Otherwise, if the value
1204disregarding any remaining window parameters. If the 1138of the @code{delete-other-windows} window parameter is a function,
1205@code{delete-other-windows} parameter of @var{window} specifies a 1139that function is called with the argument @var{window}, in lieu of the
1206function, it calls that function with @var{window} as its sole argument. 1140usual action of @code{delete-other-windows}. Otherwise, this function
1141obeys the @code{window-atom} or @code{window-side} window parameter,
1142if 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
1210This function deletes all windows showing @var{buffer-or-name}. If 1146This function deletes all windows showing @var{buffer-or-name}, by
1211there are no windows showing @var{buffer-or-name}, it does nothing. 1147calling @code{delete-window} on those windows. @var{buffer-or-name}
1212The optional argument @var{buffer-or-name} may be a buffer or the name 1148should be a buffer, or the name of a buffer; if omitted or @code{nil},
1213of an existing buffer and defaults to the current buffer. Invoking 1149it defaults to the current buffer. If there are no windows showing
1214this command on a minibuffer signals an error. 1150the specified buffer, this function does nothing. If the specified
1215 1151buffer is a minibuffer, an error is signaled.
1216The function @code{delete-windows-on} operates by calling 1152
1217@code{delete-window} for each window showing @var{buffer-or-name}. If a 1153If there is a dedicated window showing the buffer, and that window is
1218frame has several windows showing different buffers, then those showing 1154the 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 1155is not the only frame on the terminal.
1220the space. 1156
1221 1157The optional argument @var{frame} specifies which frames to operate
1222If all windows in some frame are showing @var{buffer-or-name} (including 1158on:
1223the case where there is only one window), then that frame is deleted
1224provided there are other frames left.
1225
1226The optional argument @var{frame} specifies which frames to operate on.
1227This function does not use it in quite the same way as the other
1228functions which scan all live windows (@pxref{Cyclic Window Ordering});
1229specifically, the values @code{t} and @code{nil} have the opposite of
1230their 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
1242means operate on that frame. 1170means operate on that frame.
1243@end itemize 1171@end itemize
1244@end deffn
1245 1172
1173Note that this argument does not have the same meaning as in other
1174functions which scan all live windows (@pxref{Cyclic Window
1175Ordering}). Specifically, the values @code{t} and @code{nil} have the
1176opposite 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
1252This function makes @var{window} the selected window, see @ref{Basic 1184This function makes @var{window} the selected window, as well as the
1253Windows}. Unless @var{window} already is the selected window, this also 1185window selected within its frame (@pxref{Basic Windows}).
1254makes @var{window}'s buffer (@pxref{Buffers and Windows}) the current 1186@var{window} must be a live window. Unless @var{window} already is the
1255buffer. Moreover, the cursor for selected windows will be displayed in 1187selected window, its buffer becomes the current buffer (@pxref{Buffers
1256@var{window} after the next redisplay. This function returns 1188and Windows}). The return value is @var{window}.
1257@var{window}.
1258 1189
1259Normally, @var{window}'s selected buffer is moved to the front of the 1190By default, this function also moves @var{window}'s selected buffer to
1260buffer list (@pxref{The Buffer List}) and @var{window} becomes the most 1191the front of the buffer list (@pxref{The Buffer List}), and makes
1261recently selected window. But if the optional argument @var{norecord} 1192@var{window} the most recently selected window. However, if the
1262is non-@code{nil}, the buffer list remains unchanged and @var{window} 1193optional argument @var{norecord} is non-@code{nil}, these additional
1263does not become the most recently selected one. 1194actions are omitted.
1264@end defun 1195@end defun
1265 1196
1266@cindex most recently selected windows 1197@cindex most recently selected windows
1267The 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
1269selection time. The function @code{get-lru-window} can be used to 1200selection time. The function @code{get-lru-window} can be used to
1270retrieve the least recently selected live window in this ordering, see 1201retrieve the least recently selected live window (@pxref{Cyclic Window
1271@ref{Cyclic Window Ordering}. 1202Ordering}).
1272 1203
1273@defmac save-selected-window forms@dots{} 1204@defmac save-selected-window forms@dots{}
1274This macro records the selected frame, as well as the selected window 1205This 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
1300changed by this macro. 1231changed 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 1235This function returns the window on @var{frame} that is selected
1305Earlier (@pxref{Basic Windows}) we mentioned that at any time, exactly 1236within that frame. @var{frame} should be a live frame; if omitted or
1306one window on any frame is selected within the frame. The significance 1237@code{nil}, it defaults to the selected frame.
1307of this designation is that selecting the frame also selects this
1308window. 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
1312This function returns the window on @var{frame} that is selected within
1313@var{frame}. The optional argument @var{frame} must denote a live frame
1314and 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
1318This function sets the selected window of frame @var{frame} to 1241This 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
1320defaults to the selected one. If @var{frame} is the selected frame, 1243@code{nil}, it defaults to the selected frame. @var{window} should be
1321this also makes @var{window} the selected window. The argument 1244a live window; if omitted or @code{nil}, it defaults to the selected
1322@var{window} must denote a live window. This function returns 1245window.
1323@var{window}.
1324 1246
1325Optional argument @var{norecord} non-@code{nil} means to neither change 1247If @var{frame} is the selected frame, this makes @var{window} the
1326the list of most recently selected windows (@pxref{Selecting Windows}) 1248selected window.
1327nor the buffer list (@pxref{The Buffer List}).
1328@end defun
1329 1249
1250If the optional argument @var{norecord} is non-@code{nil}, this
1251function does not alter the list of most recently selected windows,
1252nor 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
1337When 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
1338some other window, it moves through live windows in a specific order. 1262some other window, it moves through live windows in a specific order.
1339For any given configuration of windows, this order never varies. It is 1263For any given configuration of windows, this order never varies. It
1340called the @dfn{cyclic ordering of windows}. 1264is called the @dfn{cyclic ordering of windows}.
1341
1342 For a particular frame, this ordering is determined by the window
1343tree of that frame, see @ref{Windows and Frames}. More precisely, the
1344ordering is obtained by a depth-first traversal of the frame's window
1345tree 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
1348for that frame. Otherwise, the cyclic ordering is obtained by appending 1267window tree, retrieving the live windows which are the leaf nodes of
1349the orderings for individual frames in order of the list of all live 1268the tree (@pxref{Windows and Frames}). If the minibuffer is active,
1350frames, @ref{Finding All Frames}. In any case, the ordering is made 1269the minibuffer window is included too. The ordering is cyclic, so the
1351``cyclic'' by having the last window precede the first window in the 1270last window in the sequence is followed by the first one.
1352ordering.
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}
1356This function returns the window following @var{window} in the cyclic 1274This function returns a live window, the one following @var{window} in
1357ordering of windows. The argument @var{window} must specify a live 1275the cyclic ordering of windows. @var{window} should be a live window;
1358window and defaults to the selected one. 1276if omitted or @code{nil}, it defaults to the selected window.
1359 1277
1360The optional argument @var{minibuf} specifies whether minibuffer windows 1278The optional argument @var{minibuf} specifies whether minibuffer windows
1361shall be included in the cyclic ordering. Normally, when @var{minibuf} 1279shall 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
1371The optional argument @var{all-frames} specifies which frames to 1289The optional argument @var{all-frames} specifies which frames to
1372consider. Here are the possible values and their meanings: 1290consider:
1373 1291
1374@itemize @bullet 1292@itemize @bullet
1375@item @code{nil} 1293@item @code{nil}
1376means consider all windows on @var{window}'s frame, plus the minibuffer 1294means to consider windows on @var{window}'s frame. If the minibuffer
1377window used by that frame even if it lies in some other frame. If the 1295window is considered (as specified by the @var{minibuf} argument),
1378minibuffer counts (as determined by @var{minibuf}), then all windows on 1296then frames that share the minibuffer window are considered too.
1379all frames that share that minibuffer count too.
1380 1297
1381@item @code{t} 1298@item @code{t}
1382means consider all windows on all existing frames. 1299means to consider windows on all existing frames.
1383 1300
1384@item @code{visible} 1301@item @code{visible}
1385means consider all windows on all visible frames. (To get useful 1302means to consider windows on all visible frames.
1386results, ensure that @var{window} is on a visible frame.)
1387 1303
1388@item 0 1304@item 0
1389means consider all windows on all visible or iconified frames. 1305means to consider windows on all visible or iconified frames.
1390 1306
1391@item A frame 1307@item A frame
1392means consider all windows on that frame. 1308means to consider windows on that specific frame.
1393 1309
1394@item Anything else 1310@item Anything else
1395means consider the windows on @var{window}'s frame, and no others. 1311means to consider windows on @var{window}'s frame, and no others.
1396@end itemize 1312@end itemize
1397 1313
1398This example assumes there are two windows, both displaying the 1314If more than one frame is considered, the cyclic ordering is obtained
1399buffer @samp{windows.texi}: 1315by appending the orderings for those frames, in the same order as the
1400 1316list 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
1418This function returns the window preceding @var{window} in the cyclic 1320This function returns a live window, the one preceding @var{window} in
1419ordering of windows. The other arguments specify which windows to 1321the cyclic ordering of windows. The other arguments are handled like
1420consider as in @code{next-window}. 1322in @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
1424This function selects another window in the cyclic ordering of windows. 1326This function selects a live window, one @var{count} places from the
1425@var{count} specifies the number of windows to skip in the ordering, 1327selected window in the cyclic ordering of windows. If @var{count} is
1426starting with the selected window, before making the selection. If 1328a 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. 1330backwards; if @var{count} is zero, that simply re-selects the selected
1429If @var{count} is zero, it does not skip any window, thus re-selecting 1331window. When called interactively, @var{count} is the numeric prefix
1430the selected window. In an interactive call, @var{count} is the numeric 1332argument.
1431prefix argument.
1432 1333
1433The optional argument @var{all-frames} has the same meaning as in 1334The 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
1435is always effectively @code{nil}. This function returns @code{nil}. 1336@code{next-window}.
1436 1337
1437This function does not select a window that has a non-@code{nil} 1338This 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
1441The following function returns a copy of the list of windows in the 1342@defun walk-windows fun &optional minibuf all-frames
1442cyclic ordering. 1343This function calls the function @var{fun} once for each live window,
1344with the window as the argument.
1443 1345
1444@defun window-list-1 &optional window &optional minibuf &optional all_frames 1346It follows the cyclic ordering of windows. The optional arguments
1445This 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 1348included; these have the same arguments as in @code{next-window}. If
1447in the list. See the description of @code{next-window} for details. 1349@var{all-frames} specifies a frame, the first window walked is the
1350first window on that frame (the one returned by
1351@code{frame-first-window}), not necessarily the selected window.
1448 1352
1449The optional argument @var{window} specifies the first window to list 1353If @var{fun} changes the window configuration by splitting or deleting
1450and defaults to the selected window. If @var{window} is not on the list 1354windows, that does not alter the set of windows walked, which is
1451of windows returned, some other window will be listed first but no error 1355determined prior to calling @var{fun} for the first time.
1452is signaled.
1453@end defun 1356@end defun
1454 1357
1455The functions described below use @code{window-list-1} for generating a
1456copy of the list of all relevant windows. Hence, any change of the
1457window configuration that occurs while one of these functions is
1458executed is @emph{not} reflected in the list of windows investigated.
1459
1460@defun walk-windows proc &optional minibuf all-frames
1461This function cycles through live windows. It calls the function
1462@var{proc} once for each window, with the window as its sole argument.
1463
1464The optional arguments @var{minibuf} and @var{all-frames} specify the
1465set 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
1467window on that frame as returned by @code{frame-first-window} and not
1468necessarily the selected window.
1469
1470If @var{proc} changes the window configuration by splitting or deleting
1471windows, that change is not reflected in the set of windows walked.
1472That set is determined entirely by the set of live windows at the time
1473this function was invoked.
1474@end defun
1475
1476The following function allows to determine whether a specific window is
1477the only live window.
1478
1479@defun one-window-p &optional no-mini all-frames 1358@defun one-window-p &optional no-mini all-frames
1480This function returns non-@code{nil} if the selected window is the only 1359This function returns @code{t} if the selected window is the only live
1481window. 1360window, and @code{nil} otherwise.
1482 1361
1483The optional argument @var{no-mini}, if non-@code{nil}, means don't 1362If the minibuffer window is active, it is normally considered (so that
1484count the minibuffer even if it is active; otherwise, the minibuffer 1363this function returns @code{nil}). However, if the optional argument
1485window 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 1365if active. The optional argument @var{all-frames} has the same
1487above. 1366meaning 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
1492on the screen, offering various criteria for the choice. 1371criterion, 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
1496This function returns the window least recently ``used'' (that is, 1375This function returns a live window which is heuristically the ``least
1497selected). If any full-width windows are present, it only considers 1376recently used'' window. The optional argument @var{all-frames} has
1498these. The optional argument @var{all-frames} has the same meaning as 1377the same meaning as in @code{next-window}.
1499in @code{next-window}.
1500 1378
1501The selected window is returned if it is the only candidate. A 1379If any full-width windows are present, only those windows are
1502minibuffer window is never a candidate. A dedicated window 1380considered. The selected window is never returned, unless it is the
1503(@pxref{Dedicated Windows}) is never a candidate unless the optional 1381only candidate. A minibuffer window is never a candidate. A
1504argument @var{dedicated} is non-@code{nil}. 1382dedicated window (@pxref{Dedicated Windows}) is never a candidate
1383unless 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
1515prefers the one that comes first in the cyclic ordering of windows, 1394prefers the one that comes first in the cyclic ordering of windows,
1516starting from the selected window. 1395starting from the selected window.
1517 1396
1518The optional argument @var{all-frames} specifies which set of windows to 1397The optional argument @var{all-frames} specifies the windows to
1519consider as with @code{next-window}, see above. 1398search, 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
1525This function returns a window satisfying @var{predicate}. It cycles 1404This function calls the function @var{predicate} for each of the
1526through all visible windows calling @var{predicate} on each one of them 1405windows in the cyclic order of windows in turn, passing it the window
1527with that window as its argument. The function returns the first window 1406as an argument. If the predicate returns non-@code{nil} for any
1528for which @var{predicate} returns a non-@code{nil} value; if that never 1407window, this function stops and returns that window. If no such
1529happens, it returns @var{default} (which defaults to @code{nil}). 1408window is found, the return value is @var{default} (which defaults to
1409@code{nil}).
1530 1410
1531The optional arguments @var{minibuf} and @var{all-frames} specify the 1411The optional arguments @var{minibuf} and @var{all-frames} specify the
1532set of windows to investigate. See the description of 1412windows 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
1542To find out which buffer is displayed in a given window the following 1422 This section describes low-level functions for examining and setting
1543function is used. 1423the contents of windows. @xref{Switching Buffers}, for higher-level
1424functions for displaying a specific buffer in a window.
1544 1425
1545@defun window-buffer &optional window 1426@defun window-buffer &optional window
1546This function returns the buffer that @var{window} is displaying. The 1427This function returns the buffer that @var{window} is displaying. If
1547argument @var{window} can be any window and defaults to the selected 1428@var{window} is omitted or @code{nil} it defaults to the selected
1548one. If @var{window} is an internal window, this function returns 1429window. If @var{window} is an internal window, this function returns
1549@code{nil}. 1430@code{nil}.
1550@end defun 1431@end defun
1551 1432
1552The 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
1555of user customizations regulating which windows are supposed to
1556display which buffers. @xref{Switching Buffers}. When writing an
1557application, you should avoid using @code{set-window-buffer} unless
1558you 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
1561This function makes @var{window} display @var{buffer-or-name} and 1434This function makes @var{window} display @var{buffer-or-name}.
1562returns @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
1563window and defaults to the selected one. The argument 1436the 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 1437name of an existing buffer. This function does not change which
1565buffer. An error is signaled when @var{window} is @dfn{strongly} 1438window is selected, nor does it directly change which buffer is
1566dedicated to its buffer (@pxref{Dedicated Windows}) and does not already 1439current (@pxref{Current Buffer}). Its return value is @code{nil}.
1567display @var{buffer-or-name}.
1568
1569Normally, displaying @var{buffer-or-name} in @var{window} resets the
1570window's position, display margins, fringe widths, and scroll bar
1571settings based on the local variables of the specified buffer. However,
1572if the optional argument @var{keep-margins} is non-@code{nil}, display
1573margins and fringe widths of @var{window} remain unchanged.
1574@xref{Fringes}.
1575
1576This function is the fundamental primitive for changing which buffer is
1577displayed in a window, and all ways of doing that call this function.
1578Neither the selected window nor the current buffer are changed by this
1579function.
1580 1440
1581This function runs @code{window-scroll-functions} before running 1441If @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
1443signals an error. @xref{Dedicated Windows}.
1444
1445By default, this function resets @var{window}'s position, display
1446margins, fringe widths, and scroll bar settings, based on the local
1447variables in the specified buffer. However, if the optional argument
1448@var{keep-margins} is non-@code{nil}, it leaves the display margins
1449and fringe widths unchanged.
1450
1451When writing an application, you should normally use the higher-level
1452functions described in @ref{Switching Buffers}, instead of calling
1453@code{set-window-buffer} directly.
1454
1455This 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
1592This variable records the time at which a buffer was last made visible 1466This buffer-local variable records the time at which a buffer was last
1593in a window. It is always local in each buffer; each time 1467displayed in a window. The value is @code{nil} if the buffer has
1594@code{set-window-buffer} is called, it sets this variable to 1468never 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
1596When a buffer is first created, @code{buffer-display-time} starts out 1470returned by @code{current-time} (@pxref{Time of Day}).
1597with 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
1601This function returns a window displaying @var{buffer-or-name}, or 1474This function returns the first window displaying @var{buffer-or-name}
1602@code{nil} if there is none. If there are several such windows, then 1475in the cyclic ordering of windows, starting from the selected window
1603the function returns the first one in the cyclic ordering of windows, 1476(@pxref{Cyclic Window Ordering}). If no such window exists, the
1604starting from the selected window, @xref{Cyclic Window Ordering}. 1477return value is @code{nil}.
1605 1478
1606The 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
1607defaults to the current buffer. The optional argument @var{all-frames} 1480omitted or @code{nil}, it defaults to the current buffer. The
1608specifies which windows to consider: 1481optional argument @var{all-frames} specifies which windows to
1482consider:
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:
16180 means consider windows on all visible or iconified frames. 14900 means consider windows on all visible or iconified frames.
1619@item 1491@item
1620A frame means consider windows on that frame only. 1492A frame means consider windows on that frame only.
1493@item
1494Any other value means consider windows on the selected frame.
1621@end itemize 1495@end itemize
1622 1496
1623Observe that the behavior of @code{get-buffer-window} may differ from 1497Note that these meanings differ slightly from those of the
1624that 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. 1499Ordering}). This function may be changed in a future version of Emacs
1626Perhaps we will change @code{get-buffer-window} in the future to make it 1500to eliminate this discrepancy.
1627compatible 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
1631This function returns a list of all windows currently displaying 1504This 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
1633or the name of an existing buffer and defaults to the current buffer. 1506name of an existing buffer. If omitted or @code{nil}, it defaults to
1507the current buffer.
1634 1508
1635The two remaining arguments work like the same-named arguments of 1509The arguments @var{minibuf} and @var{all-frames} have the same
1636@code{next-window} (@pxref{Cyclic Window Ordering}); they are @emph{not} 1510meanings as in the function @code{next-window} (@pxref{Cyclic Window
1637like the optional arguments of @code{get-buffer-window}. 1511Ordering}). Note that the @var{all-frames} argument does @emph{not}
1512behave 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
1641This command replaces @var{buffer-or-name} with some other buffer, in 1516This command replaces @var{buffer-or-name} with some other buffer, in
1642all windows displaying it. For each such window, it choose another 1517all windows displaying it. @var{buffer-or-name} should be a buffer,
1643buffer using @code{switch-to-prev-buffer} (@pxref{Window History}). 1518or the name of an existing buffer; if omitted or @code{nil}, it
1644 1519defaults to the current buffer.
1645The argument @var{buffer-or-name} may be a buffer, or the name of an 1520
1646existing buffer; it defaults to the current buffer. 1521The replacement buffer in each window is chosen via
1647 1522@code{switch-to-prev-buffer} (@pxref{Window History}). Any dedicated
1648If a window displaying @var{buffer-or-name} is dedicated 1523window displaying @var{buffer-or-name} is deleted (@pxref{Dedicated
1649(@pxref{Dedicated Windows}) and is not the only window on its frame, 1524Windows}), unless it is the only window on its frame---if it is the
1650that window is deleted. If that window is the only window on its frame 1525only window, and that frame is not the only frame on its terminal, the
1651and there are other frames on the frame's terminal, that frame is dealt 1526frame is ``dismissed'' by calling the function specified by
1652with 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 1528dedicated window is the only window on the only frame on its terminal,
1654function @code{switch-to-prev-buffer} (@pxref{Window History}) is 1529the buffer is replaced anyway.
1655displayed 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
1731meanings as in @code{switch-to-buffer}. 1604meanings as in @code{switch-to-buffer}.
1732@end deffn 1605@end deffn
1733 1606
1734The above commands use @code{pop-to-buffer}, which is the function 1607The above commands use the function @code{pop-to-buffer}, which
1735used by Lisp programs to flexibly display a buffer in some window and 1608flexibly displays a buffer in some window and selects that window for
1736select that window for editing: 1609editing. In turn, @code{pop-to-buffer} uses @code{display-buffer} for
1610displaying the buffer. Hence, all the variables affecting
1611@code{display-buffer} will affect it as well. @xref{Choosing Window},
1612for 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
1739This function makes @var{buffer-or-name} the current buffer and 1615This 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
1743possible (@pxref{Input Focus}). The return value is the buffer that 1619possible (@pxref{Input Focus}). The return value is the buffer that
1744was switched to. 1620was switched to.
1745 1621
1746This function uses @code{display-buffer} to display the buffer, so all
1747the variables affecting @code{display-buffer} will affect it as well.
1748@xref{Choosing Window}.
1749
1750If @var{buffer-or-name} is @code{nil}, it defaults to the buffer 1622If @var{buffer-or-name} is @code{nil}, it defaults to the buffer
1751returned by @code{other-buffer} (@pxref{The Buffer List}). If 1623returned 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
1775Buffers}). 1647Buffers}).
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
1781display in. These steps are described by means of @dfn{display 1653display in. These steps are described by means of @dfn{display
1782actions}, which have the form @code{(@var{function} . @var{alist})}. 1654actions}, which have the form @code{(@var{function} . @var{alist})}.
@@ -1815,6 +1687,11 @@ The variable @code{display-buffer-overriding-action}.
1815The user option @code{display-buffer-alist}. 1687The user option @code{display-buffer-alist}.
1816 1688
1817@item 1689@item
1690A special action for handling @code{special-display-buffer-names} and
1691@code{special-display-regexps}, if either of those variables is
1692non-@code{nil}. @xref{Choosing Window Options}.
1693
1694@item
1818The @var{action} argument. 1695The @var{action} argument.
1819 1696
1820@item 1697@item
@@ -1886,10 +1763,9 @@ This function tries to ``display'' @var{buffer} by finding a window
1886that is already displaying it. 1763that is already displaying it.
1887 1764
1888If @var{alist} has a non-@code{nil} @code{inhibit-same-window} entry, 1765If @var{alist} has a non-@code{nil} @code{inhibit-same-window} entry,
1889the selected window is not eligible for reuse. 1766the selected window is not eligible for reuse. If @var{alist}
1890 1767contains a @code{reusable-frames} entry, its value determines which
1891If @var{alist} contains a @code{reusable-frames} entry, its value 1768frames to search for a reusable window:
1892determines 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
1910variable @code{display-buffer-reuse-frames} or the variable 1786variable @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
1912current terminal. @xref{Choosing Window Options}. 1788current terminal. @xref{Choosing Window Options}.
1789
1790If this function chooses a window on another frame, it makes that
1791frame 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
1916This function creates a new frame, and displays the buffer in that 1795This function creates a new frame, and displays the buffer in that
1917frame's window. 1796frame's window. It actually performs the frame creation by calling
1797the 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
1921This function tries to display @var{buffer} by splitting the largest 1802This function tries to display @var{buffer} by splitting the largest
1922or least recently-used window. It uses @code{split-window-sensibly} 1803or least recently-used window (typically one on the selected frame).
1923as a subroutine (@pxref{Choosing Window Options}). 1804It actually performs the split by calling the function specified in
1805@code{split-window-preferred-function} (@pxref{Choosing Window
1806Options}).
1807
1808It 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}
1810frame 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}
1937options. 1824options.
1938 1825
1939@defopt display-buffer-reuse-frames 1826@defopt display-buffer-reuse-frames
1940If this variable is non-@code{nil}, @code{display-buffer} searches 1827If the value of this variable is non-@code{nil}, @code{display-buffer}
1941visible and iconified frames for a window displaying 1828may 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} 1829window already displaying the specified buffer. The default is
1943makes that window's frame visible and raises it if necessary, and 1830@code{nil}. This variable is consulted by the action function
1944returns 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
1950This variable specifies whether @code{display-buffer} is allowed to 1835If the value of this variable is non-@code{nil}, @code{display-buffer}
1951split (@pxref{Splitting Windows}) an existing window. If this variable 1836is allowed to split an existing window to make a new window for
1952is non-@code{nil}, @code{display-buffer} tries to split the largest or 1837displaying in. This is the default.
1953least recently used window on the selected frame. (If the selected 1838
1954frame is a minibuffer-only frame, @code{display-buffer} tries to split a 1839This variable is provided mainly for backward compatibility. It is
1955window on another frame instead.) If this variable is @code{nil} or the 1840obeyed by @code{display-buffer} via a special mechanism in
1956variable @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. 1842function @code{display-buffer-pop-up-window} (@pxref{Display Action
1843Functions}) when the value is @code{nil}. It is not consulted by
1844@code{display-buffer-pop-up-window} itself, which the user may specify
1845directly 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
1961This variable must specify a function with one argument, which is a 1849This variable specifies a function for splitting a window, in order to
1962window. The @code{display-buffer} routines will call this function with 1850make a new window for displaying a buffer. It is used by the
1963one 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
1964function is expected to split that window and return the new window. If 1852the window (@pxref{Display Action Functions}).
1965the function returns @code{nil}, this means that the argument window 1853
1966cannot (or shall not) be split. 1854The default value is @code{split-window-sensibly}, which is documented
1967 1855below. The value must be a function that takes one argument, a
1968The default value of @code{split-window-preferred-function} is the 1856window, and return either a new window (which is used to display the
1969function @code{split-window-sensibly} described below. If you 1857desired buffer) or @code{nil} (which means the splitting failed).
1970customize this option, bear in mind that the @code{display-buffer}
1971routines may call your function up to two times when trying to split a
1972window. The argument of the first call is the largest window on the
1973chosen frame (as returned by @code{get-largest-window}). If that call
1974fails to return a live window, your function is called a second time
1975with the least recently used window on that frame (as returned by
1976@code{get-lru-window}).
1977
1978The function specified by this option may try to split any other window
1979instead of the argument window. Note that the window selected at the
1980time @code{display-buffer} was invoked is still selected when your
1981function is called. Hence, you can split the selected window (instead
1982of the largest or least recently used one) by simply ignoring the window
1983argument in the body of your function. You can even choose to not split
1984any window as long as the return value of your function specifies a live
1985window or @code{nil}, but you are not encouraged to do so
1986unconditionally. If you want @code{display-buffer} to never split any
1987windows, 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
1991This function takes a window as argument and tries to split that window 1861This function tries to split @code{window}, and return the newly
1992in a suitable way. The two variables described next are useful for 1862created window. If @code{window} cannot be split, it returns
1993tuning the behavior of this function. 1863@code{nil}.
1864
1865This function obeys the usual rules that determine when a window may
1866be split (@pxref{Splitting Windows}). It first tries to split by
1867placing the new window below, subject to the restriction imposed by
1868@code{split-height-threshold} (see below) in addition to any other
1869restrictions. If that fails, it tries to split by placing the new
1870window to the right, subject to @code{split-width-threshold} (see
1871below). If that fails, and the window is the only window on its
1872frame, this function again tries to split and place the new window
1873below, disregarding @code{split-height-threshold}. If this fails as
1874well, 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
1997This variable specifies whether @code{split-window-sensibly} may split 1878This variable, used by @code{split-window-sensibly}, specifies whether
1998windows vertically. If it is an integer, @code{split-window-sensibly} 1879to split the window placing the new window below. If it is an
1999tries to vertically split a window only if it has at least this many 1880integer, that means to split only if the original window has at least
2000lines. If the window has less lines, splitting fails, or the value of 1881that many lines. If it is @code{nil}, that means not to split this
2001this variable is @code{nil}, @code{split-window-sensibly} will try to 1882way.
2002split the window horizontally, subject to restrictions of
2003@code{split-width-threshold} (see below). If splitting horizontally
2004fails too and the window is the only window on its frame,
2005@code{split-window-sensibly} will try to split the window vertically
2006disregarding the value of @code{split-height-threshold}. If this fails
2007as well, @code{split-window-sensibly} returns @code{nil}.
2008
2009@code{split-window-sensibly} does not split vertically a window whose
2010height is fixed (@pxref{Resizing Windows}). Also, it vertically splits
2011a window only if the space taken up by that window can accommodate two
2012windows one above the other that are both at least
2013@code{window-min-height} lines tall. Moreover, if the window that shall
2014be split has a mode line, @code{split-window-sensibly} does not split
2015the 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
2019This variable specifies whether @code{split-window-sensibly} may split 1886This variable, used by @code{split-window-sensibly}, specifies whether
2020windows horizontally. If it is an integer, @code{split-window-sensibly} 1887to split the window placing the new window to the right. If the value
2021tries to horizontally split a window only if it has at least this many 1888is an integer, that means to split only if the original window has at
2022columns. If it is @code{nil}, @code{split-window-sensibly} will not 1889least that many columns. If the value is @code{nil}, that means not
2023split the window horizontally. (It still might split the window 1890to split this way.
2024vertically, though, see above.)
2025
2026@code{split-window-sensibly} does not split horizontally a window if
2027that window's width is fixed (@pxref{Resizing Windows}). Also, it
2028horizontally splits a window only if the space that window takes up can
2029accommodate 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
2034This variable specifies whether @code{display-buffer} should even out
2035window heights if the buffer gets displayed in an existing window, above
2036or beneath another window. If @code{even-window-heights} is
2037non-@code{nil}, the default, window heights will be evened out. If
2038either of the involved window has fixed height (@pxref{Resizing
2039Windows}) or @code{even-window-heights} is @code{nil}, the original
2040window heights will be left alone.
2041@end defopt
2042
2043@c Emacs 19 feature
2044@defopt pop-up-frames 1893@defopt pop-up-frames
2045This variable specifies whether @code{display-buffer} should make new 1894If the value of this variable is non-@code{nil}, that means
2046frames. If it is non-@code{nil}, @code{display-buffer} looks for a 1895@code{display-buffer} may display buffers by making new frames. The
2047window already displaying @var{buffer-or-name} on any visible or 1896default is @code{nil}.
2048iconified frame. If it finds such a window, it makes that window's 1897
2049frame visible and raises it if necessary, and returns the window. 1898A non-@code{nil} value also means that when @code{display-buffer} is
2050Otherwise it makes a new frame, unless the variable's value is 1899looking 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. 1900search any visible or iconified frame, not just the selected frame.
2052@xref{Frames}, for more information. 1901
2053 1902This variable is provided mainly for backward compatibility. It is
2054Note that the value of @code{pop-up-windows} does not matter if 1903obeyed 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})
2057one. 1906if the value is non-@code{nil}. (This is done before attempting to
1907split a window.) This variable is not consulted by
1908@code{display-buffer-pop-up-frame} itself, which the user may specify
1909directly 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
2062This variable specifies how to make a new frame if @code{pop-up-frames} 1913This variable specifies a function for creating a new frame, in order
2063is non-@code{nil}. 1914to 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
2065The value of this variable must be a function of no arguments. When 1916Action Functions}).
2066@code{display-buffer} makes a new frame, it does so by calling that 1917
2067function, which should return a frame. The default value of this 1918The value should be a function that takes no arguments and returns a
2068variable is a function that creates a frame using the parameters 1919frame, or @code{nil} if no frame could be created. The default value
2069specified by @code{pop-up-frame-alist} described next. 1920is 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
2073This variable holds an alist specifying frame parameters used by the 1925This variable holds an alist of frame parameters (@pxref{Frame
2074default value of @code{pop-up-frame-function} for making new frames. 1926Parameters}), 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
2193above. 2046above.
2194@end defopt 2047@end defopt
2195 2048
2196If all options described above fail to produce a suitable window,
2197@code{display-buffer} tries to reuse an existing window. As a last
2198resort, it will try to display @var{buffer-or-name} on a separate frame.
2199In 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