diff options
| -rw-r--r-- | doc/lispref/ChangeLog | 16 | ||||
| -rw-r--r-- | doc/lispref/display.texi | 48 | ||||
| -rw-r--r-- | doc/lispref/frames.texi | 12 | ||||
| -rw-r--r-- | doc/lispref/windows.texi | 337 | ||||
| -rw-r--r-- | lisp/ChangeLog | 7 | ||||
| -rw-r--r-- | lisp/window.el | 28 | ||||
| -rw-r--r-- | src/ChangeLog | 10 | ||||
| -rw-r--r-- | src/dispnew.c | 2 | ||||
| -rw-r--r-- | src/window.c | 6 |
9 files changed, 301 insertions, 165 deletions
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index 1a76554dd55..52c2307b119 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog | |||
| @@ -1,3 +1,19 @@ | |||
| 1 | 2014-03-05 Martin Rudalics <rudalics@gmx.at> | ||
| 2 | |||
| 3 | * display.texi (Window Dividers): New section. | ||
| 4 | * frames.texi (Layout Parameters): Add right-divider-width and | ||
| 5 | bottom-divider-width. | ||
| 6 | * windows.texi (Window Sizes): Redraw schematic and rewrite its | ||
| 7 | description. Rewrite descriptions of `window-total-height', | ||
| 8 | `window-total-width', `window-total-size', `window-body-height', | ||
| 9 | `window-body-width' and `window-size-fixed'. Add descriptions | ||
| 10 | for `window-pixel-height', `window-pixel-width', | ||
| 11 | `window-min-height' and `window-min-width'. Remove description | ||
| 12 | of `window-size-fixed-p' moving part of it to that of | ||
| 13 | `window-size-fixed'. | ||
| 14 | (Resizing Windows): Mention dividers when talking about minimum | ||
| 15 | sizes. | ||
| 16 | |||
| 1 | 2014-03-05 Glenn Morris <rgm@gnu.org> | 17 | 2014-03-05 Glenn Morris <rgm@gnu.org> |
| 2 | 18 | ||
| 3 | * modes.texi (SMIE Customization): New section. | 19 | * modes.texi (SMIE Customization): New section. |
diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi index 74a3172b75a..f22252143d7 100644 --- a/doc/lispref/display.texi +++ b/doc/lispref/display.texi | |||
| @@ -24,6 +24,7 @@ that Emacs presents to the user. | |||
| 24 | font, colors, etc. | 24 | font, colors, etc. |
| 25 | * Fringes:: Controlling window fringes. | 25 | * Fringes:: Controlling window fringes. |
| 26 | * Scroll Bars:: Controlling vertical scroll bars. | 26 | * Scroll Bars:: Controlling vertical scroll bars. |
| 27 | * Window Dividers:: Separating windows visually. | ||
| 27 | * Display Property:: Enabling special display features. | 28 | * Display Property:: Enabling special display features. |
| 28 | * Images:: Displaying images in Emacs buffers. | 29 | * Images:: Displaying images in Emacs buffers. |
| 29 | * Buttons:: Adding clickable buttons to Emacs buffers. | 30 | * Buttons:: Adding clickable buttons to Emacs buffers. |
| @@ -3896,6 +3897,53 @@ buffer's scroll bars, measured in pixels. A value of @code{nil} means | |||
| 3896 | to use the value specified by the frame. | 3897 | to use the value specified by the frame. |
| 3897 | @end defvar | 3898 | @end defvar |
| 3898 | 3899 | ||
| 3900 | @node Window Dividers | ||
| 3901 | @section Window Dividers | ||
| 3902 | @cindex window dividers | ||
| 3903 | @cindex right dividers | ||
| 3904 | @cindex bottom dividers | ||
| 3905 | |||
| 3906 | Window dividers are bars drawn between a frame's windows. A ``right'' | ||
| 3907 | divider is drawn between a window and its sibling(s) on the right. Its | ||
| 3908 | width is specified by the frame parameter @code{right-divider-width}. A | ||
| 3909 | ``bottom'' divider is drawn between a window and its sibling(s) on the | ||
| 3910 | bottom or the echo area. Its width is specified by the frame parameter | ||
| 3911 | @code{bottom-divider-width}. In either case, specifying a width of zero | ||
| 3912 | means to not draw such dividers. @xref{Layout Parameters}. | ||
| 3913 | |||
| 3914 | Technically, a right divider ``belongs'' to the window on its left, | ||
| 3915 | which means that its width is part of the total width of that window. A | ||
| 3916 | bottom divider ``belongs'' to the window above it, which means that its | ||
| 3917 | height is part of the total height of that window. @xref{Window Sizes}. | ||
| 3918 | When a window has both, a right and a bottom divider, the bottom divider | ||
| 3919 | ``prevails''. This means that the width of the bottom divider equals | ||
| 3920 | the total width of the window while the height of the right divider | ||
| 3921 | equals the total height of the window minus the height of the bottom | ||
| 3922 | divider. | ||
| 3923 | |||
| 3924 | Dividers can be dragged with the mouse and are therefore useful for | ||
| 3925 | adjusting the sizes of adjacent windows with the mouse. They also serve | ||
| 3926 | to set windows visually apart from their siblings when no scroll bars or | ||
| 3927 | mode lines are present. The following three faces allow to customize | ||
| 3928 | the appearance of dividers: | ||
| 3929 | |||
| 3930 | @table @code | ||
| 3931 | @item window-divider | ||
| 3932 | When a divider is less than three pixels wide, it is drawn solidly with | ||
| 3933 | the foreground of this face. For larger dividers this face is used for | ||
| 3934 | the inner part only, exluding the first and last pixel. | ||
| 3935 | |||
| 3936 | @item window-divider-first-pixel | ||
| 3937 | This is the face used for drawing the first pixel of a divider that is | ||
| 3938 | at least three pixels wide. To obtain a solid appearance, set this to | ||
| 3939 | the same value used for the @code{window-divider} face. | ||
| 3940 | |||
| 3941 | @item window-divider-last-pixel | ||
| 3942 | This is the face used for drawing the last pixel of a divider that is at | ||
| 3943 | least three pixels wide. To obtain a solid appearance, set this to the | ||
| 3944 | same value used for the @code{window-divider} face. | ||
| 3945 | @end table | ||
| 3946 | |||
| 3899 | @node Display Property | 3947 | @node Display Property |
| 3900 | @section The @code{display} Property | 3948 | @section The @code{display} Property |
| 3901 | @cindex display specification | 3949 | @cindex display specification |
diff --git a/doc/lispref/frames.texi b/doc/lispref/frames.texi index 439f9686733..9ebc6c1adc2 100644 --- a/doc/lispref/frames.texi +++ b/doc/lispref/frames.texi | |||
| @@ -745,6 +745,18 @@ right fringe. However, you can force one fringe or the other to a | |||
| 745 | precise width by specifying that width as a negative integer. If both | 745 | precise width by specifying that width as a negative integer. If both |
| 746 | widths are negative, only the left fringe gets the specified width. | 746 | widths are negative, only the left fringe gets the specified width. |
| 747 | 747 | ||
| 748 | @vindex right-divider-width, a frame parameter | ||
| 749 | @item right-divider-width | ||
| 750 | The width of the right divider (@pxref{Window Dividers}) of any window | ||
| 751 | on the frame, in pixels. A value of zero means to not draw right | ||
| 752 | dividers. | ||
| 753 | |||
| 754 | @vindex bottom-divider-width, a frame parameter | ||
| 755 | @item bottom-divider-width | ||
| 756 | The width of the bottom divider (@pxref{Window Dividers}) of any window | ||
| 757 | on the frame, in pixels. A value of zero means to not draw bottom | ||
| 758 | dividers. | ||
| 759 | |||
| 748 | @vindex menu-bar-lines frame parameter | 760 | @vindex menu-bar-lines frame parameter |
| 749 | @item menu-bar-lines | 761 | @item menu-bar-lines |
| 750 | The number of lines to allocate at the top of the frame for a menu | 762 | The number of lines to allocate at the top of the frame for a menu |
diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi index a848128d597..a0c59afbf28 100644 --- a/doc/lispref/windows.texi +++ b/doc/lispref/windows.texi | |||
| @@ -382,6 +382,7 @@ internal window). The @var{edges} element is a list @code{(@var{left} | |||
| 382 | @code{window-edges} (@pxref{Coordinates and Windows}). | 382 | @code{window-edges} (@pxref{Coordinates and Windows}). |
| 383 | @end defun | 383 | @end defun |
| 384 | 384 | ||
| 385 | |||
| 385 | @node Window Sizes | 386 | @node Window Sizes |
| 386 | @section Window Sizes | 387 | @section Window Sizes |
| 387 | @cindex window size | 388 | @cindex window size |
| @@ -391,18 +392,18 @@ internal window). The @var{edges} element is a list @code{(@var{left} | |||
| 391 | 392 | ||
| 392 | @smallexample | 393 | @smallexample |
| 393 | @group | 394 | @group |
| 394 | _________________________________________ | 395 | ____________________________________________ |
| 395 | ^ |______________ Header Line_______________| | 396 | |______________ Header Line ______________|RD| ^ |
| 396 | | |LS|LF|LM| |RM|RF|RS| ^ | 397 | ^ |LS|LF|LM| |RM|RF|RS| | | |
| 397 | | | | | | | | | | | | 398 | | | | | | | | | | | | |
| 398 | Window | | | | Text Area | | | | Window | 399 | Window | | | | Text Area | | | | | Window |
| 399 | Total | | | | (Window Body) | | | | Body | 400 | Body | | | | | (Window Body) | | | | | Total |
| 400 | Height | | | | | | | | Height | 401 | Height | | | | | | | | | Height |
| 401 | | | | | |<- Window Body Width ->| | | | | | 402 | | | | | |<- Window Body Width ->| | | | | | |
| 402 | | |__|__|__|_______________________|__|__|__| v | 403 | v |__|__|__|_______________________|__|__|__| | | |
| 403 | v |_______________ Mode Line _______________| | 404 | |_______________ Mode Line _______________|__| | |
| 404 | 405 | |_____________ Bottom Divider _______________| v | |
| 405 | <----------- Window Total Width --------> | 406 | <---------- Window Total Width ------------> |
| 406 | 407 | ||
| 407 | @end group | 408 | @end group |
| 408 | @end smallexample | 409 | @end smallexample |
| @@ -411,104 +412,136 @@ internal window). The @var{edges} element is a list @code{(@var{left} | |||
| 411 | @cindex text area of a window | 412 | @cindex text area of a window |
| 412 | @cindex body of a window | 413 | @cindex body of a window |
| 413 | At the center of the window is the @dfn{text area}, or @dfn{body}, | 414 | At the center of the window is the @dfn{text area}, or @dfn{body}, |
| 414 | where the buffer text is displayed. On each side of the text area is | 415 | where the buffer text is displayed. The text area can be surrounded by |
| 415 | a series of vertical areas; from innermost to outermost, these are the | 416 | a series of optional areas. On the left and right, from innermost to |
| 416 | left and right margins, denoted by LM and RM in the schematic | 417 | outermost, these are the left and right margins, denoted by LM and RM in |
| 417 | (@pxref{Display Margins}); the left and right fringes, denoted by LF | 418 | the schematic (@pxref{Display Margins}); the left and right fringes, |
| 418 | and RF (@pxref{Fringes}); and the left or right scroll bar, only one of | 419 | denoted by LF and RF (@pxref{Fringes}); the left or right scroll bar, |
| 419 | which is present at any time, denoted by LS and RS (@pxref{Scroll | 420 | only one of which is present at any time, denoted by LS and RS |
| 420 | Bars}). At the top of the window is an optional header line | 421 | (@pxref{Scroll Bars}); and the right divider, denoted by RD |
| 421 | (@pxref{Header Lines}), and at the bottom of the window is the mode | 422 | (@pxref{Window Dividers}). At the top of the window is the header line |
| 422 | line (@pxref{Mode Line Format}). | 423 | (@pxref{Header Lines}); at the bottom of the window is the mode line |
| 423 | 424 | (@pxref{Mode Line Format}) followed by the bottom divider (@pxref{Window | |
| 424 | Emacs provides several functions for finding the height and width of | 425 | Dividers}). |
| 425 | a window. Except where noted, Emacs reports window heights and widths | 426 | |
| 426 | as integer numbers of lines and columns, respectively. On a graphical | 427 | Emacs provides miscellaneous functions for finding the height and |
| 427 | display, each ``line'' and ``column'' actually corresponds to the | 428 | width of a window. The return value of many of these functions can be |
| 428 | height and width of a ``default'' character specified by the frame's | 429 | specified either in units of pixels or in units of lines and columns. |
| 429 | default font. Thus, if a window is displaying text with a different | 430 | On a graphical display, the latter actually correspond to the height and |
| 430 | font or size, the reported height and width for that window may differ | 431 | width of a ``default'' character specified by the frame's default font |
| 431 | from the actual number of text lines or columns displayed within it. | 432 | as returned by @code{frame-char-height} and @code{frame-char-width} |
| 432 | 433 | (@pxref{Size and Position}). Thus, if a window is displaying text with | |
| 433 | @defun window-size &optional window horizontal pixelwise round | 434 | a different font or size, the reported line height and column width for |
| 434 | This function returns the height or width of @var{window}. | 435 | that window may differ from the actual number of text lines or columns |
| 435 | @var{window} must be a valid window. The default value of | 436 | displayed within it. |
| 436 | @var{window} is the selected window. | ||
| 437 | |||
| 438 | If @var{horizontal} is omitted or nil, return the total height of | ||
| 439 | @var{window}, in lines; otherwise return the total width in columns. | ||
| 440 | |||
| 441 | The optional argument @var{pixelwise} means return size of | ||
| 442 | @var{window}, in pixels. | ||
| 443 | |||
| 444 | The optional argument @var{round} is ignored if @var{pixelwise} is | ||
| 445 | non-@code{nil}. Otherwise it is handled as for | ||
| 446 | @code{window-total-height} and @code{window-total-width}. | ||
| 447 | @end defun | ||
| 448 | 437 | ||
| 449 | @cindex window height | 438 | @cindex window height |
| 450 | @cindex height of a window | 439 | @cindex height of a window |
| 451 | @cindex total height of a window | 440 | @cindex total height of a window |
| 452 | @cindex window width | 441 | The @dfn{total height} of a window is the number of lines comprising |
| 453 | @cindex width of a window | 442 | the window's body, the header line, the mode line and the bottom divider |
| 454 | @cindex total width of a window | 443 | (if any). Note that the height of a frame is not the same as the height |
| 455 | The @dfn{total height} of a window is the distance between the top | 444 | of its root window (@pxref{Windows and Frames}), since a frame may also |
| 456 | and bottom of the window, including the header line (if one exists) | 445 | contain an echo area, a menu bar, and a tool bar (@pxref{Size and |
| 457 | and the mode line. The @dfn{total width} of a window is the distance | 446 | Position}). |
| 458 | between the left and right edges of the mode line. Note that the | ||
| 459 | height of a frame is not the same as the height of its windows, since | ||
| 460 | a frame may also contain an echo area, menu bar, and tool bar | ||
| 461 | (@pxref{Size and Position}). | ||
| 462 | 447 | ||
| 463 | @defun window-total-height &optional window round | 448 | @defun window-total-height &optional window round |
| 464 | This function returns the total height, in lines, of the window | 449 | This function returns the total height, in lines, of the window |
| 465 | @var{window}. If @var{window} is omitted or @code{nil}, it defaults | 450 | @var{window}. If @var{window} is omitted or @code{nil}, it defaults to |
| 466 | to the selected window. If @var{window} is an internal window, the | 451 | the selected window. If @var{window} is an internal window, the return |
| 467 | return value is the total height occupied by its descendant windows. | 452 | value is the total height occupied by its descendant windows. |
| 468 | 453 | ||
| 469 | If @var{window}'s pixel height is not an integral multiple of its | 454 | If a window's pixel height is not an integral multiple of its frame's |
| 470 | frame's character height, the number of lines occupied by @var{window} | 455 | default character height, the number of lines occupied by the window is |
| 471 | is rounded internally. This is done in a way such that, if | 456 | rounded internally. This is done in a way such that, if the window is a |
| 472 | @var{window} is a parent window, the sum of the total heights of all | 457 | parent window, the sum of the total heights of all its child windows |
| 473 | its children internally equals the total height of @var{window}. | 458 | internally equals the total height of their parent. This means that |
| 474 | 459 | although two windows have the same pixel height, their internal total | |
| 475 | If the optional argument @var{round} is @code{ceiling}, this function | 460 | heights may differ by one line. This means also, that if this window is |
| 476 | will return the smallest integer larger than @var{window}'s pixel | 461 | vertically combined and has a right sibling, the topmost row of that |
| 477 | height divided by the character height of @var{window}'s frame; if it | 462 | sibling can be calculated as the sum of this window's topmost row and |
| 478 | is @code{floor}, return the largest integer smaller than | 463 | total height (@pxref{Coordinates and Windows}) |
| 479 | @var{window}'s pixel height divided by the character height of | 464 | |
| 480 | @var{window}'s frame. Any other value of @var{round} means to return | 465 | If the optional argument @var{round} equals @code{ceiling}, this |
| 481 | the internal total height of @var{window}. | 466 | function returns the smallest integer larger than @var{window}'s pixel |
| 467 | height divided by the character height of @var{window}'s frame; if it is | ||
| 468 | @code{floor}, it returns the largest integer smaller than @var{window}'s | ||
| 469 | pixel height divided by the character height of @var{window}'s frame. | ||
| 470 | Any other value of @var{round} means to return the internal value of the | ||
| 471 | total height of @var{window}. | ||
| 482 | @end defun | 472 | @end defun |
| 483 | 473 | ||
| 474 | @cindex window width | ||
| 475 | @cindex width of a window | ||
| 476 | @cindex total width of a window | ||
| 477 | The @dfn{total width} of a window is the number of lines comprising the | ||
| 478 | window's body, its margins, fringes, scroll bars and a right divider (if | ||
| 479 | any). | ||
| 480 | |||
| 484 | @defun window-total-width &optional window round | 481 | @defun window-total-width &optional window round |
| 485 | This function returns the total width, in columns, of the window | 482 | This function returns the total width, in columns, of the window |
| 486 | @var{window}. If @var{window} is omitted or @code{nil}, it defaults | 483 | @var{window}. If @var{window} is omitted or @code{nil}, it defaults to |
| 487 | to the selected window. If @var{window} is internal, the return value | 484 | the selected window. If @var{window} is internal, the return value is |
| 488 | is the total width occupied by its descendant windows. | 485 | the total width occupied by its descendant windows. |
| 489 | 486 | ||
| 490 | If @var{window}'s pixel width is not an integral multiple of its | 487 | If a window's pixel width is not an integral multiple of its frame's |
| 491 | frame's character width, the number of lines occupied by @var{window} | 488 | character width, the number of lines occupied by the window is rounded |
| 492 | is rounded internally. This is done in a way such that, if | 489 | internally. This is done in a way such that, if the window is a parent |
| 493 | @var{window} is a parent window, the sum of the total widths of all | 490 | window, the sum of the total widths of all its children internally |
| 494 | its children internally equals the total width of @var{window}. | 491 | equals the total width of their parent. This means that although two |
| 492 | windows have the same pixel width, their internal total widths may | ||
| 493 | differ by one column. This means also, that if this window is | ||
| 494 | horizontally combined and has a right sibling, the leftmost column of | ||
| 495 | that sibling can be calculated as the sum of this window's leftmost | ||
| 496 | column and total width (@pxref{Coordinates and Windows}). | ||
| 495 | 497 | ||
| 496 | If the optional argument @var{round} is @code{ceiling}, this function | 498 | If the optional argument @var{round} is @code{ceiling}, this function |
| 497 | will return the smallest integer larger than @var{window}'s pixel | 499 | will return the smallest integer larger than @var{window}'s pixel width |
| 498 | width divided by the character width of @var{window}'s frame; if it is | 500 | divided by the character width of @var{window}'s frame; if it is |
| 499 | @code{floor}, return the largest integer smaller than @var{window}'s | 501 | @code{floor}, it returns the largest integer smaller than @var{window}'s |
| 500 | pixel width divided by the character width of @var{window}'s frame. | 502 | pixel width divided by the character width of @var{window}'s frame. Any |
| 501 | Any other value of @var{round} means to return the internal total | 503 | other value of @var{round} means to return the internal total width of |
| 502 | width of @var{window}. | 504 | @var{window}. |
| 503 | @end defun | 505 | @end defun |
| 504 | 506 | ||
| 505 | @defun window-total-size &optional window horizontal round | 507 | @defun window-total-size &optional window horizontal round |
| 506 | This function returns either the total height or width of the window | 508 | This function returns either the total height in lines or the total |
| 507 | @var{window}. If @var{horizontal} is omitted or @code{nil}, this is | 509 | width in columns of the window @var{window}. If @var{horizontal} is |
| 508 | equivalent to calling @code{window-total-height} for @var{window}; | 510 | omitted or @code{nil}, this is equivalent to calling |
| 509 | otherwise it is equivalent to calling @code{window-total-width} for | 511 | @code{window-total-height} for @var{window}; otherwise it is equivalent |
| 510 | @var{window}. The optional argument @code{ROUND} is handled as for | 512 | to calling @code{window-total-width} for @var{window}. The optional |
| 511 | @code{window-total-height} and @code{window-total-width}. | 513 | argument @code{ROUND} is handled as for @code{window-total-height} and |
| 514 | @code{window-total-width}. | ||
| 515 | @end defun | ||
| 516 | |||
| 517 | The following two functions can be used to return the total size of a | ||
| 518 | window in units of pixels. | ||
| 519 | |||
| 520 | @cindex window pixel height | ||
| 521 | @cindex pixel height of a window | ||
| 522 | @cindex total pixel height of a window | ||
| 523 | |||
| 524 | @defun window-pixel-height &optional window | ||
| 525 | This function returns the total height of window @var{window} in pixels. | ||
| 526 | @var{window} must be a valid window and defaults to the selected one. | ||
| 527 | |||
| 528 | The return value includes mode and header line and a bottom divider, if | ||
| 529 | any. If @var{window} is an internal window, its pixel height is the | ||
| 530 | pixel height of the screen areas spanned by its children. | ||
| 531 | @end defun | ||
| 532 | |||
| 533 | @cindex window pixel height | ||
| 534 | @cindex pixel height of a window | ||
| 535 | @cindex total pixel height of a window | ||
| 536 | |||
| 537 | @defun window-pixel-width &optional Lisp_Object &optional window | ||
| 538 | This function returns the width of window @var{window} in pixels. | ||
| 539 | @var{window} must be a valid window and defaults to the selected one. | ||
| 540 | |||
| 541 | The return value includes the fringes and margins of @var{window} as | ||
| 542 | well as any vertical dividers or scroll bars belonging to @var{window}. | ||
| 543 | If @var{window} is an internal window, its pixel width is the width of | ||
| 544 | the screen areas spanned by its children. | ||
| 512 | @end defun | 545 | @end defun |
| 513 | 546 | ||
| 514 | @cindex full-width window | 547 | @cindex full-width window |
| @@ -533,40 +566,51 @@ that of the root window on that frame. If @var{window} is omitted or | |||
| 533 | @cindex window body height | 566 | @cindex window body height |
| 534 | @cindex body height of a window | 567 | @cindex body height of a window |
| 535 | @cindex window body width | 568 | @cindex window body width |
| 536 | @cindex body width of a window | 569 | The @dfn{body height} of a window is the height of its text area, which |
| 537 | @cindex body size of a window | 570 | does not include a mode or header line or a bottom divider. |
| 538 | @cindex window body size | ||
| 539 | The @dfn{body height} of a window is the height of its text area, | ||
| 540 | which does not include the mode or header line. Similarly, the | ||
| 541 | @dfn{body width} is the width of the text area, which does not include | ||
| 542 | the scroll bar, fringes, or margins. | ||
| 543 | 571 | ||
| 544 | @defun window-body-height &optional window pixelwise | 572 | @defun window-body-height &optional window pixelwise |
| 545 | This function returns the body height, in lines, of the window | 573 | This function returns the height, in lines, of the body of window |
| 546 | @var{window}. If @var{window} is omitted or @code{nil}, it defaults | 574 | @var{window}. If @var{window} is omitted or @code{nil}, it defaults to |
| 547 | to the selected window; otherwise it must be a live window. | 575 | the selected window; otherwise it must be a live window. |
| 576 | |||
| 577 | If the optional argument @var{pixelwise} is non-@code{nil}, this | ||
| 578 | function returns the body height of @var{window} counted in pixels. | ||
| 548 | 579 | ||
| 549 | If there is a partially-visible line at the bottom of the text area, | 580 | If @var{pixelwise} is @code{nil}, the return value is rounded down to |
| 550 | that counts as a whole line; to exclude such a partially-visible line, | 581 | the nearest integer, if necessary. This means that if a line at the |
| 551 | use @code{window-text-height}, below. | 582 | bottom of the text area is only partially visible, that line is not |
| 583 | counted. It also means that the height of a window's body can never | ||
| 584 | exceed its total height as returned by @code{window-total-height}. | ||
| 552 | @end defun | 585 | @end defun |
| 553 | 586 | ||
| 587 | @cindex body width of a window | ||
| 588 | @cindex body size of a window | ||
| 589 | @cindex window body size | ||
| 590 | The @dfn{body width} of a window is the width of its text area, which | ||
| 591 | does not include the scroll bar, fringes, margins or a right divider. | ||
| 592 | |||
| 554 | @defun window-body-width &optional window pixelwise | 593 | @defun window-body-width &optional window pixelwise |
| 555 | This function returns the body width, in columns, of the window | 594 | This function returns the width, in columns, of the body of window |
| 556 | @var{window}. If @var{window} is omitted or @code{nil}, it defaults | 595 | @var{window}. If @var{window} is omitted or @code{nil}, it defaults to |
| 557 | to the selected window; otherwise it must be a live window. | 596 | the selected window; otherwise it must be a live window. |
| 558 | @end defun | 597 | |
| 598 | If the optional argument @var{pixelwise} is non-@code{nil}, this | ||
| 599 | function returns the body width of @var{window} in units of pixels. | ||
| 559 | 600 | ||
| 560 | @defun window-body-size &optional window horizontal | 601 | If @var{pixelwise} is @code{nil}, the return value is rounded down to |
| 561 | This function returns the body height or body width of @var{window}. | 602 | the nearest integer, if necessary. This means that if a column on the |
| 562 | If @var{horizontal} is omitted or @code{nil}, it is equivalent to | 603 | right of the text area is only partially visible, that column is not |
| 563 | calling @code{window-body-height} for @var{window}; otherwise it is | 604 | counted. It also means that the width of a window's body can never |
| 564 | equivalent to calling @code{window-body-width}. | 605 | exceed its total width as returned by @code{window-total-width}. |
| 565 | @end defun | 606 | @end defun |
| 566 | 607 | ||
| 567 | @defun window-text-height &optional window | 608 | @defun window-body-size &optional window horizontal pixelwise |
| 568 | This function is like @code{window-body-height}, except that any | 609 | This function returns the body height or body width of @var{window}. If |
| 569 | partially-visible line at the bottom of the text area is not counted. | 610 | @var{horizontal} is omitted or @code{nil}, it is equivalent to calling |
| 611 | @code{window-body-height} for @var{window}; otherwise it is equivalent | ||
| 612 | to calling @code{window-body-width}. In either case, the optional | ||
| 613 | argument @var{pixelwise} is passed to the function called. | ||
| 570 | @end defun | 614 | @end defun |
| 571 | 615 | ||
| 572 | For compatibility with previous versions of Emacs, | 616 | For compatibility with previous versions of Emacs, |
| @@ -579,11 +623,22 @@ aliases are considered obsolete and will be removed in the future. | |||
| 579 | @vindex window-min-width | 623 | @vindex window-min-width |
| 580 | Commands that change the size of windows (@pxref{Resizing Windows}), | 624 | Commands that change the size of windows (@pxref{Resizing Windows}), |
| 581 | or split them (@pxref{Splitting Windows}), obey the variables | 625 | or split them (@pxref{Splitting Windows}), obey the variables |
| 582 | @code{window-min-height} and @code{window-min-width}, which specify | 626 | @code{window-min-height} and @code{window-min-width}, which specify the |
| 583 | the smallest allowable window height and width. @xref{Change | 627 | smallest allowable window height and width. They also obey the variable |
| 584 | Window,,Deleting and Rearranging Windows, emacs, The GNU Emacs | 628 | @code{window-size-fixed}, with which a window can be @dfn{fixed} in |
| 585 | Manual}. They also obey the variable @code{window-size-fixed}, with | 629 | size: |
| 586 | which a window can be @dfn{fixed} in size: | 630 | |
| 631 | @defopt window-min-height | ||
| 632 | This option specifies the minimum total height, in lines, of any window. | ||
| 633 | Its value has to accommodate at least one text line as well as a mode | ||
| 634 | and header line and a bottom divider, if present. | ||
| 635 | @end defopt | ||
| 636 | |||
| 637 | @defopt window-min-width | ||
| 638 | This option specifies the minimum total width, in columns, of any | ||
| 639 | window. Its value has to accommodate two text columns as well as | ||
| 640 | margins, fringes, a scroll bar and a right divider, if present. | ||
| 641 | @end defopt | ||
| 587 | 642 | ||
| 588 | @defvar window-size-fixed | 643 | @defvar window-size-fixed |
| 589 | If this buffer-local variable is non-@code{nil}, the size of any | 644 | If this buffer-local variable is non-@code{nil}, the size of any |
| @@ -594,26 +649,13 @@ there is no choice. | |||
| 594 | If the value is @code{height}, then only the window's height is fixed; | 649 | If the value is @code{height}, then only the window's height is fixed; |
| 595 | if the value is @code{width}, then only the window's width is fixed. | 650 | if the value is @code{width}, then only the window's width is fixed. |
| 596 | Any other non-@code{nil} value fixes both the width and the height. | 651 | Any other non-@code{nil} value fixes both the width and the height. |
| 597 | @end defvar | ||
| 598 | |||
| 599 | @defun window-size-fixed-p &optional window horizontal | ||
| 600 | This function returns a non-@code{nil} value if @var{window}'s height | ||
| 601 | is fixed. If @var{window} is omitted or @code{nil}, it defaults to | ||
| 602 | the selected window. If the optional argument @var{horizontal} is | ||
| 603 | non-@code{nil}, the return value is non-@code{nil} if @var{window}'s | ||
| 604 | width is fixed. | ||
| 605 | 652 | ||
| 606 | A @code{nil} return value does not necessarily mean that @var{window} | 653 | If this variable is @code{nil}, this does not necessarily mean that any |
| 607 | can be resized in the desired direction. To determine that, use the | 654 | window showing the buffer can be resized in the desired direction. To |
| 608 | function @code{window-resizable}. @xref{Resizing Windows}. | 655 | determine that, use the function @code{window-resizable}. |
| 609 | @end defun | 656 | @xref{Resizing Windows}. |
| 657 | @end defvar | ||
| 610 | 658 | ||
| 611 | @xref{Coordinates and Windows}, for more functions that report the | ||
| 612 | positions of various parts of a window relative to the frame, from | ||
| 613 | which you can calculate its size. In particular, you can use the | ||
| 614 | functions @code{window-pixel-edges} and | ||
| 615 | @code{window-inside-pixel-edges} to find the size in pixels, for | ||
| 616 | graphical displays. | ||
| 617 | 659 | ||
| 618 | @node Resizing Windows | 660 | @node Resizing Windows |
| 619 | @section Resizing Windows | 661 | @section Resizing Windows |
| @@ -653,11 +695,12 @@ Normally, the variables @code{window-min-height} and | |||
| 653 | @xref{Change Window,, Deleting and Rearranging Windows, emacs, The GNU | 695 | @xref{Change Window,, Deleting and Rearranging Windows, emacs, The GNU |
| 654 | Emacs Manual}. However, if the optional argument @var{ignore} is | 696 | Emacs Manual}. However, if the optional argument @var{ignore} is |
| 655 | non-@code{nil}, this function ignores @code{window-min-height} and | 697 | non-@code{nil}, this function ignores @code{window-min-height} and |
| 656 | @code{window-min-width}, as well as @code{window-size-fixed}. | 698 | @code{window-min-width}, as well as @code{window-size-fixed}. Instead, |
| 657 | Instead, it considers the minimum-height window to be one consisting | 699 | it considers the minimum-height window to be one consisting of a header, |
| 658 | of a header (if any), a mode line, plus a text area one line tall; and | 700 | a mode line and a bottom divider (if any), plus a text area one line |
| 659 | a minimum-width window as one consisting of fringes, margins, and | 701 | tall; and a minimum-width window as one consisting of fringes, margins, |
| 660 | scroll bar (if any), plus a text area two columns wide. | 702 | a scroll bar and a right divider (if any), plus a text area two columns |
| 703 | wide. | ||
| 661 | 704 | ||
| 662 | If the optional argument @code{pixelwise} is non-@code{nil}, | 705 | If the optional argument @code{pixelwise} is non-@code{nil}, |
| 663 | @var{delta} will be interpreted as pixels. | 706 | @var{delta} will be interpreted as pixels. |
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 55490e502a1..579acdb90c5 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,10 @@ | |||
| 1 | 2014-03-05 Martin Rudalics <rudalics@gmx.at> | ||
| 2 | |||
| 3 | * window.el (window-min-height, window-min-width): Rewrite | ||
| 4 | doc-strings. | ||
| 5 | (window-body-size): Add PIXELWISE argument to make it consistent | ||
| 6 | with its callees. | ||
| 7 | |||
| 1 | 2014-03-05 Juanma Barranquero <lekktu@gmail.com> | 8 | 2014-03-05 Juanma Barranquero <lekktu@gmail.com> |
| 2 | 9 | ||
| 3 | * finder.el (finder-mode-map, finder-mode-syntax-table): | 10 | * finder.el (finder-mode-map, finder-mode-syntax-table): |
diff --git a/lisp/window.el b/lisp/window.el index 0c42a7906be..6df3776da56 100644 --- a/lisp/window.el +++ b/lisp/window.el | |||
| @@ -319,10 +319,11 @@ Anything less might crash Emacs.") | |||
| 319 | (frame-char-size (window-normalize-window window)))) | 319 | (frame-char-size (window-normalize-window window)))) |
| 320 | 320 | ||
| 321 | (defcustom window-min-height 4 | 321 | (defcustom window-min-height 4 |
| 322 | "The minimum number of lines of any window. | 322 | "The minimum total height, in lines, of any window. |
| 323 | The value has to accommodate a mode- or header-line if present. | 323 | The value has to accommodate one text line, a mode and header |
| 324 | A value less than `window-safe-min-height' is ignored. The value | 324 | line, and a bottom divider, if present. A value less than |
| 325 | of this variable is honored when windows are resized or split. | 325 | `window-safe-min-height' is ignored. The value of this variable |
| 326 | is honored when windows are resized or split. | ||
| 326 | 327 | ||
| 327 | Applications should never rebind this variable. To resize a | 328 | Applications should never rebind this variable. To resize a |
| 328 | window to a height less than the one specified here, an | 329 | window to a height less than the one specified here, an |
| @@ -349,11 +350,11 @@ Anything less might crash Emacs.") | |||
| 349 | (frame-char-size (window-normalize-window window) t))) | 350 | (frame-char-size (window-normalize-window window) t))) |
| 350 | 351 | ||
| 351 | (defcustom window-min-width 10 | 352 | (defcustom window-min-width 10 |
| 352 | "The minimum number of columns of any window. | 353 | "The minimum total width, in columns, of any window. |
| 353 | The value has to accommodate margins, fringes, or scrollbars if | 354 | The value has to accommodate two text columns as well as margins, |
| 354 | present. A value less than `window-safe-min-width' is ignored. | 355 | fringes, a scroll bar and a right divider, if present. A value |
| 355 | The value of this variable is honored when windows are resized or | 356 | less than `window-safe-min-width' is ignored. The value of this |
| 356 | split. | 357 | variable is honored when windows are resized or split. |
| 357 | 358 | ||
| 358 | Applications should never rebind this variable. To resize a | 359 | Applications should never rebind this variable. To resize a |
| 359 | window to a width less than the one specified here, an | 360 | window to a width less than the one specified here, an |
| @@ -1671,16 +1672,17 @@ WINDOW must be a valid window and defaults to the selected one." | |||
| 1671 | (= (window-pixel-width window) | 1672 | (= (window-pixel-width window) |
| 1672 | (window-pixel-width (frame-root-window window)))) | 1673 | (window-pixel-width (frame-root-window window)))) |
| 1673 | 1674 | ||
| 1674 | (defun window-body-size (&optional window horizontal) | 1675 | (defun window-body-size (&optional window horizontal pixelwise) |
| 1675 | "Return the height or width of WINDOW's text area. | 1676 | "Return the height or width of WINDOW's text area. |
| 1676 | WINDOW must be a live window and defaults to the selected one. | 1677 | WINDOW must be a live window and defaults to the selected one. |
| 1677 | 1678 | ||
| 1678 | If HORIZONTAL is omitted or nil, return the height of the text | 1679 | If HORIZONTAL is omitted or nil, return the height of the text |
| 1679 | area, like `window-body-height'. Otherwise, return the width of | 1680 | area, like `window-body-height'. Otherwise, return the width of |
| 1680 | the text area, like `window-body-width'." | 1681 | the text area, like `window-body-width'. In either case, the |
| 1682 | optional argument PIXELWISE is passed to the functions." | ||
| 1681 | (if horizontal | 1683 | (if horizontal |
| 1682 | (window-body-width window) | 1684 | (window-body-width window pixelwise) |
| 1683 | (window-body-height window))) | 1685 | (window-body-height window pixelwise))) |
| 1684 | 1686 | ||
| 1685 | (defun window-current-scroll-bars (&optional window) | 1687 | (defun window-current-scroll-bars (&optional window) |
| 1686 | "Return the current scroll bar settings for WINDOW. | 1688 | "Return the current scroll bar settings for WINDOW. |
diff --git a/src/ChangeLog b/src/ChangeLog index 22830f49fb8..29b6078b037 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,6 +1,14 @@ | |||
| 1 | 2014-03-05 Martin Rudalics <rudalics@gmx.at> | ||
| 2 | |||
| 3 | * dispnew.c (change_frame_size_1): Add new_lines instead of | ||
| 4 | new_height, the latter may be still zero if passed as such. | ||
| 5 | * window.c (Fwindow_pixel_height): Mention bottom divider in | ||
| 6 | doc-string. | ||
| 7 | |||
| 1 | 2014-03-05 Paul Eggert <eggert@cs.ucla.edu> | 8 | 2014-03-05 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 9 | ||
| 3 | Fix "resource temporarily unavailable" with xgselect (Bug#16925). | 10 | Fix "resource temporarily unavailable" with xgselect |
| 11 | (Bug#16925). | ||
| 4 | * xgselect.c: Include <stdbool.h>. | 12 | * xgselect.c: Include <stdbool.h>. |
| 5 | (xg_select) [!USE_GTK]: Don't lose track of errno. | 13 | (xg_select) [!USE_GTK]: Don't lose track of errno. |
| 6 | 14 | ||
diff --git a/src/dispnew.c b/src/dispnew.c index e11d143d0b5..7833f8e8af5 100644 --- a/src/dispnew.c +++ b/src/dispnew.c | |||
| @@ -5539,7 +5539,7 @@ change_frame_size_1 (struct frame *f, int new_width, int new_height, | |||
| 5539 | /* MSDOS frames cannot PRETEND, as they change frame size by | 5539 | /* MSDOS frames cannot PRETEND, as they change frame size by |
| 5540 | manipulating video hardware. */ | 5540 | manipulating video hardware. */ |
| 5541 | if ((FRAME_TERMCAP_P (f) && !pretend) || FRAME_MSDOS_P (f)) | 5541 | if ((FRAME_TERMCAP_P (f) && !pretend) || FRAME_MSDOS_P (f)) |
| 5542 | FrameRows (FRAME_TTY (f)) = new_height; | 5542 | FrameRows (FRAME_TTY (f)) = new_lines; |
| 5543 | } | 5543 | } |
| 5544 | 5544 | ||
| 5545 | if (new_text_width != FRAME_TEXT_WIDTH (f) | 5545 | if (new_text_width != FRAME_TEXT_WIDTH (f) |
diff --git a/src/window.c b/src/window.c index 09280d206c3..b6cfacd9aad 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -699,9 +699,9 @@ DEFUN ("window-pixel-height", Fwindow_pixel_height, Swindow_pixel_height, 0, 1, | |||
| 699 | doc: /* Return the height of window WINDOW in pixels. | 699 | doc: /* Return the height of window WINDOW in pixels. |
| 700 | WINDOW must be a valid window and defaults to the selected one. | 700 | WINDOW must be a valid window and defaults to the selected one. |
| 701 | 701 | ||
| 702 | The return value includes the mode line and header line, if any. If | 702 | The return value includes the mode line and header line and the bottom |
| 703 | WINDOW is an internal window, its pixel height is the height of the | 703 | divider, if any. If WINDOW is an internal window, its pixel height is |
| 704 | screen areas spanned by its children. */) | 704 | the height of the screen areas spanned by its children. */) |
| 705 | (Lisp_Object window) | 705 | (Lisp_Object window) |
| 706 | { | 706 | { |
| 707 | return make_number (decode_valid_window (window)->pixel_height); | 707 | return make_number (decode_valid_window (window)->pixel_height); |