diff options
Diffstat (limited to 'src/window.c')
| -rw-r--r-- | src/window.c | 159 |
1 files changed, 74 insertions, 85 deletions
diff --git a/src/window.c b/src/window.c index 5dc908f0a4d..875d7770277 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -692,7 +692,7 @@ On a graphical display, this total height is reported as an | |||
| 692 | integer multiple of the default character height. */) | 692 | integer multiple of the default character height. */) |
| 693 | (Lisp_Object window) | 693 | (Lisp_Object window) |
| 694 | { | 694 | { |
| 695 | return decode_valid_window (window)->total_lines; | 695 | return make_number (decode_valid_window (window)->total_lines); |
| 696 | } | 696 | } |
| 697 | 697 | ||
| 698 | DEFUN ("window-total-width", Fwindow_total_width, Swindow_total_width, 0, 1, 0, | 698 | DEFUN ("window-total-width", Fwindow_total_width, Swindow_total_width, 0, 1, 0, |
| @@ -707,7 +707,7 @@ On a graphical display, this total width is reported as an | |||
| 707 | integer multiple of the default character width. */) | 707 | integer multiple of the default character width. */) |
| 708 | (Lisp_Object window) | 708 | (Lisp_Object window) |
| 709 | { | 709 | { |
| 710 | return decode_valid_window (window)->total_cols; | 710 | return make_number (decode_valid_window (window)->total_cols); |
| 711 | } | 711 | } |
| 712 | 712 | ||
| 713 | DEFUN ("window-new-total", Fwindow_new_total, Swindow_new_total, 0, 1, 0, | 713 | DEFUN ("window-new-total", Fwindow_new_total, Swindow_new_total, 0, 1, 0, |
| @@ -746,7 +746,7 @@ value is 0 if there is no window to the left of WINDOW. | |||
| 746 | WINDOW must be a valid window and defaults to the selected one. */) | 746 | WINDOW must be a valid window and defaults to the selected one. */) |
| 747 | (Lisp_Object window) | 747 | (Lisp_Object window) |
| 748 | { | 748 | { |
| 749 | return decode_valid_window (window)->left_col; | 749 | return make_number (decode_valid_window (window)->left_col); |
| 750 | } | 750 | } |
| 751 | 751 | ||
| 752 | DEFUN ("window-top-line", Fwindow_top_line, Swindow_top_line, 0, 1, 0, | 752 | DEFUN ("window-top-line", Fwindow_top_line, Swindow_top_line, 0, 1, 0, |
| @@ -758,7 +758,7 @@ there is no window above WINDOW. | |||
| 758 | WINDOW must be a valid window and defaults to the selected one. */) | 758 | WINDOW must be a valid window and defaults to the selected one. */) |
| 759 | (Lisp_Object window) | 759 | (Lisp_Object window) |
| 760 | { | 760 | { |
| 761 | return decode_valid_window (window)->top_line; | 761 | return make_number (decode_valid_window (window)->top_line); |
| 762 | } | 762 | } |
| 763 | 763 | ||
| 764 | /* Return the number of lines of W's body. Don't count any mode or | 764 | /* Return the number of lines of W's body. Don't count any mode or |
| @@ -767,7 +767,7 @@ WINDOW must be a valid window and defaults to the selected one. */) | |||
| 767 | static int | 767 | static int |
| 768 | window_body_lines (struct window *w) | 768 | window_body_lines (struct window *w) |
| 769 | { | 769 | { |
| 770 | int height = XFASTINT (w->total_lines); | 770 | int height = w->total_lines; |
| 771 | 771 | ||
| 772 | if (!MINI_WINDOW_P (w)) | 772 | if (!MINI_WINDOW_P (w)) |
| 773 | { | 773 | { |
| @@ -789,7 +789,7 @@ int | |||
| 789 | window_body_cols (struct window *w) | 789 | window_body_cols (struct window *w) |
| 790 | { | 790 | { |
| 791 | struct frame *f = XFRAME (WINDOW_FRAME (w)); | 791 | struct frame *f = XFRAME (WINDOW_FRAME (w)); |
| 792 | int width = XINT (w->total_cols); | 792 | int width = w->total_cols; |
| 793 | 793 | ||
| 794 | if (WINDOW_HAS_VERTICAL_SCROLL_BAR (w)) | 794 | if (WINDOW_HAS_VERTICAL_SCROLL_BAR (w)) |
| 795 | /* Scroll bars occupy a few columns. */ | 795 | /* Scroll bars occupy a few columns. */ |
| @@ -2007,12 +2007,12 @@ replace_window (Lisp_Object old, Lisp_Object new, int setflag) | |||
| 2007 | if (EQ (old, FRAME_ROOT_WINDOW (XFRAME (o->frame)))) | 2007 | if (EQ (old, FRAME_ROOT_WINDOW (XFRAME (o->frame)))) |
| 2008 | fset_root_window (XFRAME (o->frame), new); | 2008 | fset_root_window (XFRAME (o->frame), new); |
| 2009 | 2009 | ||
| 2010 | if (setflag) | 2010 | if (setflag) |
| 2011 | { | 2011 | { |
| 2012 | wset_left_col (n, o->left_col); | 2012 | n->left_col = o->left_col; |
| 2013 | wset_top_line (n, o->top_line); | 2013 | n->top_line = o->top_line; |
| 2014 | wset_total_cols (n, o->total_cols); | 2014 | n->total_cols = o->total_cols; |
| 2015 | wset_total_lines (n, o->total_lines); | 2015 | n->total_lines = o->total_lines; |
| 2016 | wset_normal_cols (n, o->normal_cols); | 2016 | wset_normal_cols (n, o->normal_cols); |
| 2017 | wset_normal_cols (o, make_float (1.0)); | 2017 | wset_normal_cols (o, make_float (1.0)); |
| 2018 | wset_normal_lines (n, o->normal_lines); | 2018 | wset_normal_lines (n, o->normal_lines); |
| @@ -2097,12 +2097,12 @@ recombine_windows (Lisp_Object window) | |||
| 2097 | 2097 | ||
| 2098 | if (horflag) | 2098 | if (horflag) |
| 2099 | wset_normal_cols (c, | 2099 | wset_normal_cols (c, |
| 2100 | make_float (XFLOATINT (c->total_cols) | 2100 | make_float ((double) c->total_cols |
| 2101 | / XFLOATINT (p->total_cols))); | 2101 | / (double) p->total_cols)); |
| 2102 | else | 2102 | else |
| 2103 | wset_normal_lines (c, | 2103 | wset_normal_lines (c, |
| 2104 | make_float (XFLOATINT (c->total_lines) | 2104 | make_float ((double) c->total_lines |
| 2105 | / XFLOATINT (p->total_lines))); | 2105 | / (double) p->total_lines)); |
| 2106 | 2106 | ||
| 2107 | if (NILP (c->next)) | 2107 | if (NILP (c->next)) |
| 2108 | { | 2108 | { |
| @@ -2861,9 +2861,8 @@ window-start value is reasonable when this function is called. */) | |||
| 2861 | if (NILP (w->buffer)) | 2861 | if (NILP (w->buffer)) |
| 2862 | { | 2862 | { |
| 2863 | /* Resize child windows vertically. */ | 2863 | /* Resize child windows vertically. */ |
| 2864 | XSETINT (delta, XINT (r->total_lines) | 2864 | XSETINT (delta, r->total_lines - w->total_lines); |
| 2865 | - XINT (w->total_lines)); | 2865 | w->top_line = r->top_line; |
| 2866 | wset_top_line (w, r->top_line); | ||
| 2867 | resize_root_window (window, delta, Qnil, Qnil); | 2866 | resize_root_window (window, delta, Qnil, Qnil); |
| 2868 | if (window_resize_check (w, 0)) | 2867 | if (window_resize_check (w, 0)) |
| 2869 | window_resize_apply (w, 0); | 2868 | window_resize_apply (w, 0); |
| @@ -2879,10 +2878,8 @@ window-start value is reasonable when this function is called. */) | |||
| 2879 | /* Resize child windows horizontally. */ | 2878 | /* Resize child windows horizontally. */ |
| 2880 | if (!resize_failed) | 2879 | if (!resize_failed) |
| 2881 | { | 2880 | { |
| 2882 | wset_left_col (w, r->left_col); | 2881 | w->left_col = r->left_col; |
| 2883 | XSETINT (delta, | 2882 | XSETINT (delta, r->total_cols - w->total_cols); |
| 2884 | XINT (r->total_cols) - XINT (w->total_cols)); | ||
| 2885 | wset_left_col (w, r->left_col); | ||
| 2886 | resize_root_window (window, delta, Qt, Qnil); | 2883 | resize_root_window (window, delta, Qt, Qnil); |
| 2887 | if (window_resize_check (w, 1)) | 2884 | if (window_resize_check (w, 1)) |
| 2888 | window_resize_apply (w, 1); | 2885 | window_resize_apply (w, 1); |
| @@ -3453,10 +3450,6 @@ make_window (void) | |||
| 3453 | w = allocate_window (); | 3450 | w = allocate_window (); |
| 3454 | /* Initialize Lisp data. Note that allocate_window initializes all | 3451 | /* Initialize Lisp data. Note that allocate_window initializes all |
| 3455 | Lisp data to nil, so do it only for slots which should not be nil. */ | 3452 | Lisp data to nil, so do it only for slots which should not be nil. */ |
| 3456 | wset_left_col (w, make_number (0)); | ||
| 3457 | wset_top_line (w, make_number (0)); | ||
| 3458 | wset_total_lines (w, make_number (0)); | ||
| 3459 | wset_total_cols (w, make_number (0)); | ||
| 3460 | wset_normal_lines (w, make_float (1.0)); | 3453 | wset_normal_lines (w, make_float (1.0)); |
| 3461 | wset_normal_cols (w, make_float (1.0)); | 3454 | wset_normal_cols (w, make_float (1.0)); |
| 3462 | wset_new_total (w, make_number (0)); | 3455 | wset_new_total (w, make_number (0)); |
| @@ -3617,19 +3610,19 @@ window_resize_apply (struct window *w, bool horflag) | |||
| 3617 | parent window has been set *before*. */ | 3610 | parent window has been set *before*. */ |
| 3618 | if (horflag) | 3611 | if (horflag) |
| 3619 | { | 3612 | { |
| 3620 | wset_total_cols (w, w->new_total); | 3613 | w->total_cols = XFASTINT (w->new_total); |
| 3621 | if (NUMBERP (w->new_normal)) | 3614 | if (NUMBERP (w->new_normal)) |
| 3622 | wset_normal_cols (w, w->new_normal); | 3615 | wset_normal_cols (w, w->new_normal); |
| 3623 | 3616 | ||
| 3624 | pos = XINT (w->left_col); | 3617 | pos = w->left_col; |
| 3625 | } | 3618 | } |
| 3626 | else | 3619 | else |
| 3627 | { | 3620 | { |
| 3628 | wset_total_lines (w, w->new_total); | 3621 | w->total_lines = XFASTINT (w->new_total); |
| 3629 | if (NUMBERP (w->new_normal)) | 3622 | if (NUMBERP (w->new_normal)) |
| 3630 | wset_normal_lines (w, w->new_normal); | 3623 | wset_normal_lines (w, w->new_normal); |
| 3631 | 3624 | ||
| 3632 | pos = XINT (w->top_line); | 3625 | pos = w->top_line; |
| 3633 | } | 3626 | } |
| 3634 | 3627 | ||
| 3635 | if (!NILP (w->vchild)) | 3628 | if (!NILP (w->vchild)) |
| @@ -3639,12 +3632,12 @@ window_resize_apply (struct window *w, bool horflag) | |||
| 3639 | while (c) | 3632 | while (c) |
| 3640 | { | 3633 | { |
| 3641 | if (horflag) | 3634 | if (horflag) |
| 3642 | wset_left_col (c, make_number (pos)); | 3635 | c->left_col = pos; |
| 3643 | else | 3636 | else |
| 3644 | wset_top_line (c, make_number (pos)); | 3637 | c->top_line = pos; |
| 3645 | window_resize_apply (c, horflag); | 3638 | window_resize_apply (c, horflag); |
| 3646 | if (!horflag) | 3639 | if (!horflag) |
| 3647 | pos = pos + XINT (c->total_lines); | 3640 | pos = pos + c->total_lines; |
| 3648 | c = NILP (c->next) ? 0 : XWINDOW (c->next); | 3641 | c = NILP (c->next) ? 0 : XWINDOW (c->next); |
| 3649 | } | 3642 | } |
| 3650 | } | 3643 | } |
| @@ -3655,12 +3648,12 @@ window_resize_apply (struct window *w, bool horflag) | |||
| 3655 | while (c) | 3648 | while (c) |
| 3656 | { | 3649 | { |
| 3657 | if (horflag) | 3650 | if (horflag) |
| 3658 | wset_left_col (c, make_number (pos)); | 3651 | c->left_col = pos; |
| 3659 | else | 3652 | else |
| 3660 | wset_top_line (c, make_number (pos)); | 3653 | c->top_line = pos; |
| 3661 | window_resize_apply (c, horflag); | 3654 | window_resize_apply (c, horflag); |
| 3662 | if (horflag) | 3655 | if (horflag) |
| 3663 | pos = pos + XINT (c->total_cols); | 3656 | pos = pos + c->total_cols; |
| 3664 | c = NILP (c->next) ? 0 : XWINDOW (c->next); | 3657 | c = NILP (c->next) ? 0 : XWINDOW (c->next); |
| 3665 | } | 3658 | } |
| 3666 | } | 3659 | } |
| @@ -3692,8 +3685,8 @@ be applied on the Elisp level. */) | |||
| 3692 | bool horflag = !NILP (horizontal); | 3685 | bool horflag = !NILP (horizontal); |
| 3693 | 3686 | ||
| 3694 | if (!window_resize_check (r, horflag) | 3687 | if (!window_resize_check (r, horflag) |
| 3695 | || ! EQ (r->new_total, | 3688 | || (XINT (r->new_total) |
| 3696 | (horflag ? r->total_cols : r->total_lines))) | 3689 | != (horflag ? r->total_cols : r->total_lines))) |
| 3697 | return Qnil; | 3690 | return Qnil; |
| 3698 | 3691 | ||
| 3699 | block_input (); | 3692 | block_input (); |
| @@ -3733,18 +3726,17 @@ resize_frame_windows (struct frame *f, int size, bool horflag) | |||
| 3733 | - ((FRAME_HAS_MINIBUF_P (f) && !FRAME_MINIBUF_ONLY_P (f)) | 3726 | - ((FRAME_HAS_MINIBUF_P (f) && !FRAME_MINIBUF_ONLY_P (f)) |
| 3734 | ? 1 : 0))); | 3727 | ? 1 : 0))); |
| 3735 | 3728 | ||
| 3736 | wset_top_line (r, make_number (FRAME_TOP_MARGIN (f))); | 3729 | r->top_line = FRAME_TOP_MARGIN (f); |
| 3737 | if (NILP (r->vchild) && NILP (r->hchild)) | 3730 | if (NILP (r->vchild) && NILP (r->hchild)) |
| 3738 | /* For a leaf root window just set the size. */ | 3731 | /* For a leaf root window just set the size. */ |
| 3739 | if (horflag) | 3732 | if (horflag) |
| 3740 | wset_total_cols (r, make_number (new_size)); | 3733 | r->total_cols = new_size; |
| 3741 | else | 3734 | else |
| 3742 | wset_total_lines (r, make_number (new_size)); | 3735 | r->total_lines = new_size; |
| 3743 | else | 3736 | else |
| 3744 | { | 3737 | { |
| 3745 | /* old_size is the old size of the frame's root window. */ | 3738 | /* old_size is the old size of the frame's root window. */ |
| 3746 | int old_size = XFASTINT (horflag ? r->total_cols | 3739 | int old_size = horflag ? r->total_cols : r->total_lines; |
| 3747 | : r->total_lines); | ||
| 3748 | Lisp_Object delta; | 3740 | Lisp_Object delta; |
| 3749 | 3741 | ||
| 3750 | XSETINT (delta, new_size - old_size); | 3742 | XSETINT (delta, new_size - old_size); |
| @@ -3774,9 +3766,9 @@ resize_frame_windows (struct frame *f, int size, bool horflag) | |||
| 3774 | root = f->selected_window; | 3766 | root = f->selected_window; |
| 3775 | Fdelete_other_windows_internal (root, Qnil); | 3767 | Fdelete_other_windows_internal (root, Qnil); |
| 3776 | if (horflag) | 3768 | if (horflag) |
| 3777 | wset_total_cols (XWINDOW (root), make_number (new_size)); | 3769 | XWINDOW (root)->total_cols = new_size; |
| 3778 | else | 3770 | else |
| 3779 | wset_total_lines (XWINDOW (root), make_number (new_size)); | 3771 | XWINDOW (root)->total_lines = new_size; |
| 3780 | } | 3772 | } |
| 3781 | } | 3773 | } |
| 3782 | } | 3774 | } |
| @@ -3786,13 +3778,12 @@ resize_frame_windows (struct frame *f, int size, bool horflag) | |||
| 3786 | { | 3778 | { |
| 3787 | m = XWINDOW (mini); | 3779 | m = XWINDOW (mini); |
| 3788 | if (horflag) | 3780 | if (horflag) |
| 3789 | wset_total_cols (m, make_number (size)); | 3781 | m->total_cols = size; |
| 3790 | else | 3782 | else |
| 3791 | { | 3783 | { |
| 3792 | /* Are we sure we always want 1 line here? */ | 3784 | /* Are we sure we always want 1 line here? */ |
| 3793 | wset_total_lines (m, make_number (1)); | 3785 | m->total_lines = 1; |
| 3794 | wset_top_line | 3786 | m->top_line = r->top_line + r->total_lines; |
| 3795 | (m, make_number (XINT (r->top_line) + XINT (r->total_lines))); | ||
| 3796 | } | 3787 | } |
| 3797 | } | 3788 | } |
| 3798 | 3789 | ||
| @@ -3876,20 +3867,21 @@ set correctly. See the code of `split-window' for how this is done. */) | |||
| 3876 | p = XWINDOW (o->parent); | 3867 | p = XWINDOW (o->parent); |
| 3877 | /* Temporarily pretend we split the parent window. */ | 3868 | /* Temporarily pretend we split the parent window. */ |
| 3878 | wset_new_total | 3869 | wset_new_total |
| 3879 | (p, make_number (XINT (horflag ? p->total_cols : p->total_lines) | 3870 | (p, make_number ((horflag ? p->total_cols : p->total_lines) |
| 3880 | - XINT (total_size))); | 3871 | - XINT (total_size))); |
| 3881 | if (!window_resize_check (p, horflag)) | 3872 | if (!window_resize_check (p, horflag)) |
| 3882 | error ("Window sizes don't fit"); | 3873 | error ("Window sizes don't fit"); |
| 3883 | else | 3874 | else |
| 3884 | /* Undo the temporary pretension. */ | 3875 | /* Undo the temporary pretension. */ |
| 3885 | wset_new_total (p, horflag ? p->total_cols : p->total_lines); | 3876 | wset_new_total (p, make_number |
| 3877 | (horflag ? p->total_cols : p->total_lines)); | ||
| 3886 | } | 3878 | } |
| 3887 | else | 3879 | else |
| 3888 | { | 3880 | { |
| 3889 | if (!window_resize_check (o, horflag)) | 3881 | if (!window_resize_check (o, horflag)) |
| 3890 | error ("Resizing old window failed"); | 3882 | error ("Resizing old window failed"); |
| 3891 | else if (XINT (total_size) + XINT (o->new_total) | 3883 | else if (XINT (total_size) + XINT (o->new_total) |
| 3892 | != XINT (horflag ? o->total_cols : o->total_lines)) | 3884 | != (horflag ? o->total_cols : o->total_lines)) |
| 3893 | error ("Sum of sizes of old and new window don't fit"); | 3885 | error ("Sum of sizes of old and new window don't fit"); |
| 3894 | } | 3886 | } |
| 3895 | 3887 | ||
| @@ -3909,7 +3901,8 @@ set correctly. See the code of `split-window' for how this is done. */) | |||
| 3909 | that its children get merged into another window. */ | 3901 | that its children get merged into another window. */ |
| 3910 | wset_combination_limit (p, Qt); | 3902 | wset_combination_limit (p, Qt); |
| 3911 | /* These get applied below. */ | 3903 | /* These get applied below. */ |
| 3912 | wset_new_total (p, horflag ? o->total_cols : o->total_lines); | 3904 | wset_new_total (p, make_number |
| 3905 | (horflag ? o->total_cols : o->total_lines)); | ||
| 3913 | wset_new_normal (p, new_normal); | 3906 | wset_new_normal (p, new_normal); |
| 3914 | } | 3907 | } |
| 3915 | else | 3908 | else |
| @@ -3961,13 +3954,13 @@ set correctly. See the code of `split-window' for how this is done. */) | |||
| 3961 | /* Directly assign orthogonal coordinates and sizes. */ | 3954 | /* Directly assign orthogonal coordinates and sizes. */ |
| 3962 | if (horflag) | 3955 | if (horflag) |
| 3963 | { | 3956 | { |
| 3964 | wset_top_line (n, o->top_line); | 3957 | n->top_line = o->top_line; |
| 3965 | wset_total_lines (n, o->total_lines); | 3958 | n->total_lines = o->total_lines; |
| 3966 | } | 3959 | } |
| 3967 | else | 3960 | else |
| 3968 | { | 3961 | { |
| 3969 | wset_left_col (n, o->left_col); | 3962 | n->left_col = o->left_col; |
| 3970 | wset_total_cols (n, o->total_cols); | 3963 | n->total_cols = o->total_cols; |
| 3971 | } | 3964 | } |
| 3972 | 3965 | ||
| 3973 | /* Iso-coordinates and sizes are assigned by window_resize_apply, | 3966 | /* Iso-coordinates and sizes are assigned by window_resize_apply, |
| @@ -4056,8 +4049,8 @@ Signal an error when WINDOW is the only window on its frame. */) | |||
| 4056 | } | 4049 | } |
| 4057 | 4050 | ||
| 4058 | if (window_resize_check (r, horflag) | 4051 | if (window_resize_check (r, horflag) |
| 4059 | && EQ (r->new_total, | 4052 | && (XINT (r->new_total) |
| 4060 | (horflag ? r->total_cols : r->total_lines))) | 4053 | == (horflag ? r->total_cols : r->total_lines))) |
| 4061 | /* We can delete WINDOW now. */ | 4054 | /* We can delete WINDOW now. */ |
| 4062 | { | 4055 | { |
| 4063 | 4056 | ||
| @@ -4203,10 +4196,8 @@ grow_mini_window (struct window *w, int delta) | |||
| 4203 | window_resize_apply (r, 0); | 4196 | window_resize_apply (r, 0); |
| 4204 | 4197 | ||
| 4205 | /* Grow the mini-window. */ | 4198 | /* Grow the mini-window. */ |
| 4206 | wset_top_line | 4199 | w->top_line = r->top_line + r->total_lines; |
| 4207 | (w, make_number (XFASTINT (r->top_line) + XFASTINT (r->total_lines))); | 4200 | w->total_lines -= XINT (value); |
| 4208 | wset_total_lines | ||
| 4209 | (w, make_number (XFASTINT (w->total_lines) - XINT (value))); | ||
| 4210 | w->last_modified = 0; | 4201 | w->last_modified = 0; |
| 4211 | w->last_overlay_modified = 0; | 4202 | w->last_overlay_modified = 0; |
| 4212 | 4203 | ||
| @@ -4228,7 +4219,7 @@ shrink_mini_window (struct window *w) | |||
| 4228 | 4219 | ||
| 4229 | eassert (MINI_WINDOW_P (w)); | 4220 | eassert (MINI_WINDOW_P (w)); |
| 4230 | 4221 | ||
| 4231 | size = XINT (w->total_lines); | 4222 | size = w->total_lines; |
| 4232 | if (size > 1) | 4223 | if (size > 1) |
| 4233 | { | 4224 | { |
| 4234 | root = FRAME_ROOT_WINDOW (f); | 4225 | root = FRAME_ROOT_WINDOW (f); |
| @@ -4241,9 +4232,8 @@ shrink_mini_window (struct window *w) | |||
| 4241 | window_resize_apply (r, 0); | 4232 | window_resize_apply (r, 0); |
| 4242 | 4233 | ||
| 4243 | /* Shrink the mini-window. */ | 4234 | /* Shrink the mini-window. */ |
| 4244 | wset_top_line (w, make_number (XFASTINT (r->top_line) | 4235 | w->top_line = r->top_line + r->total_lines; |
| 4245 | + XFASTINT (r->total_lines))); | 4236 | w->total_lines = 1; |
| 4246 | wset_total_lines (w, make_number (1)); | ||
| 4247 | 4237 | ||
| 4248 | w->last_modified = 0; | 4238 | w->last_modified = 0; |
| 4249 | w->last_overlay_modified = 0; | 4239 | w->last_overlay_modified = 0; |
| @@ -4277,7 +4267,7 @@ DEFUN ("resize-mini-window-internal", Fresize_mini_window_internal, Sresize_mini | |||
| 4277 | error ("Cannot resize a minibuffer-only frame"); | 4267 | error ("Cannot resize a minibuffer-only frame"); |
| 4278 | 4268 | ||
| 4279 | r = XWINDOW (FRAME_ROOT_WINDOW (f)); | 4269 | r = XWINDOW (FRAME_ROOT_WINDOW (f)); |
| 4280 | height = XINT (r->total_lines) + XINT (w->total_lines); | 4270 | height = r->total_lines + w->total_lines; |
| 4281 | if (window_resize_check (r, 0) | 4271 | if (window_resize_check (r, 0) |
| 4282 | && XINT (w->new_total) > 0 | 4272 | && XINT (w->new_total) > 0 |
| 4283 | && height == XINT (r->new_total) + XINT (w->new_total)) | 4273 | && height == XINT (r->new_total) + XINT (w->new_total)) |
| @@ -4285,9 +4275,8 @@ DEFUN ("resize-mini-window-internal", Fresize_mini_window_internal, Sresize_mini | |||
| 4285 | block_input (); | 4275 | block_input (); |
| 4286 | window_resize_apply (r, 0); | 4276 | window_resize_apply (r, 0); |
| 4287 | 4277 | ||
| 4288 | wset_total_lines (w, w->new_total); | 4278 | w->total_lines = XFASTINT (w->new_total); |
| 4289 | wset_top_line (w, make_number (XINT (r->top_line) | 4279 | w->top_line = r->top_line + r->total_lines; |
| 4290 | + XINT (r->total_lines))); | ||
| 4291 | 4280 | ||
| 4292 | windows_or_buffers_changed++; | 4281 | windows_or_buffers_changed++; |
| 4293 | FRAME_WINDOW_SIZES_CHANGED (f) = 1; | 4282 | FRAME_WINDOW_SIZES_CHANGED (f) = 1; |
| @@ -4327,7 +4316,7 @@ mark_window_cursors_off (struct window *w) | |||
| 4327 | int | 4316 | int |
| 4328 | window_internal_height (struct window *w) | 4317 | window_internal_height (struct window *w) |
| 4329 | { | 4318 | { |
| 4330 | int ht = XFASTINT (w->total_lines); | 4319 | int ht = w->total_lines; |
| 4331 | 4320 | ||
| 4332 | if (!MINI_WINDOW_P (w)) | 4321 | if (!MINI_WINDOW_P (w)) |
| 4333 | { | 4322 | { |
| @@ -4637,7 +4626,7 @@ window_scroll_pixel_based (Lisp_Object window, int n, int whole, int noerror) | |||
| 4637 | even if there is a header line. */ | 4626 | even if there is a header line. */ |
| 4638 | this_scroll_margin = max (0, scroll_margin); | 4627 | this_scroll_margin = max (0, scroll_margin); |
| 4639 | this_scroll_margin | 4628 | this_scroll_margin |
| 4640 | = min (this_scroll_margin, XFASTINT (w->total_lines) / 4); | 4629 | = min (this_scroll_margin, w->total_lines / 4); |
| 4641 | this_scroll_margin *= FRAME_LINE_HEIGHT (it.f); | 4630 | this_scroll_margin *= FRAME_LINE_HEIGHT (it.f); |
| 4642 | 4631 | ||
| 4643 | if (n > 0) | 4632 | if (n > 0) |
| @@ -4814,7 +4803,7 @@ window_scroll_line_based (Lisp_Object window, int n, int whole, int noerror) | |||
| 4814 | { | 4803 | { |
| 4815 | /* Don't use a scroll margin that is negative or too large. */ | 4804 | /* Don't use a scroll margin that is negative or too large. */ |
| 4816 | int this_scroll_margin = | 4805 | int this_scroll_margin = |
| 4817 | max (0, min (scroll_margin, XINT (w->total_lines) / 4)); | 4806 | max (0, min (scroll_margin, w->total_lines / 4)); |
| 4818 | 4807 | ||
| 4819 | set_marker_restricted_both (w->start, w->buffer, pos, pos_byte); | 4808 | set_marker_restricted_both (w->start, w->buffer, pos, pos_byte); |
| 4820 | w->start_at_line_beg = !NILP (bolp); | 4809 | w->start_at_line_beg = !NILP (bolp); |
| @@ -5231,7 +5220,7 @@ and redisplay normally--don't erase and redraw the frame. */) | |||
| 5231 | /* Do this after making BUF current | 5220 | /* Do this after making BUF current |
| 5232 | in case scroll_margin is buffer-local. */ | 5221 | in case scroll_margin is buffer-local. */ |
| 5233 | this_scroll_margin = | 5222 | this_scroll_margin = |
| 5234 | max (0, min (scroll_margin, XFASTINT (w->total_lines) / 4)); | 5223 | max (0, min (scroll_margin, w->total_lines / 4)); |
| 5235 | 5224 | ||
| 5236 | /* Handle centering on a graphical frame specially. Such frames can | 5225 | /* Handle centering on a graphical frame specially. Such frames can |
| 5237 | have variable-height lines and centering point on the basis of | 5226 | have variable-height lines and centering point on the basis of |
| @@ -5705,7 +5694,7 @@ the return value is nil. Otherwise the value is t. */) | |||
| 5705 | wset_prev (w, Qnil); | 5694 | wset_prev (w, Qnil); |
| 5706 | if (!NILP (w->parent)) | 5695 | if (!NILP (w->parent)) |
| 5707 | { | 5696 | { |
| 5708 | if (EQ (p->total_cols, XWINDOW (w->parent)->total_cols)) | 5697 | if (XINT (p->total_cols) == XWINDOW (w->parent)->total_cols) |
| 5709 | { | 5698 | { |
| 5710 | wset_vchild (XWINDOW (w->parent), p->window); | 5699 | wset_vchild (XWINDOW (w->parent), p->window); |
| 5711 | wset_hchild (XWINDOW (w->parent), Qnil); | 5700 | wset_hchild (XWINDOW (w->parent), Qnil); |
| @@ -5721,10 +5710,10 @@ the return value is nil. Otherwise the value is t. */) | |||
| 5721 | /* If we squirreled away the buffer, restore it now. */ | 5710 | /* If we squirreled away the buffer, restore it now. */ |
| 5722 | if (BUFFERP (w->combination_limit)) | 5711 | if (BUFFERP (w->combination_limit)) |
| 5723 | wset_buffer (w, w->combination_limit); | 5712 | wset_buffer (w, w->combination_limit); |
| 5724 | wset_left_col (w, p->left_col); | 5713 | w->left_col = XFASTINT (p->left_col); |
| 5725 | wset_top_line (w, p->top_line); | 5714 | w->top_line = XFASTINT (p->top_line); |
| 5726 | wset_total_cols (w, p->total_cols); | 5715 | w->total_cols = XFASTINT (p->total_cols); |
| 5727 | wset_total_lines (w, p->total_lines); | 5716 | w->total_lines = XFASTINT (p->total_lines); |
| 5728 | wset_normal_cols (w, p->normal_cols); | 5717 | wset_normal_cols (w, p->normal_cols); |
| 5729 | wset_normal_lines (w, p->normal_lines); | 5718 | wset_normal_lines (w, p->normal_lines); |
| 5730 | w->hscroll = XFASTINT (p->hscroll); | 5719 | w->hscroll = XFASTINT (p->hscroll); |
| @@ -6038,10 +6027,10 @@ save_window_save (Lisp_Object window, struct Lisp_Vector *vector, int i) | |||
| 6038 | wset_temslot (w, make_number (i)); i++; | 6027 | wset_temslot (w, make_number (i)); i++; |
| 6039 | p->window = window; | 6028 | p->window = window; |
| 6040 | p->buffer = w->buffer; | 6029 | p->buffer = w->buffer; |
| 6041 | p->left_col = w->left_col; | 6030 | p->left_col = make_number (w->left_col); |
| 6042 | p->top_line = w->top_line; | 6031 | p->top_line = make_number (w->top_line); |
| 6043 | p->total_cols = w->total_cols; | 6032 | p->total_cols = make_number (w->total_cols); |
| 6044 | p->total_lines = w->total_lines; | 6033 | p->total_lines = make_number (w->total_lines); |
| 6045 | p->normal_cols = w->normal_cols; | 6034 | p->normal_cols = w->normal_cols; |
| 6046 | p->normal_lines = w->normal_lines; | 6035 | p->normal_lines = w->normal_lines; |
| 6047 | XSETFASTINT (p->hscroll, w->hscroll); | 6036 | XSETFASTINT (p->hscroll, w->hscroll); |