diff options
| author | Chong Yidong | 2011-11-08 15:43:30 +0800 |
|---|---|---|
| committer | Chong Yidong | 2011-11-08 15:43:30 +0800 |
| commit | a79db6e01262fc0d55b7ee32cbfba4611d44e584 (patch) | |
| tree | b604b48db68a4ba88aa0c0669abd6e6d9882ad43 | |
| parent | 105216ed03e65f32a7477ba3d27ab05c94bd3449 (diff) | |
| download | emacs-a79db6e01262fc0d55b7ee32cbfba4611d44e584.tar.gz emacs-a79db6e01262fc0d55b7ee32cbfba4611d44e584.zip | |
Edits to Window Sizes node of Lisp manual.
* doc/lispref/windows.texi (Window Sizes): Copyedits. Document
window-text-height. Remove window-min-height and window-min-width
discussion, referring instead to Emacs manual.
(Splitting Windows, Resizing Windows): Add xref to Emacs manual.
| -rw-r--r-- | doc/lispref/ChangeLog | 7 | ||||
| -rw-r--r-- | doc/lispref/windows.texi | 401 |
2 files changed, 151 insertions, 257 deletions
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index ff629ce67ae..47214596c1a 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog | |||
| @@ -1,3 +1,10 @@ | |||
| 1 | 2011-11-08 Chong Yidong <cyd@gnu.org> | ||
| 2 | |||
| 3 | * windows.texi (Window Sizes): Copyedits. Document | ||
| 4 | window-text-height. Remove window-min-height and window-min-width | ||
| 5 | discussion, referring instead to Emacs manual. | ||
| 6 | (Splitting Windows, Resizing Windows): Add xref to Emacs manual. | ||
| 7 | |||
| 1 | 2011-11-07 Glenn Morris <rgm@gnu.org> | 8 | 2011-11-07 Glenn Morris <rgm@gnu.org> |
| 2 | 9 | ||
| 3 | * windows.texi (Choosing Window): Fix keybinding typo. | 10 | * windows.texi (Choosing Window): Fix keybinding typo. |
diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi index 02626adfd87..2bb30dd4cbc 100644 --- a/doc/lispref/windows.texi +++ b/doc/lispref/windows.texi | |||
| @@ -340,13 +340,12 @@ internal window). The @var{edges} element is a list @code{(@var{left} | |||
| 340 | @cindex window size | 340 | @cindex window size |
| 341 | @cindex size of window | 341 | @cindex size of window |
| 342 | 342 | ||
| 343 | Emacs windows are rectangular. The structure of a live window can be | 343 | The following schematic shows the structure of a live window: |
| 344 | roughly sketched as follows: | ||
| 345 | 344 | ||
| 346 | @smallexample | 345 | @smallexample |
| 347 | @group | 346 | @group |
| 348 | _________________________________________ | 347 | _________________________________________ |
| 349 | ^ |______________ Header Line_______________| | 348 | ^ |______________ Header Line_______________| |
| 350 | | |LS|LF|LM| |RM|RF|RS| ^ | 349 | | |LS|LF|LM| |RM|RF|RS| ^ |
| 351 | | | | | | | | | | | | 350 | | | | | | | | | | | |
| 352 | Window | | | | Text Area | | | | Window | 351 | Window | | | | Text Area | | | | Window |
| @@ -362,295 +361,177 @@ roughly sketched as follows: | |||
| 362 | @end smallexample | 361 | @end smallexample |
| 363 | 362 | ||
| 364 | @cindex window body | 363 | @cindex window body |
| 364 | @cindex text area of a window | ||
| 365 | @cindex body of a window | 365 | @cindex body of a window |
| 366 | The text area constitutes the body of the window. In its most simple | 366 | At the center of the window is the @dfn{text area}, or @dfn{body}, |
| 367 | form, a window consists of its body alone. LS and RS stand for the left | 367 | where the buffer text is displayed. On each side of the text area is |
| 368 | and right scroll bar (@pxref{Scroll Bars}) respectively. Only one of | 368 | a series of vertical areas; from innermost to outermost, these are the |
| 369 | them can be present at any time. LF and RF denote the left and right | 369 | left and right margins, denoted by LM and RM in the schematic |
| 370 | fringe, see @ref{Fringes}. LM and RM, finally, stand for the left and | 370 | (@pxref{Display Margins}); the left and right fringes, denoted by LF |
| 371 | right display margin, see @ref{Display Margins}. The header line, if | 371 | and RF (@pxref{Fringes}); and the left or right scroll bar, only one of |
| 372 | present, is located above theses areas, the mode line below, see | 372 | which is present at any time, denoted by LS and RS (@pxref{Scroll |
| 373 | @ref{Mode Line Format}. | 373 | Bars}). At the top of the window is an optional header line |
| 374 | (@pxref{Header Lines}), and at the bottom of the window is the mode | ||
| 375 | line (@pxref{Mode Line Format}). | ||
| 376 | |||
| 377 | Emacs provides several functions for finding the height and width of | ||
| 378 | a window. Most of these functions report the values as integer | ||
| 379 | multiples of the default character height and width. On a graphical | ||
| 380 | display, the actual screen size of this default height and width are | ||
| 381 | those specified by the frame's default font. Hence, if the buffer | ||
| 382 | contains text that is displayed in a different size, the reported | ||
| 383 | height and width of the window may differ from the actual number of | ||
| 384 | text lines or columns displayed in it. | ||
| 374 | 385 | ||
| 375 | @cindex window height | 386 | @cindex window height |
| 376 | @cindex total window height | ||
| 377 | @cindex height of a window | 387 | @cindex height of a window |
| 378 | @cindex total height of a window | 388 | @cindex total height of a window |
| 379 | The @dfn{total height of a window} is specified as the total number of | ||
| 380 | lines occupied by the window. Any mode or header line is included in a | ||
| 381 | window's total height. For an internal window, the total height is | ||
| 382 | calculated recursively from the total heights of its child windows. | ||
| 383 | |||
| 384 | @cindex window width | 389 | @cindex window width |
| 385 | @cindex total window width | ||
| 386 | @cindex width of a window | 390 | @cindex width of a window |
| 387 | @cindex total width of a window | 391 | @cindex total width of a window |
| 388 | The @dfn{total width of a window} denotes the total number of columns of | 392 | The @dfn{total height} of a window is the distance between the top |
| 389 | the window. Any scroll bar and the column of @samp{|} characters that | 393 | and bottom of the window, including the header line (if one exists) |
| 390 | separate the window from its right sibling are included in a window's | 394 | and the mode line. The @dfn{total width} of a window is the distance |
| 391 | total width. On a window-system, fringes and display margins are | 395 | between the left and right edges of the mode line. Note that the |
| 392 | included in a window's total width too. For an internal window, the | 396 | height of a frame is not the same as the height of its windows, since |
| 393 | total width is calculated recursively from the total widths of its child | 397 | a frame may also contain an echo area, menu bar, and tool bar |
| 394 | windows. | 398 | (@pxref{Size and Position}). |
| 395 | |||
| 396 | @cindex total size of a window | ||
| 397 | @cindex total window size | ||
| 398 | The following function is the standard interface for getting the total | ||
| 399 | size of any window: | ||
| 400 | |||
| 401 | @defun window-total-size &optional window &optional horizontal | ||
| 402 | This function returns the total number of lines of @var{window}. The | ||
| 403 | argument @var{window} can denote any window and defaults to the selected | ||
| 404 | one. If @var{window} is live, the return value includes any header or | ||
| 405 | mode lines of @var{window}. If @var{window} is internal, the return | ||
| 406 | value is the sum of the total heights of @var{window}'s child windows | ||
| 407 | provided these are vertically combined and the height of @var{window}'s | ||
| 408 | first child if they are horizontally combined. | ||
| 409 | |||
| 410 | If the optional argument @var{horizontal} is non-@code{nil}, this | ||
| 411 | function returns the total number of columns of @var{window}. If | ||
| 412 | @var{window} is live, the return value includes any vertical divider | ||
| 413 | column or scroll bars of @var{window}. On a window-system, the return | ||
| 414 | value includes the space occupied by any margins and fringes of | ||
| 415 | @var{window} too. If @var{window} is internal, the return value is the | ||
| 416 | sum of the total widths of @var{window}'s child windows provided these | ||
| 417 | are horizontally combined and the width of @var{window}'s first child | ||
| 418 | otherwise. | ||
| 419 | @end defun | ||
| 420 | |||
| 421 | Alternatively, the following two functions can be used to retrieve | ||
| 422 | either the total height or the total width of a window: | ||
| 423 | 399 | ||
| 424 | @defun window-total-height &optional window | 400 | @defun window-total-height &optional window |
| 425 | This function returns the total number of lines of @var{window}. | 401 | This function returns the total height, in lines, of the window |
| 426 | @var{window} can be any window and defaults to the selected one. The | 402 | @var{window}. If @var{window} is omitted or @code{nil}, it defaults |
| 427 | return value includes @var{window}'s mode line and header line, if any. | 403 | to the selected window. If @var{window} is an internal window, the |
| 428 | If @var{window} is internal the return value is the sum of heights of | 404 | return value is the total height occupied by its descendant windows. |
| 429 | @var{window}'s child windows for a vertical combination and the height | ||
| 430 | of @var{window}'s first child otherwise. | ||
| 431 | @end defun | 405 | @end defun |
| 432 | 406 | ||
| 433 | @defun window-total-width &optional window | 407 | @defun window-total-width &optional window |
| 434 | This function returns the total number of columns of @var{window}. | 408 | This function returns the total width, in columns, of the window |
| 435 | @var{window} can be any window and defaults to the selected one. The | 409 | @var{window}. If @var{window} is omitted or @code{nil}, it defaults |
| 436 | return value includes any vertical dividers or scrollbars of | 410 | to the selected window. If @var{window} is internal, the return value |
| 437 | @var{window}. On a window-system the return value also includes the | 411 | is the total width occupied by its descendant windows. |
| 438 | space occupied by any margins and fringes of @var{window}. If | 412 | @end defun |
| 439 | @var{window} is internal, the return value is the sum of the widths of | ||
| 440 | @var{window}'s child windows for a horizontal combination and the width | ||
| 441 | of @var{window}'s first child otherwise. | ||
| 442 | @end defun | ||
| 443 | |||
| 444 | The total height of any window is usually less than the height of the | ||
| 445 | window's frame, because the latter may also include the minibuffer | ||
| 446 | window. Depending on the toolkit in use, the frame height can also | ||
| 447 | include the menu bar and the tool bar (@pxref{Size and Position}). | ||
| 448 | Therefore, in general it is not straightforward to compare window and | ||
| 449 | frame heights. The following function is useful to determine whether | ||
| 450 | there are no other windows above or below a specified window. | ||
| 451 | 413 | ||
| 452 | @cindex full-height window | 414 | @defun window-total-size &optional window horizontal |
| 453 | @defun window-full-height-p &optional window | 415 | This function returns either the total height or width of the window |
| 454 | This function returns non-@code{nil} if there is no other window above | 416 | @var{window}. If @var{horizontal} is omitted or @code{nil}, this is |
| 455 | or below @var{window} on the containing frame. More precisely, this | 417 | equivalent to calling @code{window-total-height} for @var{window}; |
| 456 | function returns @code{t} if and only if the total height of | 418 | otherwise it is equivalent to calling @code{window-total-width} for |
| 457 | @var{window} equals the total height of the root window (@pxref{Windows | 419 | @var{window}. |
| 458 | and Frames}) of @var{window}'s frame. The @var{window} argument may | ||
| 459 | denote any window and defaults to the selected one. | ||
| 460 | @end defun | 420 | @end defun |
| 461 | 421 | ||
| 462 | @cindex full-width window | 422 | @cindex full-width window |
| 463 | The following function can be used to determine whether there are no | 423 | @cindex full-height window |
| 464 | other windows on the left or right of a specified window. | 424 | The following functions can be used to determine whether a given |
| 425 | window has any adjacent windows. | ||
| 426 | |||
| 427 | @defun window-full-height-p &optional window | ||
| 428 | This function returns non-@code{nil} if @var{window} has no other | ||
| 429 | window above or below it in its frame, i.e. its total height equals | ||
| 430 | the total height of the root window on that frame. If @var{window} is | ||
| 431 | omitted or @code{nil}, it defaults to the selected window. | ||
| 432 | @end defun | ||
| 465 | 433 | ||
| 466 | @defun window-full-width-p &optional window | 434 | @defun window-full-width-p &optional window |
| 467 | This function returns non-@code{nil} if there are no other windows on | 435 | This function returns non-@code{nil} if @var{window} has no other |
| 468 | the left or right of @var{window}; @code{nil} otherwise. More | 436 | window to the left or right in its frame, i.e. its total width equals |
| 469 | precisely, this function returns @code{t} if and only if the total width | 437 | that of the root window on that frame. If @var{window} is omitted or |
| 470 | of @var{window} equals the total width of the root window | 438 | @code{nil}, it defaults to the selected window. |
| 471 | (@pxref{Windows and Frames}) of @var{window}'s frame. The @var{window} | ||
| 472 | argument may denote any window and defaults to the selected one. | ||
| 473 | @end defun | 439 | @end defun |
| 474 | 440 | ||
| 475 | @cindex top line of window | 441 | @cindex window position |
| 476 | @cindex left column of window | 442 | The following functions can be used to determine the position of a |
| 477 | The windows of a frame are unambiguously characterized by the | 443 | window relative to the window area of its frame: |
| 478 | combination of their top line and left column within that frame. | ||
| 479 | 444 | ||
| 480 | @defun window-top-line &optional window | 445 | @defun window-top-line &optional window |
| 481 | This function returns the top line of @var{window}. The argument | 446 | This function returns the distance, in lines, between the top of |
| 482 | @var{window} can denote any window and defaults to the selected one. | 447 | @var{window} and the top of the frame's window area. For instance, |
| 448 | the return value is 0 if there is no window above @var{window}. If | ||
| 449 | @var{window} is omitted or @code{nil}, it defaults to the selected | ||
| 450 | window. | ||
| 483 | @end defun | 451 | @end defun |
| 484 | 452 | ||
| 485 | @defun window-left-column &optional window | 453 | @defun window-left-column &optional window |
| 486 | This function returns the left column of @var{window}. The argument | 454 | This function returns the distance, in columns, between the left edge |
| 487 | @var{window} can denote any window and defaults to the selected one. | 455 | of @var{window} and the left edge of the frame's window area. For |
| 456 | instance, the return value is 0 if there is no window to the left of | ||
| 457 | @var{window}. If @var{window} is omitted or @code{nil}, it defaults | ||
| 458 | to the selected window. | ||
| 488 | @end defun | 459 | @end defun |
| 489 | 460 | ||
| 490 | For a frame displaying one window only, that window's top line and left | ||
| 491 | column are both zero. When a frame displays a window @var{WB} below a | ||
| 492 | window @var{WA}, the top line of @var{WB} can be calculated by adding | ||
| 493 | the total height of @var{WA} to the top line of @var{WA}. When a frame | ||
| 494 | displays a window @var{WR} on the right of a window @var{WL}, the left | ||
| 495 | column of @var{WR} can be calculated by adding the total width of | ||
| 496 | @var{WL} to the left column of @var{WL}. | ||
| 497 | |||
| 498 | @cindex window body height | 461 | @cindex window body height |
| 499 | @cindex body height of a window | 462 | @cindex body height of a window |
| 500 | The @dfn{body height of a window} is specified as the total number of | ||
| 501 | lines occupied by the window's text area. Mode or header lines are not | ||
| 502 | included in a window's body height. | ||
| 503 | |||
| 504 | @cindex window body width | 463 | @cindex window body width |
| 505 | @cindex body width of a window | 464 | @cindex body width of a window |
| 506 | The @dfn{body width of a window} denotes the total number of columns | ||
| 507 | occupied by the window's text area. Scroll bars or columns of @samp{|} | ||
| 508 | characters that separate side-by-side windows are not included in a | ||
| 509 | window's body width. | ||
| 510 | |||
| 511 | @cindex body size of a window | 465 | @cindex body size of a window |
| 512 | @cindex window body size | 466 | @cindex window body size |
| 513 | @cindex canonical units of window/frame size | 467 | The @dfn{body height} of a window is the height of its text area, |
| 514 | The following functions retrieve height and width of the body of a | 468 | which does not include the mode or header line. Similarly, the |
| 515 | live window. Note that the values these functions return are measured | 469 | @dfn{body width} is the width of the text area, which does not include |
| 516 | in @dfn{canonical units}, i.e.@: for the default frame's face. If the | 470 | the scroll bar, fringes, or margins. |
| 517 | window shows some characters with non-default face, e.g., if the font | ||
| 518 | of some characters is larger or smaller than the default font, the | ||
| 519 | values returned by these functions will not match the actual number of | ||
| 520 | lines or characters per line shown in the window. To get the actual | ||
| 521 | number of columns and lines, move to the last character in the line | ||
| 522 | (e.g., with @code{end-of-visual-line}) or to the last line of the | ||
| 523 | window (e.g., with @code{window-end}), and use @code{posn-at-point} to | ||
| 524 | find the line or column there. | ||
| 525 | |||
| 526 | @defun window-body-size &optional window horizontal | ||
| 527 | This function returns the number of lines of @var{window}'s text area. | ||
| 528 | @var{window} must be a live window and defaults to the selected one. | ||
| 529 | The return value does not count any mode or header line of @var{window}. | ||
| 530 | |||
| 531 | Optional argument @var{horizontal} non-@code{nil} means to return the | ||
| 532 | number of columns of @var{window}'s text area. In this case the return | ||
| 533 | value does not include any vertical divider or scroll bar owned by | ||
| 534 | @var{window}. On a window-system the return value does not include the | ||
| 535 | number of columns used for @var{window}'s fringes or display margins | ||
| 536 | either. | ||
| 537 | @end defun | ||
| 538 | 471 | ||
| 539 | @defun window-body-height &optional window | 472 | @defun window-body-height &optional window |
| 540 | This function returns the number of lines of @var{window}'s body. | 473 | This function returns the body height, in lines, of the window |
| 541 | @var{window} must be a live window and defaults to the selected one. | 474 | @var{window}. If @var{window} is omitted or @code{nil}, it defaults |
| 475 | to the selected window; otherwise it must be a live window. | ||
| 542 | 476 | ||
| 543 | The return value does not include @var{window}'s mode line and header | 477 | If there is a partially-visible line at the bottom of the text area, |
| 544 | line, if any. If a line at the bottom of the window is only partially | 478 | that counts as a whole line; to exclude such a partially-visible line, |
| 545 | visible, that line is included in the return value. If you do not | 479 | use @code{window-text-height}, below. |
| 546 | want to include a partially visible bottom line in the return value, | ||
| 547 | use @code{window-text-height} instead. | ||
| 548 | @end defun | 480 | @end defun |
| 549 | 481 | ||
| 550 | @defun window-body-width &optional window | 482 | @defun window-body-width &optional window |
| 551 | This function returns the number of columns of @var{window}'s body. | 483 | This function returns the body width, in columns, of the window |
| 552 | @var{window} must be a live window and defaults to the selected one. | 484 | @var{window}. If @var{window} is omitted or @code{nil}, it defaults |
| 553 | 485 | to the selected window; otherwise it must be a live window. | |
| 554 | The return value does not include any vertical dividers or scroll bars | ||
| 555 | owned by @var{window}. On a window-system the return value does not | ||
| 556 | include the number of columns used for @var{window}'s fringes or | ||
| 557 | display margins either. | ||
| 558 | @end defun | 486 | @end defun |
| 559 | 487 | ||
| 560 | The following functions have been used in earlier versions of Emacs. | 488 | @defun window-body-size &optional window horizontal |
| 561 | They are still supported but due to the confusing nomenclature they | 489 | This function returns the body height or body width of @var{window}. |
| 562 | should not be used any more in future code. | 490 | If @var{horizontal} is omitted or @code{nil}, it is equivalent to |
| 563 | 491 | calling @code{window-body-height} for @var{window}; otherwise it is | |
| 564 | @defun window-height &optional window | 492 | equivalent to calling @code{window-body-width}. |
| 565 | This function is an alias for `window-total-height', see above. | ||
| 566 | @end defun | 493 | @end defun |
| 567 | 494 | ||
| 568 | @defun window-width &optional window | 495 | @defun window-text-height &optional window |
| 569 | This function is an alias for `window-body-width', see above. | 496 | This function is like @code{window-body-height}, except that any |
| 497 | partially-visible line at the bottom of the text area is not counted. | ||
| 570 | @end defun | 498 | @end defun |
| 571 | 499 | ||
| 572 | @cindex minimum window size | 500 | For compatibility with previous versions of Emacs, |
| 573 | The following two options constrain the sizes of windows to a minimum | 501 | @code{window-height} is an alias for @code{window-body-height}, and |
| 574 | height and width. Their values are honored when windows are split | 502 | @code{window-width} is an alias for @code{window-body-width}. These |
| 575 | (@pxref{Splitting Windows}) or resized (@pxref{Resizing Windows}). Any | 503 | aliases are considered obsolete and will be removed in the future. |
| 576 | request to make a window smaller than specified here will usually result | ||
| 577 | in an error. | ||
| 578 | |||
| 579 | @defopt window-min-height | ||
| 580 | The value of this variable specifies how short a window may be. The | ||
| 581 | value is measured in line units and has to account for any header or | ||
| 582 | mode line. The default value for this option is @code{4}. Values less | ||
| 583 | than @code{1} are ignored. | ||
| 584 | @end defopt | ||
| 585 | |||
| 586 | @defopt window-min-width | ||
| 587 | The value of this variable specifies how narrow a window may be. The | ||
| 588 | value is measured in characters and includes any margins, fringes, | ||
| 589 | scroll bar and vertical divider column. The default value for this | ||
| 590 | option is @code{10}. A value less than @code{2} is ignored. | ||
| 591 | @end defopt | ||
| 592 | |||
| 593 | Applications should not rebind these variables. To shrink a specific | ||
| 594 | window to a height or width less than the one specified here, they | ||
| 595 | should rather invoke @code{window-resize} (@pxref{Resizing Windows}) | ||
| 596 | with a non-@code{nil} @var{ignore} argument. The function | ||
| 597 | @code{split-window} (@pxref{Splitting Windows}) can make a window | ||
| 598 | smaller than specified here by calling it with a non-@code{nil} | ||
| 599 | @var{size} argument. Interactively, the values specified here cannot be | ||
| 600 | overridden. | ||
| 601 | |||
| 602 | Earlier versions of Emacs could delete a window when its size dropped | ||
| 603 | below @code{window-min-height} or @code{window-min-width}. As a rule, | ||
| 604 | the current version of Emacs does no more delete windows by side-effect. | ||
| 605 | The only exception to this rule are requests to resize a frame which may | ||
| 606 | implicitly delete windows when they do not fit on the frame any more, | ||
| 607 | see @ref{Size and Position}. | ||
| 608 | |||
| 609 | The size of a window can be fixed which means that it cannot be split | ||
| 610 | (@pxref{Splitting Windows}) or resized (@pxref{Resizing Windows}). | ||
| 611 | 504 | ||
| 612 | @cindex fixed-size window | 505 | @cindex fixed-size window |
| 506 | Commands that change the size of windows (@pxref{Resizing Windows}), | ||
| 507 | or split them (@pxref{Splitting Windows}), obey the variables | ||
| 508 | @code{window-min-height} and @code{window-min-width}, which specify | ||
| 509 | the smallest allowable window height and width. @xref{Change | ||
| 510 | Window,,Deleting and Rearranging Windows, emacs, The GNU Emacs | ||
| 511 | Manual}. They also obey the variable @code{window-size-fixed}, with | ||
| 512 | which a window can be @dfn{fixed} in size: | ||
| 513 | |||
| 613 | @defvar window-size-fixed | 514 | @defvar window-size-fixed |
| 614 | If this variable is non-@code{nil}, in a given buffer, then the size of | 515 | If this buffer-local variable is non-@code{nil}, the size of any |
| 615 | any window displaying that buffer remains fixed unless you either | 516 | window displaying the buffer cannot normally be changed. Deleting a |
| 616 | explicitly change it or Emacs has no other choice. | 517 | window or changing the frame's size may still change its size, if |
| 518 | there is no choice. | ||
| 617 | 519 | ||
| 618 | If the value is @code{height}, then only the window's height is fixed; | 520 | If the value is @code{height}, then only the window's height is fixed; |
| 619 | if the value is @code{width}, then only the window's width is fixed. | 521 | if the value is @code{width}, then only the window's width is fixed. |
| 620 | Any other non-@code{nil} value fixes both the width and the height. | 522 | Any other non-@code{nil} value fixes both the width and the height. |
| 621 | |||
| 622 | This variable automatically becomes buffer-local when set. | ||
| 623 | @end defvar | 523 | @end defvar |
| 624 | 524 | ||
| 625 | Commands supposed to explicitly change the size of windows such as | ||
| 626 | @code{enlarge-window} (@pxref{Resizing Windows}) get an error if they | ||
| 627 | had to change a window size which is fixed. Other functions like | ||
| 628 | @code{window-resize} (@pxref{Resizing Windows}) have an optional | ||
| 629 | @var{ignore} argument which allows to change the size of fixed-size | ||
| 630 | windows. | ||
| 631 | |||
| 632 | Deleting a window or changing a frame's size may change the size of a | ||
| 633 | fixed-size window, if there is no other alternative. | ||
| 634 | |||
| 635 | The height of a vertical combination of windows cannot be changed | ||
| 636 | when the height of all these windows is fixed. Its width cannot be | ||
| 637 | changed if the width of at least one of these windows is fixed. | ||
| 638 | Similarly, the width of a horizontal combination of windows cannot be | ||
| 639 | changed when the width of all these windows is fixed. Its height cannot | ||
| 640 | be changed if the height of at least one of these windows is fixed. | ||
| 641 | |||
| 642 | The next function allows to check whether the size of an arbitrary | ||
| 643 | window is fixed. | ||
| 644 | |||
| 645 | @defun window-size-fixed-p &optional window horizontal | 525 | @defun window-size-fixed-p &optional window horizontal |
| 646 | This function returns non-@code{nil} if @var{window}'s height is fixed. | 526 | This function returns a non-@code{nil} value if @var{window}'s height |
| 647 | The argument @var{window} can be an arbitrary window and defaults to the | 527 | is fixed. If @var{window} is omitted or @code{nil}, it defaults to |
| 648 | selected one. Optional argument @var{horizontal} non-@code{nil} means | 528 | the selected window. If the optional argument @var{horizontal} is |
| 649 | return non-@code{nil} if @var{window}'s width is fixed. | 529 | non-@code{nil}, the return value is non-@code{nil} if @var{window}'s |
| 530 | width is fixed. | ||
| 650 | 531 | ||
| 651 | If this function returns @code{nil}, this does not necessarily mean that | 532 | A @code{nil} return value does not necessarily mean that @var{window} |
| 652 | @var{window} can be resized in the desired direction. The function | 533 | can be resized in the desired direction. To determine that, use the |
| 653 | @code{window-resizable} (@pxref{Resizing Windows}) can tell that. | 534 | function @code{window-resizable}. @xref{Resizing Windows}. |
| 654 | @end defun | 535 | @end defun |
| 655 | 536 | ||
| 656 | 537 | ||
| @@ -703,13 +584,17 @@ shrunk by -@var{delta} lines or columns, this function returns the | |||
| 703 | minimum value in the range from @var{delta} to 0 that can be used for | 584 | minimum value in the range from @var{delta} to 0 that can be used for |
| 704 | shrinking @var{window}. | 585 | shrinking @var{window}. |
| 705 | 586 | ||
| 706 | Optional argument @var{ignore} non-@code{nil} means ignore any | 587 | Normally, the customizable variables @code{window-min-height} and |
| 707 | restrictions imposed by the variables @code{window-min-height} or | 588 | @code{window-min-width} specify the smallest allowable size of a |
| 708 | @code{window-min-width} and @code{window-size-fixed}. In this case the | 589 | window. @xref{Change Window,,Deleting and Rearranging Windows, |
| 709 | minimum height of a window is specified as the minimum number of lines | 590 | emacs, The GNU Emacs Manual}. If resizing would result in making any |
| 710 | that allow viewing any header or mode line and at least one line of the | 591 | window smaller than this, this function usually signals an error. |
| 711 | text area of window. The minimum width of a window includes any | 592 | However, if the optional argument @var{ignore} is non-@code{nil}, this |
| 712 | fringes, margins and the scroll bar as well as two text columns. | 593 | function ignores @code{window-min-height} and @code{window-min-width}, |
| 594 | as well as @code{window-size-fixed}. In that case, the minimum-height | ||
| 595 | window consists of a header (if any), a mode line, plus a text area | ||
| 596 | one line tall; the minimum-width window consists of any fringes, | ||
| 597 | margins and scroll bar, plus a text area two columns wide. | ||
| 713 | 598 | ||
| 714 | If @var{ignore} denotes a window, this means to ignore restrictions for | 599 | If @var{ignore} denotes a window, this means to ignore restrictions for |
| 715 | that window only. If @var{ignore} equals the constant @code{safe}, this | 600 | that window only. If @var{ignore} equals the constant @code{safe}, this |
| @@ -801,7 +686,7 @@ If @var{delta} is greater zero, this moves the edge downwards or to the | |||
| 801 | right. If @var{delta} is less than zero, this moves the edge upwards or | 686 | right. If @var{delta} is less than zero, this moves the edge upwards or |
| 802 | to the left. If the edge can't be moved by @var{delta} lines or columns, | 687 | to the left. If the edge can't be moved by @var{delta} lines or columns, |
| 803 | it is moved as far as possible in the desired direction but no error is | 688 | it is moved as far as possible in the desired direction but no error is |
| 804 | signalled. | 689 | signaled. |
| 805 | 690 | ||
| 806 | This function tries to resize windows adjacent to the edge that is | 691 | This function tries to resize windows adjacent to the edge that is |
| 807 | moved. Only if this is insufficient, it will also resize windows not | 692 | moved. Only if this is insufficient, it will also resize windows not |
| @@ -820,7 +705,7 @@ contents exactly. The default for @var{window} is the selected window. | |||
| 820 | The optional argument @var{max-height} specifies the maximum total | 705 | The optional argument @var{max-height} specifies the maximum total |
| 821 | height the window is allowed to be; @code{nil} means use the maximum | 706 | height the window is allowed to be; @code{nil} means use the maximum |
| 822 | permissible height of a window on @var{window}'s frame. The optional | 707 | permissible height of a window on @var{window}'s frame. The optional |
| 823 | argument @var{min-height} specifies the minimum toatl height for the | 708 | argument @var{min-height} specifies the minimum total height for the |
| 824 | window; @code{nil} means use @code{window-min-height}. All these height | 709 | window; @code{nil} means use @code{window-min-height}. All these height |
| 825 | values include the mode line and/or header line. | 710 | values include the mode line and/or header line. |
| 826 | 711 | ||
| @@ -912,12 +797,14 @@ tall. If @var{size} is omitted or @code{nil}, then @var{window} is | |||
| 912 | divided evenly into two parts. (If there is an odd line, it is | 797 | divided evenly into two parts. (If there is an odd line, it is |
| 913 | allocated to the new window.) | 798 | allocated to the new window.) |
| 914 | 799 | ||
| 915 | If splitting would result in making a window smaller than | 800 | Normally, the customizable variables @code{window-min-height} and |
| 916 | @code{window-min-height} or @code{window-min-width} (@pxref{Window | 801 | @code{window-min-width} specify the smallest allowable size of a |
| 917 | Sizes}), this function usually signals an error. However, if @var{size} | 802 | window. @xref{Change Window,,Deleting and Rearranging Windows, emacs, |
| 918 | is non-@code{nil} and valid, a new window of the requested size is | 803 | The GNU Emacs Manual}. If splitting would result in making a window |
| 919 | created. (A size value would be invalid if it assigned less than one | 804 | smaller than this, this function usually signals an error. However, |
| 920 | line or less than two columns to the new window.) | 805 | if @var{size} is non-@code{nil} and valid, a new window of the |
| 806 | requested size is created, provided it has enough space for a text | ||
| 807 | area one line tall and/or two columns wide. | ||
| 921 | 808 | ||
| 922 | Optional third argument @var{side} @code{nil} (or @code{below}) | 809 | Optional third argument @var{side} @code{nil} (or @code{below}) |
| 923 | specifies that the new window shall be located below @var{window}. The | 810 | specifies that the new window shall be located below @var{window}. The |
| @@ -1105,7 +992,7 @@ desired configuration as depicted below. | |||
| 1105 | 992 | ||
| 1106 | The scenario sketched above is the standard way to obtain the desired | 993 | The scenario sketched above is the standard way to obtain the desired |
| 1107 | configuration. In Emacs 23 it was also the only way to do that since | 994 | configuration. In Emacs 23 it was also the only way to do that since |
| 1108 | Emacs 23 did't allow splitting internal windows. | 995 | Emacs 23 didn't allow splitting internal windows. |
| 1109 | 996 | ||
| 1110 | With Emacs 24 you can also proceed as follows: Split an initial window | 997 | With Emacs 24 you can also proceed as follows: Split an initial window |
| 1111 | @code{W6} by evaluating @code{(split-window W6 -3)} to produce the | 998 | @code{W6} by evaluating @code{(split-window W6 -3)} to produce the |
| @@ -1833,7 +1720,7 @@ This function does not select a window that has a non-@code{nil} | |||
| 1833 | @end deffn | 1720 | @end deffn |
| 1834 | 1721 | ||
| 1835 | The following function returns a copy of the list of windows in the | 1722 | The following function returns a copy of the list of windows in the |
| 1836 | cyclic odering. | 1723 | cyclic ordering. |
| 1837 | 1724 | ||
| 1838 | @defun window-list-1 &optional window &optional minibuf &optional all_frames | 1725 | @defun window-list-1 &optional window &optional minibuf &optional all_frames |
| 1839 | This function returns a list of live windows. The optional arguments | 1726 | This function returns a list of live windows. The optional arguments |
| @@ -1843,7 +1730,7 @@ in the list. See the description of @code{next-window} for details. | |||
| 1843 | The optional argument @var{window} specifies the first window to list | 1730 | The optional argument @var{window} specifies the first window to list |
| 1844 | and defaults to the selected window. If @var{window} is not on the list | 1731 | and defaults to the selected window. If @var{window} is not on the list |
| 1845 | of windows returned, some other window will be listed first but no error | 1732 | of windows returned, some other window will be listed first but no error |
| 1846 | is signalled. | 1733 | is signaled. |
| 1847 | @end defun | 1734 | @end defun |
| 1848 | 1735 | ||
| 1849 | The functions described below use @code{window-list-1} for generating a | 1736 | The functions described below use @code{window-list-1} for generating a |
| @@ -1956,7 +1843,7 @@ This function makes @var{window} display @var{buffer-or-name} and | |||
| 1956 | returns @code{nil}. The argument @var{window} has to denote a live | 1843 | returns @code{nil}. The argument @var{window} has to denote a live |
| 1957 | window and defaults to the selected one. The argument | 1844 | window and defaults to the selected one. The argument |
| 1958 | @var{buffer-or-name} must specify a buffer or the name of an existing | 1845 | @var{buffer-or-name} must specify a buffer or the name of an existing |
| 1959 | buffer. An error is signalled when @var{window} is @dfn{strongly} | 1846 | buffer. An error is signaled when @var{window} is @dfn{strongly} |
| 1960 | dedicated to its buffer (@pxref{Dedicated Windows}) and does not already | 1847 | dedicated to its buffer (@pxref{Dedicated Windows}) and does not already |
| 1961 | display @var{buffer-or-name}. | 1848 | display @var{buffer-or-name}. |
| 1962 | 1849 | ||
| @@ -2043,7 +1930,7 @@ If a window displaying @var{buffer-or-name} is dedicated | |||
| 2043 | (@pxref{Dedicated Windows}) and is not the only window on its frame, | 1930 | (@pxref{Dedicated Windows}) and is not the only window on its frame, |
| 2044 | that window is deleted. If that window is the only window on its frame | 1931 | that window is deleted. If that window is the only window on its frame |
| 2045 | and there are other frames on the frame's terminal, that frame is dealt | 1932 | and there are other frames on the frame's terminal, that frame is dealt |
| 2046 | with by the function spcecified by @code{frame-auto-hide-function} | 1933 | with by the function specified by @code{frame-auto-hide-function} |
| 2047 | (@pxref{Quitting Windows}). Otherwise, the buffer provided by the | 1934 | (@pxref{Quitting Windows}). Otherwise, the buffer provided by the |
| 2048 | function @code{switch-to-prev-buffer} (@pxref{Window History}) is | 1935 | function @code{switch-to-prev-buffer} (@pxref{Window History}) is |
| 2049 | displayed in the window instead. | 1936 | displayed in the window instead. |
| @@ -3281,7 +3168,7 @@ This function scrolls the text in the selected window so that point is | |||
| 3281 | displayed at a specified vertical position within the window. It does | 3168 | displayed at a specified vertical position within the window. It does |
| 3282 | not ``move point'' with respect to the text. | 3169 | not ``move point'' with respect to the text. |
| 3283 | 3170 | ||
| 3284 | If @var{count} is a nonnegative number, that puts the line containing | 3171 | If @var{count} is a non-negative number, that puts the line containing |
| 3285 | point @var{count} lines down from the top of the window. If | 3172 | point @var{count} lines down from the top of the window. If |
| 3286 | @var{count} is a negative number, then it counts upward from the | 3173 | @var{count} is a negative number, then it counts upward from the |
| 3287 | bottom of the window, so that @minus{}1 stands for the last usable | 3174 | bottom of the window, so that @minus{}1 stands for the last usable |