Commit 5f24fa51 authored by Dmitry Antipov's avatar Dmitry Antipov
Browse files

* window.h (struct window): Convert left_col, top_line, total_lines

and total_cols from Lisp_Objects to integers.  Adjust comments.
(wset_left_col, wset_top_line, wset_total_cols, wset_total_lines):
Remove.
(WINDOW_TOTAL_COLS, WINDOW_TOTAL_LINES, WINDOW_LEFT_EDGE_COL)
(WINDOW_TOP_EDGE_LINE): Drop Lisp_Object to integer conversion.
* dispnew.c, frame.c, w32fns.c, window.c, xdisp.c, xfns.c:
Adjust users where appropriate.
parent 96061a21
2013-03-20 Dmitry Antipov <dmantipov@yandex.ru>
* window.h (struct window): Convert left_col, top_line, total_lines
and total_cols from Lisp_Objects to integers. Adjust comments.
(wset_left_col, wset_top_line, wset_total_cols, wset_total_lines):
Remove.
(WINDOW_TOTAL_COLS, WINDOW_TOTAL_LINES, WINDOW_LEFT_EDGE_COL)
(WINDOW_TOP_EDGE_LINE): Drop Lisp_Object to integer conversion.
* dispnew.c, frame.c, w32fns.c, window.c, xdisp.c, xfns.c:
Adjust users where appropriate.
2013-03-20 Dmitry Antipov <dmantipov@yandex.ru> 2013-03-20 Dmitry Antipov <dmantipov@yandex.ru>
   
* frame.h (struct frame): Drop resx and resy because the same data is * frame.h (struct frame): Drop resx and resy because the same data is
......
...@@ -363,7 +363,7 @@ margin_glyphs_to_reserve (struct window *w, int total_glyphs, Lisp_Object margin ...@@ -363,7 +363,7 @@ margin_glyphs_to_reserve (struct window *w, int total_glyphs, Lisp_Object margin
if (NUMBERP (margin)) if (NUMBERP (margin))
{ {
int width = XFASTINT (w->total_cols); int width = w->total_cols;
double d = max (0, XFLOATINT (margin)); double d = max (0, XFLOATINT (margin));
d = min (width / 2 - 1, d); d = min (width / 2 - 1, d);
n = (int) ((double) total_glyphs / width * d); n = (int) ((double) total_glyphs / width * d);
...@@ -1776,7 +1776,7 @@ required_matrix_width (struct window *w) ...@@ -1776,7 +1776,7 @@ required_matrix_width (struct window *w)
} }
#endif /* HAVE_WINDOW_SYSTEM */ #endif /* HAVE_WINDOW_SYSTEM */
return XINT (w->total_cols); return w->total_cols;
} }
...@@ -2114,10 +2114,10 @@ adjust_frame_glyphs_for_window_redisplay (struct frame *f) ...@@ -2114,10 +2114,10 @@ adjust_frame_glyphs_for_window_redisplay (struct frame *f)
/* Set window dimensions to frame dimensions and allocate or /* Set window dimensions to frame dimensions and allocate or
adjust glyph matrices of W. */ adjust glyph matrices of W. */
wset_top_line (w, make_number (0)); w->top_line = 0;
wset_left_col (w, make_number (0)); w->left_col = 0;
wset_total_lines (w, make_number (FRAME_MENU_BAR_LINES (f))); w->total_lines = FRAME_MENU_BAR_LINES (f);
wset_total_cols (w, make_number (FRAME_TOTAL_COLS (f))); w->total_cols = FRAME_TOTAL_COLS (f);
allocate_matrices_for_window_redisplay (w); allocate_matrices_for_window_redisplay (w);
} }
#endif /* not USE_X_TOOLKIT && not USE_GTK */ #endif /* not USE_X_TOOLKIT && not USE_GTK */
...@@ -2140,10 +2140,10 @@ adjust_frame_glyphs_for_window_redisplay (struct frame *f) ...@@ -2140,10 +2140,10 @@ adjust_frame_glyphs_for_window_redisplay (struct frame *f)
else else
w = XWINDOW (f->tool_bar_window); w = XWINDOW (f->tool_bar_window);
wset_top_line (w, make_number (FRAME_MENU_BAR_LINES (f))); w->top_line = FRAME_MENU_BAR_LINES (f);
wset_left_col (w, make_number (0)); w->left_col = 0;
wset_total_lines (w, make_number (FRAME_TOOL_BAR_LINES (f))); w->total_lines = FRAME_TOOL_BAR_LINES (f);
wset_total_cols (w, make_number (FRAME_TOTAL_COLS (f))); w->total_cols = FRAME_TOTAL_COLS (f);
allocate_matrices_for_window_redisplay (w); allocate_matrices_for_window_redisplay (w);
} }
#endif #endif
...@@ -5583,7 +5583,7 @@ change_frame_size_1 (struct frame *f, int newheight, int newwidth, ...@@ -5583,7 +5583,7 @@ change_frame_size_1 (struct frame *f, int newheight, int newwidth,
FrameCols (FRAME_TTY (f)) = newwidth; FrameCols (FRAME_TTY (f)) = newwidth;
if (WINDOWP (f->tool_bar_window)) if (WINDOWP (f->tool_bar_window))
wset_total_cols (XWINDOW (f->tool_bar_window), make_number (newwidth)); XWINDOW (f->tool_bar_window)->total_cols = newwidth;
} }
FRAME_LINES (f) = newheight; FRAME_LINES (f) = newheight;
......
...@@ -155,8 +155,8 @@ set_menu_bar_lines_1 (Lisp_Object window, int n) ...@@ -155,8 +155,8 @@ set_menu_bar_lines_1 (Lisp_Object window, int n)
struct window *w = XWINDOW (window); struct window *w = XWINDOW (window);
w->last_modified = 0; w->last_modified = 0;
wset_top_line (w, make_number (XFASTINT (w->top_line) + n)); w->top_line += n;
wset_total_lines (w, make_number (XFASTINT (w->total_lines) - n)); w->total_lines -= n;
/* Handle just the top child in a vertical split. */ /* Handle just the top child in a vertical split. */
if (!NILP (w->vchild)) if (!NILP (w->vchild))
...@@ -332,14 +332,14 @@ make_frame (int mini_p) ...@@ -332,14 +332,14 @@ make_frame (int mini_p)
SET_FRAME_COLS (f, 10); SET_FRAME_COLS (f, 10);
FRAME_LINES (f) = 10; FRAME_LINES (f) = 10;
wset_total_cols (XWINDOW (root_window), make_number (10)); XWINDOW (root_window)->total_cols = 10;
wset_total_lines (XWINDOW (root_window), make_number (mini_p ? 9 : 10)); XWINDOW (root_window)->total_lines = mini_p ? 9 : 10;
if (mini_p) if (mini_p)
{ {
wset_total_cols (XWINDOW (mini_window), make_number (10)); XWINDOW (mini_window)->total_cols = 10;
wset_top_line (XWINDOW (mini_window), make_number (9)); XWINDOW (mini_window)->top_line = 9;
wset_total_lines (XWINDOW (mini_window), make_number (1)); XWINDOW (mini_window)->total_lines = 1;
} }
/* Choose a buffer for the frame's root window. */ /* Choose a buffer for the frame's root window. */
......
...@@ -5774,8 +5774,8 @@ Text larger than the specified size is clipped. */) ...@@ -5774,8 +5774,8 @@ Text larger than the specified size is clipped. */)
/* Set up the frame's root window. */ /* Set up the frame's root window. */
w = XWINDOW (FRAME_ROOT_WINDOW (f)); w = XWINDOW (FRAME_ROOT_WINDOW (f));
wset_left_col (w, make_number (0)); w->left_col = 0;
wset_top_line (w, make_number (0)); w->top_line = 0;
if (CONSP (Vx_max_tooltip_size) if (CONSP (Vx_max_tooltip_size)
&& INTEGERP (XCAR (Vx_max_tooltip_size)) && INTEGERP (XCAR (Vx_max_tooltip_size))
...@@ -5783,13 +5783,13 @@ Text larger than the specified size is clipped. */) ...@@ -5783,13 +5783,13 @@ Text larger than the specified size is clipped. */)
&& INTEGERP (XCDR (Vx_max_tooltip_size)) && INTEGERP (XCDR (Vx_max_tooltip_size))
&& XINT (XCDR (Vx_max_tooltip_size)) > 0) && XINT (XCDR (Vx_max_tooltip_size)) > 0)
{ {
wset_total_cols (w, XCAR (Vx_max_tooltip_size)); w->total_cols = XFASTINT (XCAR (Vx_max_tooltip_size));
wset_total_lines (w, XCDR (Vx_max_tooltip_size)); w->total_lines = XFASTINT (XCDR (Vx_max_tooltip_size));
} }
else else
{ {
wset_total_cols (w, make_number (80)); w->total_cols = 80;
wset_total_lines (w, make_number (40)); w->total_lines = 40;
} }
FRAME_TOTAL_COLS (f) = XINT (w->total_cols); FRAME_TOTAL_COLS (f) = XINT (w->total_cols);
...@@ -5860,7 +5860,7 @@ Text larger than the specified size is clipped. */) ...@@ -5860,7 +5860,7 @@ Text larger than the specified size is clipped. */)
/* w->total_cols and FRAME_TOTAL_COLS want the width in columns, /* w->total_cols and FRAME_TOTAL_COLS want the width in columns,
not in pixels. */ not in pixels. */
width /= WINDOW_FRAME_COLUMN_WIDTH (w); width /= WINDOW_FRAME_COLUMN_WIDTH (w);
wset_total_cols (w, make_number (width)); w->total_cols = width;
FRAME_TOTAL_COLS (f) = width; FRAME_TOTAL_COLS (f) = width;
adjust_glyphs (f); adjust_glyphs (f);
w->pseudo_window_p = 1; w->pseudo_window_p = 1;
......
...@@ -692,7 +692,7 @@ On a graphical display, this total height is reported as an ...@@ -692,7 +692,7 @@ On a graphical display, this total height is reported as an
integer multiple of the default character height. */) integer multiple of the default character height. */)
(Lisp_Object window) (Lisp_Object window)
{ {
return decode_valid_window (window)->total_lines; return make_number (decode_valid_window (window)->total_lines);
} }
DEFUN ("window-total-width", Fwindow_total_width, Swindow_total_width, 0, 1, 0, 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,7 +707,7 @@ On a graphical display, this total width is reported as an
integer multiple of the default character width. */) integer multiple of the default character width. */)
(Lisp_Object window) (Lisp_Object window)
{ {
return decode_valid_window (window)->total_cols; return make_number (decode_valid_window (window)->total_cols);
} }
DEFUN ("window-new-total", Fwindow_new_total, Swindow_new_total, 0, 1, 0, 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,7 +746,7 @@ value is 0 if there is no window to the left of WINDOW.
WINDOW must be a valid window and defaults to the selected one. */) WINDOW must be a valid window and defaults to the selected one. */)
(Lisp_Object window) (Lisp_Object window)
{ {
return decode_valid_window (window)->left_col; return make_number (decode_valid_window (window)->left_col);
} }
DEFUN ("window-top-line", Fwindow_top_line, Swindow_top_line, 0, 1, 0, DEFUN ("window-top-line", Fwindow_top_line, Swindow_top_line, 0, 1, 0,
...@@ -758,7 +758,7 @@ there is no window above WINDOW. ...@@ -758,7 +758,7 @@ there is no window above WINDOW.
WINDOW must be a valid window and defaults to the selected one. */) WINDOW must be a valid window and defaults to the selected one. */)
(Lisp_Object window) (Lisp_Object window)
{ {
return decode_valid_window (window)->top_line; return make_number (decode_valid_window (window)->top_line);
} }
/* Return the number of lines of W's body. Don't count any mode or /* 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,7 +767,7 @@ WINDOW must be a valid window and defaults to the selected one. */)
static int static int
window_body_lines (struct window *w) window_body_lines (struct window *w)
{ {
int height = XFASTINT (w->total_lines); int height = w->total_lines;
if (!MINI_WINDOW_P (w)) if (!MINI_WINDOW_P (w))
{ {
...@@ -789,7 +789,7 @@ int ...@@ -789,7 +789,7 @@ int
window_body_cols (struct window *w) window_body_cols (struct window *w)
{ {
struct frame *f = XFRAME (WINDOW_FRAME (w)); struct frame *f = XFRAME (WINDOW_FRAME (w));
int width = XINT (w->total_cols); int width = w->total_cols;
if (WINDOW_HAS_VERTICAL_SCROLL_BAR (w)) if (WINDOW_HAS_VERTICAL_SCROLL_BAR (w))
/* Scroll bars occupy a few columns. */ /* Scroll bars occupy a few columns. */
...@@ -2007,12 +2007,12 @@ replace_window (Lisp_Object old, Lisp_Object new, int setflag) ...@@ -2007,12 +2007,12 @@ replace_window (Lisp_Object old, Lisp_Object new, int setflag)
if (EQ (old, FRAME_ROOT_WINDOW (XFRAME (o->frame)))) if (EQ (old, FRAME_ROOT_WINDOW (XFRAME (o->frame))))
fset_root_window (XFRAME (o->frame), new); fset_root_window (XFRAME (o->frame), new);
if (setflag) if (setflag)
{ {
wset_left_col (n, o->left_col); n->left_col = o->left_col;
wset_top_line (n, o->top_line); n->top_line = o->top_line;
wset_total_cols (n, o->total_cols); n->total_cols = o->total_cols;
wset_total_lines (n, o->total_lines); n->total_lines = o->total_lines;
wset_normal_cols (n, o->normal_cols); wset_normal_cols (n, o->normal_cols);
wset_normal_cols (o, make_float (1.0)); wset_normal_cols (o, make_float (1.0));
wset_normal_lines (n, o->normal_lines); wset_normal_lines (n, o->normal_lines);
...@@ -2097,12 +2097,12 @@ recombine_windows (Lisp_Object window) ...@@ -2097,12 +2097,12 @@ recombine_windows (Lisp_Object window)
if (horflag) if (horflag)
wset_normal_cols (c, wset_normal_cols (c,
make_float (XFLOATINT (c->total_cols) make_float ((double) c->total_cols
/ XFLOATINT (p->total_cols))); / (double) p->total_cols));
else else
wset_normal_lines (c, wset_normal_lines (c,
make_float (XFLOATINT (c->total_lines) make_float ((double) c->total_lines
/ XFLOATINT (p->total_lines))); / (double) p->total_lines));
if (NILP (c->next)) if (NILP (c->next))
{ {
...@@ -2861,9 +2861,8 @@ window-start value is reasonable when this function is called. */) ...@@ -2861,9 +2861,8 @@ window-start value is reasonable when this function is called. */)
if (NILP (w->buffer)) if (NILP (w->buffer))
{ {
/* Resize child windows vertically. */ /* Resize child windows vertically. */
XSETINT (delta, XINT (r->total_lines) XSETINT (delta, r->total_lines - w->total_lines);
- XINT (w->total_lines)); w->top_line = r->top_line;
wset_top_line (w, r->top_line);
resize_root_window (window, delta, Qnil, Qnil); resize_root_window (window, delta, Qnil, Qnil);
if (window_resize_check (w, 0)) if (window_resize_check (w, 0))
window_resize_apply (w, 0); window_resize_apply (w, 0);
...@@ -2879,10 +2878,8 @@ window-start value is reasonable when this function is called. */) ...@@ -2879,10 +2878,8 @@ window-start value is reasonable when this function is called. */)
/* Resize child windows horizontally. */ /* Resize child windows horizontally. */
if (!resize_failed) if (!resize_failed)
{ {
wset_left_col (w, r->left_col); w->left_col = r->left_col;
XSETINT (delta, XSETINT (delta, r->total_cols - w->total_cols);
XINT (r->total_cols) - XINT (w->total_cols));
wset_left_col (w, r->left_col);
resize_root_window (window, delta, Qt, Qnil); resize_root_window (window, delta, Qt, Qnil);
if (window_resize_check (w, 1)) if (window_resize_check (w, 1))
window_resize_apply (w, 1); window_resize_apply (w, 1);
...@@ -3453,10 +3450,6 @@ make_window (void) ...@@ -3453,10 +3450,6 @@ make_window (void)
w = allocate_window (); w = allocate_window ();
/* Initialize Lisp data. Note that allocate_window initializes all /* Initialize Lisp data. Note that allocate_window initializes all
Lisp data to nil, so do it only for slots which should not be nil. */ Lisp data to nil, so do it only for slots which should not be nil. */
wset_left_col (w, make_number (0));
wset_top_line (w, make_number (0));
wset_total_lines (w, make_number (0));
wset_total_cols (w, make_number (0));
wset_normal_lines (w, make_float (1.0)); wset_normal_lines (w, make_float (1.0));
wset_normal_cols (w, make_float (1.0)); wset_normal_cols (w, make_float (1.0));
wset_new_total (w, make_number (0)); wset_new_total (w, make_number (0));
...@@ -3617,19 +3610,19 @@ window_resize_apply (struct window *w, bool horflag) ...@@ -3617,19 +3610,19 @@ window_resize_apply (struct window *w, bool horflag)
parent window has been set *before*. */ parent window has been set *before*. */
if (horflag) if (horflag)
{ {
wset_total_cols (w, w->new_total); w->total_cols = XFASTINT (w->new_total);
if (NUMBERP (w->new_normal)) if (NUMBERP (w->new_normal))
wset_normal_cols (w, w->new_normal); wset_normal_cols (w, w->new_normal);
pos = XINT (w->left_col); pos = w->left_col;
} }
else else
{ {
wset_total_lines (w, w->new_total); w->total_lines = XFASTINT (w->new_total);
if (NUMBERP (w->new_normal)) if (NUMBERP (w->new_normal))
wset_normal_lines (w, w->new_normal); wset_normal_lines (w, w->new_normal);
pos = XINT (w->top_line); pos = w->top_line;
} }
if (!NILP (w->vchild)) if (!NILP (w->vchild))
...@@ -3639,12 +3632,12 @@ window_resize_apply (struct window *w, bool horflag) ...@@ -3639,12 +3632,12 @@ window_resize_apply (struct window *w, bool horflag)
while (c) while (c)
{ {
if (horflag) if (horflag)
wset_left_col (c, make_number (pos)); c->left_col = pos;
else else
wset_top_line (c, make_number (pos)); c->top_line = pos;
window_resize_apply (c, horflag); window_resize_apply (c, horflag);
if (!horflag) if (!horflag)
pos = pos + XINT (c->total_lines); pos = pos + c->total_lines;
c = NILP (c->next) ? 0 : XWINDOW (c->next); c = NILP (c->next) ? 0 : XWINDOW (c->next);
} }
} }
...@@ -3655,12 +3648,12 @@ window_resize_apply (struct window *w, bool horflag) ...@@ -3655,12 +3648,12 @@ window_resize_apply (struct window *w, bool horflag)
while (c) while (c)
{ {
if (horflag) if (horflag)
wset_left_col (c, make_number (pos)); c->left_col = pos;
else else
wset_top_line (c, make_number (pos)); c->top_line = pos;
window_resize_apply (c, horflag); window_resize_apply (c, horflag);
if (horflag) if (horflag)
pos = pos + XINT (c->total_cols); pos = pos + c->total_cols;
c = NILP (c->next) ? 0 : XWINDOW (c->next); c = NILP (c->next) ? 0 : XWINDOW (c->next);
} }
} }
...@@ -3692,8 +3685,8 @@ be applied on the Elisp level. */) ...@@ -3692,8 +3685,8 @@ be applied on the Elisp level. */)
bool horflag = !NILP (horizontal); bool horflag = !NILP (horizontal);
if (!window_resize_check (r, horflag) if (!window_resize_check (r, horflag)
|| ! EQ (r->new_total, || (XINT (r->new_total)
(horflag ? r->total_cols : r->total_lines))) != (horflag ? r->total_cols : r->total_lines)))
return Qnil; return Qnil;
block_input (); block_input ();
...@@ -3733,18 +3726,17 @@ resize_frame_windows (struct frame *f, int size, bool horflag) ...@@ -3733,18 +3726,17 @@ resize_frame_windows (struct frame *f, int size, bool horflag)
- ((FRAME_HAS_MINIBUF_P (f) && !FRAME_MINIBUF_ONLY_P (f)) - ((FRAME_HAS_MINIBUF_P (f) && !FRAME_MINIBUF_ONLY_P (f))
? 1 : 0))); ? 1 : 0)));
wset_top_line (r, make_number (FRAME_TOP_MARGIN (f))); r->top_line = FRAME_TOP_MARGIN (f);
if (NILP (r->vchild) && NILP (r->hchild)) if (NILP (r->vchild) && NILP (r->hchild))
/* For a leaf root window just set the size. */ /* For a leaf root window just set the size. */
if (horflag) if (horflag)
wset_total_cols (r, make_number (new_size)); r->total_cols = new_size;
else else
wset_total_lines (r, make_number (new_size)); r->total_lines = new_size;
else else
{ {
/* old_size is the old size of the frame's root window. */ /* old_size is the old size of the frame's root window. */
int old_size = XFASTINT (horflag ? r->total_cols int old_size = horflag ? r->total_cols : r->total_lines;
: r->total_lines);
Lisp_Object delta; Lisp_Object delta;
XSETINT (delta, new_size - old_size); XSETINT (delta, new_size - old_size);
...@@ -3774,9 +3766,9 @@ resize_frame_windows (struct frame *f, int size, bool horflag) ...@@ -3774,9 +3766,9 @@ resize_frame_windows (struct frame *f, int size, bool horflag)
root = f->selected_window; root = f->selected_window;
Fdelete_other_windows_internal (root, Qnil); Fdelete_other_windows_internal (root, Qnil);
if (horflag) if (horflag)
wset_total_cols (XWINDOW (root), make_number (new_size)); XWINDOW (root)->total_cols = new_size;
else else
wset_total_lines (XWINDOW (root), make_number (new_size)); XWINDOW (root)->total_lines = new_size;
} }
} }
} }
...@@ -3786,13 +3778,12 @@ resize_frame_windows (struct frame *f, int size, bool horflag) ...@@ -3786,13 +3778,12 @@ resize_frame_windows (struct frame *f, int size, bool horflag)
{ {
m = XWINDOW (mini); m = XWINDOW (mini);
if (horflag) if (horflag)
wset_total_cols (m, make_number (size)); m->total_cols = size;
else else
{ {
/* Are we sure we always want 1 line here? */ /* Are we sure we always want 1 line here? */
wset_total_lines (m, make_number (1)); m->total_lines = 1;
wset_top_line m->top_line = r->top_line + r->total_lines;
(m, make_number (XINT (r->top_line) + XINT (r->total_lines)));
} }
} }
...@@ -3876,20 +3867,21 @@ set correctly. See the code of `split-window' for how this is done. */) ...@@ -3876,20 +3867,21 @@ set correctly. See the code of `split-window' for how this is done. */)
p = XWINDOW (o->parent); p = XWINDOW (o->parent);
/* Temporarily pretend we split the parent window. */ /* Temporarily pretend we split the parent window. */
wset_new_total wset_new_total
(p, make_number (XINT (horflag ? p->total_cols : p->total_lines) (p, make_number ((horflag ? p->total_cols : p->total_lines)
- XINT (total_size))); - XINT (total_size)));
if (!window_resize_check (p, horflag)) if (!window_resize_check (p, horflag))
error ("Window sizes don't fit"); error ("Window sizes don't fit");
else else
/* Undo the temporary pretension. */ /* Undo the temporary pretension. */
wset_new_total (p, horflag ? p->total_cols : p->total_lines); wset_new_total (p, make_number
(horflag ? p->total_cols : p->total_lines));
} }
else else
{ {
if (!window_resize_check (o, horflag)) if (!window_resize_check (o, horflag))
error ("Resizing old window failed"); error ("Resizing old window failed");
else if (XINT (total_size) + XINT (o->new_total) else if (XINT (total_size) + XINT (o->new_total)
!= XINT (horflag ? o->total_cols : o->total_lines)) != (horflag ? o->total_cols : o->total_lines))
error ("Sum of sizes of old and new window don't fit"); error ("Sum of sizes of old and new window don't fit");
} }
...@@ -3909,7 +3901,8 @@ set correctly. See the code of `split-window' for how this is done. */) ...@@ -3909,7 +3901,8 @@ set correctly. See the code of `split-window' for how this is done. */)
that its children get merged into another window. */ that its children get merged into another window. */
wset_combination_limit (p, Qt); wset_combination_limit (p, Qt);
/* These get applied below. */ /* These get applied below. */
wset_new_total (p, horflag ? o->total_cols : o->total_lines); wset_new_total (p, make_number
(horflag ? o->total_cols : o->total_lines));
wset_new_normal (p, new_normal); wset_new_normal (p, new_normal);
} }
else else
...@@ -3961,13 +3954,13 @@ set correctly. See the code of `split-window' for how this is done. */) ...@@ -3961,13 +3954,13 @@ set correctly. See the code of `split-window' for how this is done. */)
/* Directly assign orthogonal coordinates and sizes. */ /* Directly assign orthogonal coordinates and sizes. */
if (horflag) if (horflag)
{ {
wset_top_line (n, o->top_line); n->top_line = o->top_line;
wset_total_lines (n, o->total_lines); n->total_lines = o->total_lines;
} }
else else
{ {
wset_left_col (n, o->left_col); n->left_col = o->left_col;
wset_total_cols (n, o->total_cols); n->total_cols = o->total_cols;
} }
/* Iso-coordinates and sizes are assigned by window_resize_apply, /* 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,8 +4049,8 @@ Signal an error when WINDOW is the only window on its frame. */)
} }
if (window_resize_check (r, horflag) if (window_resize_check (r, horflag)
&& EQ (r->new_total, && (XINT (r->new_total)
(horflag ? r->total_cols : r->total_lines))) == (horflag ? r->total_cols : r->total_lines)))
/* We can delete WINDOW now. */ /* We can delete WINDOW now. */