aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--doc/lispref/ChangeLog16
-rw-r--r--doc/lispref/display.texi48
-rw-r--r--doc/lispref/frames.texi12
-rw-r--r--doc/lispref/windows.texi337
-rw-r--r--lisp/ChangeLog7
-rw-r--r--lisp/window.el28
-rw-r--r--src/ChangeLog10
-rw-r--r--src/dispnew.c2
-rw-r--r--src/window.c6
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 @@
12014-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
12014-03-05 Glenn Morris <rgm@gnu.org> 172014-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
3896to use the value specified by the frame. 3897to 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
3906Window dividers are bars drawn between a frame's windows. A ``right''
3907divider is drawn between a window and its sibling(s) on the right. Its
3908width 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
3910bottom 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
3912means to not draw such dividers. @xref{Layout Parameters}.
3913
3914 Technically, a right divider ``belongs'' to the window on its left,
3915which means that its width is part of the total width of that window. A
3916bottom divider ``belongs'' to the window above it, which means that its
3917height is part of the total height of that window. @xref{Window Sizes}.
3918When 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
3920the total width of the window while the height of the right divider
3921equals the total height of the window minus the height of the bottom
3922divider.
3923
3924 Dividers can be dragged with the mouse and are therefore useful for
3925adjusting the sizes of adjacent windows with the mouse. They also serve
3926to set windows visually apart from their siblings when no scroll bars or
3927mode lines are present. The following three faces allow to customize
3928the appearance of dividers:
3929
3930@table @code
3931@item window-divider
3932When a divider is less than three pixels wide, it is drawn solidly with
3933the foreground of this face. For larger dividers this face is used for
3934the inner part only, exluding the first and last pixel.
3935
3936@item window-divider-first-pixel
3937This is the face used for drawing the first pixel of a divider that is
3938at least three pixels wide. To obtain a solid appearance, set this to
3939the same value used for the @code{window-divider} face.
3940
3941@item window-divider-last-pixel
3942This is the face used for drawing the last pixel of a divider that is at
3943least three pixels wide. To obtain a solid appearance, set this to the
3944same 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
745precise width by specifying that width as a negative integer. If both 745precise width by specifying that width as a negative integer. If both
746widths are negative, only the left fringe gets the specified width. 746widths 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
750The width of the right divider (@pxref{Window Dividers}) of any window
751on the frame, in pixels. A value of zero means to not draw right
752dividers.
753
754@vindex bottom-divider-width, a frame parameter
755@item bottom-divider-width
756The width of the bottom divider (@pxref{Window Dividers}) of any window
757on the frame, in pixels. A value of zero means to not draw bottom
758dividers.
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
750The number of lines to allocate at the top of the frame for a menu 762The 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 399Window | | | | Text Area | | | | | Window
399 Total | | | | (Window Body) | | | | Body 400Body | | | | | (Window Body) | | | | | Total
400 Height | | | | | | | | Height 401Height | | | | | | | | | 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},
414where the buffer text is displayed. On each side of the text area is 415where the buffer text is displayed. The text area can be surrounded by
415a series of vertical areas; from innermost to outermost, these are the 416a series of optional areas. On the left and right, from innermost to
416left and right margins, denoted by LM and RM in the schematic 417outermost, 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 418the schematic (@pxref{Display Margins}); the left and right fringes,
418and RF (@pxref{Fringes}); and the left or right scroll bar, only one of 419denoted by LF and RF (@pxref{Fringes}); the left or right scroll bar,
419which is present at any time, denoted by LS and RS (@pxref{Scroll 420only one of which is present at any time, denoted by LS and RS
420Bars}). 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
422line (@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 425Dividers}).
425a window. Except where noted, Emacs reports window heights and widths 426
426as integer numbers of lines and columns, respectively. On a graphical 427 Emacs provides miscellaneous functions for finding the height and
427display, each ``line'' and ``column'' actually corresponds to the 428width of a window. The return value of many of these functions can be
428height and width of a ``default'' character specified by the frame's 429specified either in units of pixels or in units of lines and columns.
429default font. Thus, if a window is displaying text with a different 430On a graphical display, the latter actually correspond to the height and
430font or size, the reported height and width for that window may differ 431width of a ``default'' character specified by the frame's default font
431from the actual number of text lines or columns displayed within it. 432as 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 434a different font or size, the reported line height and column width for
434This function returns the height or width of @var{window}. 435that window may differ from the actual number of text lines or columns
435@var{window} must be a valid window. The default value of 436displayed within it.
436@var{window} is the selected window.
437
438If @var{horizontal} is omitted or nil, return the total height of
439@var{window}, in lines; otherwise return the total width in columns.
440
441The optional argument @var{pixelwise} means return size of
442@var{window}, in pixels.
443
444The optional argument @var{round} is ignored if @var{pixelwise} is
445non-@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 442the 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 444of its root window (@pxref{Windows and Frames}), since a frame may also
456and bottom of the window, including the header line (if one exists) 445contain an echo area, a menu bar, and a tool bar (@pxref{Size and
457and the mode line. The @dfn{total width} of a window is the distance 446Position}).
458between the left and right edges of the mode line. Note that the
459height of a frame is not the same as the height of its windows, since
460a 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
464This function returns the total height, in lines, of the window 449This 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
466to the selected window. If @var{window} is an internal window, the 451the selected window. If @var{window} is an internal window, the return
467return value is the total height occupied by its descendant windows. 452value is the total height occupied by its descendant windows.
468 453
469If @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
470frame's character height, the number of lines occupied by @var{window} 455default character height, the number of lines occupied by the window is
471is rounded internally. This is done in a way such that, if 456rounded 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 457parent window, the sum of the total heights of all its child windows
473its children internally equals the total height of @var{window}. 458internally equals the total height of their parent. This means that
474 459although two windows have the same pixel height, their internal total
475If the optional argument @var{round} is @code{ceiling}, this function 460heights may differ by one line. This means also, that if this window is
476will return the smallest integer larger than @var{window}'s pixel 461vertically combined and has a right sibling, the topmost row of that
477height divided by the character height of @var{window}'s frame; if it 462sibling can be calculated as the sum of this window's topmost row and
478is @code{floor}, return the largest integer smaller than 463total 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
481the internal total height of @var{window}. 466function returns the smallest integer larger than @var{window}'s pixel
467height 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
469pixel height divided by the character height of @var{window}'s frame.
470Any other value of @var{round} means to return the internal value of the
471total 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
477The @dfn{total width} of a window is the number of lines comprising the
478window's body, its margins, fringes, scroll bars and a right divider (if
479any).
480
484@defun window-total-width &optional window round 481@defun window-total-width &optional window round
485This function returns the total width, in columns, of the window 482This 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
487to the selected window. If @var{window} is internal, the return value 484the selected window. If @var{window} is internal, the return value is
488is the total width occupied by its descendant windows. 485the total width occupied by its descendant windows.
489 486
490If @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
491frame's character width, the number of lines occupied by @var{window} 488character width, the number of lines occupied by the window is rounded
492is rounded internally. This is done in a way such that, if 489internally. 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 490window, the sum of the total widths of all its children internally
494its children internally equals the total width of @var{window}. 491equals the total width of their parent. This means that although two
492windows have the same pixel width, their internal total widths may
493differ by one column. This means also, that if this window is
494horizontally combined and has a right sibling, the leftmost column of
495that sibling can be calculated as the sum of this window's leftmost
496column and total width (@pxref{Coordinates and Windows}).
495 497
496If the optional argument @var{round} is @code{ceiling}, this function 498If the optional argument @var{round} is @code{ceiling}, this function
497will return the smallest integer larger than @var{window}'s pixel 499will return the smallest integer larger than @var{window}'s pixel width
498width divided by the character width of @var{window}'s frame; if it is 500divided 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
500pixel width divided by the character width of @var{window}'s frame. 502pixel width divided by the character width of @var{window}'s frame. Any
501Any other value of @var{round} means to return the internal total 503other value of @var{round} means to return the internal total width of
502width 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
506This function returns either the total height or width of the window 508This function returns either the total height in lines or the total
507@var{window}. If @var{horizontal} is omitted or @code{nil}, this is 509width in columns of the window @var{window}. If @var{horizontal} is
508equivalent to calling @code{window-total-height} for @var{window}; 510omitted or @code{nil}, this is equivalent to calling
509otherwise 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 512to calling @code{window-total-width} for @var{window}. The optional
511@code{window-total-height} and @code{window-total-width}. 513argument @code{ROUND} is handled as for @code{window-total-height} and
514@code{window-total-width}.
515@end defun
516
517The following two functions can be used to return the total size of a
518window 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
525This 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
528The return value includes mode and header line and a bottom divider, if
529any. If @var{window} is an internal window, its pixel height is the
530pixel 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
538This 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
541The return value includes the fringes and margins of @var{window} as
542well as any vertical dividers or scroll bars belonging to @var{window}.
543If @var{window} is an internal window, its pixel width is the width of
544the 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 569The @dfn{body height} of a window is the height of its text area, which
537@cindex body size of a window 570does 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,
540which 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
542the scroll bar, fringes, or margins.
543 571
544@defun window-body-height &optional window pixelwise 572@defun window-body-height &optional window pixelwise
545This function returns the body height, in lines, of the window 573This 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
547to the selected window; otherwise it must be a live window. 575the selected window; otherwise it must be a live window.
576
577If the optional argument @var{pixelwise} is non-@code{nil}, this
578function returns the body height of @var{window} counted in pixels.
548 579
549If there is a partially-visible line at the bottom of the text area, 580If @var{pixelwise} is @code{nil}, the return value is rounded down to
550that counts as a whole line; to exclude such a partially-visible line, 581the nearest integer, if necessary. This means that if a line at the
551use @code{window-text-height}, below. 582bottom of the text area is only partially visible, that line is not
583counted. It also means that the height of a window's body can never
584exceed 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
590The @dfn{body width} of a window is the width of its text area, which
591does 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
555This function returns the body width, in columns, of the window 594This 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
557to the selected window; otherwise it must be a live window. 596the selected window; otherwise it must be a live window.
558@end defun 597
598If the optional argument @var{pixelwise} is non-@code{nil}, this
599function returns the body width of @var{window} in units of pixels.
559 600
560@defun window-body-size &optional window horizontal 601If @var{pixelwise} is @code{nil}, the return value is rounded down to
561This function returns the body height or body width of @var{window}. 602the nearest integer, if necessary. This means that if a column on the
562If @var{horizontal} is omitted or @code{nil}, it is equivalent to 603right of the text area is only partially visible, that column is not
563calling @code{window-body-height} for @var{window}; otherwise it is 604counted. It also means that the width of a window's body can never
564equivalent to calling @code{window-body-width}. 605exceed 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
568This function is like @code{window-body-height}, except that any 609This function returns the body height or body width of @var{window}. If
569partially-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
612to calling @code{window-body-width}. In either case, the optional
613argument @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}),
581or split them (@pxref{Splitting Windows}), obey the variables 625or 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
583the smallest allowable window height and width. @xref{Change 627smallest allowable window height and width. They also obey the variable
584Window,,Deleting and Rearranging Windows, emacs, The GNU Emacs 628@code{window-size-fixed}, with which a window can be @dfn{fixed} in
585Manual}. They also obey the variable @code{window-size-fixed}, with 629size:
586which a window can be @dfn{fixed} in size: 630
631@defopt window-min-height
632This option specifies the minimum total height, in lines, of any window.
633Its value has to accommodate at least one text line as well as a mode
634and header line and a bottom divider, if present.
635@end defopt
636
637@defopt window-min-width
638This option specifies the minimum total width, in columns, of any
639window. Its value has to accommodate two text columns as well as
640margins, 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
589If this buffer-local variable is non-@code{nil}, the size of any 644If this buffer-local variable is non-@code{nil}, the size of any
@@ -594,26 +649,13 @@ there is no choice.
594If the value is @code{height}, then only the window's height is fixed; 649If the value is @code{height}, then only the window's height is fixed;
595if the value is @code{width}, then only the window's width is fixed. 650if the value is @code{width}, then only the window's width is fixed.
596Any other non-@code{nil} value fixes both the width and the height. 651Any 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
600This function returns a non-@code{nil} value if @var{window}'s height
601is fixed. If @var{window} is omitted or @code{nil}, it defaults to
602the selected window. If the optional argument @var{horizontal} is
603non-@code{nil}, the return value is non-@code{nil} if @var{window}'s
604width is fixed.
605 652
606A @code{nil} return value does not necessarily mean that @var{window} 653If this variable is @code{nil}, this does not necessarily mean that any
607can be resized in the desired direction. To determine that, use the 654window showing the buffer can be resized in the desired direction. To
608function @code{window-resizable}. @xref{Resizing Windows}. 655determine 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
612positions of various parts of a window relative to the frame, from
613which you can calculate its size. In particular, you can use the
614functions @code{window-pixel-edges} and
615@code{window-inside-pixel-edges} to find the size in pixels, for
616graphical 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
654Emacs Manual}. However, if the optional argument @var{ignore} is 696Emacs Manual}. However, if the optional argument @var{ignore} is
655non-@code{nil}, this function ignores @code{window-min-height} and 697non-@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,
657Instead, it considers the minimum-height window to be one consisting 699it considers the minimum-height window to be one consisting of a header,
658of a header (if any), a mode line, plus a text area one line tall; and 700a mode line and a bottom divider (if any), plus a text area one line
659a minimum-width window as one consisting of fringes, margins, and 701tall; and a minimum-width window as one consisting of fringes, margins,
660scroll bar (if any), plus a text area two columns wide. 702a scroll bar and a right divider (if any), plus a text area two columns
703wide.
661 704
662If the optional argument @code{pixelwise} is non-@code{nil}, 705If 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 @@
12014-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
12014-03-05 Juanma Barranquero <lekktu@gmail.com> 82014-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.
323The value has to accommodate a mode- or header-line if present. 323The value has to accommodate one text line, a mode and header
324A value less than `window-safe-min-height' is ignored. The value 324line, and a bottom divider, if present. A value less than
325of this variable is honored when windows are resized or split. 325`window-safe-min-height' is ignored. The value of this variable
326is honored when windows are resized or split.
326 327
327Applications should never rebind this variable. To resize a 328Applications should never rebind this variable. To resize a
328window to a height less than the one specified here, an 329window 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.
353The value has to accommodate margins, fringes, or scrollbars if 354The value has to accommodate two text columns as well as margins,
354present. A value less than `window-safe-min-width' is ignored. 355fringes, a scroll bar and a right divider, if present. A value
355The value of this variable is honored when windows are resized or 356less than `window-safe-min-width' is ignored. The value of this
356split. 357variable is honored when windows are resized or split.
357 358
358Applications should never rebind this variable. To resize a 359Applications should never rebind this variable. To resize a
359window to a width less than the one specified here, an 360window 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.
1676WINDOW must be a live window and defaults to the selected one. 1677WINDOW must be a live window and defaults to the selected one.
1677 1678
1678If HORIZONTAL is omitted or nil, return the height of the text 1679If HORIZONTAL is omitted or nil, return the height of the text
1679area, like `window-body-height'. Otherwise, return the width of 1680area, like `window-body-height'. Otherwise, return the width of
1680the text area, like `window-body-width'." 1681the text area, like `window-body-width'. In either case, the
1682optional 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 @@
12014-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
12014-03-05 Paul Eggert <eggert@cs.ucla.edu> 82014-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.
700WINDOW must be a valid window and defaults to the selected one. 700WINDOW must be a valid window and defaults to the selected one.
701 701
702The return value includes the mode line and header line, if any. If 702The return value includes the mode line and header line and the bottom
703WINDOW is an internal window, its pixel height is the height of the 703divider, if any. If WINDOW is an internal window, its pixel height is
704screen areas spanned by its children. */) 704the 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);