comparison man/lispref/windows.texi @ 444:576fb035e263 r21-2-37

Import from CVS: tag r21-2-37
author cvs
date Mon, 13 Aug 2007 11:36:19 +0200
parents abe6d1db359e
children 33f0f28b945c
comparison
equal deleted inserted replaced
443:a8296e22da4e 444:576fb035e263
1 @c -*-texinfo-*- 1 @c -*-texinfo-*-
2 @c This is part of the XEmacs Lisp Reference Manual. 2 @c This is part of the XEmacs Lisp Reference Manual.
3 @c Copyright (C) 1990, 1991, 1992, 1993, 1994 Free Software Foundation, Inc. 3 @c Copyright (C) 1990, 1991, 1992, 1993, 1994 Free Software Foundation, Inc.
4 @c See the file lispref.texi for copying conditions. 4 @c See the file lispref.texi for copying conditions.
5 @setfilename ../../info/windows.info 5 @setfilename ../../info/windows.info
6 @node Windows, Frames, Buffers, Top 6 @node Windows, Frames, Buffers, Top
7 @chapter Windows 7 @chapter Windows
8 8
20 * Displaying Buffers:: Higher-lever functions for displaying a buffer 20 * Displaying Buffers:: Higher-lever functions for displaying a buffer
21 and choosing a window for it. 21 and choosing a window for it.
22 * Choosing Window:: How to choose a window for displaying a buffer. 22 * Choosing Window:: How to choose a window for displaying a buffer.
23 * Window Point:: Each window has its own location of point. 23 * Window Point:: Each window has its own location of point.
24 * Window Start:: The display-start position controls which text 24 * Window Start:: The display-start position controls which text
25 is on-screen in the window. 25 is on-screen in the window.
26 * Vertical Scrolling:: Moving text up and down in the window. 26 * Vertical Scrolling:: Moving text up and down in the window.
27 * Horizontal Scrolling:: Moving text sideways on the window. 27 * Horizontal Scrolling:: Moving text sideways on the window.
28 * Size of Window:: Accessing the size of a window. 28 * Size of Window:: Accessing the size of a window.
29 * Position of Window:: Accessing the position of a window. 29 * Position of Window:: Accessing the position of a window.
30 * Resizing Windows:: Changing the size of a window. 30 * Resizing Windows:: Changing the size of a window.
64 64
65 @itemize @bullet 65 @itemize @bullet
66 @item 66 @item
67 containing frame 67 containing frame
68 68
69 @item 69 @item
70 window height 70 window height
71 71
72 @item 72 @item
73 window width 73 window width
74 74
75 @item 75 @item
76 window edges with respect to the frame or screen 76 window edges with respect to the frame or screen
77 77
78 @item 78 @item
79 the buffer it displays 79 the buffer it displays
80 80
81 @item 81 @item
82 position within the buffer at the upper left of the window 82 position within the buffer at the upper left of the window
83 83
84 @item 84 @item
85 amount of horizontal scrolling, in columns 85 amount of horizontal scrolling, in columns
86 86
87 @item 87 @item
88 point 88 point
89 89
90 @item 90 @item
91 the mark 91 the mark
92 92
93 @item 93 @item
94 how recently the window was selected 94 how recently the window was selected
95 @end itemize 95 @end itemize
96 96
97 @cindex multiple windows 97 @cindex multiple windows
98 Users create multiple windows so they can look at several buffers at 98 Users create multiple windows so they can look at several buffers at
137 137
138 The functions described here do not accept a buffer as an argument. 138 The functions described here do not accept a buffer as an argument.
139 The two ``halves'' of the split window initially display the same buffer 139 The two ``halves'' of the split window initially display the same buffer
140 previously visible in the window that was split. 140 previously visible in the window that was split.
141 141
142 @defun one-window-p &optional no-mini all-frames 142 @defun one-window-p &optional nomini which-frames which-devices
143 This function returns non-@code{nil} if there is only one window. The 143 This function returns non-@code{nil} if there is only one window. The
144 argument @var{no-mini}, if non-@code{nil}, means don't count the 144 argument @var{nomini}, if non-@code{nil}, means don't count the
145 minibuffer even if it is active; otherwise, the minibuffer window is 145 minibuffer even if it is active; otherwise, the minibuffer window is
146 included, if active, in the total number of windows which is compared 146 included, if active, in the total number of windows which is compared
147 against one. 147 against one.
148 148
149 The argument @var{all-frame} controls which set of windows are 149 The remaining arguments controls which set of windows are counted, as
150 counted. 150 with @code{next-window}.
151 @itemize @bullet
152 @item
153 If it is @code{nil} or omitted, then count only the selected frame, plus
154 the minibuffer it uses (which may be on another frame).
155 @item
156 If it is @code{t}, then windows on all frames that currently exist
157 (including invisible and iconified frames) are counted.
158 @item
159 If it is the symbol @code{visible}, then windows on all visible frames
160 are counted.
161 @item
162 If it is the number 0, then windows on all visible and iconified frames
163 are counted.
164 @item
165 If it is any other value, then precisely the windows in @var{window}'s
166 frame are counted, excluding the minibuffer in use if it lies in
167 some other frame.
168 @end itemize
169 @end defun 151 @end defun
170 152
171 @deffn Command split-window &optional window size horizontal 153 @deffn Command split-window &optional window size horizontal
172 This function splits @var{window} into two windows. The original 154 This function splits @var{window} into two windows. The original
173 window @var{window} remains the selected window, but occupies only 155 window @var{window} remains the selected window, but occupies only
200 @result{} (0 0 80 50) ; @r{left--top--right--bottom} 182 @result{} (0 0 80 50) ; @r{left--top--right--bottom}
201 @end group 183 @end group
202 184
203 @group 185 @group
204 ;; @r{Returns window created} 186 ;; @r{Returns window created}
205 (setq w2 (split-window w 15)) 187 (setq w2 (split-window w 15))
206 @result{} #<window 28 on windows.texi> 188 @result{} #<window 28 on windows.texi>
207 @end group 189 @end group
208 @group 190 @group
209 (window-edges w2) 191 (window-edges w2)
210 @result{} (0 15 80 50) ; @r{Bottom window;} 192 @result{} (0 15 80 50) ; @r{Bottom window;}
218 200
219 The frame looks like this: 201 The frame looks like this:
220 202
221 @smallexample 203 @smallexample
222 @group 204 @group
223 __________ 205 __________
224 | | line 0 206 | | line 0
225 | w | 207 | w |
226 |__________| 208 |__________|
227 | | line 15 209 | | line 15
228 | w2 | 210 | w2 |
229 |__________| 211 |__________|
257 Now, the screen looks like this: 239 Now, the screen looks like this:
258 240
259 @smallexample 241 @smallexample
260 @group 242 @group
261 column 35 243 column 35
262 __________ 244 __________
263 | | | line 0 245 | | | line 0
264 | w | w3 | 246 | w | w3 |
265 |___|______| 247 |___|______|
266 | | line 15 248 | | line 15
267 | w2 | 249 | w2 |
268 |__________| 250 |__________|
279 261
280 @deffn Command split-window-vertically &optional size 262 @deffn Command split-window-vertically &optional size
281 This function splits the selected window into two windows, one above 263 This function splits the selected window into two windows, one above
282 the other, leaving the selected window with @var{size} lines. 264 the other, leaving the selected window with @var{size} lines.
283 265
284 This function is simply an interface to @code{split-windows}. 266 This function is simply an interface to @code{split-window}.
285 Here is the complete function definition for it: 267 Here is the complete function definition for it:
286 268
287 @smallexample 269 @smallexample
288 @group 270 @group
289 (defun split-window-vertically (&optional arg) 271 (defun split-window-vertically (&optional arg)
296 278
297 @deffn Command split-window-horizontally &optional size 279 @deffn Command split-window-horizontally &optional size
298 This function splits the selected window into two windows 280 This function splits the selected window into two windows
299 side-by-side, leaving the selected window with @var{size} columns. 281 side-by-side, leaving the selected window with @var{size} columns.
300 282
301 This function is simply an interface to @code{split-windows}. Here is 283 This function is simply an interface to @code{split-window}. Here is
302 the complete definition for @code{split-window-horizontally} (except for 284 the complete definition for @code{split-window-horizontally} (except for
303 part of the documentation string): 285 part of the documentation string):
304 286
305 @smallexample 287 @smallexample
306 @group 288 @group
309 (interactive "P") 291 (interactive "P")
310 (split-window nil (and arg (prefix-numeric-value arg)) t)) 292 (split-window nil (and arg (prefix-numeric-value arg)) t))
311 @end group 293 @end group
312 @end smallexample 294 @end smallexample
313 @end deffn 295 @end deffn
314
315 @defun one-window-p &optional no-mini all-frames
316 This function returns non-@code{nil} if there is only one window. The
317 argument @var{no-mini}, if non-@code{nil}, means don't count the
318 minibuffer even if it is active; otherwise, the minibuffer window is
319 included, if active, in the total number of windows, which is compared
320 against one.
321
322 The argument @var{all-frames} specifies which frames to consider. Here
323 are the possible values and their meanings:
324
325 @table @asis
326 @item @code{nil}
327 Count the windows in the selected frame, plus the minibuffer used
328 by that frame even if it lies in some other frame.
329
330 @item @code{t}
331 Count all windows in all existing frames.
332
333 @item @code{visible}
334 Count all windows in all visible frames.
335
336 @item 0
337 Count all windows in all visible or iconified frames.
338
339 @item anything else
340 Count precisely the windows in the selected frame, and no others.
341 @end table
342 @end defun
343 296
344 @node Deleting Windows 297 @node Deleting Windows
345 @section Deleting Windows 298 @section Deleting Windows
346 @cindex deleting windows 299 @cindex deleting windows
347 300
364 317
365 @strong{Warning:} Erroneous information or fatal errors may result from 318 @strong{Warning:} Erroneous information or fatal errors may result from
366 using a deleted window as if it were live. 319 using a deleted window as if it were live.
367 @end defun 320 @end defun
368 321
369 @deffn Command delete-window &optional window 322 @deffn Command delete-window &optional window force
370 This function removes @var{window} from the display. If @var{window} 323 This function removes @var{window} from the display. If @var{window} is
371 is omitted, then the selected window is deleted. An error is signaled 324 omitted, then the selected window is deleted. If window is the only one
372 if there is only one window when @code{delete-window} is called. 325 on its frame, the frame is deleted as well.
326
327 Normally, you cannot delete the last non-minibuffer-only frame (you must
328 use @code{save-buffers-kill-emacs} or @code{kill-emacs}); an error is
329 signaled instead. However, if optional second argument @var{force} is
330 non-@code{nil}, you can delete the last frame. (This will automatically
331 call @code{save-buffers-kill-emacs}.)
373 332
374 This function returns @code{nil}. 333 This function returns @code{nil}.
375 334
376 When @code{delete-window} is called interactively, @var{window} 335 When @code{delete-window} is called interactively, the selected window
377 defaults to the selected window. 336 is deleted.
378 @end deffn 337 @end deffn
379 338
380 @deffn Command delete-other-windows &optional window 339 @deffn Command delete-other-windows &optional window
381 This function makes @var{window} the only window on its frame, by 340 This function makes @var{window} the only window on its frame, by
382 deleting the other windows in that frame. If @var{window} is omitted or 341 deleting the other windows in that frame. If @var{window} is omitted or
383 @code{nil}, then the selected window is used by default. 342 @code{nil}, then the selected window is used by default.
384 343
385 The result is @code{nil}. 344 The result is @code{nil}.
386 @end deffn 345 @end deffn
387 346
388 @deffn Command delete-windows-on buffer &optional frame 347 @deffn Command delete-windows-on buffer &optional which-frames which-devices
389 This function deletes all windows showing @var{buffer}. If there are 348 This function deletes all windows showing @var{buffer}. If there are
390 no windows showing @var{buffer}, it does nothing. 349 no windows showing @var{buffer}, it does nothing.
391 350
392 @code{delete-windows-on} operates frame by frame. If a frame has 351 @code{delete-windows-on} operates frame by frame. If a frame has
393 several windows showing different buffers, then those showing 352 several windows showing different buffers, then those showing
395 all windows in some frame are showing @var{buffer} (including the case 354 all windows in some frame are showing @var{buffer} (including the case
396 where there is only one window), then the frame reverts to having a 355 where there is only one window), then the frame reverts to having a
397 single window showing another buffer chosen with @code{other-buffer}. 356 single window showing another buffer chosen with @code{other-buffer}.
398 @xref{The Buffer List}. 357 @xref{The Buffer List}.
399 358
400 The argument @var{frame} controls which frames to operate on: 359 The argument @var{which-frames} controls which frames to operate on:
401 360
402 @itemize @bullet 361 @table @asis
403 @item 362 @item @code{nil}
404 If it is @code{nil}, operate on the selected frame. 363 Delete all windows showing @var{buffer} in any frame.
405 @item 364
406 If it is @code{t}, operate on all frames. 365 @item @code{t}
407 @item 366 Delete only windows showing @var{buffer} in the selected frame.
408 If it is @code{visible}, operate on all visible frames. 367
409 @item 0 368 @item @code{visible}
410 If it is 0, operate on all visible or iconified frames. 369 Delete all windows showing @var{buffer} in any visible frame.
411 @item 370
412 If it is a frame, operate on that frame. 371 @item @code{0}
413 @end itemize 372 Delete all windows showing @var{buffer} in any visible frame.
373
374 @item @var{frame}
375 If it is a frame, delete all windows showing @var{buffer} in that frame.
376 @end table
377
378 @strong{Warning:} This is similar to, but not identical to, the meaning
379 of the @var{which-frames} argument to @code{next-window}; the meanings
380 of @code{nil} and @code{t} are reversed.
381
382 The optional argument @var{which-devices} further clarifies on which
383 devices to search for frames as specified by @var{which-frames}.
384 This value is only meaningful if @var{which-frames} is not @code{t}.
385
386 @table @asis
387 @item @code{nil}
388 Consider all devices on the selected console.
389
390 @item @var{device}
391 Consider only the one device @var{device}.
392
393 @item @var{console}
394 Consider all devices on @var{console}.
395
396 @item @var{device-type}
397 Consider all devices with device type @var{device-type}.
398
399 @item @code{window-system}
400 Consider all devices on window system consoles.
401
402 @item anything else
403 Consider all devices without restriction.
404 @end table
414 405
415 This function always returns @code{nil}. 406 This function always returns @code{nil}.
416 @end deffn 407 @end deffn
417 408
418 @node Selecting Windows 409 @node Selecting Windows
436 appears in @var{window} (on redisplay). The buffer being displayed in 427 appears in @var{window} (on redisplay). The buffer being displayed in
437 @var{window} is immediately designated the current buffer. 428 @var{window} is immediately designated the current buffer.
438 429
439 If optional argument @var{norecord} is non-@code{nil} then the global 430 If optional argument @var{norecord} is non-@code{nil} then the global
440 and per-frame buffer orderings are not modified, as by the function 431 and per-frame buffer orderings are not modified, as by the function
441 @code{record-buffer}. 432 @code{record-buffer}.
442 433
443 The return value is @var{window}. 434 The return value is @var{window}.
444 435
445 @example 436 @example
446 @group 437 @group
449 @result{} #<window 65 on windows.texi> 440 @result{} #<window 65 on windows.texi>
450 @end group 441 @end group
451 @end example 442 @end example
452 @end defun 443 @end defun
453 444
454 @defmac save-selected-window forms@dots{} 445 @defspec save-selected-window forms@dots{}
455 This macro records the selected window, executes @var{forms} 446 This special form records the selected window, executes @var{forms} in
456 in sequence, then restores the earlier selected window. 447 sequence, then restores the earlier selected window. It does not save
457 It does not save or restore anything about the sizes, arrangement 448 or restore anything about the sizes, arrangement or contents of windows;
458 or contents of windows; therefore, if the @var{forms} change them, 449 therefore, if the @var{forms} change them, the changes are permanent.
459 the changes are permanent. 450 @end defspec
460 @end defmac
461 451
462 @cindex finding windows 452 @cindex finding windows
463 The following functions choose one of the windows on the screen, 453 The following functions choose one of the windows on the screen,
464 offering various criteria for the choice. 454 offering various criteria for the choice.
465 455
466 @defun get-lru-window &optional frame 456 @defun get-lru-window &optional which-frames which-devices
467 This function returns the window least recently ``used'' (that is, 457 This function returns the window least recently ``used'' (that is,
468 selected). The selected window is always the most recently used window. 458 selected). The selected window is always the most recently used window.
469 459
470 The selected window can be the least recently used window if it is the 460 The selected window can be the least recently used window if it is the
471 only window. A newly created window becomes the least recently used 461 only window. A newly created window becomes the least recently used
472 window until it is selected. A minibuffer window is never a candidate. 462 window until it is selected. A minibuffer window is never a candidate.
473 463
474 The argument @var{frame} controls which windows are considered. 464 By default, only the windows in the selected frame are considered.
475 465 The optional argument @var{which-frames} changes this behavior.
476 @itemize @bullet 466 Here are the possible values and their meanings:
477 @item 467
478 If it is @code{nil}, consider windows on the selected frame. 468 @table @asis
479 @item 469 @item @code{nil}
480 If it is @code{t}, consider windows on all frames. 470 Consider all the windows in the selected windows's frame, plus the
481 @item 471 minibuffer used by that frame even if it lies in some other frame.
482 If it is @code{visible}, consider windows on all visible frames. 472
483 @item 473 @item @code{t}
484 If it is 0, consider windows on all visible or iconified frames. 474 Consider all windows in all existing frames.
485 @item 475
486 If it is a frame, consider windows on that frame. 476 @item @code{visible}
487 @end itemize 477 Consider all windows in all visible frames. (To get useful results, you
488 @end defun 478 must ensure @var{window} is in a visible frame.)
489 479
490 @defun get-largest-window &optional frame 480 @item @code{0}
481 Consider all windows in all visible or iconified frames.
482
483 @item @var{frame}
484 Consider all windows on frame @var{frame}.
485
486 @item anything else
487 Consider precisely the windows in the selected window's frame, and no others.
488 @end table
489
490 The optional argument @var{which-devices} further clarifies on which
491 devices to search for frames as specified by @var{which-frames}.
492 This value is only meaningful if @var{which-frames} is non-@code{nil}.
493
494 @table @asis
495 @item @code{nil}
496 Consider all devices on the selected console.
497
498 @item @var{device}
499 Consider only the one device @var{device}.
500
501 @item @var{console}
502 Consider all devices on @var{console}.
503
504 @item @var{device-type}
505 Consider all devices with device type @var{device-type}.
506
507 @item @code{window-system}
508 Consider all devices on window system consoles.
509
510 @item anything else
511 Consider all devices without restriction.
512 @end table
513
514 @end defun
515
516 @defun get-largest-window &optional which-frames which-devices
491 This function returns the window with the largest area (height times 517 This function returns the window with the largest area (height times
492 width). If there are no side-by-side windows, then this is the window 518 width). If there are no side-by-side windows, then this is the window
493 with the most lines. A minibuffer window is never a candidate. 519 with the most lines. A minibuffer window is never a candidate.
494 520
495 If there are two windows of the same size, then the function returns 521 If there are two windows of the same size, then the function returns
496 the window that is first in the cyclic ordering of windows (see 522 the window that is first in the cyclic ordering of windows (see
497 following section), starting from the selected window. 523 following section), starting from the selected window.
498 524
499 The argument @var{frame} controls which set of windows are 525 The remaining arguments control which set of windows are considered.
500 considered. See @code{get-lru-window}, above. 526 See @code{next-window}, above.
501 @end defun 527 @end defun
502 528
503 @node Cyclic Window Ordering 529 @node Cyclic Window Ordering
504 @section Cyclic Ordering of Windows 530 @section Cyclic Ordering of Windows
505 @cindex cyclic ordering of windows 531 @cindex cyclic ordering of windows
506 @cindex ordering of windows, cyclic 532 @cindex ordering of windows, cyclic
507 @cindex window ordering, cyclic 533 @cindex window ordering, cyclic
508 534
509 When you use the command @kbd{C-x o} (@code{other-window}) to select 535 When you use the command @kbd{C-x o} (@code{other-window}) to select
510 the next window, it moves through all the windows on the screen in a 536 the next window, it moves through all the windows on the screen in a
511 specific cyclic order. For any given configuration of windows, this 537 specific cyclic order. For any given configuration of windows, this
512 order never varies. It is called the @dfn{cyclic ordering of windows}. 538 order never varies. It is called the @dfn{cyclic ordering of windows}.
521 next lower part of the frame, and so on. If the first split was 547 next lower part of the frame, and so on. If the first split was
522 horizontal, the ordering is top to bottom in the left part, and so on. 548 horizontal, the ordering is top to bottom in the left part, and so on.
523 In general, within each set of siblings at any level in the window tree, 549 In general, within each set of siblings at any level in the window tree,
524 the order is left to right, or top to bottom. 550 the order is left to right, or top to bottom.
525 551
526 @defun next-window &optional window minibuf all-frames 552 @defun next-window &optional window minibuf which-frames which-devices
527 @cindex minibuffer window 553 @cindex minibuffer window
528 This function returns the window following @var{window} in the cyclic 554 This function returns the window following @var{window} in the cyclic
529 ordering of windows. This is the window that @kbd{C-x o} would select 555 ordering of windows. This is the window that @kbd{C-x o} would select
530 if typed when @var{window} is selected. If @var{window} is the only 556 if typed when @var{window} is selected. If @var{window} is the only
531 window visible, then this function returns @var{window}. If omitted, 557 window visible, then this function returns @var{window}. If omitted,
541 minibuffer window even if it is not active. 567 minibuffer window even if it is not active.
542 568
543 If @var{minibuf} is neither @code{t} nor @code{nil}, then the minibuffer 569 If @var{minibuf} is neither @code{t} nor @code{nil}, then the minibuffer
544 window is not included even if it is active. 570 window is not included even if it is active.
545 571
546 The argument @var{all-frames} specifies which frames to consider. Here 572 By default, only the windows in the selected frame are considered.
547 are the possible values and their meanings: 573 The optional argument @var{which-frames} changes this behavior.
574 Here are the possible values and their meanings:
548 575
549 @table @asis 576 @table @asis
550 @item @code{nil} 577 @item @code{nil}
551 Consider all the windows in @var{window}'s frame, plus the minibuffer 578 Consider all the windows in @var{window}'s frame, plus the minibuffer
552 used by that frame even if it lies in some other frame. 579 used by that frame even if it lies in some other frame.
556 583
557 @item @code{visible} 584 @item @code{visible}
558 Consider all windows in all visible frames. (To get useful results, you 585 Consider all windows in all visible frames. (To get useful results, you
559 must ensure @var{window} is in a visible frame.) 586 must ensure @var{window} is in a visible frame.)
560 587
561 @item 0 588 @item @code{0}
562 Consider all windows in all visible or iconified frames. 589 Consider all windows in all visible or iconified frames.
590
591 @item @var{frame}
592 Consider all windows on frame @var{frame}.
563 593
564 @item anything else 594 @item anything else
565 Consider precisely the windows in @var{window}'s frame, and no others. 595 Consider precisely the windows in @var{window}'s frame, and no others.
566 @end table 596 @end table
567 597
568 This example assumes there are two windows, both displaying the 598 The optional argument @var{which-devices} further clarifies on which
599 devices to search for frames as specified by @var{which-frames}.
600 This value is only meaningful if @var{which-frames} is non-@code{nil}.
601
602 @table @asis
603 @item @code{nil}
604 Consider all devices on the selected console.
605
606 @item @var{device}
607 Consider only the one device @var{device}.
608
609 @item @var{console}
610 Consider all devices on @var{console}.
611
612 @item @var{device-type}
613 Consider all devices with device type @var{device-type}.
614
615 @item @code{window-system}
616 Consider all devices on window system consoles.
617
618 @item anything else
619 Consider all devices without restriction.
620 @end table
621
622 If you use consistent values for @var{minibuf}, @var{which-frames}, and
623 @var{which-devices}, you can use @code{next-window} to iterate through the
624 entire cycle of acceptable windows, eventually ending up back at the
625 window you started with. @code{previous-window} traverses the same
626 cycle, in the reverse order.
627
628 This example assumes there are two windows, both displaying the
569 buffer @samp{windows.texi}: 629 buffer @samp{windows.texi}:
570 630
571 @example 631 @example
572 @group 632 @group
573 (selected-window) 633 (selected-window)
582 @result{} #<window 56 on windows.texi> 642 @result{} #<window 56 on windows.texi>
583 @end group 643 @end group
584 @end example 644 @end example
585 @end defun 645 @end defun
586 646
587 @defun previous-window &optional window minibuf all-frames 647 @defun previous-window &optional window minibuf which-frames which-devices
588 This function returns the window preceding @var{window} in the cyclic 648 This function returns the window preceding @var{window} in the cyclic
589 ordering of windows. The other arguments specify which windows to 649 ordering of windows. The other arguments specify which windows to
590 include in the cycle, as in @code{next-window}. 650 include in the cycle, as in @code{next-window}.
591 @end defun 651 @end defun
592 652
593 @deffn Command other-window count &optional frame 653 @deffn Command other-window count &optional which-frames which-devices
594 This function selects the @var{count}th following window in the cyclic 654 This function selects the @var{count}th following window in the cyclic order.
595 order. If count is negative, then it selects the @minus{}@var{count}th 655 If @var{count} is negative, then it selects the @minus{}@var{count}th
596 preceding window. It returns @code{nil}. 656 preceding window. It returns @code{nil}.
597 657
598 In an interactive call, @var{count} is the numeric prefix argument. 658 In an interactive call, @var{count} is the numeric prefix argument.
599 659
600 The argument @var{frame} controls which set of windows are considered. 660 The other arguments specify which windows to include in the cycle, as in
601 @itemize @bullet 661 @code{next-window}.
602 @item 662 @end deffn
603 If it is @code{nil} or omitted, then windows on the selected frame are 663
604 considered. 664 @defun walk-windows function &optional minibuf which-frames which-devices
605 @item 665 This function cycles through all windows, calling @code{function}
606 If it is a frame, then windows on that frame are considered.
607 @item
608 If it is @code{t}, then windows on all frames that currently exist
609 (including invisible and iconified frames) are considered.
610 @item
611 If it is the symbol @code{visible}, then windows on all visible frames
612 are considered.
613 @item
614 If it is the number 0, then windows on all visible and iconified frames
615 are considered.
616 @item
617 If it is any other value, then the behavior is undefined.
618 @end itemize
619 @end deffn
620
621 @c Emacs 19 feature
622 @defun walk-windows proc &optional minibuf all-frames
623 This function cycles through all windows, calling @code{proc}
624 once for each window with the window as its sole argument. 666 once for each window with the window as its sole argument.
625 667
626 The optional arguments @var{minibuf} and @var{all-frames} specify the 668 The other arguments specify which windows to cycle through, as in
627 set of windows to include in the scan. See @code{next-window}, above, 669 @code{next-window}.
628 for details.
629 @end defun 670 @end defun
630 671
631 @node Buffers and Windows 672 @node Buffers and Windows
632 @section Buffers and Windows 673 @section Buffers and Windows
633 @cindex examining windows 674 @cindex examining windows
645 related functions that find a window to use and specify a buffer for it. 686 related functions that find a window to use and specify a buffer for it.
646 The functions described there are easier to use than these, but they 687 The functions described there are easier to use than these, but they
647 employ heuristics in choosing or creating a window; use these functions 688 employ heuristics in choosing or creating a window; use these functions
648 when you need complete control. 689 when you need complete control.
649 690
650 @defun set-window-buffer window buffer-or-name 691 @defun set-window-buffer window buffer-or-name &optional norecord
651 This function makes @var{window} display @var{buffer-or-name} as its 692 This function makes @var{window} display @var{buffer-or-name} as its
652 contents. It returns @code{nil}. 693 contents. @var{buffer-or-name} can be a buffer or a buffer name.
694
695 With non-@code{nil} optional argument @var{norecord}, do not modify the
696 global or per-frame buffer ordering.
697
698 This function returns @code{nil}.
653 699
654 @example 700 @example
655 @group 701 @group
656 (set-window-buffer (selected-window) "foo") 702 (set-window-buffer (selected-window) "foo")
657 @result{} nil 703 @result{} nil
670 @result{} #<buffer windows.texi> 716 @result{} #<buffer windows.texi>
671 @end group 717 @end group
672 @end example 718 @end example
673 @end defun 719 @end defun
674 720
675 @defun get-buffer-window buffer-or-name &optional frame 721 @defun get-buffer-window buffer-or-name &optional which-frames which-devices
676 This function returns a window currently displaying 722 This function returns a window currently displaying
677 @var{buffer-or-name}, or @code{nil} if there is none. If there are 723 @var{buffer-or-name}, or @code{nil} if there is none. If there are
678 several such windows, then the function returns the first one in the 724 several such windows, then the function returns the first one in the
679 cyclic ordering of windows, starting from the selected window. 725 cyclic ordering of windows, starting from the selected window.
680 @xref{Cyclic Window Ordering}. 726 @xref{Cyclic Window Ordering}.
681 727
682 The argument @var{all-frames} controls which windows to consider. 728 The remaining arguments control which windows to consider. They have
683 729 the same meaning as for @code{next-window}.
684 @itemize @bullet
685 @item
686 If it is @code{nil}, consider windows on the selected frame.
687 @item
688 If it is @code{t}, consider windows on all frames.
689 @item
690 If it is @code{visible}, consider windows on all visible frames.
691 @item
692 If it is 0, consider windows on all visible or iconified frames.
693 @item
694 If it is a frame, consider windows on that frame.
695 @end itemize
696 @end defun 730 @end defun
697 731
698 @node Displaying Buffers 732 @node Displaying Buffers
699 @section Displaying Buffers in Windows 733 @section Displaying Buffers in Windows
700 @cindex switching to a buffer 734 @cindex switching to a buffer
799 833
800 An example use of this function is found at the end of @ref{Filter 834 An example use of this function is found at the end of @ref{Filter
801 Functions}. 835 Functions}.
802 @end defun 836 @end defun
803 837
804 @deffn Command replace-buffer-in-windows buffer 838 @deffn Command replace-buffer-in-windows buffer &optional which-frames which-devices
805 This function replaces @var{buffer} with some other buffer in all 839 This function replaces @var{buffer} with some other buffer in all
806 windows displaying it. The other buffer used is chosen with 840 windows displaying it. The other buffer used is chosen with
807 @code{other-buffer}. In the usual applications of this function, you 841 @code{other-buffer}. In the usual applications of this function, you
808 don't care which other buffer is used; you just want to make sure that 842 don't care which other buffer is used; you just want to make sure that
809 @var{buffer} is no longer displayed. 843 @var{buffer} is no longer displayed.
810 844
845 The optional arguments @var{which-frames} and @var{which-devices} have
846 the same meaning as with @code{delete-windows-on}.
847
811 This function returns @code{nil}. 848 This function returns @code{nil}.
812 @end deffn 849 @end deffn
813 850
814 @node Choosing Window 851 @node Choosing Window
815 @section Choosing a Window for Display 852 @section Choosing a Window for Display
817 This section describes the basic facility that chooses a window to 854 This section describes the basic facility that chooses a window to
818 display a buffer in---@code{display-buffer}. All the higher-level 855 display a buffer in---@code{display-buffer}. All the higher-level
819 functions and commands use this subroutine. Here we describe how to use 856 functions and commands use this subroutine. Here we describe how to use
820 @code{display-buffer} and how to customize it. 857 @code{display-buffer} and how to customize it.
821 858
822 @deffn Command display-buffer buffer-or-name &optional not-this-window 859 @deffn Command display-buffer buffer-or-name &optional not-this-window override-frame
823 This command makes @var{buffer-or-name} appear in some window, like 860 This command makes @var{buffer-or-name} appear in some window, like
824 @code{pop-to-buffer}, but it does not select that window and does not 861 @code{pop-to-buffer}, but it does not select that window and does not
825 make the buffer current. The identity of the selected window is 862 make the buffer current. The identity of the selected window is
826 unaltered by this function. 863 unaltered by this function.
864
865 @var{buffer-or-name} can be a buffer or the name of one.
827 866
828 If @var{not-this-window} is non-@code{nil}, it means to display the 867 If @var{not-this-window} is non-@code{nil}, it means to display the
829 specified buffer in a window other than the selected one, even if it is 868 specified buffer in a window other than the selected one, even if it is
830 already on display in the selected window. This can cause the buffer to 869 already on display in the selected window. This can cause the buffer to
831 appear in two windows at once. Otherwise, if @var{buffer-or-name} is 870 appear in two windows at once. Otherwise, if @var{buffer-or-name} is
832 already being displayed in any window, that is good enough, so this 871 already being displayed in any window, that is good enough, so this
833 function does nothing. 872 function does nothing.
834 873
835 @code{display-buffer} returns the window chosen to display 874 If @var{override-frame} is non-@code{nil}, display on that frame instead
836 @var{buffer-or-name}. 875 of the current frame (or the dedicated frame).
876
877 @code{display-buffer} returns the window chosen to display @var{buffer-or-name}.
837 878
838 Precisely how @code{display-buffer} finds or creates a window depends on 879 Precisely how @code{display-buffer} finds or creates a window depends on
839 the variables described below. 880 the variables described below.
840 @end deffn 881 @end deffn
841 882
1037 1078
1038 As far as the user is concerned, point is where the cursor is, and 1079 As far as the user is concerned, point is where the cursor is, and
1039 when the user switches to another buffer, the cursor jumps to the 1080 when the user switches to another buffer, the cursor jumps to the
1040 position of point in that buffer. 1081 position of point in that buffer.
1041 1082
1042 @defun window-point window 1083 @defun window-point &optional window
1043 This function returns the current position of point in @var{window}. 1084 This function returns the current position of point in @var{window}.
1044 For a non-selected window, this is the value point would have (in that 1085 For a non-selected window, this is the value point would have (in that
1045 window's buffer) if that window were selected. 1086 window's buffer) if that window were selected.
1046 1087
1047 When @var{window} is the selected window and its buffer is also the 1088 When @var{window} is the selected window and its buffer is also the
1048 current buffer, the value returned is the same as point in that buffer. 1089 current buffer, the value returned is the same as the value of point in
1090 that buffer.
1049 1091
1050 Strictly speaking, it would be more correct to return the 1092 Strictly speaking, it would be more correct to return the
1051 ``top-level'' value of point, outside of any @code{save-excursion} 1093 ``top-level'' value of point, outside of any @code{save-excursion}
1052 forms. But that value is hard to find. 1094 forms. But that value is hard to find.
1053 @end defun 1095 @end defun
1069 1111
1070 @defun window-start &optional window 1112 @defun window-start &optional window
1071 @cindex window top line 1113 @cindex window top line
1072 This function returns the display-start position of window 1114 This function returns the display-start position of window
1073 @var{window}. If @var{window} is @code{nil}, the selected window is 1115 @var{window}. If @var{window} is @code{nil}, the selected window is
1074 used. For example, 1116 used. For example,
1075 1117
1076 @example 1118 @example
1077 @group 1119 @group
1078 (window-start) 1120 (window-start)
1079 @result{} 7058 1121 @result{} 7058
1086 1128
1087 For a realistic example, see the description of @code{count-lines} in 1129 For a realistic example, see the description of @code{count-lines} in
1088 @ref{Text Lines}. 1130 @ref{Text Lines}.
1089 @end defun 1131 @end defun
1090 1132
1091 @defun window-end &optional window 1133 @defun window-end &optional window guarantee
1092 This function returns the position of the end of the display in window 1134 This function returns the position of the end of the display in window
1093 @var{window}. If @var{window} is @code{nil}, the selected window is 1135 @var{window}. If @var{window} is @code{nil}, the selected window is
1094 used. 1136 used.
1095 1137
1096 Simply changing the buffer text or moving point does not update the 1138 Simply changing the buffer text or setting @code{window-start} does not
1097 value that @code{window-end} returns. The value is updated only when 1139 update the value that @code{window-end} returns. The value is updated
1098 Emacs redisplays and redisplay actually finishes. 1140 only when Emacs redisplays and redisplay actually finishes.
1099 1141
1100 If the last redisplay of @var{window} was preempted, and did not finish, 1142 If the last redisplay of @var{window} was preempted, and did not finish,
1101 Emacs does not know the position of the end of display in that window. 1143 Emacs does not know the position of the end of display in that window.
1102 In that case, this function returns a value that is not correct. In a 1144 In that case, this function returns a value that is not correct. In a
1103 future version, @code{window-end} will return @code{nil} in that case. 1145 future version, @code{window-end} will return @code{nil} in that case.
1146
1147 If optional arg @var{guarantee} is non-@code{nil}, the return value is
1148 guaranteed to be the same as @code{window-end} would return at the end
1149 of the next full redisplay assuming nothing else changes in the
1150 meantime. This function is potentially much slower with this flag set.
1151
1104 @ignore 1152 @ignore
1105 in that case, this function returns @code{nil}. You can compute where 1153 in that case, this function returns @code{nil}. You can compute where
1106 the end of the window @emph{would} have been, if redisplay had finished, 1154 the end of the window @emph{would} have been, if redisplay had finished,
1107 like this: 1155 like this:
1108 1156
1227 1275
1228 The scrolling functions (aside from @code{scroll-other-window}) have 1276 The scrolling functions (aside from @code{scroll-other-window}) have
1229 unpredictable results if the current buffer is different from the buffer 1277 unpredictable results if the current buffer is different from the buffer
1230 that is displayed in the selected window. @xref{Current Buffer}. 1278 that is displayed in the selected window. @xref{Current Buffer}.
1231 1279
1232 @deffn Command scroll-up &optional count 1280 @deffn Command scroll-up &optional lines
1233 This function scrolls the text in the selected window upward 1281 This function scrolls the text in the selected window upward
1234 @var{count} lines. If @var{count} is negative, scrolling is actually 1282 @var{lines} lines. If @var{lines} is negative, scrolling is actually
1235 downward. 1283 downward.
1236 1284
1237 If @var{count} is @code{nil} (or omitted), then the length of scroll 1285 If @var{lines} is @code{nil} (or omitted), then the length of scroll
1238 is @code{next-screen-context-lines} lines less than the usable height of 1286 is @code{next-screen-context-lines} lines less than the usable height of
1239 the window (not counting its modeline). 1287 the window (not counting its modeline).
1240 1288
1241 @code{scroll-up} returns @code{nil}. 1289 @code{scroll-up} returns @code{nil}.
1242 @end deffn 1290 @end deffn
1243 1291
1244 @deffn Command scroll-down &optional count 1292 @deffn Command scroll-down &optional lines
1245 This function scrolls the text in the selected window downward 1293 This function scrolls the text in the selected window downward
1246 @var{count} lines. If @var{count} is negative, scrolling is actually 1294 @var{lines} lines. If @var{lines} is negative, scrolling is actually
1247 upward. 1295 upward.
1248 1296
1249 If @var{count} is omitted or @code{nil}, then the length of the scroll 1297 If @var{lines} is omitted or @code{nil}, then the length of the scroll
1250 is @code{next-screen-context-lines} lines less than the usable height of 1298 is @code{next-screen-context-lines} lines less than the usable height of
1251 the window (not counting its mode line). 1299 the window (not counting its mode line).
1252 1300
1253 @code{scroll-down} returns @code{nil}. 1301 @code{scroll-down} returns @code{nil}.
1254 @end deffn 1302 @end deffn
1255 1303
1256 @deffn Command scroll-other-window &optional count 1304 @deffn Command scroll-other-window &optional lines
1257 This function scrolls the text in another window upward @var{count} 1305 This function scrolls the text in another window upward @var{lines}
1258 lines. Negative values of @var{count}, or @code{nil}, are handled 1306 lines. Negative values of @var{lines}, or @code{nil}, are handled
1259 as in @code{scroll-up}. 1307 as in @code{scroll-up}.
1260 1308
1261 You can specify a buffer to scroll with the variable 1309 You can specify a buffer to scroll with the variable
1262 @code{other-window-scroll-buffer}. When the selected window is the 1310 @code{other-window-scroll-buffer}. When the selected window is the
1263 minibuffer, the next window is normally the one at the top left corner. 1311 minibuffer, the next window is normally the one at the top left corner.
1303 with an argument of @code{nil} scrolls so that this many lines at the 1351 with an argument of @code{nil} scrolls so that this many lines at the
1304 bottom of the window appear instead at the top. The default value is 1352 bottom of the window appear instead at the top. The default value is
1305 @code{2}. 1353 @code{2}.
1306 @end defopt 1354 @end defopt
1307 1355
1308 @deffn Command recenter &optional count 1356 @deffn Command recenter &optional location window
1309 @cindex centering point 1357 @cindex centering point
1310 This function scrolls the selected window to put the text where point 1358 This function scrolls @var{window} (which defaults to the selected
1311 is located at a specified vertical position within the window. 1359 window) to put the text where point is located at a specified vertical
1312 1360 position within the window.
1313 If @var{count} is a nonnegative number, it puts the line containing 1361
1314 point @var{count} lines down from the top of the window. If @var{count} 1362 If @var{location} is a nonnegative number, it puts the line containing
1363 point @var{location} lines down from the top of the window. If @var{location}
1315 is a negative number, then it counts upward from the bottom of the 1364 is a negative number, then it counts upward from the bottom of the
1316 window, so that @minus{}1 stands for the last usable line in the window. 1365 window, so that @minus{}1 stands for the last usable line in the window.
1317 If @var{count} is a non-@code{nil} list, then it stands for the line in 1366 If @var{location} is a non-@code{nil} list, then it stands for the line in
1318 the middle of the window. 1367 the middle of the window.
1319 1368
1320 If @var{count} is @code{nil}, @code{recenter} puts the line containing 1369 If @var{location} is @code{nil}, @code{recenter} puts the line containing
1321 point in the middle of the window, then clears and redisplays the entire 1370 point in the middle of the window, then clears and redisplays the entire
1322 selected frame. 1371 selected frame.
1323 1372
1324 When @code{recenter} is called interactively, @var{count} is the raw 1373 When @code{recenter} is called interactively, @var{location} is the raw
1325 prefix argument. Thus, typing @kbd{C-u} as the prefix sets the 1374 prefix argument. Thus, typing @kbd{C-u} as the prefix sets the
1326 @var{count} to a non-@code{nil} list, while typing @kbd{C-u 4} sets 1375 @var{location} to a non-@code{nil} list, while typing @kbd{C-u 4} sets
1327 @var{count} to 4, which positions the current line four lines from the 1376 @var{location} to 4, which positions the current line four lines from the
1328 top. 1377 top.
1329 1378
1330 With an argument of zero, @code{recenter} positions the current line at 1379 With an argument of zero, @code{recenter} positions the current line at
1331 the top of the window. This action is so handy that some people make a 1380 the top of the window. This action is so handy that some people make a
1332 separate key binding to do this. For example, 1381 separate key binding to do this. For example,
1334 @example 1383 @example
1335 @group 1384 @group
1336 (defun line-to-top-of-window () 1385 (defun line-to-top-of-window ()
1337 "Scroll current line to top of window. 1386 "Scroll current line to top of window.
1338 Replaces three keystroke sequence C-u 0 C-l." 1387 Replaces three keystroke sequence C-u 0 C-l."
1339 (interactive) 1388 (interactive)
1340 (recenter 0)) 1389 (recenter 0))
1341 1390
1342 (global-set-key [kp-multiply] 'line-to-top-of-window) 1391 (global-set-key [kp-multiply] 'line-to-top-of-window)
1343 @end group 1392 @end group
1344 @end example 1393 @end example
1345 @end deffn 1394 @end deffn
1346 1395
1347 @node Horizontal Scrolling 1396 @node Horizontal Scrolling
1366 horizontal scrolling, you can scroll it back to the right, but only so 1415 horizontal scrolling, you can scroll it back to the right, but only so
1367 far as to reduce the net horizontal scroll to zero. There is no limit 1416 far as to reduce the net horizontal scroll to zero. There is no limit
1368 to how far left you can scroll, but eventually all the text will 1417 to how far left you can scroll, but eventually all the text will
1369 disappear off the left edge. 1418 disappear off the left edge.
1370 1419
1371 @deffn Command scroll-left count 1420 @deffn Command scroll-left &optional count
1372 This function scrolls the selected window @var{count} columns to the 1421 This function scrolls the selected window @var{count} columns to the
1373 left (or to the right if @var{count} is negative). The return value is 1422 left (or to the right if @var{count} is negative). The return value is
1374 the total amount of leftward horizontal scrolling in effect after the 1423 the total amount of leftward horizontal scrolling in effect after the
1375 change---just like the value returned by @code{window-hscroll} (below). 1424 change---just like the value returned by @code{window-hscroll} (below).
1376 @end deffn 1425 @end deffn
1377 1426
1378 @deffn Command scroll-right count 1427 @deffn Command scroll-right &optional count
1379 This function scrolls the selected window @var{count} columns to the 1428 This function scrolls the selected window @var{count} columns to the
1380 right (or to the left if @var{count} is negative). The return value is 1429 right (or to the left if @var{count} is negative). The return value is
1381 the total amount of leftward horizontal scrolling in effect after the 1430 the total amount of leftward horizontal scrolling in effect after the
1382 change---just like the value returned by @code{window-hscroll} (below). 1431 change---just like the value returned by @code{window-hscroll} (below).
1383 1432
1431 is off the screen due to horizontal scrolling: 1480 is off the screen due to horizontal scrolling:
1432 1481
1433 @example 1482 @example
1434 @group 1483 @group
1435 (defun hscroll-on-screen (window position) 1484 (defun hscroll-on-screen (window position)
1436 (save-excursion 1485 (save-excursion
1437 (goto-char position) 1486 (goto-char position)
1438 (and 1487 (and
1439 (>= (- (current-column) (window-hscroll window)) 0) 1488 (>= (- (current-column) (window-hscroll window)) 0)
1440 (< (- (current-column) (window-hscroll window)) 1489 (< (- (current-column) (window-hscroll window))
1441 (window-width window))))) 1490 (window-width window)))))
1442 @end group 1491 @end group
1443 @end example 1492 @end example
1588 1637
1589 @defun window-displayed-text-pixel-height &optional window noclipped 1638 @defun window-displayed-text-pixel-height &optional window noclipped
1590 This function returns the height in pixels of the text displayed in 1639 This function returns the height in pixels of the text displayed in
1591 @var{window}, which defaults to the selected window. Unlike 1640 @var{window}, which defaults to the selected window. Unlike
1592 @code{window-text-area-pixel-height}, any blank space below the 1641 @code{window-text-area-pixel-height}, any blank space below the
1593 end of the buffer is not included. If optional argument @var{noclipped} 1642 end of the buffer is not included. If optional argument @var{noclipped}
1594 is non-@code{nil}, any space occupied by clipped lines will not be 1643 is non-@code{nil}, any space occupied by clipped lines will not be
1595 included. 1644 included.
1596 @end defun 1645 @end defun
1597 1646
1598 @node Position of Window 1647 @node Position of Window
1609 @var{window}. If @var{window} is @code{nil}, the selected window is 1658 @var{window}. If @var{window} is @code{nil}, the selected window is
1610 used. 1659 used.
1611 1660
1612 The order of the list is @code{(@var{left} @var{top} @var{right} 1661 The order of the list is @code{(@var{left} @var{top} @var{right}
1613 @var{bottom})}, all elements relative to 0, 0 at the top left corner of 1662 @var{bottom})}, all elements relative to 0, 0 at the top left corner of
1614 the frame. The element @var{right} of the value is one more than the 1663 @var{window}'s frame. The element @var{right} of the value is one more
1615 rightmost pixel used by @var{window} (including any left margin, right 1664 than the rightmost pixel used by @var{window} (including any left
1616 margin, or vertical scrollbar displayed alongside it), and 1665 margin, right margin, or vertical scrollbar displayed alongside it), and
1617 @var{bottom} is one more than the bottommost pixel used by @var{window} 1666 @var{bottom} is one more than the bottommost pixel used by @var{window}
1618 (including any modeline or horizontal scrollbar displayed above 1667 (including any modeline or horizontal scrollbar displayed above or below
1619 or below it). The frame area does not include any frame menubars or 1668 it). The frame area does not include any frame menubars, toolbars, or
1620 toolbars that may be displayed; thus, for example, if there is only 1669 gutters that may be displayed; thus, for example, if there is only one
1621 one window on the frame, the values for @var{left} and @var{top} will 1670 window on the frame, the values for @var{left} and @var{top} will always
1622 always be 0. 1671 be 0.
1623 1672
1624 If @var{window} is at the upper left corner of its frame, @var{right} 1673 If @var{window} is at the upper left corner of its frame, @var{right}
1625 and @var{bottom} are the same as the values returned by 1674 and @var{bottom} are the same as the values returned by
1626 @code{(window-pixel-width)} and @code{(window-pixel-height)} 1675 @code{(window-pixel-width)} and @code{(window-pixel-height)}
1627 respectively, and @var{top} and @var{bottom} are zero. 1676 respectively, and @var{left} and @var{top} are zero.
1628 @end defun 1677 @end defun
1629 1678
1630 There is no longer a function @code{window-edges} because it does not 1679 There is no longer a function @code{window-edges} because it does not
1631 make sense in a world with variable-width and variable-height lines, 1680 make sense in a world with variable-width and variable-height lines,
1632 as are allowed in XEmacs. 1681 as are allowed in XEmacs.
1658 The window size functions fall into two classes: high-level commands 1707 The window size functions fall into two classes: high-level commands
1659 that change the size of windows and low-level functions that access 1708 that change the size of windows and low-level functions that access
1660 window size. XEmacs does not permit overlapping windows or gaps between 1709 window size. XEmacs does not permit overlapping windows or gaps between
1661 windows, so resizing one window affects other windows. 1710 windows, so resizing one window affects other windows.
1662 1711
1663 @deffn Command enlarge-window size &optional horizontal window 1712 @deffn Command enlarge-window count &optional horizontal window
1664 This function makes the selected window @var{size} lines taller, 1713 This function makes the selected window @var{count} lines taller,
1665 stealing lines from neighboring windows. It takes the lines from one 1714 stealing lines from neighboring windows. It takes the lines from one
1666 window at a time until that window is used up, then takes from another. 1715 window at a time until that window is used up, then takes from another.
1667 If a window from which lines are stolen shrinks below 1716 If a window from which lines are stolen shrinks below
1668 @code{window-min-height} lines, that window disappears. 1717 @code{window-min-height} lines, that window disappears.
1669 1718
1670 If @var{horizontal} is non-@code{nil}, this function makes 1719 If @var{horizontal} is non-@code{nil}, this function makes
1671 @var{window} wider by @var{size} columns, stealing columns instead of 1720 @var{window} wider by @var{count} columns, stealing columns instead of
1672 lines. If a window from which columns are stolen shrinks below 1721 lines. If a window from which columns are stolen shrinks below
1673 @code{window-min-width} columns, that window disappears. 1722 @code{window-min-width} columns, that window disappears.
1674 1723
1675 If the requested size would exceed that of the window's frame, then the 1724 If the requested size would exceed that of the window's frame, then the
1676 function makes the window occupy the entire height (or width) of the 1725 function makes the window occupy the entire height (or width) of the
1677 frame. 1726 frame.
1678 1727
1679 If @var{size} is negative, this function shrinks the window by 1728 If @var{count} is negative, this function shrinks the window by
1680 @minus{}@var{size} lines or columns. If that makes the window smaller 1729 @minus{}@var{count} lines or columns. If that makes the window smaller
1681 than the minimum size (@code{window-min-height} and 1730 than the minimum size (@code{window-min-height} and
1682 @code{window-min-width}), @code{enlarge-window} deletes the window. 1731 @code{window-min-width}), @code{enlarge-window} deletes the window.
1683 1732
1684 If @var{window} is non-@code{nil}, it specifies a window to change 1733 If @var{window} is non-@code{nil}, it specifies a window to change
1685 instead of the selected window. 1734 instead of the selected window.
1686 1735
1687 @code{enlarge-window} returns @code{nil}. 1736 @code{enlarge-window} returns @code{nil}.
1688 @end deffn 1737 @end deffn
1689 1738
1690 @deffn Command enlarge-window-horizontally columns 1739 @deffn Command enlarge-window-horizontally columns
1691 This function makes the selected window @var{columns} wider. 1740 This function makes the selected window @var{columns} wider.
1692 It could be defined as follows: 1741 It could be defined as follows:
1698 @end group 1747 @end group
1699 @end example 1748 @end example
1700 @end deffn 1749 @end deffn
1701 1750
1702 @deffn Command enlarge-window-pixels count &optional side window 1751 @deffn Command enlarge-window-pixels count &optional side window
1703 This function makes the selected window @var{count} pixels larger. When 1752 This function makes the selected window @var{count} pixels larger.
1704 called from Lisp, optional second argument @var{side} non-@code{nil} 1753 When called from Lisp, optional second argument @var{side}
1705 means to grow sideways @var{count} pixels, and optional third argument 1754 non-@code{nil} means to grow sideways @var{count} pixels, and optional
1706 @var{window} specifies the window to change instead of the selected 1755 third argument @var{window} specifies the window to change instead of
1707 window. 1756 the selected window.
1708 @end deffn 1757 @end deffn
1709 1758
1710 @deffn Command shrink-window size &optional horizontal window 1759 @deffn Command shrink-window count &optional horizontal window
1711 This function is like @code{enlarge-window} but negates the argument 1760 This function is like @code{enlarge-window} but negates the argument
1712 @var{size}, making the selected window smaller by giving lines (or 1761 @var{count}, making the selected window smaller by giving lines (or
1713 columns) to the other windows. If the window shrinks below 1762 columns) to the other windows. If the window shrinks below
1714 @code{window-min-height} or @code{window-min-width}, then it disappears. 1763 @code{window-min-height} or @code{window-min-width}, then it disappears.
1715 1764
1716 If @var{size} is negative, the window is enlarged by @minus{}@var{size} 1765 If @var{count} is negative, the window is enlarged by @minus{}@var{count}
1717 lines or columns. 1766 lines or columns.
1718 1767
1719 If @var{window} is non-@code{nil}, it specifies a window to change 1768 If @var{window} is non-@code{nil}, it specifies a window to change
1720 instead of the selected window. 1769 instead of the selected window.
1721 @end deffn 1770 @end deffn
1798 1847
1799 If you want to record all frames instead of just one, use a frame 1848 If you want to record all frames instead of just one, use a frame
1800 configuration instead of a window configuration. @xref{Frame 1849 configuration instead of a window configuration. @xref{Frame
1801 Configurations}. 1850 Configurations}.
1802 1851
1803 @defun current-window-configuration 1852 @defun current-window-configuration &optional frame
1804 This function returns a new object representing XEmacs's current window 1853 This function returns a new object representing the current current
1805 configuration, namely the number of windows, their sizes and current 1854 window configuration of @var{frame}, namely the number of windows, their
1806 buffers, which window is the selected window, and for each window the 1855 sizes and current buffers, which window is the selected window, and for
1807 displayed buffer, the display-start position, and the positions of point 1856 each window the displayed buffer, the display-start position, and the
1808 and the mark. An exception is made for point in the current buffer, 1857 positions of point and the mark. An exception is made for point in the
1809 whose value is not saved. 1858 current buffer, whose value is not saved.
1859
1860 @var{frame} defaults to the selected frame.
1810 @end defun 1861 @end defun
1811 1862
1812 @defun set-window-configuration configuration 1863 @defun set-window-configuration configuration
1813 This function restores the configuration of XEmacs's windows and 1864 This function restores the configuration of XEmacs's windows and
1814 buffers to the state specified by @var{configuration}. The argument 1865 buffers to the state specified by @var{configuration}. The argument