diff options
| author | Kenichi Handa | 2011-11-11 16:08:47 +0900 |
|---|---|---|
| committer | Kenichi Handa | 2011-11-11 16:08:47 +0900 |
| commit | 0756b0c3a6e60dd623da6f12bc8d2de05ef7b8f1 (patch) | |
| tree | 0846cacac3ba56cb8d2054fbc851fee2fb9606d2 /src/window.c | |
| parent | 9ac0394b8d1e54bf1b49291c85770af36a94531e (diff) | |
| parent | 68cbc58be59373e805fa200db02e4022e20050f0 (diff) | |
| download | emacs-0756b0c3a6e60dd623da6f12bc8d2de05ef7b8f1.tar.gz emacs-0756b0c3a6e60dd623da6f12bc8d2de05ef7b8f1.zip | |
merge trunk
Diffstat (limited to 'src/window.c')
| -rw-r--r-- | src/window.c | 207 |
1 files changed, 112 insertions, 95 deletions
diff --git a/src/window.c b/src/window.c index 605d00b8e05..83a8974e88d 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -504,8 +504,8 @@ DEFUN ("window-nest", Fwindow_nest, Swindow_nest, 0, 1, 0, | |||
| 504 | doc: /* Return nest status of window WINDOW. | 504 | doc: /* Return nest status of window WINDOW. |
| 505 | If WINDOW is omitted or nil, it defaults to the selected window. | 505 | If WINDOW is omitted or nil, it defaults to the selected window. |
| 506 | 506 | ||
| 507 | If the return value is nil, subwindows of WINDOW can be recombined with | 507 | If the return value is nil, child windows of WINDOW can be recombined with |
| 508 | WINDOW's siblings. A return value of non-nil means that subwindows of | 508 | WINDOW's siblings. A return value of non-nil means that child windows of |
| 509 | WINDOW are never \(re-)combined with WINDOW's siblings. */) | 509 | WINDOW are never \(re-)combined with WINDOW's siblings. */) |
| 510 | (Lisp_Object window) | 510 | (Lisp_Object window) |
| 511 | { | 511 | { |
| @@ -516,8 +516,8 @@ DEFUN ("set-window-nest", Fset_window_nest, Sset_window_nest, 2, 2, 0, | |||
| 516 | doc: /* Set nest status of window WINDOW to STATUS; return STATUS. | 516 | doc: /* Set nest status of window WINDOW to STATUS; return STATUS. |
| 517 | If WINDOW is omitted or nil, it defaults to the selected window. | 517 | If WINDOW is omitted or nil, it defaults to the selected window. |
| 518 | 518 | ||
| 519 | If STATUS is nil, subwindows of WINDOW can be recombined with WINDOW's | 519 | If STATUS is nil, child windows of WINDOW can be recombined with WINDOW's |
| 520 | siblings. STATUS non-nil means that subwindows of WINDOW are never | 520 | siblings. STATUS non-nil means that child windows of WINDOW are never |
| 521 | \(re-)combined with WINDOW's siblings. */) | 521 | \(re-)combined with WINDOW's siblings. */) |
| 522 | (Lisp_Object window, Lisp_Object status) | 522 | (Lisp_Object window, Lisp_Object status) |
| 523 | { | 523 | { |
| @@ -539,27 +539,34 @@ selected one. */) | |||
| 539 | return decode_window (window)->use_time; | 539 | return decode_window (window)->use_time; |
| 540 | } | 540 | } |
| 541 | 541 | ||
| 542 | DEFUN ("window-total-size", Fwindow_total_size, Swindow_total_size, 0, 2, 0, | 542 | DEFUN ("window-total-height", Fwindow_total_height, Swindow_total_height, 0, 1, 0, |
| 543 | doc: /* Return the total number of lines of window WINDOW. | 543 | doc: /* Return the total height, in lines, of window WINDOW. |
| 544 | If WINDOW is omitted or nil, it defaults to the selected window. | 544 | If WINDOW is omitted or nil, it defaults to the selected window. |
| 545 | 545 | ||
| 546 | The return value includes WINDOW's mode line and header line, if any. | 546 | The return value includes the mode line and header line, if any. |
| 547 | If WINDOW is internal, the return value is the sum of the total number | 547 | If WINDOW is an internal window, the total height is the height |
| 548 | of lines of WINDOW's child windows if these are vertically combined | 548 | of the screen areas spanned by its children. |
| 549 | and the height of WINDOW's first child otherwise. | 549 | |
| 550 | 550 | On a graphical display, this total height is reported as an | |
| 551 | Optional argument HORIZONTAL non-nil means return the total number of | 551 | integer multiple of the default character height. */) |
| 552 | columns of WINDOW. In this case the return value includes any vertical | 552 | (Lisp_Object window) |
| 553 | dividers or scrollbars of WINDOW. If WINDOW is internal, the return | ||
| 554 | value is the sum of the total number of columns of WINDOW's child | ||
| 555 | windows if they are horizontally combined and the width of WINDOW's | ||
| 556 | first child otherwise. */) | ||
| 557 | (Lisp_Object window, Lisp_Object horizontal) | ||
| 558 | { | 553 | { |
| 559 | if (NILP (horizontal)) | 554 | return decode_any_window (window)->total_lines; |
| 560 | return decode_any_window (window)->total_lines; | 555 | } |
| 561 | else | 556 | |
| 562 | return decode_any_window (window)->total_cols; | 557 | DEFUN ("window-total-width", Fwindow_total_width, Swindow_total_width, 0, 1, 0, |
| 558 | doc: /* Return the total width, in columns, of window WINDOW. | ||
| 559 | If WINDOW is omitted or nil, it defaults to the selected window. | ||
| 560 | |||
| 561 | The return value includes any vertical dividers or scroll bars | ||
| 562 | belonging to WINDOW. If WINDOW is an internal window, the total width | ||
| 563 | is the width of the screen areas spanned by its children. | ||
| 564 | |||
| 565 | On a graphical display, this total width is reported as an | ||
| 566 | integer multiple of the default character width. */) | ||
| 567 | (Lisp_Object window) | ||
| 568 | { | ||
| 569 | return decode_any_window (window)->total_cols; | ||
| 563 | } | 570 | } |
| 564 | 571 | ||
| 565 | DEFUN ("window-new-total", Fwindow_new_total, Swindow_new_total, 0, 1, 0, | 572 | DEFUN ("window-new-total", Fwindow_new_total, Swindow_new_total, 0, 1, 0, |
| @@ -592,6 +599,10 @@ If WINDOW is omitted or nil, it defaults to the selected window. */) | |||
| 592 | 599 | ||
| 593 | DEFUN ("window-left-column", Fwindow_left_column, Swindow_left_column, 0, 1, 0, | 600 | DEFUN ("window-left-column", Fwindow_left_column, Swindow_left_column, 0, 1, 0, |
| 594 | doc: /* Return left column of window WINDOW. | 601 | doc: /* Return left column of window WINDOW. |
| 602 | This is the distance, in columns, between the left edge of WINDOW and | ||
| 603 | the left edge of the frame's window area. For instance, the return | ||
| 604 | value is 0 if there is no window to the left of WINDOW. | ||
| 605 | |||
| 595 | If WINDOW is omitted or nil, it defaults to the selected window. */) | 606 | If WINDOW is omitted or nil, it defaults to the selected window. */) |
| 596 | (Lisp_Object window) | 607 | (Lisp_Object window) |
| 597 | { | 608 | { |
| @@ -600,6 +611,10 @@ If WINDOW is omitted or nil, it defaults to the selected window. */) | |||
| 600 | 611 | ||
| 601 | DEFUN ("window-top-line", Fwindow_top_line, Swindow_top_line, 0, 1, 0, | 612 | DEFUN ("window-top-line", Fwindow_top_line, Swindow_top_line, 0, 1, 0, |
| 602 | doc: /* Return top line of window WINDOW. | 613 | doc: /* Return top line of window WINDOW. |
| 614 | This is the distance, in lines, between the top of WINDOW and the top | ||
| 615 | of the frame's window area. For instance, the return value is 0 if | ||
| 616 | there is no window above WINDOW. | ||
| 617 | |||
| 603 | If WINDOW is omitted or nil, it defaults to the selected window. */) | 618 | If WINDOW is omitted or nil, it defaults to the selected window. */) |
| 604 | (Lisp_Object window) | 619 | (Lisp_Object window) |
| 605 | { | 620 | { |
| @@ -655,34 +670,34 @@ window_body_cols (struct window *w) | |||
| 655 | return width; | 670 | return width; |
| 656 | } | 671 | } |
| 657 | 672 | ||
| 658 | DEFUN ("window-body-size", Fwindow_body_size, Swindow_body_size, 0, 2, 0, | 673 | DEFUN ("window-body-height", Fwindow_body_height, Swindow_body_height, 0, 1, 0, |
| 659 | doc: /* Return the number of lines or columns of WINDOW's body. | 674 | doc: /* Return the height, in lines, of WINDOW's text area. |
| 660 | WINDOW must be a live window and defaults to the selected one. | 675 | If WINDOW is omitted or nil, it defaults to the selected window. |
| 676 | Signal an error if the window is not live. | ||
| 661 | 677 | ||
| 662 | If the optional argument HORIZONTAL is omitted or nil, the function | 678 | The returned height does not include the mode line or header line. |
| 663 | returns the number of WINDOW's lines, excluding the mode line and | 679 | On a graphical display, the height is expressed as an integer multiple |
| 664 | header line, if any. | 680 | of the default character height. If a line at the bottom of the text |
| 665 | 681 | area is only partially visible, that counts as a whole line; to | |
| 666 | If HORIZONTAL is non-nil, the function returns the number of columns | 682 | exclude partially-visible lines, use `window-text-height'. */) |
| 667 | excluding any vertical dividers or scroll bars owned by WINDOW. On a | 683 | (Lisp_Object window) |
| 668 | window-system the return value also excludes the number of columns | ||
| 669 | used for WINDOW's fringes or display margins. | ||
| 670 | |||
| 671 | Note that the return value is measured in canonical units, i.e. for | ||
| 672 | the default frame's face. If the window shows some characters with | ||
| 673 | non-default face, e.g., if the font of some characters is larger or | ||
| 674 | smaller than the default font, the value returned by this function | ||
| 675 | will not match the actual number of lines or characters per line | ||
| 676 | shown in the window. To get the actual number of columns and lines, | ||
| 677 | use `posn-at-point'. */) | ||
| 678 | (Lisp_Object window, Lisp_Object horizontal) | ||
| 679 | { | 684 | { |
| 680 | struct window *w = decode_any_window (window); | 685 | struct window *w = decode_window (window); |
| 686 | return make_number (window_body_lines (w)); | ||
| 687 | } | ||
| 681 | 688 | ||
| 682 | if (NILP (horizontal)) | 689 | DEFUN ("window-body-width", Fwindow_body_width, Swindow_body_width, 0, 1, 0, |
| 683 | return make_number (window_body_lines (w)); | 690 | doc: /* Return the width, in columns, of WINDOW's text area. |
| 684 | else | 691 | If WINDOW is omitted or nil, it defaults to the selected window. |
| 685 | return make_number (window_body_cols (w)); | 692 | Signal an error if the window is not live. |
| 693 | |||
| 694 | The return value does not include any vertical dividers, fringe or | ||
| 695 | marginal areas, or scroll bars. On a graphical display, the width is | ||
| 696 | expressed as an integer multiple of the default character width. */) | ||
| 697 | (Lisp_Object window) | ||
| 698 | { | ||
| 699 | struct window *w = decode_window (window); | ||
| 700 | return make_number (window_body_cols (w)); | ||
| 686 | } | 701 | } |
| 687 | 702 | ||
| 688 | DEFUN ("window-hscroll", Fwindow_hscroll, Swindow_hscroll, 0, 1, 0, | 703 | DEFUN ("window-hscroll", Fwindow_hscroll, Swindow_hscroll, 0, 1, 0, |
| @@ -844,7 +859,7 @@ The inside edges do not include the space used by the WINDOW's scroll | |||
| 844 | bar, display margins, fringes, header line, and/or mode line. */) | 859 | bar, display margins, fringes, header line, and/or mode line. */) |
| 845 | (Lisp_Object window) | 860 | (Lisp_Object window) |
| 846 | { | 861 | { |
| 847 | register struct window *w = decode_any_window (window); | 862 | register struct window *w = decode_window (window); |
| 848 | 863 | ||
| 849 | return list4 (make_number (WINDOW_BOX_LEFT_EDGE_COL (w) | 864 | return list4 (make_number (WINDOW_BOX_LEFT_EDGE_COL (w) |
| 850 | + WINDOW_LEFT_MARGIN_COLS (w) | 865 | + WINDOW_LEFT_MARGIN_COLS (w) |
| @@ -859,9 +874,9 @@ bar, display margins, fringes, header line, and/or mode line. */) | |||
| 859 | } | 874 | } |
| 860 | 875 | ||
| 861 | DEFUN ("window-inside-pixel-edges", Fwindow_inside_pixel_edges, Swindow_inside_pixel_edges, 0, 1, 0, | 876 | DEFUN ("window-inside-pixel-edges", Fwindow_inside_pixel_edges, Swindow_inside_pixel_edges, 0, 1, 0, |
| 862 | doc: /* Return a list of the edge pixel coordinates of WINDOW. | 877 | doc: /* Return a list of the edge pixel coordinates of WINDOW's text area. |
| 863 | The list has the form (LEFT TOP RIGHT BOTTOM), all relative to 0, 0 at | 878 | The list has the form (LEFT TOP RIGHT BOTTOM), all relative to (0,0) |
| 864 | the top left corner of the frame. | 879 | at the top left corner of the frame's window area. |
| 865 | 880 | ||
| 866 | RIGHT is one more than the rightmost x position of WINDOW's text area. | 881 | RIGHT is one more than the rightmost x position of WINDOW's text area. |
| 867 | BOTTOM is one more than the bottommost y position of WINDOW's text area. | 882 | BOTTOM is one more than the bottommost y position of WINDOW's text area. |
| @@ -869,7 +884,7 @@ The inside edges do not include the space used by WINDOW's scroll bar, | |||
| 869 | display margins, fringes, header line, and/or mode line. */) | 884 | display margins, fringes, header line, and/or mode line. */) |
| 870 | (Lisp_Object window) | 885 | (Lisp_Object window) |
| 871 | { | 886 | { |
| 872 | register struct window *w = decode_any_window (window); | 887 | register struct window *w = decode_window (window); |
| 873 | 888 | ||
| 874 | return list4 (make_number (WINDOW_BOX_LEFT_EDGE_X (w) | 889 | return list4 (make_number (WINDOW_BOX_LEFT_EDGE_X (w) |
| 875 | + WINDOW_LEFT_MARGIN_WIDTH (w) | 890 | + WINDOW_LEFT_MARGIN_WIDTH (w) |
| @@ -886,9 +901,9 @@ display margins, fringes, header line, and/or mode line. */) | |||
| 886 | DEFUN ("window-inside-absolute-pixel-edges", | 901 | DEFUN ("window-inside-absolute-pixel-edges", |
| 887 | Fwindow_inside_absolute_pixel_edges, | 902 | Fwindow_inside_absolute_pixel_edges, |
| 888 | Swindow_inside_absolute_pixel_edges, 0, 1, 0, | 903 | Swindow_inside_absolute_pixel_edges, 0, 1, 0, |
| 889 | doc: /* Return a list of the edge pixel coordinates of WINDOW. | 904 | doc: /* Return a list of the edge pixel coordinates of WINDOW's text area. |
| 890 | The list has the form (LEFT TOP RIGHT BOTTOM), all relative to 0, 0 at | 905 | The list has the form (LEFT TOP RIGHT BOTTOM), all relative to (0,0) |
| 891 | the top left corner of the display. | 906 | at the top left corner of the frame's window area. |
| 892 | 907 | ||
| 893 | RIGHT is one more than the rightmost x position of WINDOW's text area. | 908 | RIGHT is one more than the rightmost x position of WINDOW's text area. |
| 894 | BOTTOM is one more than the bottommost y position of WINDOW's text area. | 909 | BOTTOM is one more than the bottommost y position of WINDOW's text area. |
| @@ -896,7 +911,7 @@ The inside edges do not include the space used by WINDOW's scroll bar, | |||
| 896 | display margins, fringes, header line, and/or mode line. */) | 911 | display margins, fringes, header line, and/or mode line. */) |
| 897 | (Lisp_Object window) | 912 | (Lisp_Object window) |
| 898 | { | 913 | { |
| 899 | register struct window *w = decode_any_window (window); | 914 | register struct window *w = decode_window (window); |
| 900 | int add_x, add_y; | 915 | int add_x, add_y; |
| 901 | calc_absolute_offset (w, &add_x, &add_y); | 916 | calc_absolute_offset (w, &add_x, &add_y); |
| 902 | 917 | ||
| @@ -2571,9 +2586,9 @@ DEFUN ("delete-other-windows-internal", Fdelete_other_windows_internal, | |||
| 2571 | Only the frame WINDOW is on is affected. WINDOW may be any window and | 2586 | Only the frame WINDOW is on is affected. WINDOW may be any window and |
| 2572 | defaults to the selected one. | 2587 | defaults to the selected one. |
| 2573 | 2588 | ||
| 2574 | Optional argument ROOT, if non-nil, must specify an internal window | 2589 | Optional argument ROOT, if non-nil, must specify an internal window such |
| 2575 | containing WINDOW as a subwindow. If this is the case, replace ROOT by | 2590 | that WINDOW is in its window subtree. If this is the case, replace ROOT |
| 2576 | WINDOW and leave alone any windows not contained in ROOT. | 2591 | by WINDOW and leave alone any windows not part of ROOT's subtree. |
| 2577 | 2592 | ||
| 2578 | When WINDOW is live try to reduce display jumps by keeping the text | 2593 | When WINDOW is live try to reduce display jumps by keeping the text |
| 2579 | previously visible in WINDOW in the same place on the frame. Doing this | 2594 | previously visible in WINDOW in the same place on the frame. Doing this |
| @@ -2637,10 +2652,10 @@ window-start value is reasonable when this function is called. */) | |||
| 2637 | } | 2652 | } |
| 2638 | else | 2653 | else |
| 2639 | { | 2654 | { |
| 2640 | /* See if the frame's selected window is a subwindow of WINDOW, by | 2655 | /* See if the frame's selected window is a part of the window |
| 2641 | finding all the selected window's parents and comparing each | 2656 | subtree rooted at WINDOW, by finding all the selected window's |
| 2642 | one with WINDOW. If it isn't we need a new selected window for | 2657 | parents and comparing each one with WINDOW. If it isn't we |
| 2643 | this frame. */ | 2658 | need a new selected window for this frame. */ |
| 2644 | swindow = FRAME_SELECTED_WINDOW (f); | 2659 | swindow = FRAME_SELECTED_WINDOW (f); |
| 2645 | while (1) | 2660 | while (1) |
| 2646 | { | 2661 | { |
| @@ -2676,7 +2691,7 @@ window-start value is reasonable when this function is called. */) | |||
| 2676 | 2691 | ||
| 2677 | if (NILP (w->buffer)) | 2692 | if (NILP (w->buffer)) |
| 2678 | { | 2693 | { |
| 2679 | /* Resize subwindows vertically. */ | 2694 | /* Resize child windows vertically. */ |
| 2680 | XSETINT (delta, XINT (r->total_lines) - XINT (w->total_lines)); | 2695 | XSETINT (delta, XINT (r->total_lines) - XINT (w->total_lines)); |
| 2681 | w->top_line = r->top_line; | 2696 | w->top_line = r->top_line; |
| 2682 | resize_root_window (window, delta, Qnil, Qnil); | 2697 | resize_root_window (window, delta, Qnil, Qnil); |
| @@ -2691,7 +2706,7 @@ window-start value is reasonable when this function is called. */) | |||
| 2691 | resize_failed = 1; | 2706 | resize_failed = 1; |
| 2692 | } | 2707 | } |
| 2693 | 2708 | ||
| 2694 | /* Resize subwindows horizontally. */ | 2709 | /* Resize child windows horizontally. */ |
| 2695 | if (!resize_failed) | 2710 | if (!resize_failed) |
| 2696 | { | 2711 | { |
| 2697 | w->left_col = r->left_col; | 2712 | w->left_col = r->left_col; |
| @@ -2740,15 +2755,15 @@ window-start value is reasonable when this function is called. */) | |||
| 2740 | XWINDOW (w->parent)->hchild = sibling; | 2755 | XWINDOW (w->parent)->hchild = sibling; |
| 2741 | } | 2756 | } |
| 2742 | 2757 | ||
| 2743 | /* Delete ROOT and all subwindows of ROOT. */ | 2758 | /* Delete ROOT and all child windows of ROOT. */ |
| 2744 | if (!NILP (r->vchild)) | 2759 | if (!NILP (r->vchild)) |
| 2745 | { | 2760 | { |
| 2746 | delete_all_subwindows (r->vchild); | 2761 | delete_all_child_windows (r->vchild); |
| 2747 | r->vchild = Qnil; | 2762 | r->vchild = Qnil; |
| 2748 | } | 2763 | } |
| 2749 | else if (!NILP (r->hchild)) | 2764 | else if (!NILP (r->hchild)) |
| 2750 | { | 2765 | { |
| 2751 | delete_all_subwindows (r->hchild); | 2766 | delete_all_child_windows (r->hchild); |
| 2752 | r->hchild = Qnil; | 2767 | r->hchild = Qnil; |
| 2753 | } | 2768 | } |
| 2754 | 2769 | ||
| @@ -3349,7 +3364,7 @@ Return SIZE. | |||
| 3349 | Optional argument ADD non-nil means add SIZE to the new total size of | 3364 | Optional argument ADD non-nil means add SIZE to the new total size of |
| 3350 | WINDOW and return the sum. | 3365 | WINDOW and return the sum. |
| 3351 | 3366 | ||
| 3352 | Note: This function does not operate on any subwindows of WINDOW. */) | 3367 | Note: This function does not operate on any child windows of WINDOW. */) |
| 3353 | (Lisp_Object window, Lisp_Object size, Lisp_Object add) | 3368 | (Lisp_Object window, Lisp_Object size, Lisp_Object add) |
| 3354 | { | 3369 | { |
| 3355 | struct window *w = decode_any_window (window); | 3370 | struct window *w = decode_any_window (window); |
| @@ -3367,7 +3382,7 @@ DEFUN ("set-window-new-normal", Fset_window_new_normal, Sset_window_new_normal, | |||
| 3367 | doc: /* Set new normal size of WINDOW to SIZE. | 3382 | doc: /* Set new normal size of WINDOW to SIZE. |
| 3368 | Return SIZE. | 3383 | Return SIZE. |
| 3369 | 3384 | ||
| 3370 | Note: This function does not operate on any subwindows of WINDOW. */) | 3385 | Note: This function does not operate on any child windows of WINDOW. */) |
| 3371 | (Lisp_Object window, Lisp_Object size) | 3386 | (Lisp_Object window, Lisp_Object size) |
| 3372 | { | 3387 | { |
| 3373 | struct window *w = decode_any_window (window); | 3388 | struct window *w = decode_any_window (window); |
| @@ -3378,7 +3393,7 @@ Note: This function does not operate on any subwindows of WINDOW. */) | |||
| 3378 | 3393 | ||
| 3379 | /* Return 1 if setting w->total_lines (w->total_cols if HORFLAG is | 3394 | /* Return 1 if setting w->total_lines (w->total_cols if HORFLAG is |
| 3380 | non-zero) to w->new_total would result in correct heights (widths) | 3395 | non-zero) to w->new_total would result in correct heights (widths) |
| 3381 | for window W and recursively all subwindows of W. | 3396 | for window W and recursively all child windows of W. |
| 3382 | 3397 | ||
| 3383 | Note: This function does not check any of `window-fixed-size-p', | 3398 | Note: This function does not check any of `window-fixed-size-p', |
| 3384 | `window-min-height' or `window-min-width'. It does check that window | 3399 | `window-min-height' or `window-min-width'. It does check that window |
| @@ -3393,7 +3408,7 @@ window_resize_check (struct window *w, int horflag) | |||
| 3393 | { | 3408 | { |
| 3394 | c = XWINDOW (w->vchild); | 3409 | c = XWINDOW (w->vchild); |
| 3395 | if (horflag) | 3410 | if (horflag) |
| 3396 | /* All subwindows of W must have the same width as W. */ | 3411 | /* All child windows of W must have the same width as W. */ |
| 3397 | { | 3412 | { |
| 3398 | while (c) | 3413 | while (c) |
| 3399 | { | 3414 | { |
| @@ -3405,8 +3420,8 @@ window_resize_check (struct window *w, int horflag) | |||
| 3405 | return 1; | 3420 | return 1; |
| 3406 | } | 3421 | } |
| 3407 | else | 3422 | else |
| 3408 | /* The sum of the heights of the subwindows of W must equal W's | 3423 | /* The sum of the heights of the child windows of W must equal |
| 3409 | height. */ | 3424 | W's height. */ |
| 3410 | { | 3425 | { |
| 3411 | int sum_of_sizes = 0; | 3426 | int sum_of_sizes = 0; |
| 3412 | while (c) | 3427 | while (c) |
| @@ -3424,7 +3439,7 @@ window_resize_check (struct window *w, int horflag) | |||
| 3424 | { | 3439 | { |
| 3425 | c = XWINDOW (w->hchild); | 3440 | c = XWINDOW (w->hchild); |
| 3426 | if (horflag) | 3441 | if (horflag) |
| 3427 | /* The sum of the widths of the subwindows of W must equal W's | 3442 | /* The sum of the widths of the child windows of W must equal W's |
| 3428 | width. */ | 3443 | width. */ |
| 3429 | { | 3444 | { |
| 3430 | int sum_of_sizes = 0; | 3445 | int sum_of_sizes = 0; |
| @@ -3438,7 +3453,7 @@ window_resize_check (struct window *w, int horflag) | |||
| 3438 | return (sum_of_sizes == XINT (w->new_total)); | 3453 | return (sum_of_sizes == XINT (w->new_total)); |
| 3439 | } | 3454 | } |
| 3440 | else | 3455 | else |
| 3441 | /* All subwindows of W must have the same height as W. */ | 3456 | /* All child windows of W must have the same height as W. */ |
| 3442 | { | 3457 | { |
| 3443 | while (c) | 3458 | while (c) |
| 3444 | { | 3459 | { |
| @@ -3458,9 +3473,9 @@ window_resize_check (struct window *w, int horflag) | |||
| 3458 | } | 3473 | } |
| 3459 | 3474 | ||
| 3460 | /* Set w->total_lines (w->total_cols if HORIZONTAL is non-zero) to | 3475 | /* Set w->total_lines (w->total_cols if HORIZONTAL is non-zero) to |
| 3461 | w->new_total for window W and recursively all subwindows of W. Also | 3476 | w->new_total for window W and recursively all child windows of W. |
| 3462 | calculate and assign the new vertical (horizontal) start positions of | 3477 | Also calculate and assign the new vertical (horizontal) start |
| 3463 | each of these windows. | 3478 | positions of each of these windows. |
| 3464 | 3479 | ||
| 3465 | This function does not perform any error checks. Make sure you have | 3480 | This function does not perform any error checks. Make sure you have |
| 3466 | run window_resize_check on W before applying this function. */ | 3481 | run window_resize_check on W before applying this function. */ |
| @@ -3534,8 +3549,8 @@ Optional argument HORIZONTAL omitted or nil means apply requested height | |||
| 3534 | values. HORIZONTAL non-nil means apply requested width values. | 3549 | values. HORIZONTAL non-nil means apply requested width values. |
| 3535 | 3550 | ||
| 3536 | This function checks whether the requested values sum up to a valid | 3551 | This function checks whether the requested values sum up to a valid |
| 3537 | window layout, recursively assigns the new sizes of all subwindows and | 3552 | window layout, recursively assigns the new sizes of all child windows |
| 3538 | calculates and assigns the new start positions of these windows. | 3553 | and calculates and assigns the new start positions of these windows. |
| 3539 | 3554 | ||
| 3540 | Note: This function does not check any of `window-fixed-size-p', | 3555 | Note: This function does not check any of `window-fixed-size-p', |
| 3541 | `window-min-height' or `window-min-width'. All these checks have to | 3556 | `window-min-height' or `window-min-width'. All these checks have to |
| @@ -3931,12 +3946,12 @@ Signal an error when WINDOW is the only window on its frame. */) | |||
| 3931 | 3946 | ||
| 3932 | if (!NILP (w->vchild)) | 3947 | if (!NILP (w->vchild)) |
| 3933 | { | 3948 | { |
| 3934 | delete_all_subwindows (w->vchild); | 3949 | delete_all_child_windows (w->vchild); |
| 3935 | w->vchild = Qnil; | 3950 | w->vchild = Qnil; |
| 3936 | } | 3951 | } |
| 3937 | else if (!NILP (w->hchild)) | 3952 | else if (!NILP (w->hchild)) |
| 3938 | { | 3953 | { |
| 3939 | delete_all_subwindows (w->hchild); | 3954 | delete_all_child_windows (w->hchild); |
| 3940 | w->hchild = Qnil; | 3955 | w->hchild = Qnil; |
| 3941 | } | 3956 | } |
| 3942 | else if (!NILP (w->buffer)) | 3957 | else if (!NILP (w->buffer)) |
| @@ -5218,10 +5233,10 @@ and redisplay normally--don't erase and redraw the frame. */) | |||
| 5218 | DEFUN ("window-text-height", Fwindow_text_height, Swindow_text_height, | 5233 | DEFUN ("window-text-height", Fwindow_text_height, Swindow_text_height, |
| 5219 | 0, 1, 0, | 5234 | 0, 1, 0, |
| 5220 | doc: /* Return the height in lines of the text display area of WINDOW. | 5235 | doc: /* Return the height in lines of the text display area of WINDOW. |
| 5221 | WINDOW defaults to the selected window. | 5236 | If WINDOW is omitted or nil, it defaults to the selected window. |
| 5222 | 5237 | ||
| 5223 | The return value does not include the mode line, any header line, nor | 5238 | The returned height does not include the mode line, any header line, |
| 5224 | any partial-height lines in the text display area. */) | 5239 | nor any partial-height lines at the bottom of the text area. */) |
| 5225 | (Lisp_Object window) | 5240 | (Lisp_Object window) |
| 5226 | { | 5241 | { |
| 5227 | struct window *w = decode_window (window); | 5242 | struct window *w = decode_window (window); |
| @@ -5515,7 +5530,7 @@ the return value is nil. Otherwise the value is t. */) | |||
| 5515 | Save their current buffers in their height fields, since we may | 5530 | Save their current buffers in their height fields, since we may |
| 5516 | need it later, if a buffer saved in the configuration is now | 5531 | need it later, if a buffer saved in the configuration is now |
| 5517 | dead. */ | 5532 | dead. */ |
| 5518 | delete_all_subwindows (FRAME_ROOT_WINDOW (f)); | 5533 | delete_all_child_windows (FRAME_ROOT_WINDOW (f)); |
| 5519 | 5534 | ||
| 5520 | for (k = 0; k < saved_windows->header.size; k++) | 5535 | for (k = 0; k < saved_windows->header.size; k++) |
| 5521 | { | 5536 | { |
| @@ -5729,10 +5744,10 @@ the return value is nil. Otherwise the value is t. */) | |||
| 5729 | } | 5744 | } |
| 5730 | 5745 | ||
| 5731 | 5746 | ||
| 5732 | /* Delete all subwindows reachable via the next, vchild, and hchild | 5747 | /* Recursively delete all child windows reachable via the next, vchild, |
| 5733 | slots of WINDOW. */ | 5748 | and hchild slots of WINDOW. */ |
| 5734 | void | 5749 | void |
| 5735 | delete_all_subwindows (Lisp_Object window) | 5750 | delete_all_child_windows (Lisp_Object window) |
| 5736 | { | 5751 | { |
| 5737 | register struct window *w; | 5752 | register struct window *w; |
| 5738 | 5753 | ||
| @@ -5740,18 +5755,18 @@ delete_all_subwindows (Lisp_Object window) | |||
| 5740 | 5755 | ||
| 5741 | if (!NILP (w->next)) | 5756 | if (!NILP (w->next)) |
| 5742 | /* Delete WINDOW's siblings (we traverse postorderly). */ | 5757 | /* Delete WINDOW's siblings (we traverse postorderly). */ |
| 5743 | delete_all_subwindows (w->next); | 5758 | delete_all_child_windows (w->next); |
| 5744 | 5759 | ||
| 5745 | w->total_lines = w->buffer; /* See Fset_window_configuration for excuse. */ | 5760 | w->total_lines = w->buffer; /* See Fset_window_configuration for excuse. */ |
| 5746 | 5761 | ||
| 5747 | if (!NILP (w->vchild)) | 5762 | if (!NILP (w->vchild)) |
| 5748 | { | 5763 | { |
| 5749 | delete_all_subwindows (w->vchild); | 5764 | delete_all_child_windows (w->vchild); |
| 5750 | w->vchild = Qnil; | 5765 | w->vchild = Qnil; |
| 5751 | } | 5766 | } |
| 5752 | else if (!NILP (w->hchild)) | 5767 | else if (!NILP (w->hchild)) |
| 5753 | { | 5768 | { |
| 5754 | delete_all_subwindows (w->hchild); | 5769 | delete_all_child_windows (w->hchild); |
| 5755 | w->hchild = Qnil; | 5770 | w->hchild = Qnil; |
| 5756 | } | 5771 | } |
| 5757 | else if (!NILP (w->buffer)) | 5772 | else if (!NILP (w->buffer)) |
| @@ -6583,14 +6598,16 @@ function `window-nest' and altered by the function `set-window-nest'. */); | |||
| 6583 | defsubr (&Swindow_use_time); | 6598 | defsubr (&Swindow_use_time); |
| 6584 | defsubr (&Swindow_top_line); | 6599 | defsubr (&Swindow_top_line); |
| 6585 | defsubr (&Swindow_left_column); | 6600 | defsubr (&Swindow_left_column); |
| 6586 | defsubr (&Swindow_total_size); | 6601 | defsubr (&Swindow_total_height); |
| 6602 | defsubr (&Swindow_total_width); | ||
| 6587 | defsubr (&Swindow_normal_size); | 6603 | defsubr (&Swindow_normal_size); |
| 6588 | defsubr (&Swindow_new_total); | 6604 | defsubr (&Swindow_new_total); |
| 6589 | defsubr (&Swindow_new_normal); | 6605 | defsubr (&Swindow_new_normal); |
| 6590 | defsubr (&Sset_window_new_total); | 6606 | defsubr (&Sset_window_new_total); |
| 6591 | defsubr (&Sset_window_new_normal); | 6607 | defsubr (&Sset_window_new_normal); |
| 6592 | defsubr (&Swindow_resize_apply); | 6608 | defsubr (&Swindow_resize_apply); |
| 6593 | defsubr (&Swindow_body_size); | 6609 | defsubr (&Swindow_body_height); |
| 6610 | defsubr (&Swindow_body_width); | ||
| 6594 | defsubr (&Swindow_hscroll); | 6611 | defsubr (&Swindow_hscroll); |
| 6595 | defsubr (&Sset_window_hscroll); | 6612 | defsubr (&Sset_window_hscroll); |
| 6596 | defsubr (&Swindow_redisplay_end_trigger); | 6613 | defsubr (&Swindow_redisplay_end_trigger); |