aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDmitry Antipov2012-08-07 11:33:18 +0400
committerDmitry Antipov2012-08-07 11:33:18 +0400
commitd3d50620ed3a8066c15ae3d3701b83371ca5382a (patch)
tree817b59ba17d232cd087b0b24d84683c8ff094f62 /src
parentd10a51dcdfab2d9283bd2e3229330c511d5af193 (diff)
downloademacs-d3d50620ed3a8066c15ae3d3701b83371ca5382a.tar.gz
emacs-d3d50620ed3a8066c15ae3d3701b83371ca5382a.zip
Drop WGET and revert read access to Lisp_Objects slots of struct window.
* window.h (WGET): Remove. (struct window): Do not use INTERNAL_FIELD. * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c: * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c: * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m: * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c: * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog12
-rw-r--r--src/alloc.c2
-rw-r--r--src/buffer.c18
-rw-r--r--src/composite.c4
-rw-r--r--src/dispextern.h14
-rw-r--r--src/dispnew.c225
-rw-r--r--src/editfns.c8
-rw-r--r--src/fileio.c4
-rw-r--r--src/font.c4
-rw-r--r--src/fontset.c2
-rw-r--r--src/frame.c34
-rw-r--r--src/frame.h2
-rw-r--r--src/fringe.c14
-rw-r--r--src/indent.c24
-rw-r--r--src/insdel.c2
-rw-r--r--src/keyboard.c32
-rw-r--r--src/keymap.c6
-rw-r--r--src/lisp.h2
-rw-r--r--src/minibuf.c8
-rw-r--r--src/msdos.c8
-rw-r--r--src/nsfns.m2
-rw-r--r--src/nsmenu.m2
-rw-r--r--src/nsterm.m27
-rw-r--r--src/print.c4
-rw-r--r--src/textprop.c2
-rw-r--r--src/w32fns.c4
-rw-r--r--src/w32menu.c2
-rw-r--r--src/w32term.c26
-rw-r--r--src/window.c935
-rw-r--r--src/window.h224
-rw-r--r--src/xdisp.c557
-rw-r--r--src/xfaces.c12
-rw-r--r--src/xfns.c6
-rw-r--r--src/xmenu.c2
-rw-r--r--src/xterm.c38
35 files changed, 1134 insertions, 1134 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 727e3ca9819..0c7d927bf0e 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,15 @@
12012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2
3 Drop WGET and revert read access to Lisp_Objects slots of struct window.
4 * window.h (WGET): Remove.
5 (struct window): Do not use INTERNAL_FIELD.
6 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
7 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
8 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
9 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
10 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
11 Adjust users.
12
12012-08-07 Chong Yidong <cyd@gnu.org> 132012-08-07 Chong Yidong <cyd@gnu.org>
2 14
3 * window.c (Fwindow_edges, Fwindow_pixel_edges) 15 * window.c (Fwindow_edges, Fwindow_pixel_edges)
diff --git a/src/alloc.c b/src/alloc.c
index 8d7980932cf..615d2f37afa 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -6014,7 +6014,7 @@ mark_object (Lisp_Object arg)
6014 /* Mark glyphs for leaf windows. Marking window 6014 /* Mark glyphs for leaf windows. Marking window
6015 matrices is sufficient because frame matrices 6015 matrices is sufficient because frame matrices
6016 use the same glyph memory. */ 6016 use the same glyph memory. */
6017 if (NILP (WGET (w, hchild)) && NILP (WGET (w, vchild)) 6017 if (NILP (w->hchild) && NILP (w->vchild)
6018 && w->current_matrix) 6018 && w->current_matrix)
6019 { 6019 {
6020 mark_glyph_matrix (w->current_matrix); 6020 mark_glyph_matrix (w->current_matrix);
diff --git a/src/buffer.c b/src/buffer.c
index 38399609718..df1b2328394 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -1560,7 +1560,7 @@ cleaning up all windows currently displaying the buffer to be killed. */)
1560 since anything can happen within do_yes_or_no_p. */ 1560 since anything can happen within do_yes_or_no_p. */
1561 1561
1562 /* Don't kill the minibuffer now current. */ 1562 /* Don't kill the minibuffer now current. */
1563 if (EQ (buffer, WGET (XWINDOW (minibuf_window), buffer))) 1563 if (EQ (buffer, XWINDOW (minibuf_window)->buffer))
1564 return Qnil; 1564 return Qnil;
1565 1565
1566 /* When we kill an ordinary buffer which shares it's buffer text 1566 /* When we kill an ordinary buffer which shares it's buffer text
@@ -1611,7 +1611,7 @@ cleaning up all windows currently displaying the buffer to be killed. */)
1611 /* If the buffer now current is shown in the minibuffer and our buffer 1611 /* If the buffer now current is shown in the minibuffer and our buffer
1612 is the sole other buffer give up. */ 1612 is the sole other buffer give up. */
1613 XSETBUFFER (tem, current_buffer); 1613 XSETBUFFER (tem, current_buffer);
1614 if (EQ (tem, WGET (XWINDOW (minibuf_window), buffer)) 1614 if (EQ (tem, XWINDOW (minibuf_window)->buffer)
1615 && EQ (buffer, Fother_buffer (buffer, Qnil, Qnil))) 1615 && EQ (buffer, Fother_buffer (buffer, Qnil, Qnil)))
1616 return Qnil; 1616 return Qnil;
1617 1617
@@ -2193,13 +2193,13 @@ DEFUN ("buffer-swap-text", Fbuffer_swap_text, Sbuffer_swap_text,
2193 while (NILP (Fmemq (w, ws))) 2193 while (NILP (Fmemq (w, ws)))
2194 { 2194 {
2195 ws = Fcons (w, ws); 2195 ws = Fcons (w, ws);
2196 if (MARKERP (WGET (XWINDOW (w), pointm)) 2196 if (MARKERP (XWINDOW (w)->pointm)
2197 && (EQ (WGET (XWINDOW (w), buffer), buf1) 2197 && (EQ (XWINDOW (w)->buffer, buf1)
2198 || EQ (WGET (XWINDOW (w), buffer), buf2))) 2198 || EQ (XWINDOW (w)->buffer, buf2)))
2199 Fset_marker (WGET (XWINDOW (w), pointm), 2199 Fset_marker (XWINDOW (w)->pointm,
2200 make_number 2200 make_number
2201 (BUF_BEGV (XBUFFER (WGET (XWINDOW (w), buffer)))), 2201 (BUF_BEGV (XBUFFER (XWINDOW (w)->buffer))),
2202 WGET (XWINDOW (w), buffer)); 2202 XWINDOW (w)->buffer);
2203 w = Fnext_window (w, Qt, Qt); 2203 w = Fnext_window (w, Qt, Qt);
2204 } 2204 }
2205 } 2205 }
@@ -3675,7 +3675,7 @@ modify_overlay (struct buffer *buf, ptrdiff_t start, ptrdiff_t end)
3675 3675
3676 /* If this is a buffer not in the selected window, 3676 /* If this is a buffer not in the selected window,
3677 we must do other windows. */ 3677 we must do other windows. */
3678 if (buf != XBUFFER (WGET (XWINDOW (selected_window), buffer))) 3678 if (buf != XBUFFER (XWINDOW (selected_window)->buffer))
3679 windows_or_buffers_changed = 1; 3679 windows_or_buffers_changed = 1;
3680 /* If multiple windows show this buffer, we must do other windows. */ 3680 /* If multiple windows show this buffer, we must do other windows. */
3681 else if (buffer_shared > 1) 3681 else if (buffer_shared > 1)
diff --git a/src/composite.c b/src/composite.c
index 16fa3cce684..4e90e9bb914 100644
--- a/src/composite.c
+++ b/src/composite.c
@@ -909,7 +909,7 @@ static Lisp_Object
909autocmp_chars (Lisp_Object rule, ptrdiff_t charpos, ptrdiff_t bytepos, ptrdiff_t limit, struct window *win, struct face *face, Lisp_Object string) 909autocmp_chars (Lisp_Object rule, ptrdiff_t charpos, ptrdiff_t bytepos, ptrdiff_t limit, struct window *win, struct face *face, Lisp_Object string)
910{ 910{
911 ptrdiff_t count = SPECPDL_INDEX (); 911 ptrdiff_t count = SPECPDL_INDEX ();
912 FRAME_PTR f = XFRAME (WGET (win, frame)); 912 FRAME_PTR f = XFRAME (win->frame);
913 Lisp_Object pos = make_number (charpos); 913 Lisp_Object pos = make_number (charpos);
914 ptrdiff_t to; 914 ptrdiff_t to;
915 ptrdiff_t pt = PT, pt_byte = PT_BYTE; 915 ptrdiff_t pt = PT, pt_byte = PT_BYTE;
@@ -945,7 +945,7 @@ autocmp_chars (Lisp_Object rule, ptrdiff_t charpos, ptrdiff_t bytepos, ptrdiff_t
945 } 945 }
946 else 946 else
947#endif /* not HAVE_WINDOW_SYSTEM */ 947#endif /* not HAVE_WINDOW_SYSTEM */
948 font_object = WGET (win, frame); 948 font_object = win->frame;
949 lgstring = Fcomposition_get_gstring (pos, make_number (to), font_object, 949 lgstring = Fcomposition_get_gstring (pos, make_number (to), font_object,
950 string); 950 string);
951 if (NILP (LGSTRING_ID (lgstring))) 951 if (NILP (LGSTRING_ID (lgstring)))
diff --git a/src/dispextern.h b/src/dispextern.h
index 09869501ad9..a25aac96df9 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -1379,7 +1379,7 @@ struct glyph_string
1379 ? current_mode_line_height \ 1379 ? current_mode_line_height \
1380 : (MATRIX_MODE_LINE_HEIGHT ((W)->current_matrix) \ 1380 : (MATRIX_MODE_LINE_HEIGHT ((W)->current_matrix) \
1381 ? MATRIX_MODE_LINE_HEIGHT ((W)->current_matrix) \ 1381 ? MATRIX_MODE_LINE_HEIGHT ((W)->current_matrix) \
1382 : estimate_mode_line_height (XFRAME (WGET (W, frame)), \ 1382 : estimate_mode_line_height (XFRAME (W->frame), \
1383 CURRENT_MODE_LINE_FACE_ID (W)))) 1383 CURRENT_MODE_LINE_FACE_ID (W))))
1384 1384
1385/* Return the current height of the header line of window W. If not 1385/* Return the current height of the header line of window W. If not
@@ -1392,7 +1392,7 @@ struct glyph_string
1392 ? current_header_line_height \ 1392 ? current_header_line_height \
1393 : (MATRIX_HEADER_LINE_HEIGHT ((W)->current_matrix) \ 1393 : (MATRIX_HEADER_LINE_HEIGHT ((W)->current_matrix) \
1394 ? MATRIX_HEADER_LINE_HEIGHT ((W)->current_matrix) \ 1394 ? MATRIX_HEADER_LINE_HEIGHT ((W)->current_matrix) \
1395 : estimate_mode_line_height (XFRAME (WGET (W, frame)),\ 1395 : estimate_mode_line_height (XFRAME (W->frame),\
1396 HEADER_LINE_FACE_ID))) 1396 HEADER_LINE_FACE_ID)))
1397 1397
1398/* Return the height of the desired mode line of window W. */ 1398/* Return the height of the desired mode line of window W. */
@@ -1411,8 +1411,8 @@ struct glyph_string
1411 (!MINI_WINDOW_P ((W)) \ 1411 (!MINI_WINDOW_P ((W)) \
1412 && !(W)->pseudo_window_p \ 1412 && !(W)->pseudo_window_p \
1413 && FRAME_WANTS_MODELINE_P (XFRAME (WINDOW_FRAME ((W)))) \ 1413 && FRAME_WANTS_MODELINE_P (XFRAME (WINDOW_FRAME ((W)))) \
1414 && BUFFERP (WGET (W, buffer)) \ 1414 && BUFFERP (W->buffer) \
1415 && !NILP (BVAR (XBUFFER (WGET (W, buffer)), mode_line_format)) \ 1415 && !NILP (BVAR (XBUFFER (W->buffer), mode_line_format)) \
1416 && WINDOW_TOTAL_LINES (W) > 1) 1416 && WINDOW_TOTAL_LINES (W) > 1)
1417 1417
1418/* Value is non-zero if window W wants a header line. */ 1418/* Value is non-zero if window W wants a header line. */
@@ -1421,10 +1421,10 @@ struct glyph_string
1421 (!MINI_WINDOW_P ((W)) \ 1421 (!MINI_WINDOW_P ((W)) \
1422 && !(W)->pseudo_window_p \ 1422 && !(W)->pseudo_window_p \
1423 && FRAME_WANTS_MODELINE_P (XFRAME (WINDOW_FRAME ((W)))) \ 1423 && FRAME_WANTS_MODELINE_P (XFRAME (WINDOW_FRAME ((W)))) \
1424 && BUFFERP (WGET (W, buffer)) \ 1424 && BUFFERP (W->buffer) \
1425 && !NILP (BVAR (XBUFFER (WGET (W, buffer)), header_line_format)) \ 1425 && !NILP (BVAR (XBUFFER (W->buffer), header_line_format)) \
1426 && WINDOW_TOTAL_LINES (W) > 1 \ 1426 && WINDOW_TOTAL_LINES (W) > 1 \
1427 + !NILP (BVAR (XBUFFER (WGET (W, buffer)), mode_line_format))) 1427 + !NILP (BVAR (XBUFFER (W->buffer), mode_line_format)))
1428 1428
1429 1429
1430/* Return proper value to be used as baseline offset of font that has 1430/* Return proper value to be used as baseline offset of font that has
diff --git a/src/dispnew.c b/src/dispnew.c
index 2faede33b7f..b82761f8cad 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -245,9 +245,9 @@ add_window_display_history (struct window *w, const char *msg, int paused_p)
245 "%"pMu": window %p (`%s')%s\n%s", 245 "%"pMu": window %p (`%s')%s\n%s",
246 history_tick++, 246 history_tick++,
247 w, 247 w,
248 ((BUFFERP (WGET (w, buffer)) 248 ((BUFFERP (w->buffer)
249 && STRINGP (BVAR (XBUFFER (WGET (w, buffer)), name))) 249 && STRINGP (BVAR (XBUFFER (w->buffer), name)))
250 ? SSDATA (BVAR (XBUFFER (WGET (w, buffer)), name)) 250 ? SSDATA (BVAR (XBUFFER (w->buffer), name))
251 : "???"), 251 : "???"),
252 paused_p ? " ***paused***" : "", 252 paused_p ? " ***paused***" : "",
253 msg); 253 msg);
@@ -385,7 +385,7 @@ margin_glyphs_to_reserve (struct window *w, int total_glyphs, Lisp_Object margin
385 385
386 if (NUMBERP (margin)) 386 if (NUMBERP (margin))
387 { 387 {
388 int width = XFASTINT (WGET (w, total_cols)); 388 int width = XFASTINT (w->total_cols);
389 double d = max (0, XFLOATINT (margin)); 389 double d = max (0, XFLOATINT (margin));
390 d = min (width / 2 - 1, d); 390 d = min (width / 2 - 1, d);
391 n = (int) ((double) total_glyphs / width * d); 391 n = (int) ((double) total_glyphs / width * d);
@@ -455,8 +455,8 @@ adjust_glyph_matrix (struct window *w, struct glyph_matrix *matrix, int x, int y
455 the matrix means preventing redisplay. */ 455 the matrix means preventing redisplay. */
456 if (matrix->pool == NULL) 456 if (matrix->pool == NULL)
457 { 457 {
458 left = margin_glyphs_to_reserve (w, dim.width, WGET (w, left_margin_cols)); 458 left = margin_glyphs_to_reserve (w, dim.width, w->left_margin_cols);
459 right = margin_glyphs_to_reserve (w, dim.width, WGET (w, right_margin_cols)); 459 right = margin_glyphs_to_reserve (w, dim.width, w->right_margin_cols);
460 eassert (left >= 0 && right >= 0); 460 eassert (left >= 0 && right >= 0);
461 marginal_areas_changed_p = (left != matrix->left_margin_glyphs 461 marginal_areas_changed_p = (left != matrix->left_margin_glyphs
462 || right != matrix->right_margin_glyphs); 462 || right != matrix->right_margin_glyphs);
@@ -495,9 +495,9 @@ adjust_glyph_matrix (struct window *w, struct glyph_matrix *matrix, int x, int y
495 if (w) 495 if (w)
496 { 496 {
497 left = margin_glyphs_to_reserve (w, dim.width, 497 left = margin_glyphs_to_reserve (w, dim.width,
498 WGET (w, left_margin_cols)); 498 w->left_margin_cols);
499 right = margin_glyphs_to_reserve (w, dim.width, 499 right = margin_glyphs_to_reserve (w, dim.width,
500 WGET (w, right_margin_cols)); 500 w->right_margin_cols);
501 } 501 }
502 else 502 else
503 left = right = 0; 503 left = right = 0;
@@ -620,8 +620,8 @@ adjust_glyph_matrix (struct window *w, struct glyph_matrix *matrix, int x, int y
620 620
621 /* Window end is invalid, if inside of the rows that 621 /* Window end is invalid, if inside of the rows that
622 are invalidated below. */ 622 are invalidated below. */
623 if (INTEGERP (WGET (w, window_end_vpos)) 623 if (INTEGERP (w->window_end_vpos)
624 && XFASTINT (WGET (w, window_end_vpos)) >= i) 624 && XFASTINT (w->window_end_vpos) >= i)
625 WSET (w, window_end_valid, Qnil); 625 WSET (w, window_end_valid, Qnil);
626 626
627 while (i < matrix->nrows) 627 while (i < matrix->nrows)
@@ -862,15 +862,15 @@ clear_window_matrices (struct window *w, int desired_p)
862{ 862{
863 while (w) 863 while (w)
864 { 864 {
865 if (!NILP (WGET (w, hchild))) 865 if (!NILP (w->hchild))
866 { 866 {
867 eassert (WINDOWP (WGET (w, hchild))); 867 eassert (WINDOWP (w->hchild));
868 clear_window_matrices (XWINDOW (WGET (w, hchild)), desired_p); 868 clear_window_matrices (XWINDOW (w->hchild), desired_p);
869 } 869 }
870 else if (!NILP (WGET (w, vchild))) 870 else if (!NILP (w->vchild))
871 { 871 {
872 eassert (WINDOWP (WGET (w, vchild))); 872 eassert (WINDOWP (w->vchild));
873 clear_window_matrices (XWINDOW (WGET (w, vchild)), desired_p); 873 clear_window_matrices (XWINDOW (w->vchild), desired_p);
874 } 874 }
875 else 875 else
876 { 876 {
@@ -883,7 +883,7 @@ clear_window_matrices (struct window *w, int desired_p)
883 } 883 }
884 } 884 }
885 885
886 w = NILP (WGET (w, next)) ? 0 : XWINDOW (WGET (w, next)); 886 w = NILP (w->next) ? 0 : XWINDOW (w->next);
887 } 887 }
888} 888}
889 889
@@ -947,7 +947,7 @@ blank_row (struct window *w, struct glyph_row *row, int y)
947 clear_glyph_row (row); 947 clear_glyph_row (row);
948 row->y = y; 948 row->y = y;
949 row->ascent = row->phys_ascent = 0; 949 row->ascent = row->phys_ascent = 0;
950 row->height = row->phys_height = FRAME_LINE_HEIGHT (XFRAME (WGET (w, frame))); 950 row->height = row->phys_height = FRAME_LINE_HEIGHT (XFRAME (w->frame));
951 row->visible_height = row->height; 951 row->visible_height = row->height;
952 952
953 if (row->y < min_y) 953 if (row->y < min_y)
@@ -1493,7 +1493,7 @@ check_matrix_invariants (struct window *w)
1493 struct glyph_row *row = matrix->rows; 1493 struct glyph_row *row = matrix->rows;
1494 struct glyph_row *last_text_row = NULL; 1494 struct glyph_row *last_text_row = NULL;
1495 struct buffer *saved = current_buffer; 1495 struct buffer *saved = current_buffer;
1496 struct buffer *buffer = XBUFFER (WGET (w, buffer)); 1496 struct buffer *buffer = XBUFFER (w->buffer);
1497 int c; 1497 int c;
1498 1498
1499 /* This can sometimes happen for a fresh window. */ 1499 /* This can sometimes happen for a fresh window. */
@@ -1656,8 +1656,8 @@ allocate_matrices_for_frame_redisplay (Lisp_Object window, int x, int y,
1656 points to the mini-buffer window, if any, which is arranged 1656 points to the mini-buffer window, if any, which is arranged
1657 vertically below other windows. */ 1657 vertically below other windows. */
1658 in_horz_combination_p 1658 in_horz_combination_p
1659 = (!NILP (WGET (XWINDOW (window), parent)) 1659 = (!NILP (XWINDOW (window)->parent)
1660 && !NILP (WGET (XWINDOW (WGET (XWINDOW (window), parent)), hchild))); 1660 && !NILP (XWINDOW (XWINDOW (window)->parent)->hchild));
1661 1661
1662 /* For WINDOW and all windows on the same level. */ 1662 /* For WINDOW and all windows on the same level. */
1663 do 1663 do
@@ -1666,12 +1666,12 @@ allocate_matrices_for_frame_redisplay (Lisp_Object window, int x, int y,
1666 1666
1667 /* Get the dimension of the window sub-matrix for W, depending 1667 /* Get the dimension of the window sub-matrix for W, depending
1668 on whether this is a combination or a leaf window. */ 1668 on whether this is a combination or a leaf window. */
1669 if (!NILP (WGET (w, hchild))) 1669 if (!NILP (w->hchild))
1670 dim = allocate_matrices_for_frame_redisplay (WGET (w, hchild), x, y, 1670 dim = allocate_matrices_for_frame_redisplay (w->hchild, x, y,
1671 dim_only_p, 1671 dim_only_p,
1672 window_change_flags); 1672 window_change_flags);
1673 else if (!NILP (WGET (w, vchild))) 1673 else if (!NILP (w->vchild))
1674 dim = allocate_matrices_for_frame_redisplay (WGET (w, vchild), x, y, 1674 dim = allocate_matrices_for_frame_redisplay (w->vchild, x, y,
1675 dim_only_p, 1675 dim_only_p,
1676 window_change_flags); 1676 window_change_flags);
1677 else 1677 else
@@ -1695,10 +1695,10 @@ allocate_matrices_for_frame_redisplay (Lisp_Object window, int x, int y,
1695 || dim.width != w->desired_matrix->matrix_w 1695 || dim.width != w->desired_matrix->matrix_w
1696 || dim.height != w->desired_matrix->matrix_h 1696 || dim.height != w->desired_matrix->matrix_h
1697 || (margin_glyphs_to_reserve (w, dim.width, 1697 || (margin_glyphs_to_reserve (w, dim.width,
1698 WGET (w, left_margin_cols)) 1698 w->left_margin_cols)
1699 != w->desired_matrix->left_margin_glyphs) 1699 != w->desired_matrix->left_margin_glyphs)
1700 || (margin_glyphs_to_reserve (w, dim.width, 1700 || (margin_glyphs_to_reserve (w, dim.width,
1701 WGET (w, right_margin_cols)) 1701 w->right_margin_cols)
1702 != w->desired_matrix->right_margin_glyphs)) 1702 != w->desired_matrix->right_margin_glyphs))
1703 *window_change_flags |= CHANGED_LEAF_MATRIX; 1703 *window_change_flags |= CHANGED_LEAF_MATRIX;
1704 1704
@@ -1727,7 +1727,7 @@ allocate_matrices_for_frame_redisplay (Lisp_Object window, int x, int y,
1727 hmax = max (hmax, dim.height); 1727 hmax = max (hmax, dim.height);
1728 1728
1729 /* Next window on same level. */ 1729 /* Next window on same level. */
1730 window = WGET (w, next); 1730 window = w->next;
1731 } 1731 }
1732 while (!NILP (window)); 1732 while (!NILP (window));
1733 1733
@@ -1758,7 +1758,7 @@ static int
1758required_matrix_height (struct window *w) 1758required_matrix_height (struct window *w)
1759{ 1759{
1760#ifdef HAVE_WINDOW_SYSTEM 1760#ifdef HAVE_WINDOW_SYSTEM
1761 struct frame *f = XFRAME (WGET (w, frame)); 1761 struct frame *f = XFRAME (w->frame);
1762 1762
1763 if (FRAME_WINDOW_P (f)) 1763 if (FRAME_WINDOW_P (f))
1764 { 1764 {
@@ -1784,7 +1784,7 @@ static int
1784required_matrix_width (struct window *w) 1784required_matrix_width (struct window *w)
1785{ 1785{
1786#ifdef HAVE_WINDOW_SYSTEM 1786#ifdef HAVE_WINDOW_SYSTEM
1787 struct frame *f = XFRAME (WGET (w, frame)); 1787 struct frame *f = XFRAME (w->frame);
1788 if (FRAME_WINDOW_P (f)) 1788 if (FRAME_WINDOW_P (f))
1789 { 1789 {
1790 int ch_width = FRAME_SMALLEST_CHAR_WIDTH (f); 1790 int ch_width = FRAME_SMALLEST_CHAR_WIDTH (f);
@@ -1801,7 +1801,7 @@ required_matrix_width (struct window *w)
1801 } 1801 }
1802#endif /* HAVE_WINDOW_SYSTEM */ 1802#endif /* HAVE_WINDOW_SYSTEM */
1803 1803
1804 return XINT (WGET (w, total_cols)); 1804 return XINT (w->total_cols);
1805} 1805}
1806 1806
1807 1807
@@ -1813,10 +1813,10 @@ allocate_matrices_for_window_redisplay (struct window *w)
1813{ 1813{
1814 while (w) 1814 while (w)
1815 { 1815 {
1816 if (!NILP (WGET (w, vchild))) 1816 if (!NILP (w->vchild))
1817 allocate_matrices_for_window_redisplay (XWINDOW (WGET (w, vchild))); 1817 allocate_matrices_for_window_redisplay (XWINDOW (w->vchild));
1818 else if (!NILP (WGET (w, hchild))) 1818 else if (!NILP (w->hchild))
1819 allocate_matrices_for_window_redisplay (XWINDOW (WGET (w, hchild))); 1819 allocate_matrices_for_window_redisplay (XWINDOW (w->hchild));
1820 else 1820 else
1821 { 1821 {
1822 /* W is a leaf window. */ 1822 /* W is a leaf window. */
@@ -1835,7 +1835,7 @@ allocate_matrices_for_window_redisplay (struct window *w)
1835 adjust_glyph_matrix (w, w->current_matrix, 0, 0, dim); 1835 adjust_glyph_matrix (w, w->current_matrix, 0, 0, dim);
1836 } 1836 }
1837 1837
1838 w = NILP (WGET (w, next)) ? NULL : XWINDOW (WGET (w, next)); 1838 w = NILP (w->next) ? NULL : XWINDOW (w->next);
1839 } 1839 }
1840} 1840}
1841 1841
@@ -1882,7 +1882,7 @@ adjust_frame_glyphs_initially (void)
1882{ 1882{
1883 struct frame *sf = SELECTED_FRAME (); 1883 struct frame *sf = SELECTED_FRAME ();
1884 struct window *root = XWINDOW (sf->root_window); 1884 struct window *root = XWINDOW (sf->root_window);
1885 struct window *mini = XWINDOW (WGET (root, next)); 1885 struct window *mini = XWINDOW (root->next);
1886 int frame_lines = FRAME_LINES (sf); 1886 int frame_lines = FRAME_LINES (sf);
1887 int frame_cols = FRAME_COLS (sf); 1887 int frame_cols = FRAME_COLS (sf);
1888 int top_margin = FRAME_TOP_MARGIN (sf); 1888 int top_margin = FRAME_TOP_MARGIN (sf);
@@ -1927,21 +1927,21 @@ showing_window_margins_p (struct window *w)
1927{ 1927{
1928 while (w) 1928 while (w)
1929 { 1929 {
1930 if (!NILP (WGET (w, hchild))) 1930 if (!NILP (w->hchild))
1931 { 1931 {
1932 if (showing_window_margins_p (XWINDOW (WGET (w, hchild)))) 1932 if (showing_window_margins_p (XWINDOW (w->hchild)))
1933 return 1; 1933 return 1;
1934 } 1934 }
1935 else if (!NILP (WGET (w, vchild))) 1935 else if (!NILP (w->vchild))
1936 { 1936 {
1937 if (showing_window_margins_p (XWINDOW (WGET (w, vchild)))) 1937 if (showing_window_margins_p (XWINDOW (w->vchild)))
1938 return 1; 1938 return 1;
1939 } 1939 }
1940 else if (!NILP (WGET (w, left_margin_cols)) 1940 else if (!NILP (w->left_margin_cols)
1941 || !NILP (WGET (w, right_margin_cols))) 1941 || !NILP (w->right_margin_cols))
1942 return 1; 1942 return 1;
1943 1943
1944 w = NILP (WGET (w, next)) ? 0 : XWINDOW (WGET (w, next)); 1944 w = NILP (w->next) ? 0 : XWINDOW (w->next);
1945 } 1945 }
1946 return 0; 1946 return 0;
1947} 1947}
@@ -1955,18 +1955,18 @@ fake_current_matrices (Lisp_Object window)
1955{ 1955{
1956 struct window *w; 1956 struct window *w;
1957 1957
1958 for (; !NILP (window); window = WGET (w, next)) 1958 for (; !NILP (window); window = w->next)
1959 { 1959 {
1960 w = XWINDOW (window); 1960 w = XWINDOW (window);
1961 1961
1962 if (!NILP (WGET (w, hchild))) 1962 if (!NILP (w->hchild))
1963 fake_current_matrices (WGET (w, hchild)); 1963 fake_current_matrices (w->hchild);
1964 else if (!NILP (WGET (w, vchild))) 1964 else if (!NILP (w->vchild))
1965 fake_current_matrices (WGET (w, vchild)); 1965 fake_current_matrices (w->vchild);
1966 else 1966 else
1967 { 1967 {
1968 int i; 1968 int i;
1969 struct frame *f = XFRAME (WGET (w, frame)); 1969 struct frame *f = XFRAME (w->frame);
1970 struct glyph_matrix *m = w->current_matrix; 1970 struct glyph_matrix *m = w->current_matrix;
1971 struct glyph_matrix *fm = f->current_matrix; 1971 struct glyph_matrix *fm = f->current_matrix;
1972 1972
@@ -2317,10 +2317,10 @@ free_window_matrices (struct window *w)
2317{ 2317{
2318 while (w) 2318 while (w)
2319 { 2319 {
2320 if (!NILP (WGET (w, hchild))) 2320 if (!NILP (w->hchild))
2321 free_window_matrices (XWINDOW (WGET (w, hchild))); 2321 free_window_matrices (XWINDOW (w->hchild));
2322 else if (!NILP (WGET (w, vchild))) 2322 else if (!NILP (w->vchild))
2323 free_window_matrices (XWINDOW (WGET (w, vchild))); 2323 free_window_matrices (XWINDOW (w->vchild));
2324 else 2324 else
2325 { 2325 {
2326 /* This is a leaf window. Free its memory and reset fields 2326 /* This is a leaf window. Free its memory and reset fields
@@ -2332,7 +2332,7 @@ free_window_matrices (struct window *w)
2332 } 2332 }
2333 2333
2334 /* Next window on same level. */ 2334 /* Next window on same level. */
2335 w = NILP (WGET (w, next)) ? 0 : XWINDOW (WGET (w, next)); 2335 w = NILP (w->next) ? 0 : XWINDOW (w->next);
2336 } 2336 }
2337} 2337}
2338 2338
@@ -2453,14 +2453,14 @@ build_frame_matrix_from_window_tree (struct glyph_matrix *matrix, struct window
2453{ 2453{
2454 while (w) 2454 while (w)
2455 { 2455 {
2456 if (!NILP (WGET (w, hchild))) 2456 if (!NILP (w->hchild))
2457 build_frame_matrix_from_window_tree (matrix, XWINDOW (WGET (w, hchild))); 2457 build_frame_matrix_from_window_tree (matrix, XWINDOW (w->hchild));
2458 else if (!NILP (WGET (w, vchild))) 2458 else if (!NILP (w->vchild))
2459 build_frame_matrix_from_window_tree (matrix, XWINDOW (WGET (w, vchild))); 2459 build_frame_matrix_from_window_tree (matrix, XWINDOW (w->vchild));
2460 else 2460 else
2461 build_frame_matrix_from_leaf_window (matrix, w); 2461 build_frame_matrix_from_leaf_window (matrix, w);
2462 2462
2463 w = NILP (WGET (w, next)) ? 0 : XWINDOW (WGET (w, next)); 2463 w = NILP (w->next) ? 0 : XWINDOW (w->next);
2464 } 2464 }
2465} 2465}
2466 2466
@@ -2599,7 +2599,7 @@ spec_glyph_lookup_face (struct window *w, GLYPH *glyph)
2599 /* Convert the glyph's specified face to a realized (cache) face. */ 2599 /* Convert the glyph's specified face to a realized (cache) face. */
2600 if (lface_id > 0) 2600 if (lface_id > 0)
2601 { 2601 {
2602 int face_id = merge_faces (XFRAME (WGET (w, frame)), 2602 int face_id = merge_faces (XFRAME (w->frame),
2603 Qt, lface_id, DEFAULT_FACE_ID); 2603 Qt, lface_id, DEFAULT_FACE_ID);
2604 SET_GLYPH_FACE (*glyph, face_id); 2604 SET_GLYPH_FACE (*glyph, face_id);
2605 } 2605 }
@@ -2720,10 +2720,10 @@ mirror_make_current (struct window *w, int frame_row)
2720{ 2720{
2721 while (w) 2721 while (w)
2722 { 2722 {
2723 if (!NILP (WGET (w, hchild))) 2723 if (!NILP (w->hchild))
2724 mirror_make_current (XWINDOW (WGET (w, hchild)), frame_row); 2724 mirror_make_current (XWINDOW (w->hchild), frame_row);
2725 else if (!NILP (WGET (w, vchild))) 2725 else if (!NILP (w->vchild))
2726 mirror_make_current (XWINDOW (WGET (w, vchild)), frame_row); 2726 mirror_make_current (XWINDOW (w->vchild), frame_row);
2727 else 2727 else
2728 { 2728 {
2729 /* Row relative to window W. Don't use FRAME_TO_WINDOW_VPOS 2729 /* Row relative to window W. Don't use FRAME_TO_WINDOW_VPOS
@@ -2756,7 +2756,7 @@ mirror_make_current (struct window *w, int frame_row)
2756 } 2756 }
2757 } 2757 }
2758 2758
2759 w = NILP (WGET (w, next)) ? 0 : XWINDOW (WGET (w, next)); 2759 w = NILP (w->next) ? 0 : XWINDOW (w->next);
2760 } 2760 }
2761} 2761}
2762 2762
@@ -2815,16 +2815,16 @@ mirrored_line_dance (struct glyph_matrix *matrix, int unchanged_at_top, int nlin
2815static void 2815static void
2816sync_window_with_frame_matrix_rows (struct window *w) 2816sync_window_with_frame_matrix_rows (struct window *w)
2817{ 2817{
2818 struct frame *f = XFRAME (WGET (w, frame)); 2818 struct frame *f = XFRAME (w->frame);
2819 struct glyph_row *window_row, *window_row_end, *frame_row; 2819 struct glyph_row *window_row, *window_row_end, *frame_row;
2820 int left, right, x, width; 2820 int left, right, x, width;
2821 2821
2822 /* Preconditions: W must be a leaf window on a tty frame. */ 2822 /* Preconditions: W must be a leaf window on a tty frame. */
2823 eassert (NILP (WGET (w, hchild)) && NILP (WGET (w, vchild))); 2823 eassert (NILP (w->hchild) && NILP (w->vchild));
2824 eassert (!FRAME_WINDOW_P (f)); 2824 eassert (!FRAME_WINDOW_P (f));
2825 2825
2826 left = margin_glyphs_to_reserve (w, 1, WGET (w, left_margin_cols)); 2826 left = margin_glyphs_to_reserve (w, 1, w->left_margin_cols);
2827 right = margin_glyphs_to_reserve (w, 1, WGET (w, right_margin_cols)); 2827 right = margin_glyphs_to_reserve (w, 1, w->right_margin_cols);
2828 x = w->current_matrix->matrix_x; 2828 x = w->current_matrix->matrix_x;
2829 width = w->current_matrix->matrix_w; 2829 width = w->current_matrix->matrix_w;
2830 2830
@@ -2856,15 +2856,15 @@ frame_row_to_window (struct window *w, int row)
2856 2856
2857 while (w && !found) 2857 while (w && !found)
2858 { 2858 {
2859 if (!NILP (WGET (w, hchild))) 2859 if (!NILP (w->hchild))
2860 found = frame_row_to_window (XWINDOW (WGET (w, hchild)), row); 2860 found = frame_row_to_window (XWINDOW (w->hchild), row);
2861 else if (!NILP (WGET (w, vchild))) 2861 else if (!NILP (w->vchild))
2862 found = frame_row_to_window (XWINDOW (WGET (w, vchild)), row); 2862 found = frame_row_to_window (XWINDOW (w->vchild), row);
2863 else if (row >= WINDOW_TOP_EDGE_LINE (w) 2863 else if (row >= WINDOW_TOP_EDGE_LINE (w)
2864 && row < WINDOW_BOTTOM_EDGE_LINE (w)) 2864 && row < WINDOW_BOTTOM_EDGE_LINE (w))
2865 found = w; 2865 found = w;
2866 2866
2867 w = NILP (WGET (w, next)) ? 0 : XWINDOW (WGET (w, next)); 2867 w = NILP (w->next) ? 0 : XWINDOW (w->next);
2868 } 2868 }
2869 2869
2870 return found; 2870 return found;
@@ -2887,11 +2887,11 @@ mirror_line_dance (struct window *w, int unchanged_at_top, int nlines, int *copy
2887{ 2887{
2888 while (w) 2888 while (w)
2889 { 2889 {
2890 if (!NILP (WGET (w, hchild))) 2890 if (!NILP (w->hchild))
2891 mirror_line_dance (XWINDOW (WGET (w, hchild)), unchanged_at_top, 2891 mirror_line_dance (XWINDOW (w->hchild), unchanged_at_top,
2892 nlines, copy_from, retained_p); 2892 nlines, copy_from, retained_p);
2893 else if (!NILP (WGET (w, vchild))) 2893 else if (!NILP (w->vchild))
2894 mirror_line_dance (XWINDOW (WGET (w, vchild)), unchanged_at_top, 2894 mirror_line_dance (XWINDOW (w->vchild), unchanged_at_top,
2895 nlines, copy_from, retained_p); 2895 nlines, copy_from, retained_p);
2896 else 2896 else
2897 { 2897 {
@@ -2947,7 +2947,7 @@ mirror_line_dance (struct window *w, int unchanged_at_top, int nlines, int *copy
2947 { 2947 {
2948 /* A copy between windows. This is an infrequent 2948 /* A copy between windows. This is an infrequent
2949 case not worth optimizing. */ 2949 case not worth optimizing. */
2950 struct frame *f = XFRAME (WGET (w, frame)); 2950 struct frame *f = XFRAME (w->frame);
2951 struct window *root = XWINDOW (FRAME_ROOT_WINDOW (f)); 2951 struct window *root = XWINDOW (FRAME_ROOT_WINDOW (f));
2952 struct window *w2; 2952 struct window *w2;
2953 struct glyph_matrix *m2; 2953 struct glyph_matrix *m2;
@@ -2984,7 +2984,7 @@ mirror_line_dance (struct window *w, int unchanged_at_top, int nlines, int *copy
2984 } 2984 }
2985 2985
2986 /* Next window on same level. */ 2986 /* Next window on same level. */
2987 w = NILP (WGET (w, next)) ? 0 : XWINDOW (WGET (w, next)); 2987 w = NILP (w->next) ? 0 : XWINDOW (w->next);
2988 } 2988 }
2989} 2989}
2990 2990
@@ -3002,18 +3002,18 @@ check_window_matrix_pointers (struct window *w)
3002{ 3002{
3003 while (w) 3003 while (w)
3004 { 3004 {
3005 if (!NILP (WGET (w, hchild))) 3005 if (!NILP (w->hchild))
3006 check_window_matrix_pointers (XWINDOW (WGET (w, hchild))); 3006 check_window_matrix_pointers (XWINDOW (w->hchild));
3007 else if (!NILP (WGET (w, vchild))) 3007 else if (!NILP (w->vchild))
3008 check_window_matrix_pointers (XWINDOW (WGET (w, vchild))); 3008 check_window_matrix_pointers (XWINDOW (w->vchild));
3009 else 3009 else
3010 { 3010 {
3011 struct frame *f = XFRAME (WGET (w, frame)); 3011 struct frame *f = XFRAME (w->frame);
3012 check_matrix_pointers (w->desired_matrix, f->desired_matrix); 3012 check_matrix_pointers (w->desired_matrix, f->desired_matrix);
3013 check_matrix_pointers (w->current_matrix, f->current_matrix); 3013 check_matrix_pointers (w->current_matrix, f->current_matrix);
3014 } 3014 }
3015 3015
3016 w = NILP (WGET (w, next)) ? 0 : XWINDOW (WGET (w, next)); 3016 w = NILP (w->next) ? 0 : XWINDOW (w->next);
3017 } 3017 }
3018} 3018}
3019 3019
@@ -3061,10 +3061,10 @@ check_matrix_pointers (struct glyph_matrix *window_matrix,
3061static int 3061static int
3062window_to_frame_vpos (struct window *w, int vpos) 3062window_to_frame_vpos (struct window *w, int vpos)
3063{ 3063{
3064 eassert (!FRAME_WINDOW_P (XFRAME (WGET (w, frame)))); 3064 eassert (!FRAME_WINDOW_P (XFRAME (w->frame)));
3065 eassert (vpos >= 0 && vpos <= w->desired_matrix->nrows); 3065 eassert (vpos >= 0 && vpos <= w->desired_matrix->nrows);
3066 vpos += WINDOW_TOP_EDGE_LINE (w); 3066 vpos += WINDOW_TOP_EDGE_LINE (w);
3067 eassert (vpos >= 0 && vpos <= FRAME_LINES (XFRAME (WGET (w, frame)))); 3067 eassert (vpos >= 0 && vpos <= FRAME_LINES (XFRAME (w->frame)));
3068 return vpos; 3068 return vpos;
3069} 3069}
3070 3070
@@ -3075,7 +3075,7 @@ window_to_frame_vpos (struct window *w, int vpos)
3075static int 3075static int
3076window_to_frame_hpos (struct window *w, int hpos) 3076window_to_frame_hpos (struct window *w, int hpos)
3077{ 3077{
3078 eassert (!FRAME_WINDOW_P (XFRAME (WGET (w, frame)))); 3078 eassert (!FRAME_WINDOW_P (XFRAME (w->frame)));
3079 hpos += WINDOW_LEFT_EDGE_COL (w); 3079 hpos += WINDOW_LEFT_EDGE_COL (w);
3080 return hpos; 3080 return hpos;
3081} 3081}
@@ -3294,14 +3294,14 @@ update_window_tree (struct window *w, int force_p)
3294 3294
3295 while (w && !paused_p) 3295 while (w && !paused_p)
3296 { 3296 {
3297 if (!NILP (WGET (w, hchild))) 3297 if (!NILP (w->hchild))
3298 paused_p |= update_window_tree (XWINDOW (WGET (w, hchild)), force_p); 3298 paused_p |= update_window_tree (XWINDOW (w->hchild), force_p);
3299 else if (!NILP (WGET (w, vchild))) 3299 else if (!NILP (w->vchild))
3300 paused_p |= update_window_tree (XWINDOW (WGET (w, vchild)), force_p); 3300 paused_p |= update_window_tree (XWINDOW (w->vchild), force_p);
3301 else if (w->must_be_updated_p) 3301 else if (w->must_be_updated_p)
3302 paused_p |= update_window (w, force_p); 3302 paused_p |= update_window (w, force_p);
3303 3303
3304 w = NILP (WGET (w, next)) ? 0 : XWINDOW (WGET (w, next)); 3304 w = NILP (w->next) ? 0 : XWINDOW (w->next);
3305 } 3305 }
3306 3306
3307 return paused_p; 3307 return paused_p;
@@ -3789,7 +3789,7 @@ update_text_area (struct window *w, int vpos)
3789 struct glyph *glyph = &current_row->glyphs[TEXT_AREA][i - 1]; 3789 struct glyph *glyph = &current_row->glyphs[TEXT_AREA][i - 1];
3790 int left, right; 3790 int left, right;
3791 3791
3792 rif->get_glyph_overhangs (glyph, XFRAME (WGET (w, frame)), 3792 rif->get_glyph_overhangs (glyph, XFRAME (w->frame),
3793 &left, &right); 3793 &left, &right);
3794 can_skip_p = (right == 0 && !abort_skipping); 3794 can_skip_p = (right == 0 && !abort_skipping);
3795 } 3795 }
@@ -3822,7 +3822,7 @@ update_text_area (struct window *w, int vpos)
3822 int left, right; 3822 int left, right;
3823 3823
3824 rif->get_glyph_overhangs (current_glyph, 3824 rif->get_glyph_overhangs (current_glyph,
3825 XFRAME (WGET (w, frame)), 3825 XFRAME (w->frame),
3826 &left, &right); 3826 &left, &right);
3827 while (left > 0 && i > 0) 3827 while (left > 0 && i > 0)
3828 { 3828 {
@@ -3965,7 +3965,7 @@ update_window_line (struct window *w, int vpos, int *mouse_face_overwritten_p)
3965 3965
3966 /* Update display of the left margin area, if there is one. */ 3966 /* Update display of the left margin area, if there is one. */
3967 if (!desired_row->full_width_p 3967 if (!desired_row->full_width_p
3968 && !NILP (WGET (w, left_margin_cols))) 3968 && !NILP (w->left_margin_cols))
3969 { 3969 {
3970 changed_p = 1; 3970 changed_p = 1;
3971 update_marginal_area (w, LEFT_MARGIN_AREA, vpos); 3971 update_marginal_area (w, LEFT_MARGIN_AREA, vpos);
@@ -3981,7 +3981,7 @@ update_window_line (struct window *w, int vpos, int *mouse_face_overwritten_p)
3981 3981
3982 /* Update display of the right margin area, if there is one. */ 3982 /* Update display of the right margin area, if there is one. */
3983 if (!desired_row->full_width_p 3983 if (!desired_row->full_width_p
3984 && !NILP (WGET (w, right_margin_cols))) 3984 && !NILP (w->right_margin_cols))
3985 { 3985 {
3986 changed_p = 1; 3986 changed_p = 1;
3987 update_marginal_area (w, RIGHT_MARGIN_AREA, vpos); 3987 update_marginal_area (w, RIGHT_MARGIN_AREA, vpos);
@@ -4014,7 +4014,7 @@ update_window_line (struct window *w, int vpos, int *mouse_face_overwritten_p)
4014static void 4014static void
4015set_window_cursor_after_update (struct window *w) 4015set_window_cursor_after_update (struct window *w)
4016{ 4016{
4017 struct frame *f = XFRAME (WGET (w, frame)); 4017 struct frame *f = XFRAME (w->frame);
4018 struct redisplay_interface *rif = FRAME_RIF (f); 4018 struct redisplay_interface *rif = FRAME_RIF (f);
4019 int cx, cy, vpos, hpos; 4019 int cx, cy, vpos, hpos;
4020 4020
@@ -4100,14 +4100,14 @@ set_window_update_flags (struct window *w, int on_p)
4100{ 4100{
4101 while (w) 4101 while (w)
4102 { 4102 {
4103 if (!NILP (WGET (w, hchild))) 4103 if (!NILP (w->hchild))
4104 set_window_update_flags (XWINDOW (WGET (w, hchild)), on_p); 4104 set_window_update_flags (XWINDOW (w->hchild), on_p);
4105 else if (!NILP (WGET (w, vchild))) 4105 else if (!NILP (w->vchild))
4106 set_window_update_flags (XWINDOW (WGET (w, vchild)), on_p); 4106 set_window_update_flags (XWINDOW (w->vchild), on_p);
4107 else 4107 else
4108 w->must_be_updated_p = on_p; 4108 w->must_be_updated_p = on_p;
4109 4109
4110 w = NILP (WGET (w, next)) ? 0 : XWINDOW (WGET (w, next)); 4110 w = NILP (w->next) ? 0 : XWINDOW (w->next);
4111 } 4111 }
4112} 4112}
4113 4113
@@ -4790,8 +4790,8 @@ update_frame_1 (struct frame *f, int force_p, int inhibit_id_p)
4790 int x = WINDOW_TO_FRAME_HPOS (w, w->cursor.hpos); 4790 int x = WINDOW_TO_FRAME_HPOS (w, w->cursor.hpos);
4791 int y = WINDOW_TO_FRAME_VPOS (w, w->cursor.vpos); 4791 int y = WINDOW_TO_FRAME_VPOS (w, w->cursor.vpos);
4792 4792
4793 if (INTEGERP (WGET (w, left_margin_cols))) 4793 if (INTEGERP (w->left_margin_cols))
4794 x += XFASTINT (WGET (w, left_margin_cols)); 4794 x += XFASTINT (w->left_margin_cols);
4795 4795
4796 /* x = max (min (x, FRAME_TOTAL_COLS (f) - 1), 0); */ 4796 /* x = max (min (x, FRAME_TOTAL_COLS (f) - 1), 0); */
4797 cursor_to (f, y, x); 4797 cursor_to (f, y, x);
@@ -5281,9 +5281,9 @@ buffer_posn_from_coords (struct window *w, int *x, int *y, struct display_pos *p
5281 5281
5282 /* We used to set current_buffer directly here, but that does the 5282 /* We used to set current_buffer directly here, but that does the
5283 wrong thing with `face-remapping-alist' (bug#2044). */ 5283 wrong thing with `face-remapping-alist' (bug#2044). */
5284 Fset_buffer (WGET (w, buffer)); 5284 Fset_buffer (w->buffer);
5285 itdata = bidi_shelve_cache (); 5285 itdata = bidi_shelve_cache ();
5286 SET_TEXT_POS_FROM_MARKER (startp, WGET (w, start)); 5286 SET_TEXT_POS_FROM_MARKER (startp, w->start);
5287 CHARPOS (startp) = min (ZV, max (BEGV, CHARPOS (startp))); 5287 CHARPOS (startp) = min (ZV, max (BEGV, CHARPOS (startp)));
5288 BYTEPOS (startp) = min (ZV_BYTE, max (BEGV_BYTE, BYTEPOS (startp))); 5288 BYTEPOS (startp) = min (ZV_BYTE, max (BEGV_BYTE, BYTEPOS (startp)));
5289 start_display (&it, w, startp); 5289 start_display (&it, w, startp);
@@ -5327,7 +5327,7 @@ buffer_posn_from_coords (struct window *w, int *x, int *y, struct display_pos *p
5327 *dx = x0 + it.first_visible_x - it.current_x; 5327 *dx = x0 + it.first_visible_x - it.current_x;
5328 *dy = *y - it.current_y; 5328 *dy = *y - it.current_y;
5329 5329
5330 string = WGET (w, buffer); 5330 string = w->buffer;
5331 if (STRINGP (it.string)) 5331 if (STRINGP (it.string))
5332 string = it.string; 5332 string = it.string;
5333 *pos = it.current; 5333 *pos = it.current;
@@ -5345,7 +5345,7 @@ buffer_posn_from_coords (struct window *w, int *x, int *y, struct display_pos *p
5345 if (STRINGP (it.string)) 5345 if (STRINGP (it.string))
5346 BYTEPOS (pos->pos) = string_char_to_byte (string, CHARPOS (pos->pos)); 5346 BYTEPOS (pos->pos) = string_char_to_byte (string, CHARPOS (pos->pos));
5347 else 5347 else
5348 BYTEPOS (pos->pos) = buf_charpos_to_bytepos (XBUFFER (WGET (w, buffer)), 5348 BYTEPOS (pos->pos) = buf_charpos_to_bytepos (XBUFFER (w->buffer),
5349 CHARPOS (pos->pos)); 5349 CHARPOS (pos->pos));
5350 } 5350 }
5351 5351
@@ -5745,8 +5745,7 @@ change_frame_size_1 (register struct frame *f, int newheight, int newwidth, int
5745 FrameCols (FRAME_TTY (f)) = newwidth; 5745 FrameCols (FRAME_TTY (f)) = newwidth;
5746 5746
5747 if (WINDOWP (f->tool_bar_window)) 5747 if (WINDOWP (f->tool_bar_window))
5748 WSET (XWINDOW (f->tool_bar_window), 5748 WSET (XWINDOW (f->tool_bar_window), total_cols, make_number (newwidth));
5749 total_cols, make_number (newwidth));
5750 } 5749 }
5751 5750
5752 FRAME_LINES (f) = newheight; 5751 FRAME_LINES (f) = newheight;
diff --git a/src/editfns.c b/src/editfns.c
index f86e66928f2..ae568a40a68 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -366,7 +366,7 @@ get_pos_property (Lisp_Object position, register Lisp_Object prop, Lisp_Object o
366 if (NILP (object)) 366 if (NILP (object))
367 XSETBUFFER (object, current_buffer); 367 XSETBUFFER (object, current_buffer);
368 else if (WINDOWP (object)) 368 else if (WINDOWP (object))
369 object = WGET (XWINDOW (object), buffer); 369 object = XWINDOW (object)->buffer;
370 370
371 if (!BUFFERP (object)) 371 if (!BUFFERP (object))
372 /* pos-property only makes sense in buffers right now, since strings 372 /* pos-property only makes sense in buffers right now, since strings
@@ -821,7 +821,7 @@ This function does not move point. */)
821Lisp_Object 821Lisp_Object
822save_excursion_save (void) 822save_excursion_save (void)
823{ 823{
824 int visible = (XBUFFER (WGET (XWINDOW (selected_window), buffer)) 824 int visible = (XBUFFER (XWINDOW (selected_window)->buffer)
825 == current_buffer); 825 == current_buffer);
826 826
827 return Fcons (Fpoint_marker (), 827 return Fcons (Fpoint_marker (),
@@ -874,7 +874,7 @@ save_excursion_restore (Lisp_Object info)
874 and cleaner never to alter the window/buffer connections. */ 874 and cleaner never to alter the window/buffer connections. */
875 tem1 = Fcar (tem); 875 tem1 = Fcar (tem);
876 if (!NILP (tem1) 876 if (!NILP (tem1)
877 && current_buffer != XBUFFER (WGET (XWINDOW (selected_window), buffer))) 877 && current_buffer != XBUFFER (XWINDOW (selected_window)->buffer))
878 Fswitch_to_buffer (Fcurrent_buffer (), Qnil); 878 Fswitch_to_buffer (Fcurrent_buffer (), Qnil);
879#endif /* 0 */ 879#endif /* 0 */
880 880
@@ -907,7 +907,7 @@ save_excursion_restore (Lisp_Object info)
907 tem = XCDR (info); 907 tem = XCDR (info);
908 if (visible_p 908 if (visible_p
909 && !EQ (tem, selected_window) 909 && !EQ (tem, selected_window)
910 && (tem1 = WGET (XWINDOW (tem), buffer), 910 && (tem1 = XWINDOW (tem)->buffer,
911 (/* Window is live... */ 911 (/* Window is live... */
912 BUFFERP (tem1) 912 BUFFERP (tem1)
913 /* ...and it shows the current buffer. */ 913 /* ...and it shows the current buffer. */
diff --git a/src/fileio.c b/src/fileio.c
index bd037cb81c1..36d61f15617 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -3731,7 +3731,7 @@ variable `last-coding-system-used' to the coding system actually used. */)
3731 3731
3732 /* If display currently starts at beginning of line, 3732 /* If display currently starts at beginning of line,
3733 keep it that way. */ 3733 keep it that way. */
3734 if (XBUFFER (WGET (XWINDOW (selected_window), buffer)) == current_buffer) 3734 if (XBUFFER (XWINDOW (selected_window)->buffer) == current_buffer)
3735 XWINDOW (selected_window)->start_at_line_beg = !NILP (Fbolp ()); 3735 XWINDOW (selected_window)->start_at_line_beg = !NILP (Fbolp ());
3736 3736
3737 replace_handled = 1; 3737 replace_handled = 1;
@@ -3888,7 +3888,7 @@ variable `last-coding-system-used' to the coding system actually used. */)
3888 3888
3889 /* If display currently starts at beginning of line, 3889 /* If display currently starts at beginning of line,
3890 keep it that way. */ 3890 keep it that way. */
3891 if (XBUFFER (WGET (XWINDOW (selected_window), buffer)) == current_buffer) 3891 if (XBUFFER (XWINDOW (selected_window)->buffer) == current_buffer)
3892 XWINDOW (selected_window)->start_at_line_beg = !NILP (Fbolp ()); 3892 XWINDOW (selected_window)->start_at_line_beg = !NILP (Fbolp ());
3893 3893
3894 /* Replace the chars that we need to replace, 3894 /* Replace the chars that we need to replace,
diff --git a/src/font.c b/src/font.c
index db1d12de8a2..4520d9bc9a2 100644
--- a/src/font.c
+++ b/src/font.c
@@ -3665,7 +3665,7 @@ font_at (int c, ptrdiff_t pos, struct face *face, struct window *w,
3665 } 3665 }
3666 } 3666 }
3667 3667
3668 f = XFRAME (WGET (w, frame)); 3668 f = XFRAME (w->frame);
3669 if (! FRAME_WINDOW_P (f)) 3669 if (! FRAME_WINDOW_P (f))
3670 return Qnil; 3670 return Qnil;
3671 if (! face) 3671 if (! face)
@@ -3723,7 +3723,7 @@ font_range (ptrdiff_t pos, ptrdiff_t *limit, struct window *w, struct face *face
3723 3723
3724 face_id = face_at_buffer_position (w, pos, 0, 0, &ignore, 3724 face_id = face_at_buffer_position (w, pos, 0, 0, &ignore,
3725 *limit, 0, -1); 3725 *limit, 0, -1);
3726 face = FACE_FROM_ID (XFRAME (WGET (w, frame)), face_id); 3726 face = FACE_FROM_ID (XFRAME (w->frame), face_id);
3727 } 3727 }
3728 } 3728 }
3729 else 3729 else
diff --git a/src/fontset.c b/src/fontset.c
index 01b00eec180..d4ce8b08ea3 100644
--- a/src/fontset.c
+++ b/src/fontset.c
@@ -1841,7 +1841,7 @@ DEFUN ("internal-char-font", Finternal_char_font, Sinternal_char_font, 1, 2, 0,
1841 if (NILP (window)) 1841 if (NILP (window))
1842 return Qnil; 1842 return Qnil;
1843 w = XWINDOW (window); 1843 w = XWINDOW (window);
1844 f = XFRAME (WGET (w, frame)); 1844 f = XFRAME (w->frame);
1845 face_id = face_at_buffer_position (w, pos, -1, -1, &dummy, 1845 face_id = face_at_buffer_position (w, pos, -1, -1, &dummy,
1846 pos + 100, 0, -1); 1846 pos + 100, 0, -1);
1847 } 1847 }
diff --git a/src/frame.c b/src/frame.c
index 4dc86c15ecb..2a2a8576a2b 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -132,15 +132,15 @@ set_menu_bar_lines_1 (Lisp_Object window, int n)
132 struct window *w = XWINDOW (window); 132 struct window *w = XWINDOW (window);
133 133
134 w->last_modified = 0; 134 w->last_modified = 0;
135 WSET (w, top_line, make_number (XFASTINT (WGET (w, top_line)) + n)); 135 WSET (w, top_line, make_number (XFASTINT (w->top_line) + n));
136 WSET (w, total_lines, make_number (XFASTINT (WGET (w, total_lines)) - n)); 136 WSET (w, total_lines, make_number (XFASTINT (w->total_lines) - n));
137 137
138 /* Handle just the top child in a vertical split. */ 138 /* Handle just the top child in a vertical split. */
139 if (!NILP (WGET (w, vchild))) 139 if (!NILP (w->vchild))
140 set_menu_bar_lines_1 (WGET (w, vchild), n); 140 set_menu_bar_lines_1 (w->vchild, n);
141 141
142 /* Adjust all children in a horizontal split. */ 142 /* Adjust all children in a horizontal split. */
143 for (window = WGET (w, hchild); !NILP (window); window = WGET (w, next)) 143 for (window = w->hchild; !NILP (window); window = w->next)
144 { 144 {
145 w = XWINDOW (window); 145 w = XWINDOW (window);
146 set_menu_bar_lines_1 (window, n); 146 set_menu_bar_lines_1 (window, n);
@@ -376,7 +376,7 @@ make_frame_without_minibuffer (register Lisp_Object mini_window, KBOARD *kb, Lis
376 CHECK_LIVE_WINDOW (mini_window); 376 CHECK_LIVE_WINDOW (mini_window);
377 377
378 if (!NILP (mini_window) 378 if (!NILP (mini_window)
379 && FRAME_KBOARD (XFRAME (WGET (XWINDOW (mini_window), frame))) != kb) 379 && FRAME_KBOARD (XFRAME (XWINDOW (mini_window)->frame)) != kb)
380 error ("Frame and minibuffer must be on the same terminal"); 380 error ("Frame and minibuffer must be on the same terminal");
381 381
382 /* Make a frame containing just a root window. */ 382 /* Make a frame containing just a root window. */
@@ -406,7 +406,7 @@ make_frame_without_minibuffer (register Lisp_Object mini_window, KBOARD *kb, Lis
406 406
407 /* Make the chosen minibuffer window display the proper minibuffer, 407 /* Make the chosen minibuffer window display the proper minibuffer,
408 unless it is already showing a minibuffer. */ 408 unless it is already showing a minibuffer. */
409 if (NILP (Fmemq (WGET (XWINDOW (mini_window), buffer), Vminibuffer_list))) 409 if (NILP (Fmemq (XWINDOW (mini_window)->buffer, Vminibuffer_list)))
410 Fset_window_buffer (mini_window, 410 Fset_window_buffer (mini_window,
411 (NILP (Vminibuffer_list) 411 (NILP (Vminibuffer_list)
412 ? get_minibuffer (0) 412 ? get_minibuffer (0)
@@ -1241,7 +1241,7 @@ delete_frame (Lisp_Object frame, Lisp_Object force)
1241 if (EQ (f->minibuffer_window, minibuf_window)) 1241 if (EQ (f->minibuffer_window, minibuf_window))
1242 { 1242 {
1243 Fset_window_buffer (sf->minibuffer_window, 1243 Fset_window_buffer (sf->minibuffer_window,
1244 WGET (XWINDOW (minibuf_window), buffer), Qnil); 1244 XWINDOW (minibuf_window)->buffer, Qnil);
1245 minibuf_window = sf->minibuffer_window; 1245 minibuf_window = sf->minibuffer_window;
1246 1246
1247 /* If the dying minibuffer window was selected, 1247 /* If the dying minibuffer window was selected,
@@ -1672,17 +1672,17 @@ make_frame_visible_1 (Lisp_Object window)
1672{ 1672{
1673 struct window *w; 1673 struct window *w;
1674 1674
1675 for (;!NILP (window); window = WGET (w, next)) 1675 for (;!NILP (window); window = w->next)
1676 { 1676 {
1677 w = XWINDOW (window); 1677 w = XWINDOW (window);
1678 1678
1679 if (!NILP (WGET (w, buffer))) 1679 if (!NILP (w->buffer))
1680 BVAR (XBUFFER (WGET (w, buffer)), display_time) = Fcurrent_time (); 1680 BVAR (XBUFFER (w->buffer), display_time) = Fcurrent_time ();
1681 1681
1682 if (!NILP (WGET (w, vchild))) 1682 if (!NILP (w->vchild))
1683 make_frame_visible_1 (WGET (w, vchild)); 1683 make_frame_visible_1 (w->vchild);
1684 if (!NILP (WGET (w, hchild))) 1684 if (!NILP (w->hchild))
1685 make_frame_visible_1 (WGET (w, hchild)); 1685 make_frame_visible_1 (w->hchild);
1686 } 1686 }
1687} 1687}
1688 1688
@@ -1714,7 +1714,7 @@ displayed in the terminal. */)
1714 { 1714 {
1715 struct frame *sf = XFRAME (selected_frame); 1715 struct frame *sf = XFRAME (selected_frame);
1716 Fset_window_buffer (sf->minibuffer_window, 1716 Fset_window_buffer (sf->minibuffer_window,
1717 WGET (XWINDOW (minibuf_window), buffer), Qnil); 1717 XWINDOW (minibuf_window)->buffer, Qnil);
1718 minibuf_window = sf->minibuffer_window; 1718 minibuf_window = sf->minibuffer_window;
1719 } 1719 }
1720 1720
@@ -1752,7 +1752,7 @@ If omitted, FRAME defaults to the currently selected frame. */)
1752 { 1752 {
1753 struct frame *sf = XFRAME (selected_frame); 1753 struct frame *sf = XFRAME (selected_frame);
1754 Fset_window_buffer (sf->minibuffer_window, 1754 Fset_window_buffer (sf->minibuffer_window,
1755 WGET (XWINDOW (minibuf_window), buffer), Qnil); 1755 XWINDOW (minibuf_window)->buffer, Qnil);
1756 minibuf_window = sf->minibuffer_window; 1756 minibuf_window = sf->minibuffer_window;
1757 } 1757 }
1758 1758
diff --git a/src/frame.h b/src/frame.h
index 3af4c54589a..e07974fb4d2 100644
--- a/src/frame.h
+++ b/src/frame.h
@@ -511,7 +511,7 @@ typedef struct frame *FRAME_PTR;
511#define XSETFRAME(a, b) (XSETPSEUDOVECTOR (a, b, PVEC_FRAME)) 511#define XSETFRAME(a, b) (XSETPSEUDOVECTOR (a, b, PVEC_FRAME))
512 512
513/* Given a window, return its frame as a Lisp_Object. */ 513/* Given a window, return its frame as a Lisp_Object. */
514#define WINDOW_FRAME(w) WGET (w, frame) 514#define WINDOW_FRAME(w) w->frame
515 515
516/* Test a frame for particular kinds of display methods. */ 516/* Test a frame for particular kinds of display methods. */
517#define FRAME_INITIAL_P(f) ((f)->output_method == output_initial) 517#define FRAME_INITIAL_P(f) ((f)->output_method == output_initial)
diff --git a/src/fringe.c b/src/fringe.c
index 4a751439305..97d03a2bfae 100644
--- a/src/fringe.c
+++ b/src/fringe.c
@@ -692,7 +692,7 @@ get_logical_cursor_bitmap (struct window *w, Lisp_Object cursor)
692{ 692{
693 Lisp_Object cmap, bm = Qnil; 693 Lisp_Object cmap, bm = Qnil;
694 694
695 if ((cmap = BVAR (XBUFFER (WGET (w, buffer)), fringe_cursor_alist)), !NILP (cmap)) 695 if ((cmap = BVAR (XBUFFER (w->buffer), fringe_cursor_alist)), !NILP (cmap))
696 { 696 {
697 bm = Fassq (cursor, cmap); 697 bm = Fassq (cursor, cmap);
698 if (CONSP (bm)) 698 if (CONSP (bm))
@@ -729,7 +729,7 @@ get_logical_fringe_bitmap (struct window *w, Lisp_Object bitmap, int right_p, in
729 If partial, lookup partial bitmap in default value if not found here. 729 If partial, lookup partial bitmap in default value if not found here.
730 If not partial, or no partial spec is present, use non-partial bitmap. */ 730 If not partial, or no partial spec is present, use non-partial bitmap. */
731 731
732 if ((cmap = BVAR (XBUFFER (WGET (w, buffer)), fringe_indicator_alist)), !NILP (cmap)) 732 if ((cmap = BVAR (XBUFFER (w->buffer), fringe_indicator_alist)), !NILP (cmap))
733 { 733 {
734 bm1 = Fassq (bitmap, cmap); 734 bm1 = Fassq (bitmap, cmap);
735 if (CONSP (bm1)) 735 if (CONSP (bm1))
@@ -956,7 +956,7 @@ update_window_fringes (struct window *w, int keep_current_p)
956 return 0; 956 return 0;
957 957
958 if (!MINI_WINDOW_P (w) 958 if (!MINI_WINDOW_P (w)
959 && (ind = BVAR (XBUFFER (WGET (w, buffer)), indicate_buffer_boundaries), !NILP (ind))) 959 && (ind = BVAR (XBUFFER (w->buffer), indicate_buffer_boundaries), !NILP (ind)))
960 { 960 {
961 if (EQ (ind, Qleft) || EQ (ind, Qright)) 961 if (EQ (ind, Qleft) || EQ (ind, Qright))
962 boundary_top = boundary_bot = arrow_top = arrow_bot = ind; 962 boundary_top = boundary_bot = arrow_top = arrow_bot = ind;
@@ -997,7 +997,7 @@ update_window_fringes (struct window *w, int keep_current_p)
997 { 997 {
998 if (top_ind_rn < 0 && row->visible_height > 0) 998 if (top_ind_rn < 0 && row->visible_height > 0)
999 { 999 {
1000 if (MATRIX_ROW_START_CHARPOS (row) <= BUF_BEGV (XBUFFER (WGET (w, buffer))) 1000 if (MATRIX_ROW_START_CHARPOS (row) <= BUF_BEGV (XBUFFER (w->buffer))
1001 && !MATRIX_ROW_PARTIALLY_VISIBLE_AT_TOP_P (w, row)) 1001 && !MATRIX_ROW_PARTIALLY_VISIBLE_AT_TOP_P (w, row))
1002 row->indicate_bob_p = !NILP (boundary_top); 1002 row->indicate_bob_p = !NILP (boundary_top);
1003 else 1003 else
@@ -1007,7 +1007,7 @@ update_window_fringes (struct window *w, int keep_current_p)
1007 1007
1008 if (bot_ind_rn < 0) 1008 if (bot_ind_rn < 0)
1009 { 1009 {
1010 if (MATRIX_ROW_END_CHARPOS (row) >= BUF_ZV (XBUFFER (WGET (w, buffer))) 1010 if (MATRIX_ROW_END_CHARPOS (row) >= BUF_ZV (XBUFFER (w->buffer))
1011 && !MATRIX_ROW_PARTIALLY_VISIBLE_AT_BOTTOM_P (w, row)) 1011 && !MATRIX_ROW_PARTIALLY_VISIBLE_AT_BOTTOM_P (w, row))
1012 row->indicate_eob_p = !NILP (boundary_bot), bot_ind_rn = rn; 1012 row->indicate_eob_p = !NILP (boundary_bot), bot_ind_rn = rn;
1013 else if (y + row->height >= yb) 1013 else if (y + row->height >= yb)
@@ -1017,7 +1017,7 @@ update_window_fringes (struct window *w, int keep_current_p)
1017 } 1017 }
1018 } 1018 }
1019 1019
1020 empty_pos = BVAR (XBUFFER (WGET (w, buffer)), indicate_empty_lines); 1020 empty_pos = BVAR (XBUFFER (w->buffer), indicate_empty_lines);
1021 if (!NILP (empty_pos) && !EQ (empty_pos, Qright)) 1021 if (!NILP (empty_pos) && !EQ (empty_pos, Qright))
1022 empty_pos = WINDOW_LEFT_FRINGE_WIDTH (w) == 0 ? Qright : Qleft; 1022 empty_pos = WINDOW_LEFT_FRINGE_WIDTH (w) == 0 ? Qright : Qleft;
1023 1023
@@ -1740,7 +1740,7 @@ Return nil if POS is not visible in WINDOW. */)
1740 else if (w == XWINDOW (selected_window)) 1740 else if (w == XWINDOW (selected_window))
1741 textpos = PT; 1741 textpos = PT;
1742 else 1742 else
1743 textpos = XMARKER (WGET (w, pointm))->charpos; 1743 textpos = XMARKER (w->pointm)->charpos;
1744 1744
1745 row = MATRIX_FIRST_TEXT_ROW (w->current_matrix); 1745 row = MATRIX_FIRST_TEXT_ROW (w->current_matrix);
1746 row = row_containing_pos (w, textpos, row, NULL, 0); 1746 row = row_containing_pos (w, textpos, row, NULL, 0);
diff --git a/src/indent.c b/src/indent.c
index fca9f4c9271..928d61196a5 100644
--- a/src/indent.c
+++ b/src/indent.c
@@ -258,7 +258,7 @@ skip_invisible (ptrdiff_t pos, ptrdiff_t *next_boundary_p, ptrdiff_t to, Lisp_Ob
258 the next property change */ 258 the next property change */
259 prop = Fget_char_property (position, Qinvisible, 259 prop = Fget_char_property (position, Qinvisible,
260 (!NILP (window) 260 (!NILP (window)
261 && EQ (WGET (XWINDOW (window), buffer), buffer)) 261 && EQ (XWINDOW (window)->buffer, buffer))
262 ? window : buffer); 262 ? window : buffer);
263 inv_p = TEXT_PROP_MEANS_INVISIBLE (prop); 263 inv_p = TEXT_PROP_MEANS_INVISIBLE (prop);
264 /* When counting columns (window == nil), don't skip over ellipsis text. */ 264 /* When counting columns (window == nil), don't skip over ellipsis text. */
@@ -1173,14 +1173,14 @@ compute_motion (ptrdiff_t from, EMACS_INT fromvpos, EMACS_INT fromhpos, int did_
1173 width = window_body_cols (win); 1173 width = window_body_cols (win);
1174 /* We must make room for continuation marks if we don't have fringes. */ 1174 /* We must make room for continuation marks if we don't have fringes. */
1175#ifdef HAVE_WINDOW_SYSTEM 1175#ifdef HAVE_WINDOW_SYSTEM
1176 if (!FRAME_WINDOW_P (XFRAME (WGET (win, frame)))) 1176 if (!FRAME_WINDOW_P (XFRAME (win->frame)))
1177#endif 1177#endif
1178 width -= 1; 1178 width -= 1;
1179 } 1179 }
1180 1180
1181 continuation_glyph_width = 1; 1181 continuation_glyph_width = 1;
1182#ifdef HAVE_WINDOW_SYSTEM 1182#ifdef HAVE_WINDOW_SYSTEM
1183 if (FRAME_WINDOW_P (XFRAME (WGET (win, frame)))) 1183 if (FRAME_WINDOW_P (XFRAME (win->frame)))
1184 continuation_glyph_width = 0; /* In the fringe. */ 1184 continuation_glyph_width = 0; /* In the fringe. */
1185#endif 1185#endif
1186 1186
@@ -1787,7 +1787,7 @@ visible section of the buffer, and pass LINE and COL as TOPOS. */)
1787 ? (window_body_cols (w) 1787 ? (window_body_cols (w)
1788 - ( 1788 - (
1789#ifdef HAVE_WINDOW_SYSTEM 1789#ifdef HAVE_WINDOW_SYSTEM
1790 FRAME_WINDOW_P (XFRAME (WGET (w, frame))) ? 0 : 1790 FRAME_WINDOW_P (XFRAME (w->frame)) ? 0 :
1791#endif 1791#endif
1792 1)) 1792 1))
1793 : XINT (XCAR (topos))), 1793 : XINT (XCAR (topos))),
@@ -1837,7 +1837,7 @@ vmotion (register ptrdiff_t from, register EMACS_INT vtarget, struct window *w)
1837 1837
1838 /* If the window contains this buffer, use it for getting text properties. 1838 /* If the window contains this buffer, use it for getting text properties.
1839 Otherwise use the current buffer as arg for doing that. */ 1839 Otherwise use the current buffer as arg for doing that. */
1840 if (EQ (WGET (w, buffer), Fcurrent_buffer ())) 1840 if (EQ (w->buffer, Fcurrent_buffer ()))
1841 text_prop_object = window; 1841 text_prop_object = window;
1842 else 1842 else
1843 text_prop_object = Fcurrent_buffer (); 1843 text_prop_object = Fcurrent_buffer ();
@@ -1998,14 +1998,14 @@ whether or not it is currently displayed in some window. */)
1998 1998
1999 old_buffer = Qnil; 1999 old_buffer = Qnil;
2000 GCPRO3 (old_buffer, old_charpos, old_bytepos); 2000 GCPRO3 (old_buffer, old_charpos, old_bytepos);
2001 if (XBUFFER (WGET (w, buffer)) != current_buffer) 2001 if (XBUFFER (w->buffer) != current_buffer)
2002 { 2002 {
2003 /* Set the window's buffer temporarily to the current buffer. */ 2003 /* Set the window's buffer temporarily to the current buffer. */
2004 old_buffer = WGET (w, buffer); 2004 old_buffer = w->buffer;
2005 old_charpos = XMARKER (WGET (w, pointm))->charpos; 2005 old_charpos = XMARKER (w->pointm)->charpos;
2006 old_bytepos = XMARKER (WGET (w, pointm))->bytepos; 2006 old_bytepos = XMARKER (w->pointm)->bytepos;
2007 WSET (w, buffer, Fcurrent_buffer ()); 2007 WSET (w, buffer, Fcurrent_buffer ());
2008 set_marker_both (WGET (w, pointm), WGET (w, buffer), 2008 set_marker_both (w->pointm, w->buffer,
2009 BUF_PT (current_buffer), BUF_PT_BYTE (current_buffer)); 2009 BUF_PT (current_buffer), BUF_PT_BYTE (current_buffer));
2010 } 2010 }
2011 2011
@@ -2137,7 +2137,7 @@ whether or not it is currently displayed in some window. */)
2137 } 2137 }
2138 move_it_in_display_line 2138 move_it_in_display_line
2139 (&it, ZV, 2139 (&it, ZV,
2140 (int)(cols * FRAME_COLUMN_WIDTH (XFRAME (WGET (w, frame))) + 0.5), 2140 (int)(cols * FRAME_COLUMN_WIDTH (XFRAME (w->frame)) + 0.5),
2141 MOVE_TO_X); 2141 MOVE_TO_X);
2142 } 2142 }
2143 2143
@@ -2148,7 +2148,7 @@ whether or not it is currently displayed in some window. */)
2148 if (BUFFERP (old_buffer)) 2148 if (BUFFERP (old_buffer))
2149 { 2149 {
2150 WSET (w, buffer, old_buffer); 2150 WSET (w, buffer, old_buffer);
2151 set_marker_both (WGET (w, pointm), WGET (w, buffer), 2151 set_marker_both (w->pointm, w->buffer,
2152 old_charpos, old_bytepos); 2152 old_charpos, old_bytepos);
2153 } 2153 }
2154 2154
diff --git a/src/insdel.c b/src/insdel.c
index 1753d8c75a8..9646507bc4b 100644
--- a/src/insdel.c
+++ b/src/insdel.c
@@ -1820,7 +1820,7 @@ prepare_to_modify_buffer (ptrdiff_t start, ptrdiff_t end,
1820 1820
1821 /* Let redisplay consider other windows than selected_window 1821 /* Let redisplay consider other windows than selected_window
1822 if modifying another buffer. */ 1822 if modifying another buffer. */
1823 if (XBUFFER (WGET (XWINDOW (selected_window), buffer)) != current_buffer) 1823 if (XBUFFER (XWINDOW (selected_window)->buffer) != current_buffer)
1824 ++windows_or_buffers_changed; 1824 ++windows_or_buffers_changed;
1825 1825
1826 if (BUF_INTERVALS (current_buffer) != 0) 1826 if (BUF_INTERVALS (current_buffer) != 0)
diff --git a/src/keyboard.c b/src/keyboard.c
index 49ea1682400..ce14dfdafe2 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -800,7 +800,7 @@ This function is called by the editor initialization to begin editing. */)
800 update_mode_lines = 1; 800 update_mode_lines = 1;
801 801
802 if (command_loop_level 802 if (command_loop_level
803 && current_buffer != XBUFFER (WGET (XWINDOW (selected_window), buffer))) 803 && current_buffer != XBUFFER (XWINDOW (selected_window)->buffer))
804 buffer = Fcurrent_buffer (); 804 buffer = Fcurrent_buffer ();
805 else 805 else
806 buffer = Qnil; 806 buffer = Qnil;
@@ -1382,8 +1382,8 @@ command_loop_1 (void)
1382 Fkill_emacs (Qnil); 1382 Fkill_emacs (Qnil);
1383 1383
1384 /* Make sure the current window's buffer is selected. */ 1384 /* Make sure the current window's buffer is selected. */
1385 if (XBUFFER (WGET (XWINDOW (selected_window), buffer)) != current_buffer) 1385 if (XBUFFER (XWINDOW (selected_window)->buffer) != current_buffer)
1386 set_buffer_internal (XBUFFER (WGET (XWINDOW (selected_window), buffer))); 1386 set_buffer_internal (XBUFFER (XWINDOW (selected_window)->buffer));
1387 1387
1388 /* Display any malloc warning that just came out. Use while because 1388 /* Display any malloc warning that just came out. Use while because
1389 displaying one warning can cause another. */ 1389 displaying one warning can cause another. */
@@ -1452,8 +1452,8 @@ command_loop_1 (void)
1452 /* A filter may have run while we were reading the input. */ 1452 /* A filter may have run while we were reading the input. */
1453 if (! FRAME_LIVE_P (XFRAME (selected_frame))) 1453 if (! FRAME_LIVE_P (XFRAME (selected_frame)))
1454 Fkill_emacs (Qnil); 1454 Fkill_emacs (Qnil);
1455 if (XBUFFER (WGET (XWINDOW (selected_window), buffer)) != current_buffer) 1455 if (XBUFFER (XWINDOW (selected_window)->buffer) != current_buffer)
1456 set_buffer_internal (XBUFFER (WGET (XWINDOW (selected_window), buffer))); 1456 set_buffer_internal (XBUFFER (XWINDOW (selected_window)->buffer));
1457 1457
1458 ++num_input_keys; 1458 ++num_input_keys;
1459 1459
@@ -1484,7 +1484,7 @@ command_loop_1 (void)
1484 { 1484 {
1485 struct buffer *b; 1485 struct buffer *b;
1486 XWINDOW (selected_window)->force_start = 0; 1486 XWINDOW (selected_window)->force_start = 0;
1487 b = XBUFFER (WGET (XWINDOW (selected_window), buffer)); 1487 b = XBUFFER (XWINDOW (selected_window)->buffer);
1488 BUF_BEG_UNCHANGED (b) = BUF_END_UNCHANGED (b) = 0; 1488 BUF_BEG_UNCHANGED (b) = BUF_END_UNCHANGED (b) = 0;
1489 } 1489 }
1490 1490
@@ -5175,8 +5175,8 @@ make_lispy_position (struct frame *f, Lisp_Object x, Lisp_Object y,
5175 if (STRINGP (string)) 5175 if (STRINGP (string))
5176 string_info = Fcons (string, make_number (charpos)); 5176 string_info = Fcons (string, make_number (charpos));
5177 textpos = (w == XWINDOW (selected_window) 5177 textpos = (w == XWINDOW (selected_window)
5178 && current_buffer == XBUFFER (WGET (w, buffer))) 5178 && current_buffer == XBUFFER (w->buffer))
5179 ? PT : XMARKER (WGET (w, pointm))->charpos; 5179 ? PT : XMARKER (w->pointm)->charpos;
5180 5180
5181 xret = wx; 5181 xret = wx;
5182 yret = wy; 5182 yret = wy;
@@ -5564,7 +5564,7 @@ make_lispy_event (struct input_event *event)
5564 int fuzz; 5564 int fuzz;
5565 5565
5566 if (WINDOWP (event->frame_or_window)) 5566 if (WINDOWP (event->frame_or_window))
5567 f = XFRAME (WGET (XWINDOW (event->frame_or_window), frame)); 5567 f = XFRAME (XWINDOW (event->frame_or_window)->frame);
5568 else if (FRAMEP (event->frame_or_window)) 5568 else if (FRAMEP (event->frame_or_window))
5569 f = XFRAME (event->frame_or_window); 5569 f = XFRAME (event->frame_or_window);
5570 else 5570 else
@@ -5732,7 +5732,7 @@ make_lispy_event (struct input_event *event)
5732 int is_double; 5732 int is_double;
5733 5733
5734 if (WINDOWP (event->frame_or_window)) 5734 if (WINDOWP (event->frame_or_window))
5735 fr = XFRAME (WGET (XWINDOW (event->frame_or_window), frame)); 5735 fr = XFRAME (XWINDOW (event->frame_or_window)->frame);
5736 else if (FRAMEP (event->frame_or_window)) 5736 else if (FRAMEP (event->frame_or_window))
5737 fr = XFRAME (event->frame_or_window); 5737 fr = XFRAME (event->frame_or_window);
5738 else 5738 else
@@ -9402,8 +9402,8 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt,
9402 { 9402 {
9403 if (! FRAME_LIVE_P (XFRAME (selected_frame))) 9403 if (! FRAME_LIVE_P (XFRAME (selected_frame)))
9404 Fkill_emacs (Qnil); 9404 Fkill_emacs (Qnil);
9405 if (XBUFFER (WGET (XWINDOW (selected_window), buffer)) != current_buffer) 9405 if (XBUFFER (XWINDOW (selected_window)->buffer) != current_buffer)
9406 Fset_buffer (WGET (XWINDOW (selected_window), buffer)); 9406 Fset_buffer (XWINDOW (selected_window)->buffer);
9407 } 9407 }
9408 9408
9409 orig_local_map = get_local_map (PT, current_buffer, Qlocal_map); 9409 orig_local_map = get_local_map (PT, current_buffer, Qlocal_map);
@@ -9495,8 +9495,8 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt,
9495 not the current buffer. If we're at the 9495 not the current buffer. If we're at the
9496 beginning of a key sequence, switch buffers. */ 9496 beginning of a key sequence, switch buffers. */
9497 if (WINDOWP (window) 9497 if (WINDOWP (window)
9498 && BUFFERP (WGET (XWINDOW (window), buffer)) 9498 && BUFFERP (XWINDOW (window)->buffer)
9499 && XBUFFER (WGET (XWINDOW (window), buffer)) != current_buffer) 9499 && XBUFFER (XWINDOW (window)->buffer) != current_buffer)
9500 { 9500 {
9501 ASET (raw_keybuf, raw_keybuf_count, key); 9501 ASET (raw_keybuf, raw_keybuf_count, key);
9502 raw_keybuf_count++; 9502 raw_keybuf_count++;
@@ -9517,7 +9517,7 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt,
9517 9517
9518 if (! FRAME_LIVE_P (XFRAME (selected_frame))) 9518 if (! FRAME_LIVE_P (XFRAME (selected_frame)))
9519 Fkill_emacs (Qnil); 9519 Fkill_emacs (Qnil);
9520 set_buffer_internal (XBUFFER (WGET (XWINDOW (window), buffer))); 9520 set_buffer_internal (XBUFFER (XWINDOW (window)->buffer));
9521 orig_local_map = get_local_map (PT, current_buffer, 9521 orig_local_map = get_local_map (PT, current_buffer,
9522 Qlocal_map); 9522 Qlocal_map);
9523 orig_keymap = get_local_map (PT, current_buffer, 9523 orig_keymap = get_local_map (PT, current_buffer,
@@ -11201,7 +11201,7 @@ The `posn-' functions access elements of such lists. */)
11201 ? window_box_left_offset (w, TEXT_AREA) 11201 ? window_box_left_offset (w, TEXT_AREA)
11202 : 0))); 11202 : 0)));
11203 XSETINT (y, WINDOW_TO_FRAME_PIXEL_Y (w, XINT (y))); 11203 XSETINT (y, WINDOW_TO_FRAME_PIXEL_Y (w, XINT (y)));
11204 frame_or_window = WGET (w, frame); 11204 frame_or_window = w->frame;
11205 } 11205 }
11206 11206
11207 CHECK_LIVE_FRAME (frame_or_window); 11207 CHECK_LIVE_FRAME (frame_or_window);
diff --git a/src/keymap.c b/src/keymap.c
index a0a35285131..e337147ad41 100644
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -1560,8 +1560,8 @@ like in the respective argument of `key-binding'. */)
1560 window = POSN_WINDOW (position); 1560 window = POSN_WINDOW (position);
1561 1561
1562 if (WINDOWP (window) 1562 if (WINDOWP (window)
1563 && BUFFERP (WGET (XWINDOW (window), buffer)) 1563 && BUFFERP (XWINDOW (window)->buffer)
1564 && XBUFFER (WGET (XWINDOW (window), buffer)) != current_buffer) 1564 && XBUFFER (XWINDOW (window)->buffer) != current_buffer)
1565 { 1565 {
1566 /* Arrange to go back to the original buffer once we're done 1566 /* Arrange to go back to the original buffer once we're done
1567 processing the key sequence. We don't use 1567 processing the key sequence. We don't use
@@ -1573,7 +1573,7 @@ like in the respective argument of `key-binding'. */)
1573 1573
1574 record_unwind_protect (Fset_buffer, Fcurrent_buffer ()); 1574 record_unwind_protect (Fset_buffer, Fcurrent_buffer ());
1575 1575
1576 set_buffer_internal (XBUFFER (WGET (XWINDOW (window), buffer))); 1576 set_buffer_internal (XBUFFER (XWINDOW (window)->buffer));
1577 } 1577 }
1578 } 1578 }
1579 1579
diff --git a/src/lisp.h b/src/lisp.h
index aa06daa3cc5..b6a36444043 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -1787,7 +1787,7 @@ typedef struct {
1787 vchild, and hchild members are all nil. */ 1787 vchild, and hchild members are all nil. */
1788 1788
1789#define CHECK_LIVE_WINDOW(x) \ 1789#define CHECK_LIVE_WINDOW(x) \
1790 CHECK_TYPE (WINDOWP (x) && !NILP (WGET (XWINDOW (x), buffer)), \ 1790 CHECK_TYPE (WINDOWP (x) && !NILP (XWINDOW (x)->buffer), \
1791 Qwindow_live_p, x) 1791 Qwindow_live_p, x)
1792 1792
1793#define CHECK_PROCESS(x) \ 1793#define CHECK_PROCESS(x) \
diff --git a/src/minibuf.c b/src/minibuf.c
index ec8148e9024..928bdadefc8 100644
--- a/src/minibuf.c
+++ b/src/minibuf.c
@@ -115,7 +115,7 @@ choose_minibuf_frame (void)
115 /* Under X, we come here with minibuf_window being the 115 /* Under X, we come here with minibuf_window being the
116 minibuffer window of the unused termcap window created in 116 minibuffer window of the unused termcap window created in
117 init_window_once. That window doesn't have a buffer. */ 117 init_window_once. That window doesn't have a buffer. */
118 buffer = WGET (XWINDOW (minibuf_window), buffer); 118 buffer = XWINDOW (minibuf_window)->buffer;
119 if (BUFFERP (buffer)) 119 if (BUFFERP (buffer))
120 Fset_window_buffer (sf->minibuffer_window, buffer, Qnil); 120 Fset_window_buffer (sf->minibuffer_window, buffer, Qnil);
121 minibuf_window = sf->minibuffer_window; 121 minibuf_window = sf->minibuffer_window;
@@ -612,7 +612,7 @@ read_minibuf (Lisp_Object map, Lisp_Object initial, Lisp_Object prompt,
612 FOR_EACH_FRAME (dummy, frame) 612 FOR_EACH_FRAME (dummy, frame)
613 { 613 {
614 Lisp_Object root_window = Fframe_root_window (frame); 614 Lisp_Object root_window = Fframe_root_window (frame);
615 Lisp_Object mini_window = WGET (XWINDOW (root_window), next); 615 Lisp_Object mini_window = XWINDOW (root_window)->next;
616 616
617 if (! NILP (mini_window) && ! EQ (mini_window, minibuf_window) 617 if (! NILP (mini_window) && ! EQ (mini_window, minibuf_window)
618 && !NILP (Fwindow_minibuffer_p (mini_window))) 618 && !NILP (Fwindow_minibuffer_p (mini_window)))
@@ -687,7 +687,7 @@ read_minibuf (Lisp_Object map, Lisp_Object initial, Lisp_Object prompt,
687 XWINDOW (minibuf_window)->must_be_updated_p = 1; 687 XWINDOW (minibuf_window)->must_be_updated_p = 1;
688 update_frame (XFRAME (selected_frame), 1, 1); 688 update_frame (XFRAME (selected_frame), 1, 1);
689 { 689 {
690 struct frame *f = XFRAME (WGET (XWINDOW (minibuf_window), frame)); 690 struct frame *f = XFRAME (XWINDOW (minibuf_window)->frame);
691 struct redisplay_interface *rif = FRAME_RIF (f); 691 struct redisplay_interface *rif = FRAME_RIF (f);
692 if (rif && rif->flush_display) 692 if (rif && rif->flush_display)
693 rif->flush_display (f); 693 rif->flush_display (f);
@@ -844,7 +844,7 @@ read_minibuf_unwind (Lisp_Object data)
844 window = minibuf_window; 844 window = minibuf_window;
845 /* To keep things predictable, in case it matters, let's be in the 845 /* To keep things predictable, in case it matters, let's be in the
846 minibuffer when we reset the relevant variables. */ 846 minibuffer when we reset the relevant variables. */
847 Fset_buffer (WGET (XWINDOW (window), buffer)); 847 Fset_buffer (XWINDOW (window)->buffer);
848 848
849 /* Restore prompt, etc, from outer minibuffer level. */ 849 /* Restore prompt, etc, from outer minibuffer level. */
850 minibuf_prompt = Fcar (minibuf_save_list); 850 minibuf_prompt = Fcar (minibuf_save_list);
diff --git a/src/msdos.c b/src/msdos.c
index 4cb7f94ae3d..45f30af6d8c 100644
--- a/src/msdos.c
+++ b/src/msdos.c
@@ -594,7 +594,7 @@ dos_set_window_size (int *rows, int *cols)
594 Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f); 594 Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f);
595 Lisp_Object window = hlinfo->mouse_face_window; 595 Lisp_Object window = hlinfo->mouse_face_window;
596 596
597 if (! NILP (window) && XFRAME (WGET (XWINDOW (window), frame)) == f) 597 if (! NILP (window) && XFRAME (XWINDOW (window)->frame) == f)
598 { 598 {
599 hlinfo->mouse_face_beg_row = hlinfo->mouse_face_beg_col = -1; 599 hlinfo->mouse_face_beg_row = hlinfo->mouse_face_beg_col = -1;
600 hlinfo->mouse_face_end_row = hlinfo->mouse_face_end_col = -1; 600 hlinfo->mouse_face_end_row = hlinfo->mouse_face_end_col = -1;
@@ -1255,7 +1255,7 @@ IT_update_begin (struct frame *f)
1255 /* If the mouse highlight is in the window that was deleted 1255 /* If the mouse highlight is in the window that was deleted
1256 (e.g., if it was popped by completion), clear highlight 1256 (e.g., if it was popped by completion), clear highlight
1257 unconditionally. */ 1257 unconditionally. */
1258 if (NILP (WGET (w, buffer))) 1258 if (NILP (w->buffer))
1259 hlinfo->mouse_face_window = Qnil; 1259 hlinfo->mouse_face_window = Qnil;
1260 else 1260 else
1261 { 1261 {
@@ -1265,7 +1265,7 @@ IT_update_begin (struct frame *f)
1265 break; 1265 break;
1266 } 1266 }
1267 1267
1268 if (NILP (WGET (w, buffer)) || i < w->desired_matrix->nrows) 1268 if (NILP (w->buffer) || i < w->desired_matrix->nrows)
1269 clear_mouse_face (hlinfo); 1269 clear_mouse_face (hlinfo);
1270 } 1270 }
1271 } 1271 }
@@ -1327,7 +1327,7 @@ IT_frame_up_to_date (struct frame *f)
1327 new_cursor = frame_desired_cursor; 1327 new_cursor = frame_desired_cursor;
1328 else 1328 else
1329 { 1329 {
1330 struct buffer *b = XBUFFER (WGET (sw, buffer)); 1330 struct buffer *b = XBUFFER (sw->buffer);
1331 1331
1332 if (EQ (BVAR (b,cursor_type), Qt)) 1332 if (EQ (BVAR (b,cursor_type), Qt))
1333 new_cursor = frame_desired_cursor; 1333 new_cursor = frame_desired_cursor;
diff --git a/src/nsfns.m b/src/nsfns.m
index a15caf9b905..a19cbfb657c 100644
--- a/src/nsfns.m
+++ b/src/nsfns.m
@@ -607,7 +607,7 @@ ns_set_name_as_filename (struct frame *f)
607{ 607{
608 NSView *view; 608 NSView *view;
609 Lisp_Object name, filename; 609 Lisp_Object name, filename;
610 Lisp_Object buf = WGET (XWINDOW (f->selected_window), buffer); 610 Lisp_Object buf = XWINDOW (f->selected_window)->buffer;
611 const char *title; 611 const char *title;
612 NSAutoreleasePool *pool; 612 NSAutoreleasePool *pool;
613 struct gcpro gcpro1; 613 struct gcpro gcpro1;
diff --git a/src/nsmenu.m b/src/nsmenu.m
index 2707bb5e017..210f4530d7a 100644
--- a/src/nsmenu.m
+++ b/src/nsmenu.m
@@ -193,7 +193,7 @@ ns_update_menubar (struct frame *f, int deep_p, EmacsMenu *submenu)
193 = alloca (previous_menu_items_used * sizeof *previous_items); 193 = alloca (previous_menu_items_used * sizeof *previous_items);
194 194
195 /* lisp preliminaries */ 195 /* lisp preliminaries */
196 buffer = WGET (XWINDOW (FRAME_SELECTED_WINDOW (f)), buffer); 196 buffer = XWINDOW (FRAME_SELECTED_WINDOW (f))->buffer;
197 specbind (Qinhibit_quit, Qt); 197 specbind (Qinhibit_quit, Qt);
198 specbind (Qdebug_on_next_call, Qnil); 198 specbind (Qdebug_on_next_call, Qnil);
199 record_unwind_save_match_data (); 199 record_unwind_save_match_data ();
diff --git a/src/nsterm.m b/src/nsterm.m
index 472a49bd8ff..4d3a1387259 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -667,7 +667,7 @@ ns_update_window_end (struct window *w, int cursor_on_p,
667 external (RIF) call; for one window called before update_end 667 external (RIF) call; for one window called before update_end
668 -------------------------------------------------------------------------- */ 668 -------------------------------------------------------------------------- */
669{ 669{
670 Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (XFRAME (WGET (w, frame))); 670 Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (XFRAME (w->frame));
671 671
672 /* note: this fn is nearly identical in all terms */ 672 /* note: this fn is nearly identical in all terms */
673 if (!w->pseudo_window_p) 673 if (!w->pseudo_window_p)
@@ -2035,7 +2035,7 @@ ns_scroll_run (struct window *w, struct run *run)
2035 External (RIF): Insert or delete n lines at line vpos 2035 External (RIF): Insert or delete n lines at line vpos
2036 -------------------------------------------------------------------------- */ 2036 -------------------------------------------------------------------------- */
2037{ 2037{
2038 struct frame *f = XFRAME (WGET (w, frame)); 2038 struct frame *f = XFRAME (w->frame);
2039 int x, y, width, height, from_y, to_y, bottom_y; 2039 int x, y, width, height, from_y, to_y, bottom_y;
2040 2040
2041 NSTRACE (ns_scroll_run); 2041 NSTRACE (ns_scroll_run);
@@ -2114,7 +2114,7 @@ ns_after_update_window_line (struct glyph_row *desired_row)
2114 full-width rows stays visible in the internal border. 2114 full-width rows stays visible in the internal border.
2115 Under NS this is drawn inside the fringes. */ 2115 Under NS this is drawn inside the fringes. */
2116 if (windows_or_buffers_changed 2116 if (windows_or_buffers_changed
2117 && (f = XFRAME (WGET (w, frame)), 2117 && (f = XFRAME (w->frame),
2118 width = FRAME_INTERNAL_BORDER_WIDTH (f), 2118 width = FRAME_INTERNAL_BORDER_WIDTH (f),
2119 width != 0) 2119 width != 0)
2120 && (height = desired_row->visible_height, 2120 && (height = desired_row->visible_height,
@@ -3622,9 +3622,9 @@ ns_set_vertical_scroll_bar (struct window *window,
3622 EmacsScroller *bar; 3622 EmacsScroller *bar;
3623 3623
3624 /* optimization; display engine sends WAY too many of these.. */ 3624 /* optimization; display engine sends WAY too many of these.. */
3625 if (!NILP (WGET (window, vertical_scroll_bar))) 3625 if (!NILP (window->vertical_scroll_bar))
3626 { 3626 {
3627 bar = XNS_SCROLL_BAR (WGET (window, vertical_scroll_bar)); 3627 bar = XNS_SCROLL_BAR (window->vertical_scroll_bar);
3628 if ([bar checkSamePosition: position portion: portion whole: whole]) 3628 if ([bar checkSamePosition: position portion: portion whole: whole])
3629 { 3629 {
3630 if (view->scrollbarsNeedingUpdate == 0) 3630 if (view->scrollbarsNeedingUpdate == 0)
@@ -3672,9 +3672,9 @@ ns_set_vertical_scroll_bar (struct window *window,
3672 /* we want at least 5 lines to display a scrollbar */ 3672 /* we want at least 5 lines to display a scrollbar */
3673 if (WINDOW_TOTAL_LINES (window) < 5) 3673 if (WINDOW_TOTAL_LINES (window) < 5)
3674 { 3674 {
3675 if (!NILP (WGET (window, vertical_scroll_bar))) 3675 if (!NILP (window->vertical_scroll_bar))
3676 { 3676 {
3677 bar = XNS_SCROLL_BAR (WGET (window, vertical_scroll_bar)); 3677 bar = XNS_SCROLL_BAR (window->vertical_scroll_bar);
3678 [bar removeFromSuperview]; 3678 [bar removeFromSuperview];
3679 WSET (window, vertical_scroll_bar, Qnil); 3679 WSET (window, vertical_scroll_bar, Qnil);
3680 } 3680 }
@@ -3683,7 +3683,7 @@ ns_set_vertical_scroll_bar (struct window *window,
3683 return; 3683 return;
3684 } 3684 }
3685 3685
3686 if (NILP (WGET (window, vertical_scroll_bar))) 3686 if (NILP (window->vertical_scroll_bar))
3687 { 3687 {
3688 ns_clear_frame_area (f, sb_left, top, width, height); 3688 ns_clear_frame_area (f, sb_left, top, width, height);
3689 bar = [[EmacsScroller alloc] initFrame: r window: win]; 3689 bar = [[EmacsScroller alloc] initFrame: r window: win];
@@ -3692,7 +3692,7 @@ ns_set_vertical_scroll_bar (struct window *window,
3692 else 3692 else
3693 { 3693 {
3694 NSRect oldRect; 3694 NSRect oldRect;
3695 bar = XNS_SCROLL_BAR (WGET (window, vertical_scroll_bar)); 3695 bar = XNS_SCROLL_BAR (window->vertical_scroll_bar);
3696 oldRect = [bar frame]; 3696 oldRect = [bar frame];
3697 r.size.width = oldRect.size.width; 3697 r.size.width = oldRect.size.width;
3698 if (FRAME_LIVE_P (f) && !NSEqualRects (oldRect, r)) 3698 if (FRAME_LIVE_P (f) && !NSEqualRects (oldRect, r))
@@ -3739,9 +3739,9 @@ ns_redeem_scroll_bar (struct window *window)
3739{ 3739{
3740 id bar; 3740 id bar;
3741 NSTRACE (ns_redeem_scroll_bar); 3741 NSTRACE (ns_redeem_scroll_bar);
3742 if (!NILP (WGET (window, vertical_scroll_bar))) 3742 if (!NILP (window->vertical_scroll_bar))
3743 { 3743 {
3744 bar = XNS_SCROLL_BAR (WGET (window, vertical_scroll_bar)); 3744 bar = XNS_SCROLL_BAR (window->vertical_scroll_bar);
3745 [bar reprieve]; 3745 [bar reprieve];
3746 } 3746 }
3747} 3747}
@@ -6061,8 +6061,7 @@ ns_term_shutdown (int sig)
6061{ 6061{
6062 Lisp_Object str = Qnil; 6062 Lisp_Object str = Qnil;
6063 struct frame *f = SELECTED_FRAME (); 6063 struct frame *f = SELECTED_FRAME ();
6064 struct buffer *curbuf 6064 struct buffer *curbuf = XBUFFER (XWINDOW (f->selected_window)->buffer);
6065 = XBUFFER (WGET (XWINDOW (f->selected_window), buffer));
6066 6065
6067 if ([attribute isEqualToString:NSAccessibilityRoleAttribute]) 6066 if ([attribute isEqualToString:NSAccessibilityRoleAttribute])
6068 return NSAccessibilityTextFieldRole; 6067 return NSAccessibilityTextFieldRole;
@@ -6237,7 +6236,7 @@ ns_term_shutdown (int sig)
6237 if (pixel_height == 0) pixel_height = 1; 6236 if (pixel_height == 0) pixel_height = 1;
6238 min_portion = 20 / pixel_height; 6237 min_portion = 20 / pixel_height;
6239 6238
6240 frame = XFRAME (WGET (XWINDOW (win), frame)); 6239 frame = XFRAME (XWINDOW (win)->frame);
6241 if (FRAME_LIVE_P (frame)) 6240 if (FRAME_LIVE_P (frame))
6242 { 6241 {
6243 int i; 6242 int i;
diff --git a/src/print.c b/src/print.c
index 39726552ae6..ffa8a9b1b48 100644
--- a/src/print.c
+++ b/src/print.c
@@ -1773,10 +1773,10 @@ print_object (Lisp_Object obj, register Lisp_Object printcharfun, int escapeflag
1773 strout ("#<window ", -1, -1, printcharfun); 1773 strout ("#<window ", -1, -1, printcharfun);
1774 len = sprintf (buf, "%d", XWINDOW (obj)->sequence_number); 1774 len = sprintf (buf, "%d", XWINDOW (obj)->sequence_number);
1775 strout (buf, len, len, printcharfun); 1775 strout (buf, len, len, printcharfun);
1776 if (!NILP (WGET (XWINDOW (obj), buffer))) 1776 if (!NILP (XWINDOW (obj)->buffer))
1777 { 1777 {
1778 strout (" on ", -1, -1, printcharfun); 1778 strout (" on ", -1, -1, printcharfun);
1779 print_string (BVAR (XBUFFER (WGET (XWINDOW (obj), buffer)), name), 1779 print_string (BVAR (XBUFFER (XWINDOW (obj)->buffer), name),
1780 printcharfun); 1780 printcharfun);
1781 } 1781 }
1782 PRINTCHAR ('>'); 1782 PRINTCHAR ('>');
diff --git a/src/textprop.c b/src/textprop.c
index 02f134ec033..8aa52bebe5b 100644
--- a/src/textprop.c
+++ b/src/textprop.c
@@ -587,7 +587,7 @@ get_char_property_and_overlay (Lisp_Object position, register Lisp_Object prop,
587 if (WINDOWP (object)) 587 if (WINDOWP (object))
588 { 588 {
589 w = XWINDOW (object); 589 w = XWINDOW (object);
590 object = WGET (w, buffer); 590 object = w->buffer;
591 } 591 }
592 if (BUFFERP (object)) 592 if (BUFFERP (object))
593 { 593 {
diff --git a/src/w32fns.c b/src/w32fns.c
index c8218c12c18..3c40361ca86 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -5635,13 +5635,13 @@ Text larger than the specified size is clipped. */)
5635 WSET (w, total_lines, make_number (40)); 5635 WSET (w, total_lines, make_number (40));
5636 } 5636 }
5637 5637
5638 FRAME_TOTAL_COLS (f) = XINT (WGET (w, total_cols)); 5638 FRAME_TOTAL_COLS (f) = XINT (w->total_cols);
5639 adjust_glyphs (f); 5639 adjust_glyphs (f);
5640 w->pseudo_window_p = 1; 5640 w->pseudo_window_p = 1;
5641 5641
5642 /* Display the tooltip text in a temporary buffer. */ 5642 /* Display the tooltip text in a temporary buffer. */
5643 old_buffer = current_buffer; 5643 old_buffer = current_buffer;
5644 set_buffer_internal_1 (XBUFFER (WGET (XWINDOW (FRAME_ROOT_WINDOW (f)), buffer))); 5644 set_buffer_internal_1 (XBUFFER (XWINDOW (FRAME_ROOT_WINDOW (f))->buffer));
5645 BVAR (current_buffer, truncate_lines) = Qnil; 5645 BVAR (current_buffer, truncate_lines) = Qnil;
5646 clear_glyph_matrix (w->desired_matrix); 5646 clear_glyph_matrix (w->desired_matrix);
5647 clear_glyph_matrix (w->current_matrix); 5647 clear_glyph_matrix (w->current_matrix);
diff --git a/src/w32menu.c b/src/w32menu.c
index 1c837bed375..02302c2d594 100644
--- a/src/w32menu.c
+++ b/src/w32menu.c
@@ -394,7 +394,7 @@ set_frame_menubar (FRAME_PTR f, int first_time, int deep_p)
394 if (! menubar_widget) 394 if (! menubar_widget)
395 previous_menu_items_used = 0; 395 previous_menu_items_used = 0;
396 396
397 buffer = WGET (XWINDOW (FRAME_SELECTED_WINDOW (f)), buffer); 397 buffer = XWINDOW (FRAME_SELECTED_WINDOW (f))->buffer;
398 specbind (Qinhibit_quit, Qt); 398 specbind (Qinhibit_quit, Qt);
399 /* Don't let the debugger step into this code 399 /* Don't let the debugger step into this code
400 because it is not reentrant. */ 400 because it is not reentrant. */
diff --git a/src/w32term.c b/src/w32term.c
index eebf5e5d2ab..8108a1eb1c0 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -649,7 +649,7 @@ static void
649x_update_window_end (struct window *w, int cursor_on_p, 649x_update_window_end (struct window *w, int cursor_on_p,
650 int mouse_face_overwritten_p) 650 int mouse_face_overwritten_p)
651{ 651{
652 Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (XFRAME (WGET (w, frame))); 652 Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (XFRAME (w->frame));
653 653
654 if (!w->pseudo_window_p) 654 if (!w->pseudo_window_p)
655 { 655 {
@@ -754,7 +754,7 @@ x_after_update_window_line (struct glyph_row *desired_row)
754 overhead is very small. */ 754 overhead is very small. */
755 if (windows_or_buffers_changed 755 if (windows_or_buffers_changed
756 && desired_row->full_width_p 756 && desired_row->full_width_p
757 && (f = XFRAME (WGET (w, frame)), 757 && (f = XFRAME (w->frame),
758 width = FRAME_INTERNAL_BORDER_WIDTH (f), 758 width = FRAME_INTERNAL_BORDER_WIDTH (f),
759 width != 0) 759 width != 0)
760 && (height = desired_row->visible_height, 760 && (height = desired_row->visible_height,
@@ -2718,7 +2718,7 @@ x_ins_del_lines (struct frame *f, int vpos, int n)
2718static void 2718static void
2719x_scroll_run (struct window *w, struct run *run) 2719x_scroll_run (struct window *w, struct run *run)
2720{ 2720{
2721 struct frame *f = XFRAME (WGET (w, frame)); 2721 struct frame *f = XFRAME (w->frame);
2722 int x, y, width, height, from_y, to_y, bottom_y; 2722 int x, y, width, height, from_y, to_y, bottom_y;
2723 HWND hwnd = FRAME_W32_WINDOW (f); 2723 HWND hwnd = FRAME_W32_WINDOW (f);
2724 HRGN expect_dirty; 2724 HRGN expect_dirty;
@@ -3683,7 +3683,7 @@ static void
3683w32_set_vertical_scroll_bar (struct window *w, 3683w32_set_vertical_scroll_bar (struct window *w,
3684 int portion, int whole, int position) 3684 int portion, int whole, int position)
3685{ 3685{
3686 struct frame *f = XFRAME (WGET (w, frame)); 3686 struct frame *f = XFRAME (w->frame);
3687 Lisp_Object barobj; 3687 Lisp_Object barobj;
3688 struct scroll_bar *bar; 3688 struct scroll_bar *bar;
3689 int top, height, left, sb_left, width, sb_width; 3689 int top, height, left, sb_left, width, sb_width;
@@ -3724,7 +3724,7 @@ w32_set_vertical_scroll_bar (struct window *w,
3724 || WINDOW_RIGHT_MARGIN_COLS (w) == 0)); 3724 || WINDOW_RIGHT_MARGIN_COLS (w) == 0));
3725 3725
3726 /* Does the scroll bar exist yet? */ 3726 /* Does the scroll bar exist yet? */
3727 if (NILP (WGET (w, vertical_scroll_bar))) 3727 if (NILP (w->vertical_scroll_bar))
3728 { 3728 {
3729 HDC hdc; 3729 HDC hdc;
3730 BLOCK_INPUT; 3730 BLOCK_INPUT;
@@ -3746,7 +3746,7 @@ w32_set_vertical_scroll_bar (struct window *w,
3746 /* It may just need to be moved and resized. */ 3746 /* It may just need to be moved and resized. */
3747 HWND hwnd; 3747 HWND hwnd;
3748 3748
3749 bar = XSCROLL_BAR (WGET (w, vertical_scroll_bar)); 3749 bar = XSCROLL_BAR (w->vertical_scroll_bar);
3750 hwnd = SCROLL_BAR_W32_WINDOW (bar); 3750 hwnd = SCROLL_BAR_W32_WINDOW (bar);
3751 3751
3752 /* If already correctly positioned, do nothing. */ 3752 /* If already correctly positioned, do nothing. */
@@ -3853,10 +3853,10 @@ w32_redeem_scroll_bar (struct window *window)
3853 struct frame *f; 3853 struct frame *f;
3854 3854
3855 /* We can't redeem this window's scroll bar if it doesn't have one. */ 3855 /* We can't redeem this window's scroll bar if it doesn't have one. */
3856 if (NILP (WGET (window, vertical_scroll_bar))) 3856 if (NILP (window->vertical_scroll_bar))
3857 abort (); 3857 abort ();
3858 3858
3859 bar = XSCROLL_BAR (WGET (window, vertical_scroll_bar)); 3859 bar = XSCROLL_BAR (window->vertical_scroll_bar);
3860 3860
3861 /* Unlink it from the condemned list. */ 3861 /* Unlink it from the condemned list. */
3862 f = XFRAME (WINDOW_FRAME (window)); 3862 f = XFRAME (WINDOW_FRAME (window));
@@ -3864,11 +3864,11 @@ w32_redeem_scroll_bar (struct window *window)
3864 { 3864 {
3865 /* If the prev pointer is nil, it must be the first in one of 3865 /* If the prev pointer is nil, it must be the first in one of
3866 the lists. */ 3866 the lists. */
3867 if (EQ (FRAME_SCROLL_BARS (f), WGET (window, vertical_scroll_bar))) 3867 if (EQ (FRAME_SCROLL_BARS (f), window->vertical_scroll_bar))
3868 /* It's not condemned. Everything's fine. */ 3868 /* It's not condemned. Everything's fine. */
3869 return; 3869 return;
3870 else if (EQ (FRAME_CONDEMNED_SCROLL_BARS (f), 3870 else if (EQ (FRAME_CONDEMNED_SCROLL_BARS (f),
3871 WGET (window, vertical_scroll_bar))) 3871 window->vertical_scroll_bar))
3872 FSET (f, condemned_scroll_bars, bar->next); 3872 FSET (f, condemned_scroll_bars, bar->next);
3873 else 3873 else
3874 /* If its prev pointer is nil, it must be at the front of 3874 /* If its prev pointer is nil, it must be at the front of
@@ -4427,8 +4427,8 @@ w32_read_socket (struct terminal *terminal, int expected,
4427 create event iff we don't leave the 4427 create event iff we don't leave the
4428 selected frame. */ 4428 selected frame. */
4429 && (focus_follows_mouse 4429 && (focus_follows_mouse
4430 || (EQ (WGET (XWINDOW (window), frame), 4430 || (EQ (XWINDOW (window)->frame,
4431 WGET (XWINDOW (selected_window), frame))))) 4431 XWINDOW (selected_window)->frame))))
4432 { 4432 {
4433 inev.kind = SELECT_WINDOW_EVENT; 4433 inev.kind = SELECT_WINDOW_EVENT;
4434 inev.frame_or_window = window; 4434 inev.frame_or_window = window;
@@ -5043,7 +5043,7 @@ static void
5043x_draw_bar_cursor (struct window *w, struct glyph_row *row, 5043x_draw_bar_cursor (struct window *w, struct glyph_row *row,
5044 int width, enum text_cursor_kinds kind) 5044 int width, enum text_cursor_kinds kind)
5045{ 5045{
5046 struct frame *f = XFRAME (WGET (w, frame)); 5046 struct frame *f = XFRAME (w->frame);
5047 struct glyph *cursor_glyph; 5047 struct glyph *cursor_glyph;
5048 5048
5049 /* If cursor is out of bounds, don't draw garbage. This can happen 5049 /* If cursor is out of bounds, don't draw garbage. This can happen
diff --git a/src/window.c b/src/window.c
index 866f4d34a76..1348eab0ff6 100644
--- a/src/window.c
+++ b/src/window.c
@@ -176,7 +176,7 @@ DEFUN ("window-frame", Fwindow_frame, Swindow_frame, 1, 1, 0,
176If WINDOW is omitted or nil, it defaults to the selected window. */) 176If WINDOW is omitted or nil, it defaults to the selected window. */)
177 (Lisp_Object window) 177 (Lisp_Object window)
178{ 178{
179 return WGET (decode_any_window (window), frame); 179 return decode_any_window (window)->frame;
180} 180}
181 181
182DEFUN ("frame-root-window", Fframe_root_window, Sframe_root_window, 0, 1, 0, 182DEFUN ("frame-root-window", Fframe_root_window, Sframe_root_window, 0, 1, 0,
@@ -242,12 +242,12 @@ the first window of that frame. */)
242 window = XFRAME (frame_or_window)->root_window; 242 window = XFRAME (frame_or_window)->root_window;
243 } 243 }
244 244
245 while (NILP (WGET (XWINDOW (window), buffer))) 245 while (NILP (XWINDOW (window)->buffer))
246 { 246 {
247 if (! NILP (WGET (XWINDOW (window), hchild))) 247 if (! NILP (XWINDOW (window)->hchild))
248 window = WGET (XWINDOW (window), hchild); 248 window = XWINDOW (window)->hchild;
249 else if (! NILP (WGET (XWINDOW (window), vchild))) 249 else if (! NILP (XWINDOW (window)->vchild))
250 window = WGET (XWINDOW (window), vchild); 250 window = XWINDOW (window)->vchild;
251 else 251 else
252 abort (); 252 abort ();
253 } 253 }
@@ -335,7 +335,7 @@ select_window (Lisp_Object window, Lisp_Object norecord, int inhibit_point_swap)
335 if (NILP (norecord)) 335 if (NILP (norecord))
336 { 336 {
337 w->use_time = ++window_select_count; 337 w->use_time = ++window_select_count;
338 record_buffer (WGET (w, buffer)); 338 record_buffer (w->buffer);
339 } 339 }
340 340
341 if (EQ (window, selected_window) && !inhibit_point_swap) 341 if (EQ (window, selected_window) && !inhibit_point_swap)
@@ -363,17 +363,17 @@ select_window (Lisp_Object window, Lisp_Object norecord, int inhibit_point_swap)
363 if (!inhibit_point_swap) 363 if (!inhibit_point_swap)
364 { 364 {
365 ow = XWINDOW (selected_window); 365 ow = XWINDOW (selected_window);
366 if (! NILP (WGET (ow, buffer))) 366 if (! NILP (ow->buffer))
367 set_marker_both (WGET (ow, pointm), WGET (ow, buffer), 367 set_marker_both (ow->pointm, ow->buffer,
368 BUF_PT (XBUFFER (WGET (ow, buffer))), 368 BUF_PT (XBUFFER (ow->buffer)),
369 BUF_PT_BYTE (XBUFFER (WGET (ow, buffer)))); 369 BUF_PT_BYTE (XBUFFER (ow->buffer)));
370 } 370 }
371 371
372 selected_window = window; 372 selected_window = window;
373 373
374 Fset_buffer (WGET (w, buffer)); 374 Fset_buffer (w->buffer);
375 375
376 BVAR (XBUFFER (WGET (w, buffer)), last_selected_window) = window; 376 BVAR (XBUFFER (w->buffer), last_selected_window) = window;
377 377
378 /* Go to the point recorded in the window. 378 /* Go to the point recorded in the window.
379 This is important when the buffer is in more 379 This is important when the buffer is in more
@@ -381,7 +381,7 @@ select_window (Lisp_Object window, Lisp_Object norecord, int inhibit_point_swap)
381 redisplay_window has altered point after scrolling, 381 redisplay_window has altered point after scrolling,
382 because it makes the change only in the window. */ 382 because it makes the change only in the window. */
383 { 383 {
384 register ptrdiff_t new_point = marker_position (WGET (w, pointm)); 384 register ptrdiff_t new_point = marker_position (w->pointm);
385 if (new_point < BEGV) 385 if (new_point < BEGV)
386 SET_PT (BEGV); 386 SET_PT (BEGV);
387 else if (new_point > ZV) 387 else if (new_point > ZV)
@@ -416,7 +416,7 @@ If WINDOW is omitted or nil, it defaults to the selected window.
416Return nil for an internal window or a deleted window. */) 416Return nil for an internal window or a deleted window. */)
417 (Lisp_Object window) 417 (Lisp_Object window)
418{ 418{
419 return WGET (decode_any_window (window), buffer); 419 return decode_any_window (window)->buffer;
420} 420}
421 421
422DEFUN ("window-parent", Fwindow_parent, Swindow_parent, 0, 1, 0, 422DEFUN ("window-parent", Fwindow_parent, Swindow_parent, 0, 1, 0,
@@ -425,7 +425,7 @@ If WINDOW is omitted or nil, it defaults to the selected window.
425Return nil for a window with no parent (e.g. a root window). */) 425Return nil for a window with no parent (e.g. a root window). */)
426 (Lisp_Object window) 426 (Lisp_Object window)
427{ 427{
428 return WGET (decode_any_window (window), parent); 428 return decode_any_window (window)->parent;
429} 429}
430 430
431DEFUN ("window-top-child", Fwindow_top_child, Swindow_top_child, 1, 1, 0, 431DEFUN ("window-top-child", Fwindow_top_child, Swindow_top_child, 1, 1, 0,
@@ -436,7 +436,7 @@ horizontal combination. */)
436 (Lisp_Object window) 436 (Lisp_Object window)
437{ 437{
438 CHECK_WINDOW (window); 438 CHECK_WINDOW (window);
439 return WGET (decode_any_window (window), vchild); 439 return decode_any_window (window)->vchild;
440} 440}
441 441
442DEFUN ("window-left-child", Fwindow_left_child, Swindow_left_child, 1, 1, 0, 442DEFUN ("window-left-child", Fwindow_left_child, Swindow_left_child, 1, 1, 0,
@@ -447,7 +447,7 @@ vertical combination. */)
447 (Lisp_Object window) 447 (Lisp_Object window)
448{ 448{
449 CHECK_WINDOW (window); 449 CHECK_WINDOW (window);
450 return WGET (decode_any_window (window), hchild); 450 return decode_any_window (window)->hchild;
451} 451}
452 452
453DEFUN ("window-next-sibling", Fwindow_next_sibling, Swindow_next_sibling, 0, 1, 0, 453DEFUN ("window-next-sibling", Fwindow_next_sibling, Swindow_next_sibling, 0, 1, 0,
@@ -456,7 +456,7 @@ If WINDOW is omitted or nil, it defaults to the selected window.
456Return nil if WINDOW has no next sibling. */) 456Return nil if WINDOW has no next sibling. */)
457 (Lisp_Object window) 457 (Lisp_Object window)
458{ 458{
459 return WGET (decode_any_window (window), next); 459 return decode_any_window (window)->next;
460} 460}
461 461
462DEFUN ("window-prev-sibling", Fwindow_prev_sibling, Swindow_prev_sibling, 0, 1, 0, 462DEFUN ("window-prev-sibling", Fwindow_prev_sibling, Swindow_prev_sibling, 0, 1, 0,
@@ -465,7 +465,7 @@ If WINDOW is omitted or nil, it defaults to the selected window.
465Return nil if WINDOW has no previous sibling. */) 465Return nil if WINDOW has no previous sibling. */)
466 (Lisp_Object window) 466 (Lisp_Object window)
467{ 467{
468 return WGET (decode_any_window (window), prev); 468 return decode_any_window (window)->prev;
469} 469}
470 470
471DEFUN ("window-combination-limit", Fwindow_combination_limit, Swindow_combination_limit, 1, 1, 0, 471DEFUN ("window-combination-limit", Fwindow_combination_limit, Swindow_combination_limit, 1, 1, 0,
@@ -475,7 +475,7 @@ WINDOW's siblings. A return value of t means that child windows of
475WINDOW are never \(re-)combined with WINDOW's siblings. */) 475WINDOW are never \(re-)combined with WINDOW's siblings. */)
476 (Lisp_Object window) 476 (Lisp_Object window)
477{ 477{
478 return WGET (decode_any_window (window), combination_limit); 478 return decode_any_window (window)->combination_limit;
479} 479}
480 480
481DEFUN ("set-window-combination-limit", Fset_window_combination_limit, Sset_window_combination_limit, 2, 2, 0, 481DEFUN ("set-window-combination-limit", Fset_window_combination_limit, Sset_window_combination_limit, 2, 2, 0,
@@ -512,7 +512,7 @@ On a graphical display, this total height is reported as an
512integer multiple of the default character height. */) 512integer multiple of the default character height. */)
513 (Lisp_Object window) 513 (Lisp_Object window)
514{ 514{
515 return WGET (decode_any_window (window), total_lines); 515 return decode_any_window (window)->total_lines;
516} 516}
517 517
518DEFUN ("window-total-width", Fwindow_total_width, Swindow_total_width, 0, 1, 0, 518DEFUN ("window-total-width", Fwindow_total_width, Swindow_total_width, 0, 1, 0,
@@ -527,7 +527,7 @@ On a graphical display, this total width is reported as an
527integer multiple of the default character width. */) 527integer multiple of the default character width. */)
528 (Lisp_Object window) 528 (Lisp_Object window)
529{ 529{
530 return WGET (decode_any_window (window), total_cols); 530 return decode_any_window (window)->total_cols;
531} 531}
532 532
533DEFUN ("window-new-total", Fwindow_new_total, Swindow_new_total, 0, 1, 0, 533DEFUN ("window-new-total", Fwindow_new_total, Swindow_new_total, 0, 1, 0,
@@ -535,7 +535,7 @@ DEFUN ("window-new-total", Fwindow_new_total, Swindow_new_total, 0, 1, 0,
535If WINDOW is omitted or nil, it defaults to the selected window. */) 535If WINDOW is omitted or nil, it defaults to the selected window. */)
536 (Lisp_Object window) 536 (Lisp_Object window)
537{ 537{
538 return WGET (decode_any_window (window), new_total); 538 return decode_any_window (window)->new_total;
539} 539}
540 540
541DEFUN ("window-normal-size", Fwindow_normal_size, Swindow_normal_size, 0, 2, 0, 541DEFUN ("window-normal-size", Fwindow_normal_size, Swindow_normal_size, 0, 2, 0,
@@ -544,10 +544,9 @@ If WINDOW is omitted or nil, it defaults to the selected window.
544If HORIZONTAL is non-nil, return the normal width of WINDOW. */) 544If HORIZONTAL is non-nil, return the normal width of WINDOW. */)
545 (Lisp_Object window, Lisp_Object horizontal) 545 (Lisp_Object window, Lisp_Object horizontal)
546{ 546{
547 if (NILP (horizontal)) 547 struct window *w = decode_any_window (window);
548 return WGET (decode_any_window (window), normal_lines); 548
549 else 549 return NILP (horizontal) ? w->normal_lines : w->normal_cols;
550 return WGET (decode_any_window (window), normal_cols);
551} 550}
552 551
553DEFUN ("window-new-normal", Fwindow_new_normal, Swindow_new_normal, 0, 1, 0, 552DEFUN ("window-new-normal", Fwindow_new_normal, Swindow_new_normal, 0, 1, 0,
@@ -555,7 +554,7 @@ DEFUN ("window-new-normal", Fwindow_new_normal, Swindow_new_normal, 0, 1, 0,
555If WINDOW is omitted or nil, it defaults to the selected window. */) 554If WINDOW is omitted or nil, it defaults to the selected window. */)
556 (Lisp_Object window) 555 (Lisp_Object window)
557{ 556{
558 return WGET (decode_any_window (window), new_normal); 557 return decode_any_window (window)->new_normal;
559} 558}
560 559
561DEFUN ("window-left-column", Fwindow_left_column, Swindow_left_column, 0, 1, 0, 560DEFUN ("window-left-column", Fwindow_left_column, Swindow_left_column, 0, 1, 0,
@@ -567,7 +566,7 @@ value is 0 if there is no window to the left of WINDOW.
567If WINDOW is omitted or nil, it defaults to the selected window. */) 566If WINDOW is omitted or nil, it defaults to the selected window. */)
568 (Lisp_Object window) 567 (Lisp_Object window)
569{ 568{
570 return WGET (decode_any_window (window), left_col); 569 return decode_any_window (window)->left_col;
571} 570}
572 571
573DEFUN ("window-top-line", Fwindow_top_line, Swindow_top_line, 0, 1, 0, 572DEFUN ("window-top-line", Fwindow_top_line, Swindow_top_line, 0, 1, 0,
@@ -579,7 +578,7 @@ there is no window above WINDOW.
579If WINDOW is omitted or nil, it defaults to the selected window. */) 578If WINDOW is omitted or nil, it defaults to the selected window. */)
580 (Lisp_Object window) 579 (Lisp_Object window)
581{ 580{
582 return WGET (decode_any_window (window), top_line); 581 return decode_any_window (window)->top_line;
583} 582}
584 583
585/* Return the number of lines of W's body. Don't count any mode or 584/* Return the number of lines of W's body. Don't count any mode or
@@ -588,7 +587,7 @@ If WINDOW is omitted or nil, it defaults to the selected window. */)
588static int 587static int
589window_body_lines (struct window *w) 588window_body_lines (struct window *w)
590{ 589{
591 int height = XFASTINT (WGET (w, total_lines)); 590 int height = XFASTINT (w->total_lines);
592 591
593 if (!MINI_WINDOW_P (w)) 592 if (!MINI_WINDOW_P (w))
594 { 593 {
@@ -610,7 +609,7 @@ int
610window_body_cols (struct window *w) 609window_body_cols (struct window *w)
611{ 610{
612 struct frame *f = XFRAME (WINDOW_FRAME (w)); 611 struct frame *f = XFRAME (WINDOW_FRAME (w));
613 int width = XINT (WGET (w, total_cols)); 612 int width = XINT (w->total_cols);
614 613
615 if (WINDOW_HAS_VERTICAL_SCROLL_BAR (w)) 614 if (WINDOW_HAS_VERTICAL_SCROLL_BAR (w))
616 /* Scroll bars occupy a few columns. */ 615 /* Scroll bars occupy a few columns. */
@@ -685,7 +684,7 @@ set_window_hscroll (struct window *w, EMACS_INT hscroll)
685 684
686 /* Prevent redisplay shortcuts when changing the hscroll. */ 685 /* Prevent redisplay shortcuts when changing the hscroll. */
687 if (w->hscroll != new_hscroll) 686 if (w->hscroll != new_hscroll)
688 XBUFFER (WGET (w, buffer))->prevent_redisplay_optimizations_p = 1; 687 XBUFFER (w->buffer)->prevent_redisplay_optimizations_p = 1;
689 688
690 w->hscroll = new_hscroll; 689 w->hscroll = new_hscroll;
691 return make_number (new_hscroll); 690 return make_number (new_hscroll);
@@ -714,7 +713,7 @@ WINDOW defaults to the selected window.
714See `set-window-redisplay-end-trigger' for more information. */) 713See `set-window-redisplay-end-trigger' for more information. */)
715 (Lisp_Object window) 714 (Lisp_Object window)
716{ 715{
717 return WGET (decode_window (window), redisplay_end_trigger); 716 return decode_window (window)->redisplay_end_trigger;
718} 717}
719 718
720DEFUN ("set-window-redisplay-end-trigger", Fset_window_redisplay_end_trigger, 719DEFUN ("set-window-redisplay-end-trigger", Fset_window_redisplay_end_trigger,
@@ -744,7 +743,7 @@ just the text area, use `window-inside-edges'. */)
744 (Lisp_Object window) 743 (Lisp_Object window)
745{ 744{
746 register struct window *w = decode_any_window (window); 745 register struct window *w = decode_any_window (window);
747 CHECK_LIVE_FRAME (WGET (w, frame)); 746 CHECK_LIVE_FRAME (w->frame);
748 747
749 return Fcons (make_number (WINDOW_LEFT_EDGE_COL (w)), 748 return Fcons (make_number (WINDOW_LEFT_EDGE_COL (w)),
750 Fcons (make_number (WINDOW_TOP_EDGE_LINE (w)), 749 Fcons (make_number (WINDOW_TOP_EDGE_LINE (w)),
@@ -766,7 +765,7 @@ of just the text area, use `window-inside-pixel-edges'. */)
766 (Lisp_Object window) 765 (Lisp_Object window)
767{ 766{
768 register struct window *w = decode_any_window (window); 767 register struct window *w = decode_any_window (window);
769 CHECK_LIVE_FRAME (WGET (w, frame)); 768 CHECK_LIVE_FRAME (w->frame);
770 769
771 return Fcons (make_number (WINDOW_LEFT_EDGE_X (w)), 770 return Fcons (make_number (WINDOW_LEFT_EDGE_X (w)),
772 Fcons (make_number (WINDOW_TOP_EDGE_Y (w)), 771 Fcons (make_number (WINDOW_TOP_EDGE_Y (w)),
@@ -778,7 +777,7 @@ of just the text area, use `window-inside-pixel-edges'. */)
778static void 777static void
779calc_absolute_offset (struct window *w, int *add_x, int *add_y) 778calc_absolute_offset (struct window *w, int *add_x, int *add_y)
780{ 779{
781 struct frame *f = XFRAME (WGET (w, frame)); 780 struct frame *f = XFRAME (w->frame);
782 *add_y = f->top_pos; 781 *add_y = f->top_pos;
783#ifdef FRAME_MENUBAR_HEIGHT 782#ifdef FRAME_MENUBAR_HEIGHT
784 *add_y += FRAME_MENUBAR_HEIGHT (f); 783 *add_y += FRAME_MENUBAR_HEIGHT (f);
@@ -813,7 +812,7 @@ of just the text area, use `window-inside-absolute-pixel-edges'. */)
813 register struct window *w = decode_any_window (window); 812 register struct window *w = decode_any_window (window);
814 int add_x, add_y; 813 int add_x, add_y;
815 814
816 CHECK_LIVE_FRAME (WGET (w, frame)); 815 CHECK_LIVE_FRAME (w->frame);
817 calc_absolute_offset (w, &add_x, &add_y); 816 calc_absolute_offset (w, &add_x, &add_y);
818 817
819 return Fcons (make_number (WINDOW_LEFT_EDGE_X (w) + add_x), 818 return Fcons (make_number (WINDOW_LEFT_EDGE_X (w) + add_x),
@@ -1090,7 +1089,7 @@ If they are in the windows's left or right marginal areas, `left-margin'\n\
1090 1089
1091 CHECK_LIVE_WINDOW (window); 1090 CHECK_LIVE_WINDOW (window);
1092 w = XWINDOW (window); 1091 w = XWINDOW (window);
1093 f = XFRAME (WGET (w, frame)); 1092 f = XFRAME (w->frame);
1094 CHECK_CONS (coordinates); 1093 CHECK_CONS (coordinates);
1095 lx = Fcar (coordinates); 1094 lx = Fcar (coordinates);
1096 ly = Fcdr (coordinates); 1095 ly = Fcdr (coordinates);
@@ -1270,9 +1269,9 @@ But that is hard to define. */)
1270 register struct window *w = decode_window (window); 1269 register struct window *w = decode_window (window);
1271 1270
1272 if (w == XWINDOW (selected_window) 1271 if (w == XWINDOW (selected_window)
1273 && current_buffer == XBUFFER (WGET (w, buffer))) 1272 && current_buffer == XBUFFER (w->buffer))
1274 return Fpoint (); 1273 return Fpoint ();
1275 return Fmarker_position (WGET (w, pointm)); 1274 return Fmarker_position (w->pointm);
1276} 1275}
1277 1276
1278DEFUN ("window-start", Fwindow_start, Swindow_start, 0, 1, 0, 1277DEFUN ("window-start", Fwindow_start, Swindow_start, 0, 1, 0,
@@ -1281,7 +1280,7 @@ WINDOW must be a live window and defaults to the selected one.
1281This is updated by redisplay or by calling `set-window-start'. */) 1280This is updated by redisplay or by calling `set-window-start'. */)
1282 (Lisp_Object window) 1281 (Lisp_Object window)
1283{ 1282{
1284 return Fmarker_position (WGET (decode_window (window), start)); 1283 return Fmarker_position (decode_window (window)->start);
1285} 1284}
1286 1285
1287/* This is text temporarily removed from the doc string below. 1286/* This is text temporarily removed from the doc string below.
@@ -1312,7 +1311,7 @@ if it isn't already recorded. */)
1312 Lisp_Object buf; 1311 Lisp_Object buf;
1313 struct buffer *b; 1312 struct buffer *b;
1314 1313
1315 buf = WGET (w, buffer); 1314 buf = w->buffer;
1316 CHECK_BUFFER (buf); 1315 CHECK_BUFFER (buf);
1317 b = XBUFFER (buf); 1316 b = XBUFFER (buf);
1318 1317
@@ -1321,12 +1320,12 @@ if it isn't already recorded. */)
1321 The user can compute it with vertical-motion if he wants to. 1320 The user can compute it with vertical-motion if he wants to.
1322 It would be nicer to do it automatically, 1321 It would be nicer to do it automatically,
1323 but that's so slow that it would probably bother people. */ 1322 but that's so slow that it would probably bother people. */
1324 if (NILP (WGET (w, window_end_valid))) 1323 if (NILP (w->window_end_valid))
1325 return Qnil; 1324 return Qnil;
1326#endif 1325#endif
1327 1326
1328 if (! NILP (update) 1327 if (! NILP (update)
1329 && ! (! NILP (WGET (w, window_end_valid)) 1328 && ! (! NILP (w->window_end_valid)
1330 && w->last_modified >= BUF_MODIFF (b) 1329 && w->last_modified >= BUF_MODIFF (b)
1331 && w->last_overlay_modified >= BUF_OVERLAY_MODIFF (b)) 1330 && w->last_overlay_modified >= BUF_OVERLAY_MODIFF (b))
1332 && !noninteractive) 1331 && !noninteractive)
@@ -1349,12 +1348,12 @@ if it isn't already recorded. */)
1349 `-l' containing a call to `rmail' with subsequent other 1348 `-l' containing a call to `rmail' with subsequent other
1350 commands. At the end, W->start happened to be BEG, while 1349 commands. At the end, W->start happened to be BEG, while
1351 rmail had already narrowed the buffer. */ 1350 rmail had already narrowed the buffer. */
1352 if (XMARKER (WGET (w, start))->charpos < BEGV) 1351 if (XMARKER (w->start)->charpos < BEGV)
1353 SET_TEXT_POS (startp, BEGV, BEGV_BYTE); 1352 SET_TEXT_POS (startp, BEGV, BEGV_BYTE);
1354 else if (XMARKER (WGET (w, start))->charpos > ZV) 1353 else if (XMARKER (w->start)->charpos > ZV)
1355 SET_TEXT_POS (startp, ZV, ZV_BYTE); 1354 SET_TEXT_POS (startp, ZV, ZV_BYTE);
1356 else 1355 else
1357 SET_TEXT_POS_FROM_MARKER (startp, WGET (w, start)); 1356 SET_TEXT_POS_FROM_MARKER (startp, w->start);
1358 1357
1359 itdata = bidi_shelve_cache (); 1358 itdata = bidi_shelve_cache ();
1360 start_display (&it, w, startp); 1359 start_display (&it, w, startp);
@@ -1368,7 +1367,7 @@ if it isn't already recorded. */)
1368 set_buffer_internal (old_buffer); 1367 set_buffer_internal (old_buffer);
1369 } 1368 }
1370 else 1369 else
1371 XSETINT (value, BUF_Z (b) - XFASTINT (WGET (w, window_end_pos))); 1370 XSETINT (value, BUF_Z (b) - XFASTINT (w->window_end_pos));
1372 1371
1373 return value; 1372 return value;
1374} 1373}
@@ -1382,10 +1381,10 @@ Return POS. */)
1382 1381
1383 CHECK_NUMBER_COERCE_MARKER (pos); 1382 CHECK_NUMBER_COERCE_MARKER (pos);
1384 if (w == XWINDOW (selected_window) 1383 if (w == XWINDOW (selected_window)
1385 && XBUFFER (WGET (w, buffer)) == current_buffer) 1384 && XBUFFER (w->buffer) == current_buffer)
1386 Fgoto_char (pos); 1385 Fgoto_char (pos);
1387 else 1386 else
1388 set_marker_restricted (WGET (w, pointm), pos, WGET (w, buffer)); 1387 set_marker_restricted (w->pointm, pos, w->buffer);
1389 1388
1390 /* We have to make sure that redisplay updates the window to show 1389 /* We have to make sure that redisplay updates the window to show
1391 the new value of point. */ 1390 the new value of point. */
@@ -1405,7 +1404,7 @@ overriding motion of point in order to display at this exact start. */)
1405 register struct window *w = decode_window (window); 1404 register struct window *w = decode_window (window);
1406 1405
1407 CHECK_NUMBER_COERCE_MARKER (pos); 1406 CHECK_NUMBER_COERCE_MARKER (pos);
1408 set_marker_restricted (WGET (w, start), pos, WGET (w, buffer)); 1407 set_marker_restricted (w->start, pos, w->buffer);
1409 /* this is not right, but much easier than doing what is right. */ 1408 /* this is not right, but much easier than doing what is right. */
1410 w->start_at_line_beg = 0; 1409 w->start_at_line_beg = 0;
1411 if (NILP (noforce)) 1410 if (NILP (noforce))
@@ -1447,8 +1446,8 @@ display row, and VPOS is the row number (0-based) containing POS. */)
1447 int x, y; 1446 int x, y;
1448 1447
1449 w = decode_window (window); 1448 w = decode_window (window);
1450 buf = XBUFFER (WGET (w, buffer)); 1449 buf = XBUFFER (w->buffer);
1451 SET_TEXT_POS_FROM_MARKER (top, WGET (w, start)); 1450 SET_TEXT_POS_FROM_MARKER (top, w->start);
1452 1451
1453 if (EQ (pos, Qt)) 1452 if (EQ (pos, Qt))
1454 posint = -1; 1453 posint = -1;
@@ -1460,7 +1459,7 @@ display row, and VPOS is the row number (0-based) containing POS. */)
1460 else if (w == XWINDOW (selected_window)) 1459 else if (w == XWINDOW (selected_window))
1461 posint = PT; 1460 posint = PT;
1462 else 1461 else
1463 posint = XMARKER (WGET (w, pointm))->charpos; 1462 posint = XMARKER (w->pointm)->charpos;
1464 1463
1465 /* If position is above window start or outside buffer boundaries, 1464 /* If position is above window start or outside buffer boundaries,
1466 or if window start is out of range, position is not visible. */ 1465 or if window start is out of range, position is not visible. */
@@ -1517,11 +1516,11 @@ Return nil if window display is not up-to-date. In that case, use
1517 if (noninteractive || w->pseudo_window_p) 1516 if (noninteractive || w->pseudo_window_p)
1518 return Qnil; 1517 return Qnil;
1519 1518
1520 CHECK_BUFFER (WGET (w, buffer)); 1519 CHECK_BUFFER (w->buffer);
1521 b = XBUFFER (WGET (w, buffer)); 1520 b = XBUFFER (w->buffer);
1522 1521
1523 /* Fail if current matrix is not up-to-date. */ 1522 /* Fail if current matrix is not up-to-date. */
1524 if (NILP (WGET (w, window_end_valid)) 1523 if (NILP (w->window_end_valid)
1525 || current_buffer->clip_changed 1524 || current_buffer->clip_changed
1526 || current_buffer->prevent_redisplay_optimizations_p 1525 || current_buffer->prevent_redisplay_optimizations_p
1527 || w->last_modified < BUF_MODIFF (b) 1526 || w->last_modified < BUF_MODIFF (b)
@@ -1614,7 +1613,7 @@ window, unless that window is "strongly" dedicated to its buffer, that
1614is the value returned by `window-dedicated-p' is t. */) 1613is the value returned by `window-dedicated-p' is t. */)
1615 (Lisp_Object window) 1614 (Lisp_Object window)
1616{ 1615{
1617 return WGET (decode_window (window), dedicated); 1616 return decode_window (window)->dedicated;
1618} 1617}
1619 1618
1620DEFUN ("set-window-dedicated-p", Fset_window_dedicated_p, 1619DEFUN ("set-window-dedicated-p", Fset_window_dedicated_p,
@@ -1651,7 +1650,7 @@ where BUFFER is a buffer, WINDOW-START is the start position of the
1651window for that buffer, and POS is a window-specific point value. */) 1650window for that buffer, and POS is a window-specific point value. */)
1652 (Lisp_Object window) 1651 (Lisp_Object window)
1653{ 1652{
1654 return WGET (decode_window (window), prev_buffers); 1653 return decode_window (window)->prev_buffers;
1655} 1654}
1656 1655
1657DEFUN ("set-window-prev-buffers", Fset_window_prev_buffers, 1656DEFUN ("set-window-prev-buffers", Fset_window_prev_buffers,
@@ -1673,7 +1672,7 @@ DEFUN ("window-next-buffers", Fwindow_next_buffers, Swindow_next_buffers,
1673WINDOW must be a live window and defaults to the selected one. */) 1672WINDOW must be a live window and defaults to the selected one. */)
1674 (Lisp_Object window) 1673 (Lisp_Object window)
1675{ 1674{
1676 return WGET (decode_window (window), next_buffers); 1675 return decode_window (window)->next_buffers;
1677} 1676}
1678 1677
1679DEFUN ("set-window-next-buffers", Fset_window_next_buffers, 1678DEFUN ("set-window-next-buffers", Fset_window_next_buffers,
@@ -1693,7 +1692,7 @@ WINDOW defaults to the selected window. The return value is a list of
1693elements of the form (PARAMETER . VALUE). */) 1692elements of the form (PARAMETER . VALUE). */)
1694 (Lisp_Object window) 1693 (Lisp_Object window)
1695{ 1694{
1696 return Fcopy_alist (WGET (decode_any_window (window), window_parameters)); 1695 return Fcopy_alist (decode_any_window (window)->window_parameters);
1697} 1696}
1698 1697
1699DEFUN ("window-parameter", Fwindow_parameter, Swindow_parameter, 1698DEFUN ("window-parameter", Fwindow_parameter, Swindow_parameter,
@@ -1704,8 +1703,7 @@ WINDOW defaults to the selected window. */)
1704{ 1703{
1705 Lisp_Object result; 1704 Lisp_Object result;
1706 1705
1707 result = Fassq (parameter, WGET (decode_any_window (window), 1706 result = Fassq (parameter, decode_any_window (window)->window_parameters);
1708 window_parameters));
1709 return CDR_SAFE (result); 1707 return CDR_SAFE (result);
1710} 1708}
1711 1709
@@ -1718,10 +1716,10 @@ WINDOW defaults to the selected window. Return VALUE. */)
1718 register struct window *w = decode_any_window (window); 1716 register struct window *w = decode_any_window (window);
1719 Lisp_Object old_alist_elt; 1717 Lisp_Object old_alist_elt;
1720 1718
1721 old_alist_elt = Fassq (parameter, WGET (w, window_parameters)); 1719 old_alist_elt = Fassq (parameter, w->window_parameters);
1722 if (NILP (old_alist_elt)) 1720 if (NILP (old_alist_elt))
1723 WSET (w, window_parameters, 1721 WSET (w, window_parameters,
1724 Fcons (Fcons (parameter, value), WGET (w, window_parameters))); 1722 Fcons (Fcons (parameter, value), w->window_parameters));
1725 else 1723 else
1726 Fsetcdr (old_alist_elt, value); 1724 Fsetcdr (old_alist_elt, value);
1727 return value; 1725 return value;
@@ -1733,7 +1731,7 @@ DEFUN ("window-display-table", Fwindow_display_table, Swindow_display_table,
1733WINDOW defaults to the selected window. */) 1731WINDOW defaults to the selected window. */)
1734 (Lisp_Object window) 1732 (Lisp_Object window)
1735{ 1733{
1736 return WGET (decode_window (window), display_table); 1734 return decode_window (window)->display_table;
1737} 1735}
1738 1736
1739/* Get the display table for use on window W. This is either W's 1737/* Get the display table for use on window W. This is either W's
@@ -1746,11 +1744,11 @@ window_display_table (struct window *w)
1746{ 1744{
1747 struct Lisp_Char_Table *dp = NULL; 1745 struct Lisp_Char_Table *dp = NULL;
1748 1746
1749 if (DISP_TABLE_P (WGET (w, display_table))) 1747 if (DISP_TABLE_P (w->display_table))
1750 dp = XCHAR_TABLE (WGET (w, display_table)); 1748 dp = XCHAR_TABLE (w->display_table);
1751 else if (BUFFERP (WGET (w, buffer))) 1749 else if (BUFFERP (w->buffer))
1752 { 1750 {
1753 struct buffer *b = XBUFFER (WGET (w, buffer)); 1751 struct buffer *b = XBUFFER (w->buffer);
1754 1752
1755 if (DISP_TABLE_P (BVAR (b, display_table))) 1753 if (DISP_TABLE_P (BVAR (b, display_table)))
1756 dp = XCHAR_TABLE (BVAR (b, display_table)); 1754 dp = XCHAR_TABLE (BVAR (b, display_table));
@@ -1776,14 +1774,14 @@ unshow_buffer (register struct window *w)
1776 Lisp_Object buf; 1774 Lisp_Object buf;
1777 struct buffer *b; 1775 struct buffer *b;
1778 1776
1779 buf = WGET (w, buffer); 1777 buf = w->buffer;
1780 b = XBUFFER (buf); 1778 b = XBUFFER (buf);
1781 if (b != XMARKER (WGET (w, pointm))->buffer) 1779 if (b != XMARKER (w->pointm)->buffer)
1782 abort (); 1780 abort ();
1783 1781
1784#if 0 1782#if 0
1785 if (w == XWINDOW (selected_window) 1783 if (w == XWINDOW (selected_window)
1786 || ! EQ (buf, WGET (XWINDOW (selected_window), buffer))) 1784 || ! EQ (buf, XWINDOW (selected_window)->buffer))
1787 /* Do this except when the selected window's buffer 1785 /* Do this except when the selected window's buffer
1788 is being removed from some other window. */ 1786 is being removed from some other window. */
1789#endif 1787#endif
@@ -1794,22 +1792,22 @@ unshow_buffer (register struct window *w)
1794 selected window, while last_window_start reflects another 1792 selected window, while last_window_start reflects another
1795 window which was recently showing the same buffer. 1793 window which was recently showing the same buffer.
1796 Some people might say that might be a good thing. Let's see. */ 1794 Some people might say that might be a good thing. Let's see. */
1797 b->last_window_start = marker_position (WGET (w, start)); 1795 b->last_window_start = marker_position (w->start);
1798 1796
1799 /* Point in the selected window's buffer 1797 /* Point in the selected window's buffer
1800 is actually stored in that buffer, and the window's pointm isn't used. 1798 is actually stored in that buffer, and the window's pointm isn't used.
1801 So don't clobber point in that buffer. */ 1799 So don't clobber point in that buffer. */
1802 if (! EQ (buf, WGET (XWINDOW (selected_window), buffer)) 1800 if (! EQ (buf, XWINDOW (selected_window)->buffer)
1803 /* This line helps to fix Horsley's testbug.el bug. */ 1801 /* This line helps to fix Horsley's testbug.el bug. */
1804 && !(WINDOWP (BVAR (b, last_selected_window)) 1802 && !(WINDOWP (BVAR (b, last_selected_window))
1805 && w != XWINDOW (BVAR (b, last_selected_window)) 1803 && w != XWINDOW (BVAR (b, last_selected_window))
1806 && EQ (buf, WGET (XWINDOW (BVAR (b, last_selected_window)), buffer)))) 1804 && EQ (buf, XWINDOW (BVAR (b, last_selected_window))->buffer)))
1807 temp_set_point_both (b, 1805 temp_set_point_both (b,
1808 clip_to_bounds (BUF_BEGV (b), 1806 clip_to_bounds (BUF_BEGV (b),
1809 XMARKER (WGET (w, pointm))->charpos, 1807 XMARKER (w->pointm)->charpos,
1810 BUF_ZV (b)), 1808 BUF_ZV (b)),
1811 clip_to_bounds (BUF_BEGV_BYTE (b), 1809 clip_to_bounds (BUF_BEGV_BYTE (b),
1812 marker_byte_position (WGET (w, pointm)), 1810 marker_byte_position (w->pointm),
1813 BUF_ZV_BYTE (b))); 1811 BUF_ZV_BYTE (b)));
1814 1812
1815 if (WINDOWP (BVAR (b, last_selected_window)) 1813 if (WINDOWP (BVAR (b, last_selected_window))
@@ -1828,18 +1826,18 @@ replace_window (Lisp_Object old, Lisp_Object new, int setflag)
1828 1826
1829 /* If OLD is its frame's root window, then NEW is the new 1827 /* If OLD is its frame's root window, then NEW is the new
1830 root window for that frame. */ 1828 root window for that frame. */
1831 if (EQ (old, FRAME_ROOT_WINDOW (XFRAME (WGET (o, frame))))) 1829 if (EQ (old, FRAME_ROOT_WINDOW (XFRAME (o->frame))))
1832 FSET (XFRAME (WGET (o, frame)), root_window, new); 1830 FSET (XFRAME (o->frame), root_window, new);
1833 1831
1834 if (setflag) 1832 if (setflag)
1835 { 1833 {
1836 WSET (n, left_col, WGET (o, left_col)); 1834 WSET (n, left_col, o->left_col);
1837 WSET (n, top_line, WGET (o, top_line)); 1835 WSET (n, top_line, o->top_line);
1838 WSET (n, total_cols, WGET (o, total_cols)); 1836 WSET (n, total_cols, o->total_cols);
1839 WSET (n, total_lines, WGET (o, total_lines)); 1837 WSET (n, total_lines, o->total_lines);
1840 WSET (n, normal_cols, WGET (o, normal_cols)); 1838 WSET (n, normal_cols, o->normal_cols);
1841 WSET (o, normal_cols, make_float (1.0)); 1839 WSET (o, normal_cols, make_float (1.0));
1842 WSET (n, normal_lines, WGET (o, normal_lines)); 1840 WSET (n, normal_lines, o->normal_lines);
1843 WSET (o, normal_lines, make_float (1.0)); 1841 WSET (o, normal_lines, make_float (1.0));
1844 n->desired_matrix = n->current_matrix = 0; 1842 n->desired_matrix = n->current_matrix = 0;
1845 n->vscroll = 0; 1843 n->vscroll = 0;
@@ -1856,23 +1854,23 @@ replace_window (Lisp_Object old, Lisp_Object new, int setflag)
1856 n->frozen_window_start_p = 0; 1854 n->frozen_window_start_p = 0;
1857 } 1855 }
1858 1856
1859 tem = WGET (o, next); 1857 tem = o->next;
1860 WSET (n, next, tem); 1858 WSET (n, next, tem);
1861 if (!NILP (tem)) 1859 if (!NILP (tem))
1862 WSET (XWINDOW (tem), prev, new); 1860 WSET (XWINDOW (tem), prev, new);
1863 1861
1864 tem = WGET (o, prev); 1862 tem = o->prev;
1865 WSET (n, prev, tem); 1863 WSET (n, prev, tem);
1866 if (!NILP (tem)) 1864 if (!NILP (tem))
1867 WSET (XWINDOW (tem), next, new); 1865 WSET (XWINDOW (tem), next, new);
1868 1866
1869 tem = WGET (o, parent); 1867 tem = o->parent;
1870 WSET (n, parent, tem); 1868 WSET (n, parent, tem);
1871 if (!NILP (tem)) 1869 if (!NILP (tem))
1872 { 1870 {
1873 if (EQ (WGET (XWINDOW (tem), vchild), old)) 1871 if (EQ (XWINDOW (tem)->vchild, old))
1874 WSET (XWINDOW (tem), vchild, new); 1872 WSET (XWINDOW (tem), vchild, new);
1875 if (EQ (WGET (XWINDOW (tem), hchild), old)) 1873 if (EQ (XWINDOW (tem)->hchild, old))
1876 WSET (XWINDOW (tem), hchild, new); 1874 WSET (XWINDOW (tem), hchild, new);
1877 } 1875 }
1878} 1876}
@@ -1889,30 +1887,30 @@ recombine_windows (Lisp_Object window)
1889 int horflag; 1887 int horflag;
1890 1888
1891 w = XWINDOW (window); 1889 w = XWINDOW (window);
1892 parent = WGET (w, parent); 1890 parent = w->parent;
1893 if (!NILP (parent) && NILP (WGET (w, combination_limit))) 1891 if (!NILP (parent) && NILP (w->combination_limit))
1894 { 1892 {
1895 p = XWINDOW (parent); 1893 p = XWINDOW (parent);
1896 if (((!NILP (WGET (p, vchild)) && !NILP (WGET (w, vchild))) 1894 if (((!NILP (p->vchild) && !NILP (w->vchild))
1897 || (!NILP (WGET (p, hchild)) && !NILP (WGET (w, hchild))))) 1895 || (!NILP (p->hchild) && !NILP (w->hchild))))
1898 /* WINDOW and PARENT are both either a vertical or a horizontal 1896 /* WINDOW and PARENT are both either a vertical or a horizontal
1899 combination. */ 1897 combination. */
1900 { 1898 {
1901 horflag = NILP (WGET (w, vchild)); 1899 horflag = NILP (w->vchild);
1902 child = horflag ? WGET (w, hchild) : WGET (w, vchild); 1900 child = horflag ? w->hchild : w->vchild;
1903 c = XWINDOW (child); 1901 c = XWINDOW (child);
1904 1902
1905 /* Splice WINDOW's children into its parent's children and 1903 /* Splice WINDOW's children into its parent's children and
1906 assign new normal sizes. */ 1904 assign new normal sizes. */
1907 if (NILP (WGET (w, prev))) 1905 if (NILP (w->prev))
1908 if (horflag) 1906 if (horflag)
1909 WSET (p, hchild, child); 1907 WSET (p, hchild, child);
1910 else 1908 else
1911 WSET (p, vchild, child); 1909 WSET (p, vchild, child);
1912 else 1910 else
1913 { 1911 {
1914 WSET (c, prev, WGET (w, prev)); 1912 WSET (c, prev, w->prev);
1915 WSET (XWINDOW (WGET (w, prev)), next, child); 1913 WSET (XWINDOW (w->prev), next, child);
1916 } 1914 }
1917 1915
1918 while (c) 1916 while (c)
@@ -1921,26 +1919,26 @@ recombine_windows (Lisp_Object window)
1921 1919
1922 if (horflag) 1920 if (horflag)
1923 WSET (c, normal_cols, 1921 WSET (c, normal_cols,
1924 make_float (XFLOATINT (WGET (c, total_cols)) 1922 make_float (XFLOATINT (c->total_cols)
1925 / XFLOATINT (WGET (p, total_cols)))); 1923 / XFLOATINT (p->total_cols)));
1926 else 1924 else
1927 WSET (c, normal_lines, 1925 WSET (c, normal_lines,
1928 make_float (XFLOATINT (WGET (c, total_lines)) 1926 make_float (XFLOATINT (c->total_lines)
1929 / XFLOATINT (WGET (p, total_lines)))); 1927 / XFLOATINT (p->total_lines)));
1930 1928
1931 if (NILP (WGET (c, next))) 1929 if (NILP (c->next))
1932 { 1930 {
1933 if (!NILP (WGET (w, next))) 1931 if (!NILP (w->next))
1934 { 1932 {
1935 WSET (c, next, WGET (w, next)); 1933 WSET (c, next, w->next);
1936 WSET (XWINDOW (WGET (c, next)), prev, child); 1934 WSET (XWINDOW (c->next), prev, child);
1937 } 1935 }
1938 1936
1939 c = 0; 1937 c = 0;
1940 } 1938 }
1941 else 1939 else
1942 { 1940 {
1943 child = WGET (c, next); 1941 child = c->next;
1944 c = XWINDOW (child); 1942 c = XWINDOW (child);
1945 } 1943 }
1946 } 1944 }
@@ -2030,10 +2028,10 @@ static int
2030candidate_window_p (Lisp_Object window, Lisp_Object owindow, Lisp_Object minibuf, Lisp_Object all_frames) 2028candidate_window_p (Lisp_Object window, Lisp_Object owindow, Lisp_Object minibuf, Lisp_Object all_frames)
2031{ 2029{
2032 struct window *w = XWINDOW (window); 2030 struct window *w = XWINDOW (window);
2033 struct frame *f = XFRAME (WGET (w, frame)); 2031 struct frame *f = XFRAME (w->frame);
2034 int candidate_p = 1; 2032 int candidate_p = 1;
2035 2033
2036 if (!BUFFERP (WGET (w, buffer))) 2034 if (!BUFFERP (w->buffer))
2037 candidate_p = 0; 2035 candidate_p = 0;
2038 else if (MINI_WINDOW_P (w) 2036 else if (MINI_WINDOW_P (w)
2039 && (EQ (minibuf, Qlambda) 2037 && (EQ (minibuf, Qlambda)
@@ -2048,13 +2046,13 @@ candidate_window_p (Lisp_Object window, Lisp_Object owindow, Lisp_Object minibuf
2048 else if (NILP (all_frames)) 2046 else if (NILP (all_frames))
2049 { 2047 {
2050 eassert (WINDOWP (owindow)); 2048 eassert (WINDOWP (owindow));
2051 candidate_p = EQ (WGET (w, frame), WGET (XWINDOW (owindow), frame)); 2049 candidate_p = EQ (w->frame, XWINDOW (owindow)->frame);
2052 } 2050 }
2053 else if (EQ (all_frames, Qvisible)) 2051 else if (EQ (all_frames, Qvisible))
2054 { 2052 {
2055 FRAME_SAMPLE_VISIBILITY (f); 2053 FRAME_SAMPLE_VISIBILITY (f);
2056 candidate_p = FRAME_VISIBLE_P (f) 2054 candidate_p = FRAME_VISIBLE_P (f)
2057 && (FRAME_TERMINAL (XFRAME (WGET (w, frame))) 2055 && (FRAME_TERMINAL (XFRAME (w->frame))
2058 == FRAME_TERMINAL (XFRAME (selected_frame))); 2056 == FRAME_TERMINAL (XFRAME (selected_frame)));
2059 2057
2060 } 2058 }
@@ -2073,15 +2071,15 @@ candidate_window_p (Lisp_Object window, Lisp_Object owindow, Lisp_Object minibuf
2073 && !f->output_data.x->has_been_visible) 2071 && !f->output_data.x->has_been_visible)
2074#endif 2072#endif
2075 ) 2073 )
2076 && (FRAME_TERMINAL (XFRAME (WGET (w, frame))) 2074 && (FRAME_TERMINAL (XFRAME (w->frame))
2077 == FRAME_TERMINAL (XFRAME (selected_frame))); 2075 == FRAME_TERMINAL (XFRAME (selected_frame)));
2078 } 2076 }
2079 else if (WINDOWP (all_frames)) 2077 else if (WINDOWP (all_frames))
2080 candidate_p = (EQ (FRAME_MINIBUF_WINDOW (f), all_frames) 2078 candidate_p = (EQ (FRAME_MINIBUF_WINDOW (f), all_frames)
2081 || EQ (WGET (XWINDOW (all_frames), frame), WGET (w, frame)) 2079 || EQ (XWINDOW (all_frames)->frame, w->frame)
2082 || EQ (WGET (XWINDOW (all_frames), frame), FRAME_FOCUS_FRAME (f))); 2080 || EQ (XWINDOW (all_frames)->frame, FRAME_FOCUS_FRAME (f)));
2083 else if (FRAMEP (all_frames)) 2081 else if (FRAMEP (all_frames))
2084 candidate_p = EQ (all_frames, WGET (w, frame)); 2082 candidate_p = EQ (all_frames, w->frame);
2085 2083
2086 return candidate_p; 2084 return candidate_p;
2087} 2085}
@@ -2114,7 +2112,7 @@ decode_next_window_args (Lisp_Object *window, Lisp_Object *minibuf, Lisp_Object
2114 if (NILP (*all_frames)) 2112 if (NILP (*all_frames))
2115 *all_frames 2113 *all_frames
2116 = (!EQ (*minibuf, Qlambda) 2114 = (!EQ (*minibuf, Qlambda)
2117 ? FRAME_MINIBUF_WINDOW (XFRAME (WGET (XWINDOW (*window), frame))) 2115 ? FRAME_MINIBUF_WINDOW (XFRAME (XWINDOW (*window)->frame))
2118 : Qnil); 2116 : Qnil);
2119 else if (EQ (*all_frames, Qvisible)) 2117 else if (EQ (*all_frames, Qvisible))
2120 ; 2118 ;
@@ -2140,7 +2138,7 @@ next_window (Lisp_Object window, Lisp_Object minibuf, Lisp_Object all_frames, in
2140 /* If ALL_FRAMES is a frame, and WINDOW isn't on that frame, just 2138 /* If ALL_FRAMES is a frame, and WINDOW isn't on that frame, just
2141 return the first window on the frame. */ 2139 return the first window on the frame. */
2142 if (FRAMEP (all_frames) 2140 if (FRAMEP (all_frames)
2143 && !EQ (all_frames, WGET (XWINDOW (window), frame))) 2141 && !EQ (all_frames, XWINDOW (window)->frame))
2144 return Fframe_first_window (all_frames); 2142 return Fframe_first_window (all_frames);
2145 2143
2146 if (next_p) 2144 if (next_p)
@@ -2320,7 +2318,7 @@ MINIBUF neither nil nor t means never include the minibuffer window. */)
2320 if (NILP (frame)) 2318 if (NILP (frame))
2321 frame = selected_frame; 2319 frame = selected_frame;
2322 2320
2323 if (!EQ (frame, WGET (XWINDOW (window), frame))) 2321 if (!EQ (frame, XWINDOW (window)->frame))
2324 error ("Window is on a different frame"); 2322 error ("Window is on a different frame");
2325 2323
2326 return window_list_1 (window, minibuf, frame); 2324 return window_list_1 (window, minibuf, frame);
@@ -2441,7 +2439,7 @@ window_loop (enum window_loop type, Lisp_Object obj, int mini, Lisp_Object frame
2441 switch (type) 2439 switch (type)
2442 { 2440 {
2443 case GET_BUFFER_WINDOW: 2441 case GET_BUFFER_WINDOW:
2444 if (EQ (WGET (w, buffer), obj) 2442 if (EQ (w->buffer, obj)
2445 /* Don't find any minibuffer window except the one that 2443 /* Don't find any minibuffer window except the one that
2446 is currently in use. */ 2444 is currently in use. */
2447 && (MINI_WINDOW_P (w) ? EQ (window, minibuf_window) : 1)) 2445 && (MINI_WINDOW_P (w) ? EQ (window, minibuf_window) : 1))
@@ -2449,7 +2447,7 @@ window_loop (enum window_loop type, Lisp_Object obj, int mini, Lisp_Object frame
2449 if (EQ (window, selected_window)) 2447 if (EQ (window, selected_window))
2450 /* Preferably return the selected window. */ 2448 /* Preferably return the selected window. */
2451 RETURN_UNGCPRO (window); 2449 RETURN_UNGCPRO (window);
2452 else if (EQ (WGET (XWINDOW (window), frame), selected_frame) 2450 else if (EQ (XWINDOW (window)->frame, selected_frame)
2453 && !frame_best_window_flag) 2451 && !frame_best_window_flag)
2454 /* Prefer windows on the current frame (but don't 2452 /* Prefer windows on the current frame (but don't
2455 choose another one if we have one already). */ 2453 choose another one if we have one already). */
@@ -2465,25 +2463,25 @@ window_loop (enum window_loop type, Lisp_Object obj, int mini, Lisp_Object frame
2465 case REPLACE_BUFFER_IN_WINDOWS_SAFELY: 2463 case REPLACE_BUFFER_IN_WINDOWS_SAFELY:
2466 /* We could simply check whether the buffer shown by window 2464 /* We could simply check whether the buffer shown by window
2467 is live, and show another buffer in case it isn't. */ 2465 is live, and show another buffer in case it isn't. */
2468 if (EQ (WGET (w, buffer), obj)) 2466 if (EQ (w->buffer, obj))
2469 { 2467 {
2470 /* Undedicate WINDOW. */ 2468 /* Undedicate WINDOW. */
2471 WSET (w, dedicated, Qnil); 2469 WSET (w, dedicated, Qnil);
2472 /* Make WINDOW show the buffer returned by 2470 /* Make WINDOW show the buffer returned by
2473 other_buffer_safely, don't run any hooks. */ 2471 other_buffer_safely, don't run any hooks. */
2474 set_window_buffer 2472 set_window_buffer
2475 (window, other_buffer_safely (WGET (w, buffer)), 0, 0); 2473 (window, other_buffer_safely (w->buffer), 0, 0);
2476 /* If WINDOW is the selected window, make its buffer 2474 /* If WINDOW is the selected window, make its buffer
2477 current. But do so only if the window shows the 2475 current. But do so only if the window shows the
2478 current buffer (Bug#6454). */ 2476 current buffer (Bug#6454). */
2479 if (EQ (window, selected_window) 2477 if (EQ (window, selected_window)
2480 && XBUFFER (WGET (w, buffer)) == current_buffer) 2478 && XBUFFER (w->buffer) == current_buffer)
2481 Fset_buffer (WGET (w, buffer)); 2479 Fset_buffer (w->buffer);
2482 } 2480 }
2483 break; 2481 break;
2484 2482
2485 case REDISPLAY_BUFFER_WINDOWS: 2483 case REDISPLAY_BUFFER_WINDOWS:
2486 if (EQ (WGET (w, buffer), obj)) 2484 if (EQ (w->buffer, obj))
2487 { 2485 {
2488 mark_window_display_accurate (window, 0); 2486 mark_window_display_accurate (window, 0);
2489 w->update_mode_line = 1; 2487 w->update_mode_line = 1;
@@ -2495,8 +2493,8 @@ window_loop (enum window_loop type, Lisp_Object obj, int mini, Lisp_Object frame
2495 2493
2496 /* Check for a window that has a killed buffer. */ 2494 /* Check for a window that has a killed buffer. */
2497 case CHECK_ALL_WINDOWS: 2495 case CHECK_ALL_WINDOWS:
2498 if (! NILP (WGET (w, buffer)) 2496 if (! NILP (w->buffer)
2499 && NILP (BVAR (XBUFFER (WGET (w, buffer)), name))) 2497 && NILP (BVAR (XBUFFER (w->buffer), name)))
2500 abort (); 2498 abort ();
2501 break; 2499 break;
2502 2500
@@ -2582,9 +2580,9 @@ window-start value is reasonable when this function is called. */)
2582 int top IF_LINT (= 0), new_top, resize_failed; 2580 int top IF_LINT (= 0), new_top, resize_failed;
2583 2581
2584 w = decode_any_window (window); 2582 w = decode_any_window (window);
2585 CHECK_LIVE_FRAME (WGET (w, frame)); 2583 CHECK_LIVE_FRAME (w->frame);
2586 XSETWINDOW (window, w); 2584 XSETWINDOW (window, w);
2587 f = XFRAME (WGET (w, frame)); 2585 f = XFRAME (w->frame);
2588 2586
2589 if (NILP (root)) 2587 if (NILP (root))
2590 /* ROOT is the frame's root window. */ 2588 /* ROOT is the frame's root window. */
@@ -2596,13 +2594,13 @@ window-start value is reasonable when this function is called. */)
2596 /* ROOT must be an ancestor of WINDOW. */ 2594 /* ROOT must be an ancestor of WINDOW. */
2597 { 2595 {
2598 r = decode_any_window (root); 2596 r = decode_any_window (root);
2599 CHECK_LIVE_FRAME (WGET (r, frame)); 2597 CHECK_LIVE_FRAME (r->frame);
2600 pwindow = WGET (XWINDOW (window), parent); 2598 pwindow = XWINDOW (window)->parent;
2601 while (!NILP (pwindow)) 2599 while (!NILP (pwindow))
2602 if (EQ (pwindow, root)) 2600 if (EQ (pwindow, root))
2603 break; 2601 break;
2604 else 2602 else
2605 pwindow = WGET (XWINDOW (pwindow), parent); 2603 pwindow = XWINDOW (pwindow)->parent;
2606 if (!EQ (pwindow, root)) 2604 if (!EQ (pwindow, root))
2607 error ("Specified root is not an ancestor of specified window"); 2605 error ("Specified root is not an ancestor of specified window");
2608 } 2606 }
@@ -2616,15 +2614,15 @@ window-start value is reasonable when this function is called. */)
2616 else if (MINI_WINDOW_P (w)) /* && top > 0) */ 2614 else if (MINI_WINDOW_P (w)) /* && top > 0) */
2617 error ("Can't expand minibuffer to full frame"); 2615 error ("Can't expand minibuffer to full frame");
2618 2616
2619 if (!NILP (WGET (w, buffer))) 2617 if (!NILP (w->buffer))
2620 { 2618 {
2621 startpos = marker_position (WGET (w, start)); 2619 startpos = marker_position (w->start);
2622 top = WINDOW_TOP_EDGE_LINE (w) 2620 top = WINDOW_TOP_EDGE_LINE (w)
2623 - FRAME_TOP_MARGIN (XFRAME (WINDOW_FRAME (w))); 2621 - FRAME_TOP_MARGIN (XFRAME (WINDOW_FRAME (w)));
2624 /* Make sure WINDOW is the frame's selected window. */ 2622 /* Make sure WINDOW is the frame's selected window. */
2625 if (!EQ (window, FRAME_SELECTED_WINDOW (f))) 2623 if (!EQ (window, FRAME_SELECTED_WINDOW (f)))
2626 { 2624 {
2627 if (EQ (selected_frame, WGET (w, frame))) 2625 if (EQ (selected_frame, w->frame))
2628 Fselect_window (window, Qnil); 2626 Fselect_window (window, Qnil);
2629 else 2627 else
2630 FSET (f, selected_window, window); 2628 FSET (f, selected_window, window);
@@ -2641,7 +2639,7 @@ window-start value is reasonable when this function is called. */)
2641 { 2639 {
2642 pwindow = swindow; 2640 pwindow = swindow;
2643 while (!NILP (pwindow) && !EQ (window, pwindow)) 2641 while (!NILP (pwindow) && !EQ (window, pwindow))
2644 pwindow = WGET (XWINDOW (pwindow), parent); 2642 pwindow = XWINDOW (pwindow)->parent;
2645 2643
2646 if (EQ (window, pwindow)) 2644 if (EQ (window, pwindow))
2647 /* If WINDOW is an ancestor of SWINDOW, then SWINDOW is ok 2645 /* If WINDOW is an ancestor of SWINDOW, then SWINDOW is ok
@@ -2654,7 +2652,7 @@ window-start value is reasonable when this function is called. */)
2654 2652
2655 if (!EQ (swindow, FRAME_SELECTED_WINDOW (f))) 2653 if (!EQ (swindow, FRAME_SELECTED_WINDOW (f)))
2656 { 2654 {
2657 if (EQ (selected_frame, WGET (w, frame))) 2655 if (EQ (selected_frame, w->frame))
2658 Fselect_window (swindow, Qnil); 2656 Fselect_window (swindow, Qnil);
2659 else 2657 else
2660 FSET (f, selected_window, swindow); 2658 FSET (f, selected_window, swindow);
@@ -2687,12 +2685,12 @@ window-start value is reasonable when this function is called. */)
2687 FRAME_WINDOW_SIZES_CHANGED (f) = 1; 2685 FRAME_WINDOW_SIZES_CHANGED (f) = 1;
2688 resize_failed = 0; 2686 resize_failed = 0;
2689 2687
2690 if (NILP (WGET (w, buffer))) 2688 if (NILP (w->buffer))
2691 { 2689 {
2692 /* Resize child windows vertically. */ 2690 /* Resize child windows vertically. */
2693 XSETINT (delta, XINT (WGET (r, total_lines)) 2691 XSETINT (delta, XINT (r->total_lines)
2694 - XINT (WGET (w, total_lines))); 2692 - XINT (w->total_lines));
2695 WSET (w, top_line, WGET (r, top_line)); 2693 WSET (w, top_line, r->top_line);
2696 resize_root_window (window, delta, Qnil, Qnil); 2694 resize_root_window (window, delta, Qnil, Qnil);
2697 if (window_resize_check (w, 0)) 2695 if (window_resize_check (w, 0))
2698 window_resize_apply (w, 0); 2696 window_resize_apply (w, 0);
@@ -2708,10 +2706,10 @@ window-start value is reasonable when this function is called. */)
2708 /* Resize child windows horizontally. */ 2706 /* Resize child windows horizontally. */
2709 if (!resize_failed) 2707 if (!resize_failed)
2710 { 2708 {
2711 WSET (w, left_col, WGET (r, left_col)); 2709 WSET (w, left_col, r->left_col);
2712 XSETINT (delta, XINT (WGET (r, total_cols)) 2710 XSETINT (delta, XINT (r->total_cols)
2713 - XINT (WGET (w, total_cols))); 2711 - XINT (w->total_cols));
2714 WSET (w, left_col, WGET (r, left_col)); 2712 WSET (w, left_col, r->left_col);
2715 resize_root_window (window, delta, Qt, Qnil); 2713 resize_root_window (window, delta, Qt, Qnil);
2716 if (window_resize_check (w, 1)) 2714 if (window_resize_check (w, 1))
2717 window_resize_apply (w, 1); 2715 window_resize_apply (w, 1);
@@ -2734,43 +2732,43 @@ window-start value is reasonable when this function is called. */)
2734 } 2732 }
2735 2733
2736 /* Cleanly unlink WINDOW from window-tree. */ 2734 /* Cleanly unlink WINDOW from window-tree. */
2737 if (!NILP (WGET (w, prev))) 2735 if (!NILP (w->prev))
2738 /* Get SIBLING above (on the left of) WINDOW. */ 2736 /* Get SIBLING above (on the left of) WINDOW. */
2739 { 2737 {
2740 sibling = WGET (w, prev); 2738 sibling = w->prev;
2741 s = XWINDOW (sibling); 2739 s = XWINDOW (sibling);
2742 WSET (s, next, WGET (w, next)); 2740 WSET (s, next, w->next);
2743 if (!NILP (WGET (s, next))) 2741 if (!NILP (s->next))
2744 WSET (XWINDOW (WGET (s, next)), prev, sibling); 2742 WSET (XWINDOW (s->next), prev, sibling);
2745 } 2743 }
2746 else 2744 else
2747 /* Get SIBLING below (on the right of) WINDOW. */ 2745 /* Get SIBLING below (on the right of) WINDOW. */
2748 { 2746 {
2749 sibling = WGET (w, next); 2747 sibling = w->next;
2750 s = XWINDOW (sibling); 2748 s = XWINDOW (sibling);
2751 WSET (s, prev, Qnil); 2749 WSET (s, prev, Qnil);
2752 if (!NILP (WGET (XWINDOW (WGET (w, parent)), vchild))) 2750 if (!NILP (XWINDOW (w->parent)->vchild))
2753 WSET (XWINDOW (WGET (w, parent)), vchild, sibling); 2751 WSET (XWINDOW (w->parent), vchild, sibling);
2754 else 2752 else
2755 WSET (XWINDOW (WGET (w, parent)), hchild, sibling); 2753 WSET (XWINDOW (w->parent), hchild, sibling);
2756 } 2754 }
2757 2755
2758 /* Delete ROOT and all child windows of ROOT. */ 2756 /* Delete ROOT and all child windows of ROOT. */
2759 if (!NILP (WGET (r, vchild))) 2757 if (!NILP (r->vchild))
2760 { 2758 {
2761 delete_all_child_windows (WGET (r, vchild)); 2759 delete_all_child_windows (r->vchild);
2762 WSET (r, vchild, Qnil); 2760 WSET (r, vchild, Qnil);
2763 } 2761 }
2764 else if (!NILP (WGET (r, hchild))) 2762 else if (!NILP (r->hchild))
2765 { 2763 {
2766 delete_all_child_windows (WGET (r, hchild)); 2764 delete_all_child_windows (r->hchild);
2767 WSET (r, hchild, Qnil); 2765 WSET (r, hchild, Qnil);
2768 } 2766 }
2769 2767
2770 replace_window (root, window, 1); 2768 replace_window (root, window, 1);
2771 2769
2772 /* This must become SWINDOW anyway ....... */ 2770 /* This must become SWINDOW anyway ....... */
2773 if (!NILP (WGET (w, buffer)) && !resize_failed) 2771 if (!NILP (w->buffer) && !resize_failed)
2774 { 2772 {
2775 /* Try to minimize scrolling, by setting the window start to the 2773 /* Try to minimize scrolling, by setting the window start to the
2776 point will cause the text at the old window start to be at the 2774 point will cause the text at the old window start to be at the
@@ -2779,18 +2777,18 @@ window-start value is reasonable when this function is called. */)
2779 when the display is not current, due to typeahead). */ 2777 when the display is not current, due to typeahead). */
2780 new_top = WINDOW_TOP_EDGE_LINE (w) - FRAME_TOP_MARGIN (XFRAME (WINDOW_FRAME (w))); 2778 new_top = WINDOW_TOP_EDGE_LINE (w) - FRAME_TOP_MARGIN (XFRAME (WINDOW_FRAME (w)));
2781 if (new_top != top 2779 if (new_top != top
2782 && startpos >= BUF_BEGV (XBUFFER (WGET (w, buffer))) 2780 && startpos >= BUF_BEGV (XBUFFER (w->buffer))
2783 && startpos <= BUF_ZV (XBUFFER (WGET (w, buffer)))) 2781 && startpos <= BUF_ZV (XBUFFER (w->buffer)))
2784 { 2782 {
2785 struct position pos; 2783 struct position pos;
2786 struct buffer *obuf = current_buffer; 2784 struct buffer *obuf = current_buffer;
2787 2785
2788 Fset_buffer (WGET (w, buffer)); 2786 Fset_buffer (w->buffer);
2789 /* This computation used to temporarily move point, but that 2787 /* This computation used to temporarily move point, but that
2790 can have unwanted side effects due to text properties. */ 2788 can have unwanted side effects due to text properties. */
2791 pos = *vmotion (startpos, -top, w); 2789 pos = *vmotion (startpos, -top, w);
2792 2790
2793 set_marker_both (WGET (w, start), WGET (w, buffer), pos.bufpos, pos.bytepos); 2791 set_marker_both (w->start, w->buffer, pos.bufpos, pos.bytepos);
2794 WSET (w, window_end_valid, Qnil); 2792 WSET (w, window_end_valid, Qnil);
2795 w->start_at_line_beg = (pos.bytepos == BEGV_BYTE 2793 w->start_at_line_beg = (pos.bytepos == BEGV_BYTE
2796 || FETCH_BYTE (pos.bytepos - 1) == '\n'); 2794 || FETCH_BYTE (pos.bytepos - 1) == '\n');
@@ -2987,7 +2985,7 @@ set_window_buffer (Lisp_Object window, Lisp_Object buffer, int run_hooks_p, int
2987 struct window *w = XWINDOW (window); 2985 struct window *w = XWINDOW (window);
2988 struct buffer *b = XBUFFER (buffer); 2986 struct buffer *b = XBUFFER (buffer);
2989 ptrdiff_t count = SPECPDL_INDEX (); 2987 ptrdiff_t count = SPECPDL_INDEX ();
2990 int samebuf = EQ (buffer, WGET (w, buffer)); 2988 int samebuf = EQ (buffer, w->buffer);
2991 2989
2992 WSET (w, buffer, buffer); 2990 WSET (w, buffer, buffer);
2993 2991
@@ -3017,8 +3015,8 @@ set_window_buffer (Lisp_Object window, Lisp_Object buffer, int run_hooks_p, int
3017 whenever we resize the frame. */ 3015 whenever we resize the frame. */
3018 w->hscroll = w->min_hscroll = 0; 3016 w->hscroll = w->min_hscroll = 0;
3019 w->vscroll = 0; 3017 w->vscroll = 0;
3020 set_marker_both (WGET (w, pointm), buffer, BUF_PT (b), BUF_PT_BYTE (b)); 3018 set_marker_both (w->pointm, buffer, BUF_PT (b), BUF_PT_BYTE (b));
3021 set_marker_restricted (WGET (w, start), 3019 set_marker_restricted (w->start,
3022 make_number (b->last_window_start), 3020 make_number (b->last_window_start),
3023 buffer); 3021 buffer);
3024 w->start_at_line_beg = 0; 3022 w->start_at_line_beg = 0;
@@ -3039,7 +3037,7 @@ set_window_buffer (Lisp_Object window, Lisp_Object buffer, int run_hooks_p, int
3039 Fset_buffer (buffer); 3037 Fset_buffer (buffer);
3040 } 3038 }
3041 3039
3042 XMARKER (WGET (w, pointm))->insertion_type = !NILP (Vwindow_point_insertion_type); 3040 XMARKER (w->pointm)->insertion_type = !NILP (Vwindow_point_insertion_type);
3043 3041
3044 if (!keep_margins_p) 3042 if (!keep_margins_p)
3045 { 3043 {
@@ -3047,8 +3045,8 @@ set_window_buffer (Lisp_Object window, Lisp_Object buffer, int run_hooks_p, int
3047 3045
3048 /* This may call adjust_window_margins three times, so 3046 /* This may call adjust_window_margins three times, so
3049 temporarily disable window margins. */ 3047 temporarily disable window margins. */
3050 Lisp_Object save_left = WGET (w, left_margin_cols); 3048 Lisp_Object save_left = w->left_margin_cols;
3051 Lisp_Object save_right = WGET (w, right_margin_cols); 3049 Lisp_Object save_right = w->right_margin_cols;
3052 3050
3053 WSET (w, left_margin_cols, Qnil); 3051 WSET (w, left_margin_cols, Qnil);
3054 WSET (w, right_margin_cols, Qnil); 3052 WSET (w, right_margin_cols, Qnil);
@@ -3072,7 +3070,7 @@ set_window_buffer (Lisp_Object window, Lisp_Object buffer, int run_hooks_p, int
3072 { 3070 {
3073 if (! NILP (Vwindow_scroll_functions)) 3071 if (! NILP (Vwindow_scroll_functions))
3074 run_hook_with_args_2 (Qwindow_scroll_functions, window, 3072 run_hook_with_args_2 (Qwindow_scroll_functions, window,
3075 Fmarker_position (WGET (w, start))); 3073 Fmarker_position (w->start));
3076 run_window_configuration_change_hook (XFRAME (WINDOW_FRAME (w))); 3074 run_window_configuration_change_hook (XFRAME (WINDOW_FRAME (w)));
3077 } 3075 }
3078 3076
@@ -3106,7 +3104,7 @@ This function runs `window-scroll-functions' before running
3106 if (NILP (BVAR (XBUFFER (buffer), name))) 3104 if (NILP (BVAR (XBUFFER (buffer), name)))
3107 error ("Attempt to display deleted buffer"); 3105 error ("Attempt to display deleted buffer");
3108 3106
3109 tem = WGET (w, buffer); 3107 tem = w->buffer;
3110 if (NILP (tem)) 3108 if (NILP (tem))
3111 error ("Window is deleted"); 3109 error ("Window is deleted");
3112 else if (!EQ (tem, Qt)) 3110 else if (!EQ (tem, Qt))
@@ -3114,7 +3112,7 @@ This function runs `window-scroll-functions' before running
3114 { 3112 {
3115 if (!EQ (tem, buffer)) 3113 if (!EQ (tem, buffer))
3116 { 3114 {
3117 if (EQ (WGET (w, dedicated), Qt)) 3115 if (EQ (w->dedicated, Qt))
3118 /* WINDOW is strongly dedicated to its buffer, signal an 3116 /* WINDOW is strongly dedicated to its buffer, signal an
3119 error. */ 3117 error. */
3120 error ("Window is dedicated to `%s'", SDATA (BVAR (XBUFFER (tem), name))); 3118 error ("Window is dedicated to `%s'", SDATA (BVAR (XBUFFER (tem), name)));
@@ -3160,8 +3158,8 @@ displaying that buffer. */)
3160 struct window *w = XWINDOW (object); 3158 struct window *w = XWINDOW (object);
3161 mark_window_display_accurate (object, 0); 3159 mark_window_display_accurate (object, 0);
3162 w->update_mode_line = 1; 3160 w->update_mode_line = 1;
3163 if (BUFFERP (WGET (w, buffer))) 3161 if (BUFFERP (w->buffer))
3164 XBUFFER (WGET (w, buffer))->prevent_redisplay_optimizations_p = 1; 3162 XBUFFER (w->buffer)->prevent_redisplay_optimizations_p = 1;
3165 ++update_mode_lines; 3163 ++update_mode_lines;
3166 return Qt; 3164 return Qt;
3167 } 3165 }
@@ -3206,14 +3204,14 @@ temp_output_buffer_show (register Lisp_Object buf)
3206 { 3204 {
3207 window = display_buffer (buf, Qnil, Qnil); 3205 window = display_buffer (buf, Qnil, Qnil);
3208 3206
3209 if (!EQ (WGET (XWINDOW (window), frame), selected_frame)) 3207 if (!EQ (XWINDOW (window)->frame, selected_frame))
3210 Fmake_frame_visible (WINDOW_FRAME (XWINDOW (window))); 3208 Fmake_frame_visible (WINDOW_FRAME (XWINDOW (window)));
3211 Vminibuf_scroll_window = window; 3209 Vminibuf_scroll_window = window;
3212 w = XWINDOW (window); 3210 w = XWINDOW (window);
3213 w->hscroll = 0; 3211 w->hscroll = 0;
3214 w->min_hscroll = 0; 3212 w->min_hscroll = 0;
3215 set_marker_restricted_both (WGET (w, start), buf, BEG, BEG); 3213 set_marker_restricted_both (w->start, buf, BEG, BEG);
3216 set_marker_restricted_both (WGET (w, pointm), buf, BEG, BEG); 3214 set_marker_restricted_both (w->pointm, buf, BEG, BEG);
3217 3215
3218 /* Run temp-buffer-show-hook, with the chosen window selected 3216 /* Run temp-buffer-show-hook, with the chosen window selected
3219 and its buffer current. */ 3217 and its buffer current. */
@@ -3230,7 +3228,7 @@ temp_output_buffer_show (register Lisp_Object buf)
3230 record_unwind_protect (Fset_buffer, prev_buffer); 3228 record_unwind_protect (Fset_buffer, prev_buffer);
3231 record_unwind_protect (select_window_norecord, prev_window); 3229 record_unwind_protect (select_window_norecord, prev_window);
3232 Fselect_window (window, Qt); 3230 Fselect_window (window, Qt);
3233 Fset_buffer (WGET (w, buffer)); 3231 Fset_buffer (w->buffer);
3234 Frun_hooks (1, &Qtemp_buffer_show_hook); 3232 Frun_hooks (1, &Qtemp_buffer_show_hook);
3235 unbind_to (count, Qnil); 3233 unbind_to (count, Qnil);
3236 } 3234 }
@@ -3334,9 +3332,9 @@ Note: This function does not operate on any child windows of WINDOW. */)
3334 if (NILP (add)) 3332 if (NILP (add))
3335 WSET (w, new_total, size); 3333 WSET (w, new_total, size);
3336 else 3334 else
3337 WSET (w, new_total, make_number (XINT (WGET (w, new_total)) + XINT (size))); 3335 WSET (w, new_total, make_number (XINT (w->new_total) + XINT (size)));
3338 3336
3339 return WGET (w, new_total); 3337 return w->new_total;
3340} 3338}
3341 3339
3342DEFUN ("set-window-new-normal", Fset_window_new_normal, Sset_window_new_normal, 1, 2, 0, 3340DEFUN ("set-window-new-normal", Fset_window_new_normal, Sset_window_new_normal, 1, 2, 0,
@@ -3361,19 +3359,19 @@ window_resize_check (struct window *w, int horflag)
3361{ 3359{
3362 struct window *c; 3360 struct window *c;
3363 3361
3364 if (!NILP (WGET (w, vchild))) 3362 if (!NILP (w->vchild))
3365 /* W is a vertical combination. */ 3363 /* W is a vertical combination. */
3366 { 3364 {
3367 c = XWINDOW (WGET (w, vchild)); 3365 c = XWINDOW (w->vchild);
3368 if (horflag) 3366 if (horflag)
3369 /* All child windows of W must have the same width as W. */ 3367 /* All child windows of W must have the same width as W. */
3370 { 3368 {
3371 while (c) 3369 while (c)
3372 { 3370 {
3373 if ((XINT (WGET (c, new_total)) != XINT (WGET (w, new_total))) 3371 if ((XINT (c->new_total) != XINT (w->new_total))
3374 || !window_resize_check (c, horflag)) 3372 || !window_resize_check (c, horflag))
3375 return 0; 3373 return 0;
3376 c = NILP (WGET (c, next)) ? 0 : XWINDOW (WGET (c, next)); 3374 c = NILP (c->next) ? 0 : XWINDOW (c->next);
3377 } 3375 }
3378 return 1; 3376 return 1;
3379 } 3377 }
@@ -3386,16 +3384,16 @@ window_resize_check (struct window *w, int horflag)
3386 { 3384 {
3387 if (!window_resize_check (c, horflag)) 3385 if (!window_resize_check (c, horflag))
3388 return 0; 3386 return 0;
3389 sum_of_sizes = sum_of_sizes + XINT (WGET (c, new_total)); 3387 sum_of_sizes = sum_of_sizes + XINT (c->new_total);
3390 c = NILP (WGET (c, next)) ? 0 : XWINDOW (WGET (c, next)); 3388 c = NILP (c->next) ? 0 : XWINDOW (c->next);
3391 } 3389 }
3392 return (sum_of_sizes == XINT (WGET (w, new_total))); 3390 return (sum_of_sizes == XINT (w->new_total));
3393 } 3391 }
3394 } 3392 }
3395 else if (!NILP (WGET (w, hchild))) 3393 else if (!NILP (w->hchild))
3396 /* W is a horizontal combination. */ 3394 /* W is a horizontal combination. */
3397 { 3395 {
3398 c = XWINDOW (WGET (w, hchild)); 3396 c = XWINDOW (w->hchild);
3399 if (horflag) 3397 if (horflag)
3400 /* The sum of the widths of the child windows of W must equal W's 3398 /* The sum of the widths of the child windows of W must equal W's
3401 width. */ 3399 width. */
@@ -3405,20 +3403,20 @@ window_resize_check (struct window *w, int horflag)
3405 { 3403 {
3406 if (!window_resize_check (c, horflag)) 3404 if (!window_resize_check (c, horflag))
3407 return 0; 3405 return 0;
3408 sum_of_sizes = sum_of_sizes + XINT (WGET (c, new_total)); 3406 sum_of_sizes = sum_of_sizes + XINT (c->new_total);
3409 c = NILP (WGET (c, next)) ? 0 : XWINDOW (WGET (c, next)); 3407 c = NILP (c->next) ? 0 : XWINDOW (c->next);
3410 } 3408 }
3411 return (sum_of_sizes == XINT (WGET (w, new_total))); 3409 return (sum_of_sizes == XINT (w->new_total));
3412 } 3410 }
3413 else 3411 else
3414 /* All child windows of W must have the same height as W. */ 3412 /* All child windows of W must have the same height as W. */
3415 { 3413 {
3416 while (c) 3414 while (c)
3417 { 3415 {
3418 if ((XINT (WGET (c, new_total)) != XINT (WGET (w, new_total))) 3416 if ((XINT (c->new_total) != XINT (w->new_total))
3419 || !window_resize_check (c, horflag)) 3417 || !window_resize_check (c, horflag))
3420 return 0; 3418 return 0;
3421 c = NILP (WGET (c, next)) ? 0 : XWINDOW (WGET (c, next)); 3419 c = NILP (c->next) ? 0 : XWINDOW (c->next);
3422 } 3420 }
3423 return 1; 3421 return 1;
3424 } 3422 }
@@ -3427,7 +3425,7 @@ window_resize_check (struct window *w, int horflag)
3427 /* A leaf window. Make sure it's not too small. The following 3425 /* A leaf window. Make sure it's not too small. The following
3428 hardcodes the values of `window-safe-min-width' (2) and 3426 hardcodes the values of `window-safe-min-width' (2) and
3429 `window-safe-min-height' (1) which are defined in window.el. */ 3427 `window-safe-min-height' (1) which are defined in window.el. */
3430 return XINT (WGET (w, new_total)) >= (horflag ? 2 : 1); 3428 return XINT (w->new_total) >= (horflag ? 2 : 1);
3431} 3429}
3432 3430
3433/* Set w->total_lines (w->total_cols if HORIZONTAL is non-zero) to 3431/* Set w->total_lines (w->total_cols if HORIZONTAL is non-zero) to
@@ -3447,25 +3445,25 @@ window_resize_apply (struct window *w, int horflag)
3447 parent window has been set *before*. */ 3445 parent window has been set *before*. */
3448 if (horflag) 3446 if (horflag)
3449 { 3447 {
3450 WSET (w, total_cols, WGET (w, new_total)); 3448 WSET (w, total_cols, w->new_total);
3451 if (NUMBERP (WGET (w, new_normal))) 3449 if (NUMBERP (w->new_normal))
3452 WSET (w, normal_cols, WGET (w, new_normal)); 3450 WSET (w, normal_cols, w->new_normal);
3453 3451
3454 pos = XINT (WGET (w, left_col)); 3452 pos = XINT (w->left_col);
3455 } 3453 }
3456 else 3454 else
3457 { 3455 {
3458 WSET (w, total_lines, WGET (w, new_total)); 3456 WSET (w, total_lines, w->new_total);
3459 if (NUMBERP (WGET (w, new_normal))) 3457 if (NUMBERP (w->new_normal))
3460 WSET (w, normal_lines, WGET (w, new_normal)); 3458 WSET (w, normal_lines, w->new_normal);
3461 3459
3462 pos = XINT (WGET (w, top_line)); 3460 pos = XINT (w->top_line);
3463 } 3461 }
3464 3462
3465 if (!NILP (WGET (w, vchild))) 3463 if (!NILP (w->vchild))
3466 /* W is a vertical combination. */ 3464 /* W is a vertical combination. */
3467 { 3465 {
3468 c = XWINDOW (WGET (w, vchild)); 3466 c = XWINDOW (w->vchild);
3469 while (c) 3467 while (c)
3470 { 3468 {
3471 if (horflag) 3469 if (horflag)
@@ -3474,14 +3472,14 @@ window_resize_apply (struct window *w, int horflag)
3474 WSET (c, top_line, make_number (pos)); 3472 WSET (c, top_line, make_number (pos));
3475 window_resize_apply (c, horflag); 3473 window_resize_apply (c, horflag);
3476 if (!horflag) 3474 if (!horflag)
3477 pos = pos + XINT (WGET (c, total_lines)); 3475 pos = pos + XINT (c->total_lines);
3478 c = NILP (WGET (c, next)) ? 0 : XWINDOW (WGET (c, next)); 3476 c = NILP (c->next) ? 0 : XWINDOW (c->next);
3479 } 3477 }
3480 } 3478 }
3481 else if (!NILP (WGET (w, hchild))) 3479 else if (!NILP (w->hchild))
3482 /* W is a horizontal combination. */ 3480 /* W is a horizontal combination. */
3483 { 3481 {
3484 c = XWINDOW (WGET (w, hchild)); 3482 c = XWINDOW (w->hchild);
3485 while (c) 3483 while (c)
3486 { 3484 {
3487 if (horflag) 3485 if (horflag)
@@ -3490,8 +3488,8 @@ window_resize_apply (struct window *w, int horflag)
3490 WSET (c, top_line, make_number (pos)); 3488 WSET (c, top_line, make_number (pos));
3491 window_resize_apply (c, horflag); 3489 window_resize_apply (c, horflag);
3492 if (horflag) 3490 if (horflag)
3493 pos = pos + XINT (WGET (c, total_cols)); 3491 pos = pos + XINT (c->total_cols);
3494 c = NILP (WGET (c, next)) ? 0 : XWINDOW (WGET (c, next)); 3492 c = NILP (c->next) ? 0 : XWINDOW (c->next);
3495 } 3493 }
3496 } 3494 }
3497 3495
@@ -3527,8 +3525,8 @@ be applied on the Elisp level. */)
3527 r = XWINDOW (FRAME_ROOT_WINDOW (f)); 3525 r = XWINDOW (FRAME_ROOT_WINDOW (f));
3528 3526
3529 if (!window_resize_check (r, horflag) 3527 if (!window_resize_check (r, horflag)
3530 || ! EQ (WGET (r, new_total), 3528 || ! EQ (r->new_total,
3531 (horflag ? WGET (r, total_cols) : WGET (r, total_lines)))) 3529 (horflag ? r->total_cols : r->total_lines)))
3532 return Qnil; 3530 return Qnil;
3533 3531
3534 BLOCK_INPUT; 3532 BLOCK_INPUT;
@@ -3569,7 +3567,7 @@ resize_frame_windows (struct frame *f, int size, int horflag)
3569 ? 1 : 0))); 3567 ? 1 : 0)));
3570 3568
3571 WSET (r, top_line, make_number (FRAME_TOP_MARGIN (f))); 3569 WSET (r, top_line, make_number (FRAME_TOP_MARGIN (f)));
3572 if (NILP (WGET (r, vchild)) && NILP (WGET (r, hchild))) 3570 if (NILP (r->vchild) && NILP (r->hchild))
3573 /* For a leaf root window just set the size. */ 3571 /* For a leaf root window just set the size. */
3574 if (horflag) 3572 if (horflag)
3575 WSET (r, total_cols, make_number (new_size)); 3573 WSET (r, total_cols, make_number (new_size));
@@ -3578,29 +3576,29 @@ resize_frame_windows (struct frame *f, int size, int horflag)
3578 else 3576 else
3579 { 3577 {
3580 /* old_size is the old size of the frame's root window. */ 3578 /* old_size is the old size of the frame's root window. */
3581 int old_size = XFASTINT (horflag ? WGET (r, total_cols) 3579 int old_size = XFASTINT (horflag ? r->total_cols
3582 : WGET (r, total_lines)); 3580 : r->total_lines);
3583 Lisp_Object delta; 3581 Lisp_Object delta;
3584 3582
3585 XSETINT (delta, new_size - old_size); 3583 XSETINT (delta, new_size - old_size);
3586 /* Try a "normal" resize first. */ 3584 /* Try a "normal" resize first. */
3587 resize_root_window (root, delta, horflag ? Qt : Qnil, Qnil); 3585 resize_root_window (root, delta, horflag ? Qt : Qnil, Qnil);
3588 if (window_resize_check (r, horflag) 3586 if (window_resize_check (r, horflag)
3589 && new_size == XINT (WGET (r, new_total))) 3587 && new_size == XINT (r->new_total))
3590 window_resize_apply (r, horflag); 3588 window_resize_apply (r, horflag);
3591 else 3589 else
3592 { 3590 {
3593 /* Try with "reasonable" minimum sizes next. */ 3591 /* Try with "reasonable" minimum sizes next. */
3594 resize_root_window (root, delta, horflag ? Qt : Qnil, Qt); 3592 resize_root_window (root, delta, horflag ? Qt : Qnil, Qt);
3595 if (window_resize_check (r, horflag) 3593 if (window_resize_check (r, horflag)
3596 && new_size == XINT (WGET (r, new_total))) 3594 && new_size == XINT (r->new_total))
3597 window_resize_apply (r, horflag); 3595 window_resize_apply (r, horflag);
3598 else 3596 else
3599 { 3597 {
3600 /* Finally, try with "safe" minimum sizes. */ 3598 /* Finally, try with "safe" minimum sizes. */
3601 resize_root_window (root, delta, horflag ? Qt : Qnil, Qsafe); 3599 resize_root_window (root, delta, horflag ? Qt : Qnil, Qsafe);
3602 if (window_resize_check (r, horflag) 3600 if (window_resize_check (r, horflag)
3603 && new_size == XINT (WGET (r, new_total))) 3601 && new_size == XINT (r->new_total))
3604 window_resize_apply (r, horflag); 3602 window_resize_apply (r, horflag);
3605 else 3603 else
3606 { 3604 {
@@ -3627,7 +3625,7 @@ resize_frame_windows (struct frame *f, int size, int horflag)
3627 /* Are we sure we always want 1 line here? */ 3625 /* Are we sure we always want 1 line here? */
3628 WSET (m, total_lines, make_number (1)); 3626 WSET (m, total_lines, make_number (1));
3629 WSET (m, top_line, 3627 WSET (m, top_line,
3630 make_number (XINT (WGET (r, top_line)) + XINT (WGET (r, total_lines)))); 3628 make_number (XINT (r->top_line) + XINT (r->total_lines)));
3631 } 3629 }
3632 } 3630 }
3633} 3631}
@@ -3683,10 +3681,10 @@ set correctly. See the code of `split-window' for how this is done. */)
3683 parent, or OLD is ortho-combined. */ 3681 parent, or OLD is ortho-combined. */
3684 combination_limit = 3682 combination_limit =
3685 !NILP (Vwindow_combination_limit) 3683 !NILP (Vwindow_combination_limit)
3686 || NILP (WGET (o, parent)) 3684 || NILP (o->parent)
3687 || NILP (horflag 3685 || NILP (horflag
3688 ? (WGET (XWINDOW (WGET (o, parent)), hchild)) 3686 ? (XWINDOW (o->parent)->hchild)
3689 : (WGET (XWINDOW (WGET (o, parent)), vchild))); 3687 : (XWINDOW (o->parent)->vchild));
3690 3688
3691 /* We need a live reference window to initialize some parameters. */ 3689 /* We need a live reference window to initialize some parameters. */
3692 if (WINDOW_LIVE_P (old)) 3690 if (WINDOW_LIVE_P (old))
@@ -3706,24 +3704,24 @@ set correctly. See the code of `split-window' for how this is done. */)
3706 /* `window-combination-resize' non-nil means try to resize OLD's siblings 3704 /* `window-combination-resize' non-nil means try to resize OLD's siblings
3707 proportionally. */ 3705 proportionally. */
3708 { 3706 {
3709 p = XWINDOW (WGET (o, parent)); 3707 p = XWINDOW (o->parent);
3710 /* Temporarily pretend we split the parent window. */ 3708 /* Temporarily pretend we split the parent window. */
3711 WSET (p, new_total, 3709 WSET (p, new_total,
3712 make_number (XINT (horflag ? WGET (p, total_cols) : WGET (p, total_lines)) 3710 make_number (XINT (horflag ? p->total_cols : p->total_lines)
3713 - XINT (total_size))); 3711 - XINT (total_size)));
3714 if (!window_resize_check (p, horflag)) 3712 if (!window_resize_check (p, horflag))
3715 error ("Window sizes don't fit"); 3713 error ("Window sizes don't fit");
3716 else 3714 else
3717 /* Undo the temporary pretension. */ 3715 /* Undo the temporary pretension. */
3718 WSET (p, new_total, 3716 WSET (p, new_total,
3719 horflag ? WGET (p, total_cols) : WGET (p, total_lines)); 3717 horflag ? p->total_cols : p->total_lines);
3720 } 3718 }
3721 else 3719 else
3722 { 3720 {
3723 if (!window_resize_check (o, horflag)) 3721 if (!window_resize_check (o, horflag))
3724 error ("Resizing old window failed"); 3722 error ("Resizing old window failed");
3725 else if (XINT (total_size) + XINT (WGET (o, new_total)) 3723 else if (XINT (total_size) + XINT (o->new_total)
3726 != XINT (horflag ? WGET (o, total_cols) : WGET (o, total_lines))) 3724 != XINT (horflag ? o->total_cols : o->total_lines))
3727 error ("Sum of sizes of old and new window don't fit"); 3725 error ("Sum of sizes of old and new window don't fit");
3728 } 3726 }
3729 3727
@@ -3734,48 +3732,47 @@ set correctly. See the code of `split-window' for how this is done. */)
3734 by make_parent_window and we need it below for assigning it to 3732 by make_parent_window and we need it below for assigning it to
3735 p->new_normal. */ 3733 p->new_normal. */
3736 Lisp_Object new_normal 3734 Lisp_Object new_normal
3737 = horflag ? WGET (o, normal_cols) : WGET (o, normal_lines); 3735 = horflag ? o->normal_cols : o->normal_lines;
3738 3736
3739 make_parent_window (old, horflag); 3737 make_parent_window (old, horflag);
3740 p = XWINDOW (WGET (o, parent)); 3738 p = XWINDOW (o->parent);
3741 /* Store value of `window-combination-limit' in new parent's 3739 /* Store value of `window-combination-limit' in new parent's
3742 combination_limit slot. */ 3740 combination_limit slot. */
3743 WSET (p, combination_limit, Vwindow_combination_limit); 3741 WSET (p, combination_limit, Vwindow_combination_limit);
3744 /* These get applied below. */ 3742 /* These get applied below. */
3745 WSET (p, new_total, 3743 WSET (p, new_total, horflag ? o->total_cols : o->total_lines);
3746 horflag ? WGET (o, total_cols) : WGET (o, total_lines));
3747 WSET (p, new_normal, new_normal); 3744 WSET (p, new_normal, new_normal);
3748 } 3745 }
3749 else 3746 else
3750 p = XWINDOW (WGET (o, parent)); 3747 p = XWINDOW (o->parent);
3751 3748
3752 windows_or_buffers_changed++; 3749 windows_or_buffers_changed++;
3753 FRAME_WINDOW_SIZES_CHANGED (f) = 1; 3750 FRAME_WINDOW_SIZES_CHANGED (f) = 1;
3754 new = make_window (); 3751 new = make_window ();
3755 n = XWINDOW (new); 3752 n = XWINDOW (new);
3756 WSET (n, frame, frame); 3753 WSET (n, frame, frame);
3757 WSET (n, parent, WGET (o, parent)); 3754 WSET (n, parent, o->parent);
3758 WSET (n, vchild, Qnil); 3755 WSET (n, vchild, Qnil);
3759 WSET (n, hchild, Qnil); 3756 WSET (n, hchild, Qnil);
3760 3757
3761 if (EQ (side, Qabove) || EQ (side, Qleft)) 3758 if (EQ (side, Qabove) || EQ (side, Qleft))
3762 { 3759 {
3763 WSET (n, prev, WGET (o, prev)); 3760 WSET (n, prev, o->prev);
3764 if (NILP (WGET (n, prev))) 3761 if (NILP (n->prev))
3765 if (horflag) 3762 if (horflag)
3766 WSET (p, hchild, new); 3763 WSET (p, hchild, new);
3767 else 3764 else
3768 WSET (p, vchild, new); 3765 WSET (p, vchild, new);
3769 else 3766 else
3770 WSET (XWINDOW (WGET (n, prev)), next, new); 3767 WSET (XWINDOW (n->prev), next, new);
3771 WSET (n, next, old); 3768 WSET (n, next, old);
3772 WSET (o, prev, new); 3769 WSET (o, prev, new);
3773 } 3770 }
3774 else 3771 else
3775 { 3772 {
3776 WSET (n, next, WGET (o, next)); 3773 WSET (n, next, o->next);
3777 if (!NILP (WGET (n, next))) 3774 if (!NILP (n->next))
3778 WSET (XWINDOW (WGET (n, next)), prev, new); 3775 WSET (XWINDOW (n->next), prev, new);
3779 WSET (n, prev, old); 3776 WSET (n, prev, old);
3780 WSET (o, next, new); 3777 WSET (o, next, new);
3781 } 3778 }
@@ -3785,24 +3782,24 @@ set correctly. See the code of `split-window' for how this is done. */)
3785 memset (&n->last_cursor, 0, sizeof n->last_cursor); 3782 memset (&n->last_cursor, 0, sizeof n->last_cursor);
3786 3783
3787 /* Get special geometry settings from reference window. */ 3784 /* Get special geometry settings from reference window. */
3788 WSET (n, left_margin_cols, WGET (r, left_margin_cols)); 3785 WSET (n, left_margin_cols, r->left_margin_cols);
3789 WSET (n, right_margin_cols, WGET (r, right_margin_cols)); 3786 WSET (n, right_margin_cols, r->right_margin_cols);
3790 WSET (n, left_fringe_width, WGET (r, left_fringe_width)); 3787 WSET (n, left_fringe_width, r->left_fringe_width);
3791 WSET (n, right_fringe_width, WGET (r, right_fringe_width)); 3788 WSET (n, right_fringe_width, r->right_fringe_width);
3792 n->fringes_outside_margins = r->fringes_outside_margins; 3789 n->fringes_outside_margins = r->fringes_outside_margins;
3793 WSET (n, scroll_bar_width, WGET (r, scroll_bar_width)); 3790 WSET (n, scroll_bar_width, r->scroll_bar_width);
3794 WSET (n, vertical_scroll_bar_type, WGET (r, vertical_scroll_bar_type)); 3791 WSET (n, vertical_scroll_bar_type, r->vertical_scroll_bar_type);
3795 3792
3796 /* Directly assign orthogonal coordinates and sizes. */ 3793 /* Directly assign orthogonal coordinates and sizes. */
3797 if (horflag) 3794 if (horflag)
3798 { 3795 {
3799 WSET (n, top_line, WGET (o, top_line)); 3796 WSET (n, top_line, o->top_line);
3800 WSET (n, total_lines, WGET (o, total_lines)); 3797 WSET (n, total_lines, o->total_lines);
3801 } 3798 }
3802 else 3799 else
3803 { 3800 {
3804 WSET (n, left_col, WGET (o, left_col)); 3801 WSET (n, left_col, o->left_col);
3805 WSET (n, total_cols, WGET (o, total_cols)); 3802 WSET (n, total_cols, o->total_cols);
3806 } 3803 }
3807 3804
3808 /* Iso-coordinates and sizes are assigned by window_resize_apply, 3805 /* Iso-coordinates and sizes are assigned by window_resize_apply,
@@ -3815,14 +3812,14 @@ set correctly. See the code of `split-window' for how this is done. */)
3815 adjust_glyphs (f); 3812 adjust_glyphs (f);
3816 /* Set buffer of NEW to buffer of reference window. Don't run 3813 /* Set buffer of NEW to buffer of reference window. Don't run
3817 any hooks. */ 3814 any hooks. */
3818 set_window_buffer (new, WGET (r, buffer), 0, 1); 3815 set_window_buffer (new, r->buffer, 0, 1);
3819 UNBLOCK_INPUT; 3816 UNBLOCK_INPUT;
3820 3817
3821 /* Maybe we should run the scroll functions in Elisp (which already 3818 /* Maybe we should run the scroll functions in Elisp (which already
3822 runs the configuration change hook). */ 3819 runs the configuration change hook). */
3823 if (! NILP (Vwindow_scroll_functions)) 3820 if (! NILP (Vwindow_scroll_functions))
3824 run_hook_with_args_2 (Qwindow_scroll_functions, new, 3821 run_hook_with_args_2 (Qwindow_scroll_functions, new,
3825 Fmarker_position (WGET (n, start))); 3822 Fmarker_position (n->start));
3826 /* Return NEW. */ 3823 /* Return NEW. */
3827 return new; 3824 return new;
3828} 3825}
@@ -3841,25 +3838,25 @@ Signal an error when WINDOW is the only window on its frame. */)
3841 int before_sibling = 0; 3838 int before_sibling = 0;
3842 3839
3843 w = decode_any_window (window); 3840 w = decode_any_window (window);
3844 CHECK_LIVE_FRAME (WGET (w, frame)); 3841 CHECK_LIVE_FRAME (w->frame);
3845 3842
3846 XSETWINDOW (window, w); 3843 XSETWINDOW (window, w);
3847 if (NILP (WGET (w, buffer)) 3844 if (NILP (w->buffer)
3848 && NILP (WGET (w, hchild)) && NILP (WGET (w, vchild))) 3845 && NILP (w->hchild) && NILP (w->vchild))
3849 /* It's a no-op to delete an already deleted window. */ 3846 /* It's a no-op to delete an already deleted window. */
3850 return Qnil; 3847 return Qnil;
3851 3848
3852 parent = WGET (w, parent); 3849 parent = w->parent;
3853 if (NILP (parent)) 3850 if (NILP (parent))
3854 /* Never delete a minibuffer or frame root window. */ 3851 /* Never delete a minibuffer or frame root window. */
3855 error ("Attempt to delete minibuffer or sole ordinary window"); 3852 error ("Attempt to delete minibuffer or sole ordinary window");
3856 else if (NILP (WGET (w, prev)) && NILP (WGET (w, next))) 3853 else if (NILP (w->prev) && NILP (w->next))
3857 /* Rather bow out here, this case should be handled on the Elisp 3854 /* Rather bow out here, this case should be handled on the Elisp
3858 level. */ 3855 level. */
3859 error ("Attempt to delete sole window of parent"); 3856 error ("Attempt to delete sole window of parent");
3860 3857
3861 p = XWINDOW (parent); 3858 p = XWINDOW (parent);
3862 horflag = NILP (WGET (p, vchild)); 3859 horflag = NILP (p->vchild);
3863 3860
3864 frame = WINDOW_FRAME (w); 3861 frame = WINDOW_FRAME (w);
3865 f = XFRAME (frame); 3862 f = XFRAME (frame);
@@ -3868,13 +3865,13 @@ Signal an error when WINDOW is the only window on its frame. */)
3868 r = XWINDOW (root); 3865 r = XWINDOW (root);
3869 3866
3870 /* Unlink WINDOW from window tree. */ 3867 /* Unlink WINDOW from window tree. */
3871 if (NILP (WGET (w, prev))) 3868 if (NILP (w->prev))
3872 /* Get SIBLING below (on the right of) WINDOW. */ 3869 /* Get SIBLING below (on the right of) WINDOW. */
3873 { 3870 {
3874 /* before_sibling 1 means WINDOW is the first child of its 3871 /* before_sibling 1 means WINDOW is the first child of its
3875 parent and thus before the sibling. */ 3872 parent and thus before the sibling. */
3876 before_sibling = 1; 3873 before_sibling = 1;
3877 sibling = WGET (w, next); 3874 sibling = w->next;
3878 s = XWINDOW (sibling); 3875 s = XWINDOW (sibling);
3879 WSET (s, prev, Qnil); 3876 WSET (s, prev, Qnil);
3880 if (horflag) 3877 if (horflag)
@@ -3885,16 +3882,16 @@ Signal an error when WINDOW is the only window on its frame. */)
3885 else 3882 else
3886 /* Get SIBLING above (on the left of) WINDOW. */ 3883 /* Get SIBLING above (on the left of) WINDOW. */
3887 { 3884 {
3888 sibling = WGET (w, prev); 3885 sibling = w->prev;
3889 s = XWINDOW (sibling); 3886 s = XWINDOW (sibling);
3890 WSET (s, next, WGET (w, next)); 3887 WSET (s, next, w->next);
3891 if (!NILP (WGET (s, next))) 3888 if (!NILP (s->next))
3892 WSET (XWINDOW (WGET (s, next)), prev, sibling); 3889 WSET (XWINDOW (s->next), prev, sibling);
3893 } 3890 }
3894 3891
3895 if (window_resize_check (r, horflag) 3892 if (window_resize_check (r, horflag)
3896 && EQ (WGET (r, new_total), 3893 && EQ (r->new_total,
3897 (horflag ? WGET (r, total_cols) : WGET (r, total_lines)))) 3894 (horflag ? r->total_cols : r->total_lines)))
3898 /* We can delete WINDOW now. */ 3895 /* We can delete WINDOW now. */
3899 { 3896 {
3900 3897
@@ -3919,25 +3916,25 @@ Signal an error when WINDOW is the only window on its frame. */)
3919 WSET (w, next, Qnil); /* Don't delete w->next too. */ 3916 WSET (w, next, Qnil); /* Don't delete w->next too. */
3920 free_window_matrices (w); 3917 free_window_matrices (w);
3921 3918
3922 if (!NILP (WGET (w, vchild))) 3919 if (!NILP (w->vchild))
3923 { 3920 {
3924 delete_all_child_windows (WGET (w, vchild)); 3921 delete_all_child_windows (w->vchild);
3925 WSET (w, vchild, Qnil); 3922 WSET (w, vchild, Qnil);
3926 } 3923 }
3927 else if (!NILP (WGET (w, hchild))) 3924 else if (!NILP (w->hchild))
3928 { 3925 {
3929 delete_all_child_windows (WGET (w, hchild)); 3926 delete_all_child_windows (w->hchild);
3930 WSET (w, hchild, Qnil); 3927 WSET (w, hchild, Qnil);
3931 } 3928 }
3932 else if (!NILP (WGET (w, buffer))) 3929 else if (!NILP (w->buffer))
3933 { 3930 {
3934 unshow_buffer (w); 3931 unshow_buffer (w);
3935 unchain_marker (XMARKER (WGET (w, pointm))); 3932 unchain_marker (XMARKER (w->pointm));
3936 unchain_marker (XMARKER (WGET (w, start))); 3933 unchain_marker (XMARKER (w->start));
3937 WSET (w, buffer, Qnil); 3934 WSET (w, buffer, Qnil);
3938 } 3935 }
3939 3936
3940 if (NILP (WGET (s, prev)) && NILP (WGET (s, next))) 3937 if (NILP (s->prev) && NILP (s->next))
3941 /* A matrjoshka where SIBLING has become the only child of 3938 /* A matrjoshka where SIBLING has become the only child of
3942 PARENT. */ 3939 PARENT. */
3943 { 3940 {
@@ -3945,8 +3942,8 @@ Signal an error when WINDOW is the only window on its frame. */)
3945 replace_window (parent, sibling, 0); 3942 replace_window (parent, sibling, 0);
3946 /* Have SIBLING inherit the following three slot values from 3943 /* Have SIBLING inherit the following three slot values from
3947 PARENT (the combination_limit slot is not inherited). */ 3944 PARENT (the combination_limit slot is not inherited). */
3948 WSET (s, normal_cols, WGET (p, normal_cols)); 3945 WSET (s, normal_cols, p->normal_cols);
3949 WSET (s, normal_lines, WGET (p, normal_lines)); 3946 WSET (s, normal_lines, p->normal_lines);
3950 /* Mark PARENT as deleted. */ 3947 /* Mark PARENT as deleted. */
3951 WSET (p, vchild, Qnil); 3948 WSET (p, vchild, Qnil);
3952 WSET (p, hchild, Qnil); 3949 WSET (p, hchild, Qnil);
@@ -3976,7 +3973,7 @@ Signal an error when WINDOW is the only window on its frame. */)
3976 /* Now look whether `get-mru-window' gets us something. */ 3973 /* Now look whether `get-mru-window' gets us something. */
3977 mru_window = call1 (Qget_mru_window, frame); 3974 mru_window = call1 (Qget_mru_window, frame);
3978 if (WINDOW_LIVE_P (mru_window) 3975 if (WINDOW_LIVE_P (mru_window)
3979 && EQ (WGET (XWINDOW (mru_window), frame), frame)) 3976 && EQ (XWINDOW (mru_window)->frame, frame))
3980 new_selected_window = mru_window; 3977 new_selected_window = mru_window;
3981 3978
3982 /* If all ended up well, we now promote the mru window. */ 3979 /* If all ended up well, we now promote the mru window. */
@@ -4005,8 +4002,8 @@ Signal an error when WINDOW is the only window on its frame. */)
4005 else 4002 else
4006 { 4003 {
4007 WSET (s, next, window); 4004 WSET (s, next, window);
4008 if (!NILP (WGET (w, next))) 4005 if (!NILP (w->next))
4009 WSET (XWINDOW (WGET (w, next)), prev, window); 4006 WSET (XWINDOW (w->next), prev, window);
4010 } 4007 }
4011 error ("Deletion failed"); 4008 error ("Deletion failed");
4012 } 4009 }
@@ -4023,7 +4020,7 @@ Signal an error when WINDOW is the only window on its frame. */)
4023void 4020void
4024grow_mini_window (struct window *w, int delta) 4021grow_mini_window (struct window *w, int delta)
4025{ 4022{
4026 struct frame *f = XFRAME (WGET (w, frame)); 4023 struct frame *f = XFRAME (w->frame);
4027 struct window *r; 4024 struct window *r;
4028 Lisp_Object root, value; 4025 Lisp_Object root, value;
4029 4026
@@ -4041,9 +4038,9 @@ grow_mini_window (struct window *w, int delta)
4041 4038
4042 /* Grow the mini-window. */ 4039 /* Grow the mini-window. */
4043 WSET (w, top_line, 4040 WSET (w, top_line,
4044 make_number (XFASTINT (WGET (r, top_line)) + XFASTINT (WGET (r, total_lines)))); 4041 make_number (XFASTINT (r->top_line) + XFASTINT (r->total_lines)));
4045 WSET (w, total_lines, 4042 WSET (w, total_lines,
4046 make_number (XFASTINT (WGET (w, total_lines)) - XINT (value))); 4043 make_number (XFASTINT (w->total_lines) - XINT (value)));
4047 w->last_modified = 0; 4044 w->last_modified = 0;
4048 w->last_overlay_modified = 0; 4045 w->last_overlay_modified = 0;
4049 4046
@@ -4057,14 +4054,14 @@ grow_mini_window (struct window *w, int delta)
4057void 4054void
4058shrink_mini_window (struct window *w) 4055shrink_mini_window (struct window *w)
4059{ 4056{
4060 struct frame *f = XFRAME (WGET (w, frame)); 4057 struct frame *f = XFRAME (w->frame);
4061 struct window *r; 4058 struct window *r;
4062 Lisp_Object root, value; 4059 Lisp_Object root, value;
4063 EMACS_INT size; 4060 EMACS_INT size;
4064 4061
4065 eassert (MINI_WINDOW_P (w)); 4062 eassert (MINI_WINDOW_P (w));
4066 4063
4067 size = XINT (WGET (w, total_lines)); 4064 size = XINT (w->total_lines);
4068 if (size > 1) 4065 if (size > 1)
4069 { 4066 {
4070 root = FRAME_ROOT_WINDOW (f); 4067 root = FRAME_ROOT_WINDOW (f);
@@ -4078,7 +4075,7 @@ shrink_mini_window (struct window *w)
4078 4075
4079 /* Shrink the mini-window. */ 4076 /* Shrink the mini-window. */
4080 WSET (w, top_line, 4077 WSET (w, top_line,
4081 make_number (XFASTINT (WGET (r, top_line)) + XFASTINT (WGET (r, total_lines)))); 4078 make_number (XFASTINT (r->top_line) + XFASTINT (r->total_lines)));
4082 WSET (w, total_lines, make_number (1)); 4079 WSET (w, total_lines, make_number (1));
4083 4080
4084 w->last_modified = 0; 4081 w->last_modified = 0;
@@ -4104,25 +4101,25 @@ DEFUN ("resize-mini-window-internal", Fresize_mini_window_internal, Sresize_mini
4104 int height; 4101 int height;
4105 4102
4106 CHECK_WINDOW (window); 4103 CHECK_WINDOW (window);
4107 f = XFRAME (WGET (w, frame)); 4104 f = XFRAME (w->frame);
4108 4105
4109 if (!EQ (FRAME_MINIBUF_WINDOW (XFRAME (WGET (w, frame))), window)) 4106 if (!EQ (FRAME_MINIBUF_WINDOW (XFRAME (w->frame)), window))
4110 error ("Not a valid minibuffer window"); 4107 error ("Not a valid minibuffer window");
4111 else if (FRAME_MINIBUF_ONLY_P (f)) 4108 else if (FRAME_MINIBUF_ONLY_P (f))
4112 error ("Cannot resize a minibuffer-only frame"); 4109 error ("Cannot resize a minibuffer-only frame");
4113 4110
4114 r = XWINDOW (FRAME_ROOT_WINDOW (f)); 4111 r = XWINDOW (FRAME_ROOT_WINDOW (f));
4115 height = XINT (WGET (r, total_lines)) + XINT (WGET (w, total_lines)); 4112 height = XINT (r->total_lines) + XINT (w->total_lines);
4116 if (window_resize_check (r, 0) 4113 if (window_resize_check (r, 0)
4117 && XINT (WGET (w, new_total)) > 0 4114 && XINT (w->new_total) > 0
4118 && height == XINT (WGET (r, new_total)) + XINT (WGET (w, new_total))) 4115 && height == XINT (r->new_total) + XINT (w->new_total))
4119 { 4116 {
4120 BLOCK_INPUT; 4117 BLOCK_INPUT;
4121 window_resize_apply (r, 0); 4118 window_resize_apply (r, 0);
4122 4119
4123 WSET (w, total_lines, WGET (w, new_total)); 4120 WSET (w, total_lines, w->new_total);
4124 WSET (w, top_line, 4121 WSET (w, top_line,
4125 make_number (XINT (WGET (r, top_line)) + XINT (WGET (r, total_lines)))); 4122 make_number (XINT (r->top_line) + XINT (r->total_lines)));
4126 4123
4127 windows_or_buffers_changed++; 4124 windows_or_buffers_changed++;
4128 FRAME_WINDOW_SIZES_CHANGED (f) = 1; 4125 FRAME_WINDOW_SIZES_CHANGED (f) = 1;
@@ -4145,14 +4142,14 @@ mark_window_cursors_off (struct window *w)
4145{ 4142{
4146 while (w) 4143 while (w)
4147 { 4144 {
4148 if (!NILP (WGET (w, hchild))) 4145 if (!NILP (w->hchild))
4149 mark_window_cursors_off (XWINDOW (WGET (w, hchild))); 4146 mark_window_cursors_off (XWINDOW (w->hchild));
4150 else if (!NILP (WGET (w, vchild))) 4147 else if (!NILP (w->vchild))
4151 mark_window_cursors_off (XWINDOW (WGET (w, vchild))); 4148 mark_window_cursors_off (XWINDOW (w->vchild));
4152 else 4149 else
4153 w->phys_cursor_on_p = 0; 4150 w->phys_cursor_on_p = 0;
4154 4151
4155 w = NILP (WGET (w, next)) ? 0 : XWINDOW (WGET (w, next)); 4152 w = NILP (w->next) ? 0 : XWINDOW (w->next);
4156 } 4153 }
4157} 4154}
4158 4155
@@ -4162,15 +4159,15 @@ mark_window_cursors_off (struct window *w)
4162int 4159int
4163window_internal_height (struct window *w) 4160window_internal_height (struct window *w)
4164{ 4161{
4165 int ht = XFASTINT (WGET (w, total_lines)); 4162 int ht = XFASTINT (w->total_lines);
4166 4163
4167 if (!MINI_WINDOW_P (w)) 4164 if (!MINI_WINDOW_P (w))
4168 { 4165 {
4169 if (!NILP (WGET (w, parent)) 4166 if (!NILP (w->parent)
4170 || !NILP (WGET (w, vchild)) 4167 || !NILP (w->vchild)
4171 || !NILP (WGET (w, hchild)) 4168 || !NILP (w->hchild)
4172 || !NILP (WGET (w, next)) 4169 || !NILP (w->next)
4173 || !NILP (WGET (w, prev)) 4170 || !NILP (w->prev)
4174 || WINDOW_WANTS_MODELINE_P (w)) 4171 || WINDOW_WANTS_MODELINE_P (w))
4175 --ht; 4172 --ht;
4176 4173
@@ -4200,7 +4197,7 @@ window_scroll (Lisp_Object window, EMACS_INT n, int whole, int noerror)
4200 4197
4201 /* If we must, use the pixel-based version which is much slower than 4198 /* If we must, use the pixel-based version which is much slower than
4202 the line-based one but can handle varying line heights. */ 4199 the line-based one but can handle varying line heights. */
4203 if (FRAME_WINDOW_P (XFRAME (WGET (XWINDOW (window), frame)))) 4200 if (FRAME_WINDOW_P (XFRAME (XWINDOW (window)->frame)))
4204 window_scroll_pixel_based (window, n, whole, noerror); 4201 window_scroll_pixel_based (window, n, whole, noerror);
4205 else 4202 else
4206 window_scroll_line_based (window, n, whole, noerror); 4203 window_scroll_line_based (window, n, whole, noerror);
@@ -4225,7 +4222,7 @@ window_scroll_pixel_based (Lisp_Object window, int n, int whole, int noerror)
4225 int x, y, rtop, rbot, rowh, vpos; 4222 int x, y, rtop, rbot, rowh, vpos;
4226 void *itdata = NULL; 4223 void *itdata = NULL;
4227 4224
4228 SET_TEXT_POS_FROM_MARKER (start, WGET (w, start)); 4225 SET_TEXT_POS_FROM_MARKER (start, w->start);
4229 /* Scrolling a minibuffer window via scroll bar when the echo area 4226 /* Scrolling a minibuffer window via scroll bar when the echo area
4230 shows long text sometimes resets the minibuffer contents behind 4227 shows long text sometimes resets the minibuffer contents behind
4231 our backs. */ 4228 our backs. */
@@ -4306,8 +4303,8 @@ window_scroll_pixel_based (Lisp_Object window, int n, int whole, int noerror)
4306 spos = XINT (Fline_beginning_position (Qnil)); 4303 spos = XINT (Fline_beginning_position (Qnil));
4307 else 4304 else
4308 spos = min (XINT (Fline_end_position (Qnil)) + 1, ZV); 4305 spos = min (XINT (Fline_end_position (Qnil)) + 1, ZV);
4309 set_marker_restricted (WGET (w, start), make_number (spos), 4306 set_marker_restricted (w->start, make_number (spos),
4310 WGET (w, buffer)); 4307 w->buffer);
4311 w->start_at_line_beg = 1; 4308 w->start_at_line_beg = 1;
4312 w->update_mode_line = 1; 4309 w->update_mode_line = 1;
4313 w->last_modified = 0; 4310 w->last_modified = 0;
@@ -4431,7 +4428,7 @@ window_scroll_pixel_based (Lisp_Object window, int n, int whole, int noerror)
4431 4428
4432 /* If control gets here, then we vscrolled. */ 4429 /* If control gets here, then we vscrolled. */
4433 4430
4434 XBUFFER (WGET (w, buffer))->prevent_redisplay_optimizations_p = 1; 4431 XBUFFER (w->buffer)->prevent_redisplay_optimizations_p = 1;
4435 4432
4436 /* Don't try to change the window start below. */ 4433 /* Don't try to change the window start below. */
4437 vscrolled = 1; 4434 vscrolled = 1;
@@ -4451,9 +4448,9 @@ window_scroll_pixel_based (Lisp_Object window, int n, int whole, int noerror)
4451 } 4448 }
4452 4449
4453 /* Set the window start, and set up the window for redisplay. */ 4450 /* Set the window start, and set up the window for redisplay. */
4454 set_marker_restricted (WGET (w, start), make_number (pos), 4451 set_marker_restricted (w->start, make_number (pos),
4455 WGET (w, buffer)); 4452 w->buffer);
4456 bytepos = XMARKER (WGET (w, start))->bytepos; 4453 bytepos = XMARKER (w->start)->bytepos;
4457 w->start_at_line_beg = (pos == BEGV || FETCH_BYTE (bytepos - 1) == '\n'); 4454 w->start_at_line_beg = (pos == BEGV || FETCH_BYTE (bytepos - 1) == '\n');
4458 w->update_mode_line = 1; 4455 w->update_mode_line = 1;
4459 w->last_modified = 0; 4456 w->last_modified = 0;
@@ -4472,7 +4469,7 @@ window_scroll_pixel_based (Lisp_Object window, int n, int whole, int noerror)
4472 even if there is a header line. */ 4469 even if there is a header line. */
4473 this_scroll_margin = max (0, scroll_margin); 4470 this_scroll_margin = max (0, scroll_margin);
4474 this_scroll_margin 4471 this_scroll_margin
4475 = min (this_scroll_margin, XFASTINT (WGET (w, total_lines)) / 4); 4472 = min (this_scroll_margin, XFASTINT (w->total_lines) / 4);
4476 this_scroll_margin *= FRAME_LINE_HEIGHT (it.f); 4473 this_scroll_margin *= FRAME_LINE_HEIGHT (it.f);
4477 4474
4478 if (n > 0) 4475 if (n > 0)
@@ -4546,7 +4543,7 @@ window_scroll_pixel_based (Lisp_Object window, int n, int whole, int noerror)
4546 ; 4543 ;
4547 else if (window_scroll_pixel_based_preserve_y >= 0) 4544 else if (window_scroll_pixel_based_preserve_y >= 0)
4548 { 4545 {
4549 SET_TEXT_POS_FROM_MARKER (start, WGET (w, start)); 4546 SET_TEXT_POS_FROM_MARKER (start, w->start);
4550 start_display (&it, w, start); 4547 start_display (&it, w, start);
4551 /* It would be wrong to subtract CURRENT_HEADER_LINE_HEIGHT 4548 /* It would be wrong to subtract CURRENT_HEADER_LINE_HEIGHT
4552 here because we called start_display again and did not 4549 here because we called start_display again and did not
@@ -4600,7 +4597,7 @@ window_scroll_line_based (Lisp_Object window, int n, int whole, int noerror)
4600 if (whole) 4597 if (whole)
4601 n *= max (1, ht - next_screen_context_lines); 4598 n *= max (1, ht - next_screen_context_lines);
4602 4599
4603 startpos = marker_position (WGET (w, start)); 4600 startpos = marker_position (w->start);
4604 4601
4605 if (!NILP (Vscroll_preserve_screen_position)) 4602 if (!NILP (Vscroll_preserve_screen_position))
4606 { 4603 {
@@ -4651,9 +4648,9 @@ window_scroll_line_based (Lisp_Object window, int n, int whole, int noerror)
4651 { 4648 {
4652 /* Don't use a scroll margin that is negative or too large. */ 4649 /* Don't use a scroll margin that is negative or too large. */
4653 int this_scroll_margin = 4650 int this_scroll_margin =
4654 max (0, min (scroll_margin, XINT (WGET (w, total_lines)) / 4)); 4651 max (0, min (scroll_margin, XINT (w->total_lines) / 4));
4655 4652
4656 set_marker_restricted_both (WGET (w, start), WGET (w, buffer), pos, pos_byte); 4653 set_marker_restricted_both (w->start, w->buffer, pos, pos_byte);
4657 w->start_at_line_beg = !NILP (bolp); 4654 w->start_at_line_beg = !NILP (bolp);
4658 w->update_mode_line = 1; 4655 w->update_mode_line = 1;
4659 w->last_modified = 0; 4656 w->last_modified = 0;
@@ -4747,10 +4744,10 @@ scroll_command (Lisp_Object n, int direction)
4747 4744
4748 /* If selected window's buffer isn't current, make it current for 4745 /* If selected window's buffer isn't current, make it current for
4749 the moment. But don't screw up if window_scroll gets an error. */ 4746 the moment. But don't screw up if window_scroll gets an error. */
4750 if (XBUFFER (WGET (XWINDOW (selected_window), buffer)) != current_buffer) 4747 if (XBUFFER (XWINDOW (selected_window)->buffer) != current_buffer)
4751 { 4748 {
4752 record_unwind_protect (save_excursion_restore, save_excursion_save ()); 4749 record_unwind_protect (save_excursion_restore, save_excursion_save ());
4753 Fset_buffer (WGET (XWINDOW (selected_window), buffer)); 4750 Fset_buffer (XWINDOW (selected_window)->buffer);
4754 4751
4755 /* Make redisplay consider other windows than just selected_window. */ 4752 /* Make redisplay consider other windows than just selected_window. */
4756 ++windows_or_buffers_changed; 4753 ++windows_or_buffers_changed;
@@ -4865,8 +4862,8 @@ specifies the window to scroll. This takes precedence over
4865 record_unwind_protect (save_excursion_restore, save_excursion_save ()); 4862 record_unwind_protect (save_excursion_restore, save_excursion_save ());
4866 ++windows_or_buffers_changed; 4863 ++windows_or_buffers_changed;
4867 4864
4868 Fset_buffer (WGET (w, buffer)); 4865 Fset_buffer (w->buffer);
4869 SET_PT (marker_position (WGET (w, pointm))); 4866 SET_PT (marker_position (w->pointm));
4870 4867
4871 if (NILP (arg)) 4868 if (NILP (arg))
4872 window_scroll (window, 1, 1, 1); 4869 window_scroll (window, 1, 1, 1);
@@ -4880,7 +4877,7 @@ specifies the window to scroll. This takes precedence over
4880 window_scroll (window, XINT (arg), 0, 1); 4877 window_scroll (window, XINT (arg), 0, 1);
4881 } 4878 }
4882 4879
4883 set_marker_both (WGET (w, pointm), Qnil, PT, PT_BYTE); 4880 set_marker_both (w->pointm, Qnil, PT, PT_BYTE);
4884 unbind_to (count, Qnil); 4881 unbind_to (count, Qnil);
4885 4882
4886 return Qnil; 4883 return Qnil;
@@ -4958,10 +4955,10 @@ displayed_window_lines (struct window *w)
4958 int bottom_y; 4955 int bottom_y;
4959 void *itdata = NULL; 4956 void *itdata = NULL;
4960 4957
4961 if (XBUFFER (WGET (w, buffer)) != current_buffer) 4958 if (XBUFFER (w->buffer) != current_buffer)
4962 { 4959 {
4963 old_buffer = current_buffer; 4960 old_buffer = current_buffer;
4964 set_buffer_internal (XBUFFER (WGET (w, buffer))); 4961 set_buffer_internal (XBUFFER (w->buffer));
4965 } 4962 }
4966 else 4963 else
4967 old_buffer = NULL; 4964 old_buffer = NULL;
@@ -4969,12 +4966,12 @@ displayed_window_lines (struct window *w)
4969 /* In case W->start is out of the accessible range, do something 4966 /* In case W->start is out of the accessible range, do something
4970 reasonable. This happens in Info mode when Info-scroll-down 4967 reasonable. This happens in Info mode when Info-scroll-down
4971 calls (recenter -1) while W->start is 1. */ 4968 calls (recenter -1) while W->start is 1. */
4972 if (XMARKER (WGET (w, start))->charpos < BEGV) 4969 if (XMARKER (w->start)->charpos < BEGV)
4973 SET_TEXT_POS (start, BEGV, BEGV_BYTE); 4970 SET_TEXT_POS (start, BEGV, BEGV_BYTE);
4974 else if (XMARKER (WGET (w, start))->charpos > ZV) 4971 else if (XMARKER (w->start)->charpos > ZV)
4975 SET_TEXT_POS (start, ZV, ZV_BYTE); 4972 SET_TEXT_POS (start, ZV, ZV_BYTE);
4976 else 4973 else
4977 SET_TEXT_POS_FROM_MARKER (start, WGET (w, start)); 4974 SET_TEXT_POS_FROM_MARKER (start, w->start);
4978 4975
4979 itdata = bidi_shelve_cache (); 4976 itdata = bidi_shelve_cache ();
4980 start_display (&it, w, start); 4977 start_display (&it, w, start);
@@ -4988,7 +4985,7 @@ displayed_window_lines (struct window *w)
4988 This kludge fixes a bug whereby (move-to-window-line -1) 4985 This kludge fixes a bug whereby (move-to-window-line -1)
4989 when ZV is on the last screen line 4986 when ZV is on the last screen line
4990 moves to the previous screen line instead of the last one. */ 4987 moves to the previous screen line instead of the last one. */
4991 if (! FRAME_WINDOW_P (XFRAME (WGET (w, frame)))) 4988 if (! FRAME_WINDOW_P (XFRAME (w->frame)))
4992 height++; 4989 height++;
4993 4990
4994 /* Add in empty lines at the bottom of the window. */ 4991 /* Add in empty lines at the bottom of the window. */
@@ -5023,7 +5020,7 @@ and redisplay normally--don't erase and redraw the frame. */)
5023 (register Lisp_Object arg) 5020 (register Lisp_Object arg)
5024{ 5021{
5025 struct window *w = XWINDOW (selected_window); 5022 struct window *w = XWINDOW (selected_window);
5026 struct buffer *buf = XBUFFER (WGET (w, buffer)); 5023 struct buffer *buf = XBUFFER (w->buffer);
5027 struct buffer *obuf = current_buffer; 5024 struct buffer *obuf = current_buffer;
5028 int center_p = 0; 5025 int center_p = 0;
5029 ptrdiff_t charpos, bytepos; 5026 ptrdiff_t charpos, bytepos;
@@ -5067,12 +5064,12 @@ and redisplay normally--don't erase and redraw the frame. */)
5067 /* Do this after making BUF current 5064 /* Do this after making BUF current
5068 in case scroll_margin is buffer-local. */ 5065 in case scroll_margin is buffer-local. */
5069 this_scroll_margin = 5066 this_scroll_margin =
5070 max (0, min (scroll_margin, XFASTINT (WGET (w, total_lines)) / 4)); 5067 max (0, min (scroll_margin, XFASTINT (w->total_lines) / 4));
5071 5068
5072 /* Handle centering on a graphical frame specially. Such frames can 5069 /* Handle centering on a graphical frame specially. Such frames can
5073 have variable-height lines and centering point on the basis of 5070 have variable-height lines and centering point on the basis of
5074 line counts would lead to strange effects. */ 5071 line counts would lead to strange effects. */
5075 if (FRAME_WINDOW_P (XFRAME (WGET (w, frame)))) 5072 if (FRAME_WINDOW_P (XFRAME (w->frame)))
5076 { 5073 {
5077 if (center_p) 5074 if (center_p)
5078 { 5075 {
@@ -5189,7 +5186,7 @@ and redisplay normally--don't erase and redraw the frame. */)
5189 } 5186 }
5190 5187
5191 /* Set the new window start. */ 5188 /* Set the new window start. */
5192 set_marker_both (WGET (w, start), WGET (w, buffer), charpos, bytepos); 5189 set_marker_both (w->start, w->buffer, charpos, bytepos);
5193 WSET (w, window_end_valid, Qnil); 5190 WSET (w, window_end_valid, Qnil);
5194 5191
5195 w->optional_new_start = 1; 5192 w->optional_new_start = 1;
@@ -5212,7 +5209,7 @@ nor any partial-height lines at the bottom of the text area. */)
5212{ 5209{
5213 struct window *w = decode_window (window); 5210 struct window *w = decode_window (window);
5214 int pixel_height = window_box_height (w); 5211 int pixel_height = window_box_height (w);
5215 int line_height = pixel_height / FRAME_LINE_HEIGHT (XFRAME (WGET (w, frame))); 5212 int line_height = pixel_height / FRAME_LINE_HEIGHT (XFRAME (w->frame));
5216 return make_number (line_height); 5213 return make_number (line_height);
5217} 5214}
5218 5215
@@ -5233,24 +5230,24 @@ zero means top of window, negative means relative to bottom of window. */)
5233 int this_scroll_margin; 5230 int this_scroll_margin;
5234#endif 5231#endif
5235 5232
5236 if (!(BUFFERP (WGET (w, buffer)) 5233 if (!(BUFFERP (w->buffer)
5237 && XBUFFER (WGET (w, buffer)) == current_buffer)) 5234 && XBUFFER (w->buffer) == current_buffer))
5238 /* This test is needed to make sure PT/PT_BYTE make sense in w->buffer 5235 /* This test is needed to make sure PT/PT_BYTE make sense in w->buffer
5239 when passed below to set_marker_both. */ 5236 when passed below to set_marker_both. */
5240 error ("move-to-window-line called from unrelated buffer"); 5237 error ("move-to-window-line called from unrelated buffer");
5241 5238
5242 window = selected_window; 5239 window = selected_window;
5243 start = marker_position (WGET (w, start)); 5240 start = marker_position (w->start);
5244 if (start < BEGV || start > ZV) 5241 if (start < BEGV || start > ZV)
5245 { 5242 {
5246 int height = window_internal_height (w); 5243 int height = window_internal_height (w);
5247 Fvertical_motion (make_number (- (height / 2)), window); 5244 Fvertical_motion (make_number (- (height / 2)), window);
5248 set_marker_both (WGET (w, start), WGET (w, buffer), PT, PT_BYTE); 5245 set_marker_both (w->start, w->buffer, PT, PT_BYTE);
5249 w->start_at_line_beg = !NILP (Fbolp ()); 5246 w->start_at_line_beg = !NILP (Fbolp ());
5250 w->force_start = 1; 5247 w->force_start = 1;
5251 } 5248 }
5252 else 5249 else
5253 Fgoto_char (WGET (w, start)); 5250 Fgoto_char (w->start);
5254 5251
5255 lines = displayed_window_lines (w); 5252 lines = displayed_window_lines (w);
5256 5253
@@ -5354,7 +5351,7 @@ DEFUN ("window-configuration-frame", Fwindow_configuration_frame, Swindow_config
5354 5351
5355 data = (struct save_window_data *) XVECTOR (config); 5352 data = (struct save_window_data *) XVECTOR (config);
5356 saved_windows = XVECTOR (data->saved_windows); 5353 saved_windows = XVECTOR (data->saved_windows);
5357 return WGET (XWINDOW (SAVED_WINDOW_N (saved_windows, 0)->window), frame); 5354 return XWINDOW (SAVED_WINDOW_N (saved_windows, 0)->window)->frame;
5358} 5355}
5359 5356
5360DEFUN ("set-window-configuration", Fset_window_configuration, 5357DEFUN ("set-window-configuration", Fset_window_configuration,
@@ -5396,11 +5393,11 @@ the return value is nil. Otherwise the value is t. */)
5396 window-point of the final-selected-window to the window-point of 5393 window-point of the final-selected-window to the window-point of
5397 the current-selected-window. So we have to be careful which 5394 the current-selected-window. So we have to be careful which
5398 point of the current-buffer we copy into old_point. */ 5395 point of the current-buffer we copy into old_point. */
5399 if (EQ (WGET (XWINDOW (data->current_window), buffer), new_current_buffer) 5396 if (EQ (XWINDOW (data->current_window)->buffer, new_current_buffer)
5400 && WINDOWP (selected_window) 5397 && WINDOWP (selected_window)
5401 && EQ (WGET (XWINDOW (selected_window), buffer), new_current_buffer) 5398 && EQ (XWINDOW (selected_window)->buffer, new_current_buffer)
5402 && !EQ (selected_window, data->current_window)) 5399 && !EQ (selected_window, data->current_window))
5403 old_point = XMARKER (WGET (XWINDOW (data->current_window), pointm))->charpos; 5400 old_point = XMARKER (XWINDOW (data->current_window)->pointm)->charpos;
5404 else 5401 else
5405 old_point = PT; 5402 old_point = PT;
5406 else 5403 else
@@ -5412,15 +5409,15 @@ the return value is nil. Otherwise the value is t. */)
5412 So if possible we want this arbitrary choice of "which point" to 5409 So if possible we want this arbitrary choice of "which point" to
5413 be the one from the to-be-selected-window so as to prevent this 5410 be the one from the to-be-selected-window so as to prevent this
5414 window's cursor from being copied from another window. */ 5411 window's cursor from being copied from another window. */
5415 if (EQ (WGET (XWINDOW (data->current_window), buffer), new_current_buffer) 5412 if (EQ (XWINDOW (data->current_window)->buffer, new_current_buffer)
5416 /* If current_window = selected_window, its point is in BUF_PT. */ 5413 /* If current_window = selected_window, its point is in BUF_PT. */
5417 && !EQ (selected_window, data->current_window)) 5414 && !EQ (selected_window, data->current_window))
5418 old_point = XMARKER (WGET (XWINDOW (data->current_window), pointm))->charpos; 5415 old_point = XMARKER (XWINDOW (data->current_window)->pointm)->charpos;
5419 else 5416 else
5420 old_point = BUF_PT (XBUFFER (new_current_buffer)); 5417 old_point = BUF_PT (XBUFFER (new_current_buffer));
5421 } 5418 }
5422 5419
5423 frame = WGET (XWINDOW (SAVED_WINDOW_N (saved_windows, 0)->window), frame); 5420 frame = XWINDOW (SAVED_WINDOW_N (saved_windows, 0)->window)->frame;
5424 f = XFRAME (frame); 5421 f = XFRAME (frame);
5425 5422
5426 /* If f is a dead frame, don't bother rebuilding its window tree. 5423 /* If f is a dead frame, don't bother rebuilding its window tree.
@@ -5473,13 +5470,13 @@ the return value is nil. Otherwise the value is t. */)
5473 window holds garbage.) We do this now, before 5470 window holds garbage.) We do this now, before
5474 restoring the window contents, and prevent it from 5471 restoring the window contents, and prevent it from
5475 being done later on when we select a new window. */ 5472 being done later on when we select a new window. */
5476 if (! NILP (WGET (XWINDOW (selected_window), buffer))) 5473 if (! NILP (XWINDOW (selected_window)->buffer))
5477 { 5474 {
5478 w = XWINDOW (selected_window); 5475 w = XWINDOW (selected_window);
5479 set_marker_both (WGET (w, pointm), 5476 set_marker_both (w->pointm,
5480 WGET (w, buffer), 5477 w->buffer,
5481 BUF_PT (XBUFFER (WGET (w, buffer))), 5478 BUF_PT (XBUFFER (w->buffer)),
5482 BUF_PT_BYTE (XBUFFER (WGET (w, buffer)))); 5479 BUF_PT_BYTE (XBUFFER (w->buffer)));
5483 } 5480 }
5484 5481
5485 windows_or_buffers_changed++; 5482 windows_or_buffers_changed++;
@@ -5511,39 +5508,39 @@ the return value is nil. Otherwise the value is t. */)
5511 WSET (w, next, Qnil); 5508 WSET (w, next, Qnil);
5512 5509
5513 if (!NILP (p->parent)) 5510 if (!NILP (p->parent))
5514 WSET (w, parent, SAVED_WINDOW_N (saved_windows, 5511 WSET (w, parent, SAVED_WINDOW_N
5515 XFASTINT (p->parent))->window); 5512 (saved_windows, XFASTINT (p->parent))->window);
5516 else 5513 else
5517 WSET (w, parent, Qnil); 5514 WSET (w, parent, Qnil);
5518 5515
5519 if (!NILP (p->prev)) 5516 if (!NILP (p->prev))
5520 { 5517 {
5521 WSET (w, prev, SAVED_WINDOW_N (saved_windows, 5518 WSET (w, prev, SAVED_WINDOW_N
5522 XFASTINT (p->prev))->window); 5519 (saved_windows, XFASTINT (p->prev))->window);
5523 WSET (XWINDOW (WGET (w, prev)), next, p->window); 5520 WSET (XWINDOW (w->prev), next, p->window);
5524 } 5521 }
5525 else 5522 else
5526 { 5523 {
5527 WSET (w, prev, Qnil); 5524 WSET (w, prev, Qnil);
5528 if (!NILP (WGET (w, parent))) 5525 if (!NILP (w->parent))
5529 { 5526 {
5530 if (EQ (p->total_cols, WGET (XWINDOW (WGET (w, parent)), total_cols))) 5527 if (EQ (p->total_cols, XWINDOW (w->parent)->total_cols))
5531 { 5528 {
5532 WSET (XWINDOW (WGET (w, parent)), vchild, p->window); 5529 WSET (XWINDOW (w->parent), vchild, p->window);
5533 WSET (XWINDOW (WGET (w, parent)), hchild, Qnil); 5530 WSET (XWINDOW (w->parent), hchild, Qnil);
5534 } 5531 }
5535 else 5532 else
5536 { 5533 {
5537 WSET (XWINDOW (WGET (w, parent)), hchild, p->window); 5534 WSET (XWINDOW (w->parent), hchild, p->window);
5538 WSET (XWINDOW (WGET (w, parent)), vchild, Qnil); 5535 WSET (XWINDOW (w->parent), vchild, Qnil);
5539 } 5536 }
5540 } 5537 }
5541 } 5538 }
5542 5539
5543 /* If we squirreled away the buffer in the window's height, 5540 /* If we squirreled away the buffer in the window's height,
5544 restore it now. */ 5541 restore it now. */
5545 if (BUFFERP (WGET (w, total_lines))) 5542 if (BUFFERP (w->total_lines))
5546 WSET (w, buffer, WGET (w, total_lines)); 5543 WSET (w, buffer, w->total_lines);
5547 WSET (w, left_col, p->left_col); 5544 WSET (w, left_col, p->left_col);
5548 WSET (w, top_line, p->top_line); 5545 WSET (w, top_line, p->top_line);
5549 WSET (w, total_cols, p->total_cols); 5546 WSET (w, total_cols, p->total_cols);
@@ -5571,7 +5568,7 @@ the return value is nil. Otherwise the value is t. */)
5571 { 5568 {
5572 if (NILP (XCDR (pers))) 5569 if (NILP (XCDR (pers)))
5573 { 5570 {
5574 par = Fassq (XCAR (pers), WGET (w, window_parameters)); 5571 par = Fassq (XCAR (pers), w->window_parameters);
5575 if (CONSP (par) && !NILP (XCDR (par))) 5572 if (CONSP (par) && !NILP (XCDR (par)))
5576 /* Reset a parameter to nil if and only if it 5573 /* Reset a parameter to nil if and only if it
5577 has a non-nil association. Don't make new 5574 has a non-nil association. Don't make new
@@ -5596,33 +5593,33 @@ the return value is nil. Otherwise the value is t. */)
5596 { 5593 {
5597 WSET (w, buffer, p->buffer); 5594 WSET (w, buffer, p->buffer);
5598 w->start_at_line_beg = !NILP (p->start_at_line_beg); 5595 w->start_at_line_beg = !NILP (p->start_at_line_beg);
5599 set_marker_restricted (WGET (w, start), p->start, WGET (w, buffer)); 5596 set_marker_restricted (w->start, p->start, w->buffer);
5600 set_marker_restricted (WGET (w, pointm), p->pointm, 5597 set_marker_restricted (w->pointm, p->pointm,
5601 WGET (w, buffer)); 5598 w->buffer);
5602 Fset_marker (BVAR (XBUFFER (WGET (w, buffer)), mark), 5599 Fset_marker (BVAR (XBUFFER (w->buffer), mark),
5603 p->mark, WGET (w, buffer)); 5600 p->mark, w->buffer);
5604 5601
5605 /* As documented in Fcurrent_window_configuration, don't 5602 /* As documented in Fcurrent_window_configuration, don't
5606 restore the location of point in the buffer which was 5603 restore the location of point in the buffer which was
5607 current when the window configuration was recorded. */ 5604 current when the window configuration was recorded. */
5608 if (!EQ (p->buffer, new_current_buffer) 5605 if (!EQ (p->buffer, new_current_buffer)
5609 && XBUFFER (p->buffer) == current_buffer) 5606 && XBUFFER (p->buffer) == current_buffer)
5610 Fgoto_char (WGET (w, pointm)); 5607 Fgoto_char (w->pointm);
5611 } 5608 }
5612 else if (!NILP (WGET (w, buffer)) 5609 else if (!NILP (w->buffer)
5613 && !NILP (BVAR (XBUFFER (WGET (w, buffer)), name))) 5610 && !NILP (BVAR (XBUFFER (w->buffer), name)))
5614 /* Keep window's old buffer; make sure the markers are 5611 /* Keep window's old buffer; make sure the markers are
5615 real. */ 5612 real. */
5616 { 5613 {
5617 /* Set window markers at start of visible range. */ 5614 /* Set window markers at start of visible range. */
5618 if (XMARKER (WGET (w, start))->buffer == 0) 5615 if (XMARKER (w->start)->buffer == 0)
5619 set_marker_restricted (WGET (w, start), make_number (0), 5616 set_marker_restricted (w->start, make_number (0),
5620 WGET (w, buffer)); 5617 w->buffer);
5621 if (XMARKER (WGET (w, pointm))->buffer == 0) 5618 if (XMARKER (w->pointm)->buffer == 0)
5622 set_marker_restricted_both 5619 set_marker_restricted_both
5623 (WGET (w, pointm), WGET (w, buffer), 5620 (w->pointm, w->buffer,
5624 BUF_PT (XBUFFER (WGET (w, buffer))), 5621 BUF_PT (XBUFFER (w->buffer)),
5625 BUF_PT_BYTE (XBUFFER (WGET (w, buffer)))); 5622 BUF_PT_BYTE (XBUFFER (w->buffer)));
5626 w->start_at_line_beg = 1; 5623 w->start_at_line_beg = 1;
5627 } 5624 }
5628 else if (STRINGP (auto_buffer_name = 5625 else if (STRINGP (auto_buffer_name =
@@ -5630,10 +5627,10 @@ the return value is nil. Otherwise the value is t. */)
5630 && SCHARS (auto_buffer_name) != 0 5627 && SCHARS (auto_buffer_name) != 0
5631 && !NILP (WSET (w, buffer, Fget_buffer_create (auto_buffer_name)))) 5628 && !NILP (WSET (w, buffer, Fget_buffer_create (auto_buffer_name))))
5632 { 5629 {
5633 set_marker_restricted (WGET (w, start), 5630 set_marker_restricted (w->start,
5634 make_number (0), WGET (w, buffer)); 5631 make_number (0), w->buffer);
5635 set_marker_restricted (WGET (w, pointm), 5632 set_marker_restricted (w->pointm,
5636 make_number (0), WGET (w, buffer)); 5633 make_number (0), w->buffer);
5637 w->start_at_line_beg = 1; 5634 w->start_at_line_beg = 1;
5638 } 5635 }
5639 else 5636 else
@@ -5646,12 +5643,12 @@ the return value is nil. Otherwise the value is t. */)
5646 WSET (w, buffer, other_buffer_safely (Fcurrent_buffer ())); 5643 WSET (w, buffer, other_buffer_safely (Fcurrent_buffer ()));
5647 /* This will set the markers to beginning of visible 5644 /* This will set the markers to beginning of visible
5648 range. */ 5645 range. */
5649 set_marker_restricted (WGET (w, start), 5646 set_marker_restricted (w->start,
5650 make_number (0), WGET (w, buffer)); 5647 make_number (0), w->buffer);
5651 set_marker_restricted (WGET (w, pointm), 5648 set_marker_restricted (w->pointm,
5652 make_number (0), WGET (w, buffer)); 5649 make_number (0), w->buffer);
5653 w->start_at_line_beg = 1; 5650 w->start_at_line_beg = 1;
5654 if (!NILP (WGET (w, dedicated))) 5651 if (!NILP (w->dedicated))
5655 /* Record this window as dead. */ 5652 /* Record this window as dead. */
5656 dead_windows = Fcons (window, dead_windows); 5653 dead_windows = Fcons (window, dead_windows);
5657 /* Make sure window is no more dedicated. */ 5654 /* Make sure window is no more dedicated. */
@@ -5662,17 +5659,17 @@ the return value is nil. Otherwise the value is t. */)
5662 FSET (f, root_window, data->root_window); 5659 FSET (f, root_window, data->root_window);
5663 /* Arrange *not* to restore point in the buffer that was 5660 /* Arrange *not* to restore point in the buffer that was
5664 current when the window configuration was saved. */ 5661 current when the window configuration was saved. */
5665 if (EQ (WGET (XWINDOW (data->current_window), buffer), new_current_buffer)) 5662 if (EQ (XWINDOW (data->current_window)->buffer, new_current_buffer))
5666 set_marker_restricted (WGET (XWINDOW (data->current_window), pointm), 5663 set_marker_restricted (XWINDOW (data->current_window)->pointm,
5667 make_number (old_point), 5664 make_number (old_point),
5668 WGET (XWINDOW (data->current_window), buffer)); 5665 XWINDOW (data->current_window)->buffer);
5669 5666
5670 /* In the following call to `select-window', prevent "swapping out 5667 /* In the following call to `select-window', prevent "swapping out
5671 point" in the old selected window using the buffer that has 5668 point" in the old selected window using the buffer that has
5672 been restored into it. We already swapped out that point from 5669 been restored into it. We already swapped out that point from
5673 that window's old buffer. */ 5670 that window's old buffer. */
5674 select_window (data->current_window, Qnil, 1); 5671 select_window (data->current_window, Qnil, 1);
5675 BVAR (XBUFFER (WGET (XWINDOW (selected_window), buffer)), last_selected_window) 5672 BVAR (XBUFFER (XWINDOW (selected_window)->buffer), last_selected_window)
5676 = selected_window; 5673 = selected_window;
5677 5674
5678 if (NILP (data->focus_frame) 5675 if (NILP (data->focus_frame)
@@ -5699,14 +5696,14 @@ the return value is nil. Otherwise the value is t. */)
5699 /* Now, free glyph matrices in windows that were not reused. */ 5696 /* Now, free glyph matrices in windows that were not reused. */
5700 for (i = n = 0; i < n_leaf_windows; ++i) 5697 for (i = n = 0; i < n_leaf_windows; ++i)
5701 { 5698 {
5702 if (NILP (WGET (leaf_windows[i], buffer))) 5699 if (NILP (leaf_windows[i]->buffer))
5703 { 5700 {
5704 /* Assert it's not reused as a combination. */ 5701 /* Assert it's not reused as a combination. */
5705 eassert (NILP (WGET (leaf_windows[i], hchild)) 5702 eassert (NILP (leaf_windows[i]->hchild)
5706 && NILP (WGET (leaf_windows[i], vchild))); 5703 && NILP (leaf_windows[i]->vchild));
5707 free_window_matrices (leaf_windows[i]); 5704 free_window_matrices (leaf_windows[i]);
5708 } 5705 }
5709 else if (EQ (WGET (leaf_windows[i], buffer), new_current_buffer)) 5706 else if (EQ (leaf_windows[i]->buffer, new_current_buffer))
5710 ++n; 5707 ++n;
5711 } 5708 }
5712 5709
@@ -5751,27 +5748,27 @@ delete_all_child_windows (Lisp_Object window)
5751 5748
5752 w = XWINDOW (window); 5749 w = XWINDOW (window);
5753 5750
5754 if (!NILP (WGET (w, next))) 5751 if (!NILP (w->next))
5755 /* Delete WINDOW's siblings (we traverse postorderly). */ 5752 /* Delete WINDOW's siblings (we traverse postorderly). */
5756 delete_all_child_windows (WGET (w, next)); 5753 delete_all_child_windows (w->next);
5757 5754
5758 WSET (w, total_lines, WGET (w, buffer)); /* See Fset_window_configuration for excuse. */ 5755 WSET (w, total_lines, w->buffer); /* See Fset_window_configuration for excuse. */
5759 5756
5760 if (!NILP (WGET (w, vchild))) 5757 if (!NILP (w->vchild))
5761 { 5758 {
5762 delete_all_child_windows (WGET (w, vchild)); 5759 delete_all_child_windows (w->vchild);
5763 WSET (w, vchild, Qnil); 5760 WSET (w, vchild, Qnil);
5764 } 5761 }
5765 else if (!NILP (WGET (w, hchild))) 5762 else if (!NILP (w->hchild))
5766 { 5763 {
5767 delete_all_child_windows (WGET (w, hchild)); 5764 delete_all_child_windows (w->hchild);
5768 WSET (w, hchild, Qnil); 5765 WSET (w, hchild, Qnil);
5769 } 5766 }
5770 else if (!NILP (WGET (w, buffer))) 5767 else if (!NILP (w->buffer))
5771 { 5768 {
5772 unshow_buffer (w); 5769 unshow_buffer (w);
5773 unchain_marker (XMARKER (WGET (w, pointm))); 5770 unchain_marker (XMARKER (w->pointm));
5774 unchain_marker (XMARKER (WGET (w, start))); 5771 unchain_marker (XMARKER (w->start));
5775 WSET (w, buffer, Qnil); 5772 WSET (w, buffer, Qnil);
5776 } 5773 }
5777 5774
@@ -5782,12 +5779,12 @@ static int
5782count_windows (register struct window *window) 5779count_windows (register struct window *window)
5783{ 5780{
5784 register int count = 1; 5781 register int count = 1;
5785 if (!NILP (WGET (window, next))) 5782 if (!NILP (window->next))
5786 count += count_windows (XWINDOW (WGET (window, next))); 5783 count += count_windows (XWINDOW (window->next));
5787 if (!NILP (WGET (window, vchild))) 5784 if (!NILP (window->vchild))
5788 count += count_windows (XWINDOW (WGET (window, vchild))); 5785 count += count_windows (XWINDOW (window->vchild));
5789 if (!NILP (WGET (window, hchild))) 5786 if (!NILP (window->hchild))
5790 count += count_windows (XWINDOW (WGET (window, hchild))); 5787 count += count_windows (XWINDOW (window->hchild));
5791 return count; 5788 return count;
5792} 5789}
5793 5790
@@ -5799,14 +5796,14 @@ get_leaf_windows (struct window *w, struct window **flat, int i)
5799{ 5796{
5800 while (w) 5797 while (w)
5801 { 5798 {
5802 if (!NILP (WGET (w, hchild))) 5799 if (!NILP (w->hchild))
5803 i = get_leaf_windows (XWINDOW (WGET (w, hchild)), flat, i); 5800 i = get_leaf_windows (XWINDOW (w->hchild), flat, i);
5804 else if (!NILP (WGET (w, vchild))) 5801 else if (!NILP (w->vchild))
5805 i = get_leaf_windows (XWINDOW (WGET (w, vchild)), flat, i); 5802 i = get_leaf_windows (XWINDOW (w->vchild), flat, i);
5806 else 5803 else
5807 flat[i++] = w; 5804 flat[i++] = w;
5808 5805
5809 w = NILP (WGET (w, next)) ? 0 : XWINDOW (WGET (w, next)); 5806 w = NILP (w->next) ? 0 : XWINDOW (w->next);
5810 } 5807 }
5811 5808
5812 return i; 5809 return i;
@@ -5859,32 +5856,32 @@ save_window_save (Lisp_Object window, struct Lisp_Vector *vector, int i)
5859 register struct window *w; 5856 register struct window *w;
5860 register Lisp_Object tem, pers, par; 5857 register Lisp_Object tem, pers, par;
5861 5858
5862 for (;!NILP (window); window = WGET (w, next)) 5859 for (;!NILP (window); window = w->next)
5863 { 5860 {
5864 p = SAVED_WINDOW_N (vector, i); 5861 p = SAVED_WINDOW_N (vector, i);
5865 w = XWINDOW (window); 5862 w = XWINDOW (window);
5866 5863
5867 WSET (w, temslot, make_number (i)); i++; 5864 WSET (w, temslot, make_number (i)); i++;
5868 p->window = window; 5865 p->window = window;
5869 p->buffer = WGET (w, buffer); 5866 p->buffer = w->buffer;
5870 p->left_col = WGET (w, left_col); 5867 p->left_col = w->left_col;
5871 p->top_line = WGET (w, top_line); 5868 p->top_line = w->top_line;
5872 p->total_cols = WGET (w, total_cols); 5869 p->total_cols = w->total_cols;
5873 p->total_lines = WGET (w, total_lines); 5870 p->total_lines = w->total_lines;
5874 p->normal_cols = WGET (w, normal_cols); 5871 p->normal_cols = w->normal_cols;
5875 p->normal_lines = WGET (w, normal_lines); 5872 p->normal_lines = w->normal_lines;
5876 XSETFASTINT (p->hscroll, w->hscroll); 5873 XSETFASTINT (p->hscroll, w->hscroll);
5877 XSETFASTINT (p->min_hscroll, w->min_hscroll); 5874 XSETFASTINT (p->min_hscroll, w->min_hscroll);
5878 p->display_table = WGET (w, display_table); 5875 p->display_table = w->display_table;
5879 p->left_margin_cols = WGET (w, left_margin_cols); 5876 p->left_margin_cols = w->left_margin_cols;
5880 p->right_margin_cols = WGET (w, right_margin_cols); 5877 p->right_margin_cols = w->right_margin_cols;
5881 p->left_fringe_width = WGET (w, left_fringe_width); 5878 p->left_fringe_width = w->left_fringe_width;
5882 p->right_fringe_width = WGET (w, right_fringe_width); 5879 p->right_fringe_width = w->right_fringe_width;
5883 p->fringes_outside_margins = w->fringes_outside_margins ? Qt : Qnil; 5880 p->fringes_outside_margins = w->fringes_outside_margins ? Qt : Qnil;
5884 p->scroll_bar_width = WGET (w, scroll_bar_width); 5881 p->scroll_bar_width = w->scroll_bar_width;
5885 p->vertical_scroll_bar_type = WGET (w, vertical_scroll_bar_type); 5882 p->vertical_scroll_bar_type = w->vertical_scroll_bar_type;
5886 p->dedicated = WGET (w, dedicated); 5883 p->dedicated = w->dedicated;
5887 p->combination_limit = WGET (w, combination_limit); 5884 p->combination_limit = w->combination_limit;
5888 p->window_parameters = Qnil; 5885 p->window_parameters = Qnil;
5889 5886
5890 if (!NILP (Vwindow_persistent_parameters)) 5887 if (!NILP (Vwindow_persistent_parameters))
@@ -5917,7 +5914,7 @@ save_window_save (Lisp_Object window, struct Lisp_Vector *vector, int i)
5917 /* Save values for persistent window parameters. */ 5914 /* Save values for persistent window parameters. */
5918 if (CONSP (pers) && !NILP (XCDR (pers))) 5915 if (CONSP (pers) && !NILP (XCDR (pers)))
5919 { 5916 {
5920 par = Fassq (XCAR (pers), WGET (w, window_parameters)); 5917 par = Fassq (XCAR (pers), w->window_parameters);
5921 if (NILP (par)) 5918 if (NILP (par))
5922 /* If the window has no value for the parameter, 5919 /* If the window has no value for the parameter,
5923 make one. */ 5920 make one. */
@@ -5933,24 +5930,24 @@ save_window_save (Lisp_Object window, struct Lisp_Vector *vector, int i)
5933 } 5930 }
5934 } 5931 }
5935 5932
5936 if (!NILP (WGET (w, buffer))) 5933 if (!NILP (w->buffer))
5937 { 5934 {
5938 /* Save w's value of point in the window configuration. If w 5935 /* Save w's value of point in the window configuration. If w
5939 is the selected window, then get the value of point from 5936 is the selected window, then get the value of point from
5940 the buffer; pointm is garbage in the selected window. */ 5937 the buffer; pointm is garbage in the selected window. */
5941 if (EQ (window, selected_window)) 5938 if (EQ (window, selected_window))
5942 p->pointm = build_marker (XBUFFER (WGET (w, buffer)), 5939 p->pointm = build_marker (XBUFFER (w->buffer),
5943 BUF_PT (XBUFFER (WGET (w, buffer))), 5940 BUF_PT (XBUFFER (w->buffer)),
5944 BUF_PT_BYTE (XBUFFER (WGET (w, buffer)))); 5941 BUF_PT_BYTE (XBUFFER (w->buffer)));
5945 else 5942 else
5946 p->pointm = Fcopy_marker (WGET (w, pointm), Qnil); 5943 p->pointm = Fcopy_marker (w->pointm, Qnil);
5947 XMARKER (p->pointm)->insertion_type 5944 XMARKER (p->pointm)->insertion_type
5948 = !NILP (Vwindow_point_insertion_type); 5945 = !NILP (Vwindow_point_insertion_type);
5949 5946
5950 p->start = Fcopy_marker (WGET (w, start), Qnil); 5947 p->start = Fcopy_marker (w->start, Qnil);
5951 p->start_at_line_beg = w->start_at_line_beg ? Qt : Qnil; 5948 p->start_at_line_beg = w->start_at_line_beg ? Qt : Qnil;
5952 5949
5953 tem = BVAR (XBUFFER (WGET (w, buffer)), mark); 5950 tem = BVAR (XBUFFER (w->buffer), mark);
5954 p->mark = Fcopy_marker (tem, Qnil); 5951 p->mark = Fcopy_marker (tem, Qnil);
5955 } 5952 }
5956 else 5953 else
@@ -5961,20 +5958,20 @@ save_window_save (Lisp_Object window, struct Lisp_Vector *vector, int i)
5961 p->start_at_line_beg = Qnil; 5958 p->start_at_line_beg = Qnil;
5962 } 5959 }
5963 5960
5964 if (NILP (WGET (w, parent))) 5961 if (NILP (w->parent))
5965 p->parent = Qnil; 5962 p->parent = Qnil;
5966 else 5963 else
5967 p->parent = WGET (XWINDOW (WGET (w, parent)), temslot); 5964 p->parent = XWINDOW (w->parent)->temslot;
5968 5965
5969 if (NILP (WGET (w, prev))) 5966 if (NILP (w->prev))
5970 p->prev = Qnil; 5967 p->prev = Qnil;
5971 else 5968 else
5972 p->prev = WGET (XWINDOW (WGET (w, prev)), temslot); 5969 p->prev = XWINDOW (w->prev)->temslot;
5973 5970
5974 if (!NILP (WGET (w, vchild))) 5971 if (!NILP (w->vchild))
5975 i = save_window_save (WGET (w, vchild), vector, i); 5972 i = save_window_save (w->vchild, vector, i);
5976 if (!NILP (WGET (w, hchild))) 5973 if (!NILP (w->hchild))
5977 i = save_window_save (WGET (w, hchild), vector, i); 5974 i = save_window_save (w->hchild, vector, i);
5978 } 5975 }
5979 5976
5980 return i; 5977 return i;
@@ -6063,8 +6060,8 @@ means no margin. */)
6063 right_width = Qnil; 6060 right_width = Qnil;
6064 } 6061 }
6065 6062
6066 if (!EQ (WGET (w, left_margin_cols), left_width) 6063 if (!EQ (w->left_margin_cols, left_width)
6067 || !EQ (WGET (w, right_margin_cols), right_width)) 6064 || !EQ (w->right_margin_cols, right_width))
6068 { 6065 {
6069 WSET (w, left_margin_cols, left_width); 6066 WSET (w, left_margin_cols, left_width);
6070 WSET (w, right_margin_cols, right_width); 6067 WSET (w, right_margin_cols, right_width);
@@ -6089,7 +6086,7 @@ as nil. */)
6089 (Lisp_Object window) 6086 (Lisp_Object window)
6090{ 6087{
6091 struct window *w = decode_window (window); 6088 struct window *w = decode_window (window);
6092 return Fcons (WGET (w, left_margin_cols), WGET (w, right_margin_cols)); 6089 return Fcons (w->left_margin_cols, w->right_margin_cols);
6093} 6090}
6094 6091
6095 6092
@@ -6123,8 +6120,8 @@ display marginal areas and the text area. */)
6123 6120
6124 /* Do nothing on a tty. */ 6121 /* Do nothing on a tty. */
6125 if (FRAME_WINDOW_P (WINDOW_XFRAME (w)) 6122 if (FRAME_WINDOW_P (WINDOW_XFRAME (w))
6126 && (!EQ (WGET (w, left_fringe_width), left_width) 6123 && (!EQ (w->left_fringe_width, left_width)
6127 || !EQ (WGET (w, right_fringe_width), right_width) 6124 || !EQ (w->right_fringe_width, right_width)
6128 || w->fringes_outside_margins != outside)) 6125 || w->fringes_outside_margins != outside))
6129 { 6126 {
6130 WSET (w, left_fringe_width, left_width); 6127 WSET (w, left_fringe_width, left_width);
@@ -6194,8 +6191,8 @@ Fourth parameter HORIZONTAL-TYPE is currently unused. */)
6194 || EQ (vertical_type, Qt))) 6191 || EQ (vertical_type, Qt)))
6195 error ("Invalid type of vertical scroll bar"); 6192 error ("Invalid type of vertical scroll bar");
6196 6193
6197 if (!EQ (WGET (w, scroll_bar_width), width) 6194 if (!EQ (w->scroll_bar_width, width)
6198 || !EQ (WGET (w, vertical_scroll_bar_type), vertical_type)) 6195 || !EQ (w->vertical_scroll_bar_type, vertical_type))
6199 { 6196 {
6200 WSET (w, scroll_bar_width, width); 6197 WSET (w, scroll_bar_width, width);
6201 WSET (w, vertical_scroll_bar_type, vertical_type); 6198 WSET (w, vertical_scroll_bar_type, vertical_type);
@@ -6227,7 +6224,7 @@ value. */)
6227 ? WINDOW_CONFIG_SCROLL_BAR_WIDTH (w) 6224 ? WINDOW_CONFIG_SCROLL_BAR_WIDTH (w)
6228 : WINDOW_SCROLL_BAR_AREA_WIDTH (w))), 6225 : WINDOW_SCROLL_BAR_AREA_WIDTH (w))),
6229 Fcons (make_number (WINDOW_SCROLL_BAR_COLS (w)), 6226 Fcons (make_number (WINDOW_SCROLL_BAR_COLS (w)),
6230 Fcons (WGET (w, vertical_scroll_bar_type), 6227 Fcons (w->vertical_scroll_bar_type,
6231 Fcons (Qnil, Qnil)))); 6228 Fcons (Qnil, Qnil))));
6232} 6229}
6233 6230
@@ -6253,7 +6250,7 @@ optional second arg PIXELS-P means value is measured in pixels. */)
6253 else 6250 else
6254 CHECK_WINDOW (window); 6251 CHECK_WINDOW (window);
6255 w = XWINDOW (window); 6252 w = XWINDOW (window);
6256 f = XFRAME (WGET (w, frame)); 6253 f = XFRAME (w->frame);
6257 6254
6258 if (FRAME_WINDOW_P (f)) 6255 if (FRAME_WINDOW_P (f))
6259 result = (NILP (pixels_p) 6256 result = (NILP (pixels_p)
@@ -6287,7 +6284,7 @@ If PIXELS-P is non-nil, the return value is VSCROLL. */)
6287 CHECK_NUMBER_OR_FLOAT (vscroll); 6284 CHECK_NUMBER_OR_FLOAT (vscroll);
6288 6285
6289 w = XWINDOW (window); 6286 w = XWINDOW (window);
6290 f = XFRAME (WGET (w, frame)); 6287 f = XFRAME (w->frame);
6291 6288
6292 if (FRAME_WINDOW_P (f)) 6289 if (FRAME_WINDOW_P (f))
6293 { 6290 {
@@ -6306,7 +6303,7 @@ If PIXELS-P is non-nil, the return value is VSCROLL. */)
6306 adjust_glyphs (f); 6303 adjust_glyphs (f);
6307 6304
6308 /* Prevent redisplay shortcuts. */ 6305 /* Prevent redisplay shortcuts. */
6309 XBUFFER (WGET (w, buffer))->prevent_redisplay_optimizations_p = 1; 6306 XBUFFER (w->buffer)->prevent_redisplay_optimizations_p = 1;
6310 } 6307 }
6311 } 6308 }
6312 6309
@@ -6340,14 +6337,14 @@ foreach_window_1 (struct window *w, int (*fn) (struct window *, void *), void *u
6340 6337
6341 for (cont = 1; w && cont;) 6338 for (cont = 1; w && cont;)
6342 { 6339 {
6343 if (!NILP (WGET (w, hchild))) 6340 if (!NILP (w->hchild))
6344 cont = foreach_window_1 (XWINDOW (WGET (w, hchild)), fn, user_data); 6341 cont = foreach_window_1 (XWINDOW (w->hchild), fn, user_data);
6345 else if (!NILP (WGET (w, vchild))) 6342 else if (!NILP (w->vchild))
6346 cont = foreach_window_1 (XWINDOW (WGET (w, vchild)), fn, user_data); 6343 cont = foreach_window_1 (XWINDOW (w->vchild), fn, user_data);
6347 else 6344 else
6348 cont = fn (w, user_data); 6345 cont = fn (w, user_data);
6349 6346
6350 w = NILP (WGET (w, next)) ? 0 : XWINDOW (WGET (w, next)); 6347 w = NILP (w->next) ? 0 : XWINDOW (w->next);
6351 } 6348 }
6352 6349
6353 return cont; 6350 return cont;
diff --git a/src/window.h b/src/window.h
index 64b6c19ec69..3e6f4f82b0a 100644
--- a/src/window.h
+++ b/src/window.h
@@ -86,15 +86,9 @@ struct cursor_pos
86 int hpos, vpos; 86 int hpos, vpos;
87}; 87};
88 88
89/* Most code should use these macros to access Lisp fields 89/* Most code should use this macro to set Lisp fields in struct window. */
90 in struct window. WGET should not be used as lvalue. */
91 90
92#define WGET(f, field) \ 91#define WSET(w, field, value) ((w)->field = (value))
93 (eassert (offsetof (struct window, field ## _) \
94 < offsetof (struct window, current_matrix)), \
95 ((f)->INTERNAL_FIELD (field)))
96
97#define WSET(w, field, value) ((w)->INTERNAL_FIELD (field) = (value))
98 92
99struct window 93struct window
100 { 94 {
@@ -102,140 +96,140 @@ struct window
102 struct vectorlike_header header; 96 struct vectorlike_header header;
103 97
104 /* The frame this window is on. */ 98 /* The frame this window is on. */
105 Lisp_Object INTERNAL_FIELD (frame); 99 Lisp_Object frame;
106 100
107 /* Following (to right or down) and preceding (to left or up) child 101 /* Following (to right or down) and preceding (to left or up) child
108 at same level of tree. */ 102 at same level of tree. */
109 Lisp_Object INTERNAL_FIELD (next); 103 Lisp_Object next;
110 Lisp_Object INTERNAL_FIELD (prev); 104 Lisp_Object prev;
111 105
112 /* First child of this window: vchild is used if this is a vertical 106 /* First child of this window: vchild is used if this is a vertical
113 combination, hchild if this is a horizontal combination. Of the 107 combination, hchild if this is a horizontal combination. Of the
114 fields vchild, hchild and buffer, one and only one is non-nil 108 fields vchild, hchild and buffer, one and only one is non-nil
115 unless the window is dead. */ 109 unless the window is dead. */
116 Lisp_Object INTERNAL_FIELD (hchild); 110 Lisp_Object hchild;
117 Lisp_Object INTERNAL_FIELD (vchild); 111 Lisp_Object vchild;
118 112
119 /* The window this one is a child of. */ 113 /* The window this one is a child of. */
120 Lisp_Object INTERNAL_FIELD (parent); 114 Lisp_Object parent;
121 115
122 /* The upper left corner coordinates of this window, as integers 116 /* The upper left corner coordinates of this window, as integers
123 relative to upper left corner of frame = 0, 0. */ 117 relative to upper left corner of frame = 0, 0. */
124 Lisp_Object INTERNAL_FIELD (left_col); 118 Lisp_Object left_col;
125 Lisp_Object INTERNAL_FIELD (top_line); 119 Lisp_Object top_line;
126 120
127 /* The size of the window. */ 121 /* The size of the window. */
128 Lisp_Object INTERNAL_FIELD (total_lines); 122 Lisp_Object total_lines;
129 Lisp_Object INTERNAL_FIELD (total_cols); 123 Lisp_Object total_cols;
130 124
131 /* The normal size of the window. */ 125 /* The normal size of the window. */
132 Lisp_Object INTERNAL_FIELD (normal_lines); 126 Lisp_Object normal_lines;
133 Lisp_Object INTERNAL_FIELD (normal_cols); 127 Lisp_Object normal_cols;
134 128
135 /* New sizes of the window. */ 129 /* New sizes of the window. */
136 Lisp_Object INTERNAL_FIELD (new_total); 130 Lisp_Object new_total;
137 Lisp_Object INTERNAL_FIELD (new_normal); 131 Lisp_Object new_normal;
138 132
139 /* The buffer displayed in this window. Of the fields vchild, 133 /* The buffer displayed in this window. Of the fields vchild,
140 hchild and buffer, one and only one is non-nil unless the window 134 hchild and buffer, one and only one is non-nil unless the window
141 is dead. */ 135 is dead. */
142 Lisp_Object INTERNAL_FIELD (buffer); 136 Lisp_Object buffer;
143 137
144 /* A marker pointing to where in the text to start displaying. 138 /* A marker pointing to where in the text to start displaying.
145 BIDI Note: This is the _logical-order_ start, i.e. the smallest 139 BIDI Note: This is the _logical-order_ start, i.e. the smallest
146 buffer position visible in the window, not necessarily the 140 buffer position visible in the window, not necessarily the
147 character displayed in the top left corner of the window. */ 141 character displayed in the top left corner of the window. */
148 Lisp_Object INTERNAL_FIELD (start); 142 Lisp_Object start;
149 143
150 /* A marker pointing to where in the text point is in this window, 144 /* A marker pointing to where in the text point is in this window,
151 used only when the window is not selected. 145 used only when the window is not selected.
152 This exists so that when multiple windows show one buffer 146 This exists so that when multiple windows show one buffer
153 each one can have its own value of point. */ 147 each one can have its own value of point. */
154 Lisp_Object INTERNAL_FIELD (pointm); 148 Lisp_Object pointm;
155 149
156 /* No permanent meaning; used by save-window-excursion's 150 /* No permanent meaning; used by save-window-excursion's
157 bookkeeping. */ 151 bookkeeping. */
158 Lisp_Object INTERNAL_FIELD (temslot); 152 Lisp_Object temslot;
159 153
160 /* This window's vertical scroll bar. This field is only for use 154 /* This window's vertical scroll bar. This field is only for use
161 by the window-system-dependent code which implements the 155 by the window-system-dependent code which implements the
162 scroll bars; it can store anything it likes here. If this 156 scroll bars; it can store anything it likes here. If this
163 window is newly created and we haven't displayed a scroll bar in 157 window is newly created and we haven't displayed a scroll bar in
164 it yet, or if the frame doesn't have any scroll bars, this is nil. */ 158 it yet, or if the frame doesn't have any scroll bars, this is nil. */
165 Lisp_Object INTERNAL_FIELD (vertical_scroll_bar); 159 Lisp_Object vertical_scroll_bar;
166 160
167 /* Width of left and right marginal areas. A value of nil means 161 /* Width of left and right marginal areas. A value of nil means
168 no margin. */ 162 no margin. */
169 Lisp_Object INTERNAL_FIELD (left_margin_cols); 163 Lisp_Object left_margin_cols;
170 Lisp_Object INTERNAL_FIELD (right_margin_cols); 164 Lisp_Object right_margin_cols;
171 165
172 /* Width of left and right fringes. 166 /* Width of left and right fringes.
173 A value of nil or t means use frame values. */ 167 A value of nil or t means use frame values. */
174 Lisp_Object INTERNAL_FIELD (left_fringe_width); 168 Lisp_Object left_fringe_width;
175 Lisp_Object INTERNAL_FIELD (right_fringe_width); 169 Lisp_Object right_fringe_width;
176 170
177 /* Pixel width of scroll bars. 171 /* Pixel width of scroll bars.
178 A value of nil or t means use frame values. */ 172 A value of nil or t means use frame values. */
179 Lisp_Object INTERNAL_FIELD (scroll_bar_width); 173 Lisp_Object scroll_bar_width;
180 174
181 /* Type of vertical scroll bar. A value of nil means 175 /* Type of vertical scroll bar. A value of nil means
182 no scroll bar. A value of t means use frame value. */ 176 no scroll bar. A value of t means use frame value. */
183 Lisp_Object INTERNAL_FIELD (vertical_scroll_bar_type); 177 Lisp_Object vertical_scroll_bar_type;
184 178
185 /* Z - the buffer position of the last glyph in the current matrix 179 /* Z - the buffer position of the last glyph in the current matrix
186 of W. Only valid if WINDOW_END_VALID is not nil. */ 180 of W. Only valid if WINDOW_END_VALID is not nil. */
187 Lisp_Object INTERNAL_FIELD (window_end_pos); 181 Lisp_Object window_end_pos;
188 /* Glyph matrix row of the last glyph in the current matrix 182 /* Glyph matrix row of the last glyph in the current matrix
189 of W. Only valid if WINDOW_END_VALID is not nil. */ 183 of W. Only valid if WINDOW_END_VALID is not nil. */
190 Lisp_Object INTERNAL_FIELD (window_end_vpos); 184 Lisp_Object window_end_vpos;
191 /* t if window_end_pos is truly valid. 185 /* t if window_end_pos is truly valid.
192 This is nil if nontrivial redisplay is preempted 186 This is nil if nontrivial redisplay is preempted
193 since in that case the frame image that window_end_pos 187 since in that case the frame image that window_end_pos
194 did not get onto the frame. */ 188 did not get onto the frame. */
195 Lisp_Object INTERNAL_FIELD (window_end_valid); 189 Lisp_Object window_end_valid;
196 190
197 /* Display-table to use for displaying chars in this window. 191 /* Display-table to use for displaying chars in this window.
198 Nil means use the buffer's own display-table. */ 192 Nil means use the buffer's own display-table. */
199 Lisp_Object INTERNAL_FIELD (display_table); 193 Lisp_Object display_table;
200 194
201 /* Non-nil usually means window is marked as dedicated. 195 /* Non-nil usually means window is marked as dedicated.
202 Note Lisp code may set this to something beyond Qnil 196 Note Lisp code may set this to something beyond Qnil
203 and Qt, so bitfield can't be used here. */ 197 and Qt, so bitfield can't be used here. */
204 Lisp_Object INTERNAL_FIELD (dedicated); 198 Lisp_Object dedicated;
205 199
206 /* Line number and position of a line somewhere above the top of the 200 /* Line number and position of a line somewhere above the top of the
207 screen. If this field is nil, it means we don't have a base 201 screen. If this field is nil, it means we don't have a base
208 line. */ 202 line. */
209 Lisp_Object INTERNAL_FIELD (base_line_number); 203 Lisp_Object base_line_number;
210 /* If this field is nil, it means we don't have a base line. 204 /* If this field is nil, it means we don't have a base line.
211 If it is a buffer, it means don't display the line number 205 If it is a buffer, it means don't display the line number
212 as long as the window shows that buffer. */ 206 as long as the window shows that buffer. */
213 Lisp_Object INTERNAL_FIELD (base_line_pos); 207 Lisp_Object base_line_pos;
214 208
215 /* If we have highlighted the region (or any part of it), 209 /* If we have highlighted the region (or any part of it),
216 this is the mark position that we used, as an integer. */ 210 this is the mark position that we used, as an integer. */
217 Lisp_Object INTERNAL_FIELD (region_showing); 211 Lisp_Object region_showing;
218 212
219 /* The column number currently displayed in this window's mode line, 213 /* The column number currently displayed in this window's mode line,
220 or nil if column numbers are not being displayed. */ 214 or nil if column numbers are not being displayed. */
221 Lisp_Object INTERNAL_FIELD (column_number_displayed); 215 Lisp_Object column_number_displayed;
222 216
223 /* If redisplay in this window goes beyond this buffer position, 217 /* If redisplay in this window goes beyond this buffer position,
224 must run the redisplay-end-trigger-hook. */ 218 must run the redisplay-end-trigger-hook. */
225 Lisp_Object INTERNAL_FIELD (redisplay_end_trigger); 219 Lisp_Object redisplay_end_trigger;
226 220
227 /* t means this window's child windows are not (re-)combined. */ 221 /* t means this window's child windows are not (re-)combined. */
228 Lisp_Object INTERNAL_FIELD (combination_limit); 222 Lisp_Object combination_limit;
229 223
230 /* Alist of <buffer, window-start, window-point> triples listing 224 /* Alist of <buffer, window-start, window-point> triples listing
231 buffers previously shown in this window. */ 225 buffers previously shown in this window. */
232 Lisp_Object INTERNAL_FIELD (prev_buffers); 226 Lisp_Object prev_buffers;
233 227
234 /* List of buffers re-shown in this window. */ 228 /* List of buffers re-shown in this window. */
235 Lisp_Object INTERNAL_FIELD (next_buffers); 229 Lisp_Object next_buffers;
236 230
237 /* An alist with parameters. */ 231 /* An alist with parameters. */
238 Lisp_Object INTERNAL_FIELD (window_parameters); 232 Lisp_Object window_parameters;
239 233
240 /* No Lisp data may follow below this point without changing 234 /* No Lisp data may follow below this point without changing
241 mark_object in alloc.c. The member current_matrix must be the 235 mark_object in alloc.c. The member current_matrix must be the
@@ -402,13 +396,13 @@ struct window
402 This includes scroll bars and fringes. */ 396 This includes scroll bars and fringes. */
403 397
404#define WINDOW_TOTAL_COLS(W) \ 398#define WINDOW_TOTAL_COLS(W) \
405 (XFASTINT (WGET (W, total_cols))) 399 (XFASTINT (W->total_cols))
406 400
407/* Return the height of window W in canonical line units. 401/* Return the height of window W in canonical line units.
408 This includes header and mode lines, if any. */ 402 This includes header and mode lines, if any. */
409 403
410#define WINDOW_TOTAL_LINES(W) \ 404#define WINDOW_TOTAL_LINES(W) \
411 (XFASTINT (WGET (W, total_lines))) 405 (XFASTINT (W->total_lines))
412 406
413/* Return the total pixel width of window W. */ 407/* Return the total pixel width of window W. */
414 408
@@ -436,7 +430,7 @@ struct window
436 This includes a left-hand scroll bar, if any. */ 430 This includes a left-hand scroll bar, if any. */
437 431
438#define WINDOW_LEFT_EDGE_COL(W) \ 432#define WINDOW_LEFT_EDGE_COL(W) \
439 (XFASTINT (WGET (W, left_col))) 433 (XFASTINT (W->left_col))
440 434
441/* Return the canonical frame column before which window W ends. 435/* Return the canonical frame column before which window W ends.
442 This includes a right-hand scroll bar, if any. */ 436 This includes a right-hand scroll bar, if any. */
@@ -448,7 +442,7 @@ struct window
448 This includes a header line, if any. */ 442 This includes a header line, if any. */
449 443
450#define WINDOW_TOP_EDGE_LINE(W) \ 444#define WINDOW_TOP_EDGE_LINE(W) \
451 (XFASTINT (WGET (W, top_line))) 445 (XFASTINT (W->top_line))
452 446
453/* Return the canonical frame line before which window W ends. 447/* Return the canonical frame line before which window W ends.
454 This includes a mode line, if any. */ 448 This includes a mode line, if any. */
@@ -552,32 +546,32 @@ struct window
552 546
553/* Width of left margin area in columns. */ 547/* Width of left margin area in columns. */
554 548
555#define WINDOW_LEFT_MARGIN_COLS(W) \ 549#define WINDOW_LEFT_MARGIN_COLS(W) \
556 (NILP (WGET (W, left_margin_cols)) \ 550 (NILP (W->left_margin_cols) \
557 ? 0 \ 551 ? 0 \
558 : XINT (WGET (W, left_margin_cols))) 552 : XINT (W->left_margin_cols))
559 553
560/* Width of right marginal area in columns. */ 554/* Width of right marginal area in columns. */
561 555
562#define WINDOW_RIGHT_MARGIN_COLS(W) \ 556#define WINDOW_RIGHT_MARGIN_COLS(W) \
563 (NILP (WGET (W, right_margin_cols)) \ 557 (NILP (W->right_margin_cols) \
564 ? 0 \ 558 ? 0 \
565 : XINT (WGET (W, right_margin_cols))) 559 : XINT (W->right_margin_cols))
566 560
567/* Width of left margin area in pixels. */ 561/* Width of left margin area in pixels. */
568 562
569#define WINDOW_LEFT_MARGIN_WIDTH(W) \ 563#define WINDOW_LEFT_MARGIN_WIDTH(W) \
570 (NILP (WGET (W, left_margin_cols)) \ 564 (NILP (W->left_margin_cols) \
571 ? 0 \ 565 ? 0 \
572 : (XINT (WGET (W, left_margin_cols)) \ 566 : (XINT (W->left_margin_cols) \
573 * WINDOW_FRAME_COLUMN_WIDTH (W))) 567 * WINDOW_FRAME_COLUMN_WIDTH (W)))
574 568
575/* Width of right marginal area in pixels. */ 569/* Width of right marginal area in pixels. */
576 570
577#define WINDOW_RIGHT_MARGIN_WIDTH(W) \ 571#define WINDOW_RIGHT_MARGIN_WIDTH(W) \
578 (NILP (WGET (W, right_margin_cols)) \ 572 (NILP (W->right_margin_cols) \
579 ? 0 \ 573 ? 0 \
580 : (XINT (WGET (W, right_margin_cols)) \ 574 : (XINT (W->right_margin_cols) \
581 * WINDOW_FRAME_COLUMN_WIDTH (W))) 575 * WINDOW_FRAME_COLUMN_WIDTH (W)))
582 576
583/* Total width of fringes reserved for drawing truncation bitmaps, 577/* Total width of fringes reserved for drawing truncation bitmaps,
@@ -586,37 +580,37 @@ struct window
586 sizes aren't pixel values. If it weren't the case, we wouldn't be 580 sizes aren't pixel values. If it weren't the case, we wouldn't be
587 able to split windows horizontally nicely. */ 581 able to split windows horizontally nicely. */
588 582
589#define WINDOW_FRINGE_COLS(W) \ 583#define WINDOW_FRINGE_COLS(W) \
590 ((INTEGERP (WGET (W, left_fringe_width)) \ 584 ((INTEGERP (W->left_fringe_width) \
591 || INTEGERP (WGET (W, right_fringe_width))) \ 585 || INTEGERP (W->right_fringe_width)) \
592 ? ((WINDOW_LEFT_FRINGE_WIDTH (W) \ 586 ? ((WINDOW_LEFT_FRINGE_WIDTH (W) \
593 + WINDOW_RIGHT_FRINGE_WIDTH (W) \ 587 + WINDOW_RIGHT_FRINGE_WIDTH (W) \
594 + WINDOW_FRAME_COLUMN_WIDTH (W) - 1) \ 588 + WINDOW_FRAME_COLUMN_WIDTH (W) - 1) \
595 / WINDOW_FRAME_COLUMN_WIDTH (W)) \ 589 / WINDOW_FRAME_COLUMN_WIDTH (W)) \
596 : FRAME_FRINGE_COLS (WINDOW_XFRAME (W))) 590 : FRAME_FRINGE_COLS (WINDOW_XFRAME (W)))
597 591
598/* Column-width of the left and right fringe. */ 592/* Column-width of the left and right fringe. */
599 593
600#define WINDOW_LEFT_FRINGE_COLS(W) \ 594#define WINDOW_LEFT_FRINGE_COLS(W) \
601 ((WINDOW_LEFT_FRINGE_WIDTH ((W)) \ 595 ((WINDOW_LEFT_FRINGE_WIDTH ((W)) \
602 + WINDOW_FRAME_COLUMN_WIDTH (W) - 1) \ 596 + WINDOW_FRAME_COLUMN_WIDTH (W) - 1) \
603 / WINDOW_FRAME_COLUMN_WIDTH (W)) 597 / WINDOW_FRAME_COLUMN_WIDTH (W))
604 598
605#define WINDOW_RIGHT_FRINGE_COLS(W) \ 599#define WINDOW_RIGHT_FRINGE_COLS(W) \
606 ((WINDOW_RIGHT_FRINGE_WIDTH ((W)) \ 600 ((WINDOW_RIGHT_FRINGE_WIDTH ((W)) \
607 + WINDOW_FRAME_COLUMN_WIDTH (W) - 1) \ 601 + WINDOW_FRAME_COLUMN_WIDTH (W) - 1) \
608 / WINDOW_FRAME_COLUMN_WIDTH (W)) 602 / WINDOW_FRAME_COLUMN_WIDTH (W))
609 603
610/* Pixel-width of the left and right fringe. */ 604/* Pixel-width of the left and right fringe. */
611 605
612#define WINDOW_LEFT_FRINGE_WIDTH(W) \ 606#define WINDOW_LEFT_FRINGE_WIDTH(W) \
613 (INTEGERP (WGET (W, left_fringe_width)) \ 607 (INTEGERP (W->left_fringe_width) \
614 ? XFASTINT (WGET (W, left_fringe_width)) \ 608 ? XFASTINT (W->left_fringe_width) \
615 : FRAME_LEFT_FRINGE_WIDTH (WINDOW_XFRAME (W))) 609 : FRAME_LEFT_FRINGE_WIDTH (WINDOW_XFRAME (W)))
616 610
617#define WINDOW_RIGHT_FRINGE_WIDTH(W) \ 611#define WINDOW_RIGHT_FRINGE_WIDTH(W) \
618 (INTEGERP (WGET (W, right_fringe_width)) \ 612 (INTEGERP (W->right_fringe_width) \
619 ? XFASTINT (WGET (W, right_fringe_width)) \ 613 ? XFASTINT (W->right_fringe_width) \
620 : FRAME_RIGHT_FRINGE_WIDTH (WINDOW_XFRAME (W))) 614 : FRAME_RIGHT_FRINGE_WIDTH (WINDOW_XFRAME (W)))
621 615
622/* Total width of fringes in pixels. */ 616/* Total width of fringes in pixels. */
@@ -633,36 +627,36 @@ struct window
633 and which side they are on. */ 627 and which side they are on. */
634 628
635#define WINDOW_VERTICAL_SCROLL_BAR_TYPE(w) \ 629#define WINDOW_VERTICAL_SCROLL_BAR_TYPE(w) \
636 (EQ (WGET (w, vertical_scroll_bar_type), Qt) \ 630 (EQ (w->vertical_scroll_bar_type, Qt) \
637 ? FRAME_VERTICAL_SCROLL_BAR_TYPE (WINDOW_XFRAME (w)) \ 631 ? FRAME_VERTICAL_SCROLL_BAR_TYPE (WINDOW_XFRAME (w)) \
638 : EQ (WGET (w, vertical_scroll_bar_type), Qleft) \ 632 : EQ (w->vertical_scroll_bar_type, Qleft) \
639 ? vertical_scroll_bar_left \ 633 ? vertical_scroll_bar_left \
640 : EQ (WGET (w, vertical_scroll_bar_type), Qright) \ 634 : EQ (w->vertical_scroll_bar_type, Qright) \
641 ? vertical_scroll_bar_right \ 635 ? vertical_scroll_bar_right \
642 : vertical_scroll_bar_none) \ 636 : vertical_scroll_bar_none) \
643 637
644#define WINDOW_HAS_VERTICAL_SCROLL_BAR(w) \ 638#define WINDOW_HAS_VERTICAL_SCROLL_BAR(w) \
645 (EQ (WGET (w, vertical_scroll_bar_type), Qt) \ 639 (EQ (w->vertical_scroll_bar_type, Qt) \
646 ? FRAME_HAS_VERTICAL_SCROLL_BARS (WINDOW_XFRAME (w)) \ 640 ? FRAME_HAS_VERTICAL_SCROLL_BARS (WINDOW_XFRAME (w)) \
647 : !NILP (WGET (w, vertical_scroll_bar_type))) 641 : !NILP (w->vertical_scroll_bar_type))
648 642
649#define WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT(w) \ 643#define WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT(w) \
650 (EQ (WGET (w, vertical_scroll_bar_type), Qt) \ 644 (EQ (w->vertical_scroll_bar_type, Qt) \
651 ? FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT (WINDOW_XFRAME (w)) \ 645 ? FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT (WINDOW_XFRAME (w)) \
652 : EQ (WGET (w, vertical_scroll_bar_type), Qleft)) 646 : EQ (w->vertical_scroll_bar_type, Qleft))
653 647
654#define WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_RIGHT(w) \ 648#define WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_RIGHT(w) \
655 (EQ (WGET (w, vertical_scroll_bar_type), Qt) \ 649 (EQ (w->vertical_scroll_bar_type, Qt) \
656 ? FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT (WINDOW_XFRAME (w))\ 650 ? FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT (WINDOW_XFRAME (w)) \
657 : EQ (WGET (w, vertical_scroll_bar_type), Qright)) 651 : EQ (w->vertical_scroll_bar_type, Qright))
658 652
659/* Width that a scroll bar in window W should have, if there is one. 653/* Width that a scroll bar in window W should have, if there is one.
660 Measured in pixels. If scroll bars are turned off, this is still 654 Measured in pixels. If scroll bars are turned off, this is still
661 nonzero. */ 655 nonzero. */
662 656
663#define WINDOW_CONFIG_SCROLL_BAR_WIDTH(w) \ 657#define WINDOW_CONFIG_SCROLL_BAR_WIDTH(w) \
664 (INTEGERP (WGET (w, scroll_bar_width)) \ 658 (INTEGERP (w->scroll_bar_width) \
665 ? XFASTINT (WGET (w, scroll_bar_width)) \ 659 ? XFASTINT (w->scroll_bar_width) \
666 : FRAME_CONFIG_SCROLL_BAR_WIDTH (WINDOW_XFRAME (w))) 660 : FRAME_CONFIG_SCROLL_BAR_WIDTH (WINDOW_XFRAME (w)))
667 661
668/* Width that a scroll bar in window W should have, if there is one. 662/* Width that a scroll bar in window W should have, if there is one.
@@ -670,8 +664,8 @@ struct window
670 this is still nonzero. */ 664 this is still nonzero. */
671 665
672#define WINDOW_CONFIG_SCROLL_BAR_COLS(w) \ 666#define WINDOW_CONFIG_SCROLL_BAR_COLS(w) \
673 (INTEGERP (WGET (w, scroll_bar_width)) \ 667 (INTEGERP (w->scroll_bar_width) \
674 ? ((XFASTINT (WGET (w, scroll_bar_width)) \ 668 ? ((XFASTINT (w->scroll_bar_width) \
675 + WINDOW_FRAME_COLUMN_WIDTH (w) - 1) \ 669 + WINDOW_FRAME_COLUMN_WIDTH (w) - 1) \
676 / WINDOW_FRAME_COLUMN_WIDTH (w)) \ 670 / WINDOW_FRAME_COLUMN_WIDTH (w)) \
677 : FRAME_CONFIG_SCROLL_BAR_COLS (WINDOW_XFRAME (w))) 671 : FRAME_CONFIG_SCROLL_BAR_COLS (WINDOW_XFRAME (w)))
@@ -681,14 +675,14 @@ struct window
681 the right in this frame, or there are no scroll bars, value is 0. */ 675 the right in this frame, or there are no scroll bars, value is 0. */
682 676
683#define WINDOW_LEFT_SCROLL_BAR_COLS(w) \ 677#define WINDOW_LEFT_SCROLL_BAR_COLS(w) \
684 (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT (w) \ 678 (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT (w) \
685 ? (WINDOW_CONFIG_SCROLL_BAR_COLS (w)) \ 679 ? (WINDOW_CONFIG_SCROLL_BAR_COLS (w)) \
686 : 0) 680 : 0)
687 681
688/* Width of a left scroll bar area in window W , measured in pixels. */ 682/* Width of a left scroll bar area in window W , measured in pixels. */
689 683
690#define WINDOW_LEFT_SCROLL_BAR_AREA_WIDTH(w) \ 684#define WINDOW_LEFT_SCROLL_BAR_AREA_WIDTH(w) \
691 (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT (w) \ 685 (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT (w) \
692 ? (WINDOW_CONFIG_SCROLL_BAR_COLS (w) * WINDOW_FRAME_COLUMN_WIDTH (w)) \ 686 ? (WINDOW_CONFIG_SCROLL_BAR_COLS (w) * WINDOW_FRAME_COLUMN_WIDTH (w)) \
693 : 0) 687 : 0)
694 688
@@ -697,7 +691,7 @@ struct window
697 the left in this frame, or there are no scroll bars, value is 0. */ 691 the left in this frame, or there are no scroll bars, value is 0. */
698 692
699#define WINDOW_RIGHT_SCROLL_BAR_COLS(w) \ 693#define WINDOW_RIGHT_SCROLL_BAR_COLS(w) \
700 (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_RIGHT (w) \ 694 (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_RIGHT (w) \
701 ? WINDOW_CONFIG_SCROLL_BAR_COLS (w) \ 695 ? WINDOW_CONFIG_SCROLL_BAR_COLS (w) \
702 : 0) 696 : 0)
703 697
@@ -719,7 +713,7 @@ struct window
719/* Width of a left scroll bar area in window W , measured in pixels. */ 713/* Width of a left scroll bar area in window W , measured in pixels. */
720 714
721#define WINDOW_SCROLL_BAR_AREA_WIDTH(w) \ 715#define WINDOW_SCROLL_BAR_AREA_WIDTH(w) \
722 (WINDOW_HAS_VERTICAL_SCROLL_BAR (w) \ 716 (WINDOW_HAS_VERTICAL_SCROLL_BAR (w) \
723 ? (WINDOW_CONFIG_SCROLL_BAR_COLS (w) * WINDOW_FRAME_COLUMN_WIDTH (w)) \ 717 ? (WINDOW_CONFIG_SCROLL_BAR_COLS (w) * WINDOW_FRAME_COLUMN_WIDTH (w)) \
724 : 0) 718 : 0)
725 719
@@ -740,7 +734,7 @@ struct window
740 ? CURRENT_MODE_LINE_HEIGHT (W) \ 734 ? CURRENT_MODE_LINE_HEIGHT (W) \
741 : 0) 735 : 0)
742 736
743#define WINDOW_MODE_LINE_LINES(W) \ 737#define WINDOW_MODE_LINE_LINES(W) \
744 (!! WINDOW_WANTS_MODELINE_P ((W))) 738 (!! WINDOW_WANTS_MODELINE_P ((W)))
745 739
746/* Height in pixels, and in lines, of the header line. 740/* Height in pixels, and in lines, of the header line.
@@ -751,7 +745,7 @@ struct window
751 ? CURRENT_HEADER_LINE_HEIGHT (W) \ 745 ? CURRENT_HEADER_LINE_HEIGHT (W) \
752 : 0) 746 : 0)
753 747
754#define WINDOW_HEADER_LINE_LINES(W) \ 748#define WINDOW_HEADER_LINE_LINES(W) \
755 (!! WINDOW_WANTS_HEADER_LINE_P ((W))) 749 (!! WINDOW_WANTS_HEADER_LINE_P ((W)))
756 750
757/* Pixel height of window W without mode line. */ 751/* Pixel height of window W without mode line. */
@@ -762,36 +756,36 @@ struct window
762 756
763/* Pixel height of window W without mode and header line. */ 757/* Pixel height of window W without mode and header line. */
764 758
765#define WINDOW_BOX_TEXT_HEIGHT(W) \ 759#define WINDOW_BOX_TEXT_HEIGHT(W) \
766 (WINDOW_TOTAL_HEIGHT ((W)) \ 760 (WINDOW_TOTAL_HEIGHT ((W)) \
767 - WINDOW_MODE_LINE_HEIGHT ((W)) \ 761 - WINDOW_MODE_LINE_HEIGHT ((W)) \
768 - WINDOW_HEADER_LINE_HEIGHT ((W))) 762 - WINDOW_HEADER_LINE_HEIGHT ((W)))
769 763
770 764
771/* Convert window W relative pixel X to frame pixel coordinates. */ 765/* Convert window W relative pixel X to frame pixel coordinates. */
772 766
773#define WINDOW_TO_FRAME_PIXEL_X(W, X) \ 767#define WINDOW_TO_FRAME_PIXEL_X(W, X) \
774 ((X) + WINDOW_BOX_LEFT_EDGE_X ((W))) 768 ((X) + WINDOW_BOX_LEFT_EDGE_X ((W)))
775 769
776/* Convert window W relative pixel Y to frame pixel coordinates. */ 770/* Convert window W relative pixel Y to frame pixel coordinates. */
777 771
778#define WINDOW_TO_FRAME_PIXEL_Y(W, Y) \ 772#define WINDOW_TO_FRAME_PIXEL_Y(W, Y) \
779 ((Y) + WINDOW_TOP_EDGE_Y ((W))) 773 ((Y) + WINDOW_TOP_EDGE_Y ((W)))
780 774
781/* Convert frame relative pixel X to window relative pixel X. */ 775/* Convert frame relative pixel X to window relative pixel X. */
782 776
783#define FRAME_TO_WINDOW_PIXEL_X(W, X) \ 777#define FRAME_TO_WINDOW_PIXEL_X(W, X) \
784 ((X) - WINDOW_BOX_LEFT_EDGE_X ((W))) 778 ((X) - WINDOW_BOX_LEFT_EDGE_X ((W)))
785 779
786/* Convert frame relative pixel Y to window relative pixel Y. */ 780/* Convert frame relative pixel Y to window relative pixel Y. */
787 781
788#define FRAME_TO_WINDOW_PIXEL_Y(W, Y) \ 782#define FRAME_TO_WINDOW_PIXEL_Y(W, Y) \
789 ((Y) - WINDOW_TOP_EDGE_Y ((W))) 783 ((Y) - WINDOW_TOP_EDGE_Y ((W)))
790 784
791/* Convert a text area relative x-position in window W to frame X 785/* Convert a text area relative x-position in window W to frame X
792 pixel coordinates. */ 786 pixel coordinates. */
793 787
794#define WINDOW_TEXT_TO_FRAME_PIXEL_X(W, X) \ 788#define WINDOW_TEXT_TO_FRAME_PIXEL_X(W, X) \
795 (window_box_left ((W), TEXT_AREA) + (X)) 789 (window_box_left ((W), TEXT_AREA) + (X))
796 790
797/* This is the window in which the terminal's cursor should 791/* This is the window in which the terminal's cursor should
@@ -894,7 +888,7 @@ struct glyph *get_phys_cursor_glyph (struct window *w);
894/* Value is non-zero if WINDOW is a live window. */ 888/* Value is non-zero if WINDOW is a live window. */
895 889
896#define WINDOW_LIVE_P(WINDOW) \ 890#define WINDOW_LIVE_P(WINDOW) \
897 (WINDOWP (WINDOW) && !NILP (WGET (XWINDOW (WINDOW), buffer))) 891 (WINDOWP (WINDOW) && !NILP (XWINDOW (WINDOW)->buffer))
898 892
899/* These used to be in lisp.h. */ 893/* These used to be in lisp.h. */
900 894
diff --git a/src/xdisp.c b/src/xdisp.c
index ed3e48fbc36..abc98224ab6 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -984,7 +984,7 @@ window_text_bottom_y (struct window *w)
984int 984int
985window_box_width (struct window *w, int area) 985window_box_width (struct window *w, int area)
986{ 986{
987 int cols = XFASTINT (WGET (w, total_cols)); 987 int cols = XFASTINT (w->total_cols);
988 int pixels = 0; 988 int pixels = 0;
989 989
990 if (!w->pseudo_window_p) 990 if (!w->pseudo_window_p)
@@ -993,22 +993,22 @@ window_box_width (struct window *w, int area)
993 993
994 if (area == TEXT_AREA) 994 if (area == TEXT_AREA)
995 { 995 {
996 if (INTEGERP (WGET (w, left_margin_cols))) 996 if (INTEGERP (w->left_margin_cols))
997 cols -= XFASTINT (WGET (w, left_margin_cols)); 997 cols -= XFASTINT (w->left_margin_cols);
998 if (INTEGERP (WGET (w, right_margin_cols))) 998 if (INTEGERP (w->right_margin_cols))
999 cols -= XFASTINT (WGET (w, right_margin_cols)); 999 cols -= XFASTINT (w->right_margin_cols);
1000 pixels = -WINDOW_TOTAL_FRINGE_WIDTH (w); 1000 pixels = -WINDOW_TOTAL_FRINGE_WIDTH (w);
1001 } 1001 }
1002 else if (area == LEFT_MARGIN_AREA) 1002 else if (area == LEFT_MARGIN_AREA)
1003 { 1003 {
1004 cols = (INTEGERP (WGET (w, left_margin_cols)) 1004 cols = (INTEGERP (w->left_margin_cols)
1005 ? XFASTINT (WGET (w, left_margin_cols)) : 0); 1005 ? XFASTINT (w->left_margin_cols) : 0);
1006 pixels = 0; 1006 pixels = 0;
1007 } 1007 }
1008 else if (area == RIGHT_MARGIN_AREA) 1008 else if (area == RIGHT_MARGIN_AREA)
1009 { 1009 {
1010 cols = (INTEGERP (WGET (w, right_margin_cols)) 1010 cols = (INTEGERP (w->right_margin_cols)
1011 ? XFASTINT (WGET (w, right_margin_cols)) : 0); 1011 ? XFASTINT (w->right_margin_cols) : 0);
1012 pixels = 0; 1012 pixels = 0;
1013 } 1013 }
1014 } 1014 }
@@ -1023,7 +1023,7 @@ window_box_width (struct window *w, int area)
1023int 1023int
1024window_box_height (struct window *w) 1024window_box_height (struct window *w)
1025{ 1025{
1026 struct frame *f = XFRAME (WGET (w, frame)); 1026 struct frame *f = XFRAME (w->frame);
1027 int height = WINDOW_TOTAL_HEIGHT (w); 1027 int height = WINDOW_TOTAL_HEIGHT (w);
1028 1028
1029 eassert (height >= 0); 1029 eassert (height >= 0);
@@ -1112,7 +1112,7 @@ window_box_right_offset (struct window *w, int area)
1112int 1112int
1113window_box_left (struct window *w, int area) 1113window_box_left (struct window *w, int area)
1114{ 1114{
1115 struct frame *f = XFRAME (WGET (w, frame)); 1115 struct frame *f = XFRAME (w->frame);
1116 int x; 1116 int x;
1117 1117
1118 if (w->pseudo_window_p) 1118 if (w->pseudo_window_p)
@@ -1288,13 +1288,13 @@ pos_visible_p (struct window *w, ptrdiff_t charpos, int *x, int *y,
1288 if (FRAME_INITIAL_P (XFRAME (WINDOW_FRAME (w)))) 1288 if (FRAME_INITIAL_P (XFRAME (WINDOW_FRAME (w))))
1289 return visible_p; 1289 return visible_p;
1290 1290
1291 if (XBUFFER (WGET (w, buffer)) != current_buffer) 1291 if (XBUFFER (w->buffer) != current_buffer)
1292 { 1292 {
1293 old_buffer = current_buffer; 1293 old_buffer = current_buffer;
1294 set_buffer_internal_1 (XBUFFER (WGET (w, buffer))); 1294 set_buffer_internal_1 (XBUFFER (w->buffer));
1295 } 1295 }
1296 1296
1297 SET_TEXT_POS_FROM_MARKER (top, WGET (w, start)); 1297 SET_TEXT_POS_FROM_MARKER (top, w->start);
1298 /* Scrolling a minibuffer window via scroll bar when the echo area 1298 /* Scrolling a minibuffer window via scroll bar when the echo area
1299 shows long text sometimes resets the minibuffer contents behind 1299 shows long text sometimes resets the minibuffer contents behind
1300 our backs. */ 1300 our backs. */
@@ -1913,7 +1913,7 @@ frame_to_window_pixel_xy (struct window *w, int *x, int *y)
1913 { 1913 {
1914 /* A pseudo-window is always full-width, and starts at the 1914 /* A pseudo-window is always full-width, and starts at the
1915 left edge of the frame, plus a frame border. */ 1915 left edge of the frame, plus a frame border. */
1916 struct frame *f = XFRAME (WGET (w, frame)); 1916 struct frame *f = XFRAME (w->frame);
1917 *x -= FRAME_INTERNAL_BORDER_WIDTH (f); 1917 *x -= FRAME_INTERNAL_BORDER_WIDTH (f);
1918 *y = FRAME_TO_WINDOW_PIXEL_Y (w, *y); 1918 *y = FRAME_TO_WINDOW_PIXEL_Y (w, *y);
1919 } 1919 }
@@ -2522,11 +2522,11 @@ static void
2522check_window_end (struct window *w) 2522check_window_end (struct window *w)
2523{ 2523{
2524 if (!MINI_WINDOW_P (w) 2524 if (!MINI_WINDOW_P (w)
2525 && !NILP (WGET (w, window_end_valid))) 2525 && !NILP (w->window_end_valid))
2526 { 2526 {
2527 struct glyph_row *row; 2527 struct glyph_row *row;
2528 eassert ((row = MATRIX_ROW (w->current_matrix, 2528 eassert ((row = MATRIX_ROW (w->current_matrix,
2529 XFASTINT (WGET (w, window_end_vpos))), 2529 XFASTINT (w->window_end_vpos)),
2530 !row->enabled_p 2530 !row->enabled_p
2531 || MATRIX_ROW_DISPLAYS_TEXT_P (row) 2531 || MATRIX_ROW_DISPLAYS_TEXT_P (row)
2532 || MATRIX_ROW_VPOS (row, w->current_matrix) == 0)); 2532 || MATRIX_ROW_VPOS (row, w->current_matrix) == 0));
@@ -2592,7 +2592,7 @@ init_iterator (struct it *it, struct window *w,
2592 /* Perhaps remap BASE_FACE_ID to a user-specified alternative. */ 2592 /* Perhaps remap BASE_FACE_ID to a user-specified alternative. */
2593 if (! NILP (Vface_remapping_alist)) 2593 if (! NILP (Vface_remapping_alist))
2594 remapped_base_face_id 2594 remapped_base_face_id
2595 = lookup_basic_face (XFRAME (WGET (w, frame)), base_face_id); 2595 = lookup_basic_face (XFRAME (w->frame), base_face_id);
2596 2596
2597 /* Use one of the mode line rows of W's desired matrix if 2597 /* Use one of the mode line rows of W's desired matrix if
2598 appropriate. */ 2598 appropriate. */
@@ -2620,7 +2620,7 @@ init_iterator (struct it *it, struct window *w,
2620 /* The window in which we iterate over current_buffer: */ 2620 /* The window in which we iterate over current_buffer: */
2621 XSETWINDOW (it->window, w); 2621 XSETWINDOW (it->window, w);
2622 it->w = w; 2622 it->w = w;
2623 it->f = XFRAME (WGET (w, frame)); 2623 it->f = XFRAME (w->frame);
2624 2624
2625 it->cmp_it.id = -1; 2625 it->cmp_it.id = -1;
2626 2626
@@ -2704,13 +2704,13 @@ init_iterator (struct it *it, struct window *w,
2704 2704
2705 /* Get the position at which the redisplay_end_trigger hook should 2705 /* Get the position at which the redisplay_end_trigger hook should
2706 be run, if it is to be run at all. */ 2706 be run, if it is to be run at all. */
2707 if (MARKERP (WGET (w, redisplay_end_trigger)) 2707 if (MARKERP (w->redisplay_end_trigger)
2708 && XMARKER (WGET (w, redisplay_end_trigger))->buffer != 0) 2708 && XMARKER (w->redisplay_end_trigger)->buffer != 0)
2709 it->redisplay_end_trigger_charpos 2709 it->redisplay_end_trigger_charpos
2710 = marker_position (WGET (w, redisplay_end_trigger)); 2710 = marker_position (w->redisplay_end_trigger);
2711 else if (INTEGERP (WGET (w, redisplay_end_trigger))) 2711 else if (INTEGERP (w->redisplay_end_trigger))
2712 it->redisplay_end_trigger_charpos = 2712 it->redisplay_end_trigger_charpos =
2713 clip_to_bounds (PTRDIFF_MIN, XINT (WGET (w, redisplay_end_trigger)), PTRDIFF_MAX); 2713 clip_to_bounds (PTRDIFF_MIN, XINT (w->redisplay_end_trigger), PTRDIFF_MAX);
2714 2714
2715 it->tab_width = SANE_TAB_WIDTH (current_buffer); 2715 it->tab_width = SANE_TAB_WIDTH (current_buffer);
2716 2716
@@ -4408,7 +4408,7 @@ handle_display_prop (struct it *it)
4408 if it was a text property. */ 4408 if it was a text property. */
4409 4409
4410 if (!STRINGP (it->string)) 4410 if (!STRINGP (it->string))
4411 object = WGET (it->w, buffer); 4411 object = it->w->buffer;
4412 4412
4413 display_replaced_p = handle_display_spec (it, propval, object, overlay, 4413 display_replaced_p = handle_display_spec (it, propval, object, overlay,
4414 position, bufpos, 4414 position, bufpos,
@@ -4816,7 +4816,7 @@ handle_single_display_spec (struct it *it, Lisp_Object spec, Lisp_Object object,
4816 it->what = IT_IMAGE; 4816 it->what = IT_IMAGE;
4817 it->image_id = -1; /* no image */ 4817 it->image_id = -1; /* no image */
4818 it->position = start_pos; 4818 it->position = start_pos;
4819 it->object = NILP (object) ? WGET (it->w, buffer) : object; 4819 it->object = NILP (object) ? it->w->buffer : object;
4820 it->method = GET_FROM_IMAGE; 4820 it->method = GET_FROM_IMAGE;
4821 it->from_overlay = Qnil; 4821 it->from_overlay = Qnil;
4822 it->face_id = face_id; 4822 it->face_id = face_id;
@@ -4962,7 +4962,7 @@ handle_single_display_spec (struct it *it, Lisp_Object spec, Lisp_Object object,
4962 it->what = IT_IMAGE; 4962 it->what = IT_IMAGE;
4963 it->image_id = lookup_image (it->f, value); 4963 it->image_id = lookup_image (it->f, value);
4964 it->position = start_pos; 4964 it->position = start_pos;
4965 it->object = NILP (object) ? WGET (it->w, buffer) : object; 4965 it->object = NILP (object) ? it->w->buffer : object;
4966 it->method = GET_FROM_IMAGE; 4966 it->method = GET_FROM_IMAGE;
4967 4967
4968 /* Say that we haven't consumed the characters with 4968 /* Say that we haven't consumed the characters with
@@ -5785,7 +5785,7 @@ pop_it (struct it *it)
5785 it->object = p->u.stretch.object; 5785 it->object = p->u.stretch.object;
5786 break; 5786 break;
5787 case GET_FROM_BUFFER: 5787 case GET_FROM_BUFFER:
5788 it->object = WGET (it->w, buffer); 5788 it->object = it->w->buffer;
5789 break; 5789 break;
5790 case GET_FROM_STRING: 5790 case GET_FROM_STRING:
5791 it->object = it->string; 5791 it->object = it->string;
@@ -5798,7 +5798,7 @@ pop_it (struct it *it)
5798 else 5798 else
5799 { 5799 {
5800 it->method = GET_FROM_BUFFER; 5800 it->method = GET_FROM_BUFFER;
5801 it->object = WGET (it->w, buffer); 5801 it->object = it->w->buffer;
5802 } 5802 }
5803 } 5803 }
5804 it->end_charpos = p->end_charpos; 5804 it->end_charpos = p->end_charpos;
@@ -6236,7 +6236,7 @@ reseat_1 (struct it *it, struct text_pos pos, int set_stop_p)
6236 IT_STRING_BYTEPOS (*it) = -1; 6236 IT_STRING_BYTEPOS (*it) = -1;
6237 it->string = Qnil; 6237 it->string = Qnil;
6238 it->method = GET_FROM_BUFFER; 6238 it->method = GET_FROM_BUFFER;
6239 it->object = WGET (it->w, buffer); 6239 it->object = it->w->buffer;
6240 it->area = TEXT_AREA; 6240 it->area = TEXT_AREA;
6241 it->multibyte_p = !NILP (BVAR (current_buffer, enable_multibyte_characters)); 6241 it->multibyte_p = !NILP (BVAR (current_buffer, enable_multibyte_characters));
6242 it->sp = 0; 6242 it->sp = 0;
@@ -7085,7 +7085,7 @@ set_iterator_to_next (struct it *it, int reseat_p)
7085 else 7085 else
7086 { 7086 {
7087 it->method = GET_FROM_BUFFER; 7087 it->method = GET_FROM_BUFFER;
7088 it->object = WGET (it->w, buffer); 7088 it->object = it->w->buffer;
7089 } 7089 }
7090 7090
7091 it->dpvec = NULL; 7091 it->dpvec = NULL;
@@ -7660,7 +7660,7 @@ next_element_from_ellipsis (struct it *it)
7660 setting face_before_selective_p. */ 7660 setting face_before_selective_p. */
7661 it->saved_face_id = it->face_id; 7661 it->saved_face_id = it->face_id;
7662 it->method = GET_FROM_BUFFER; 7662 it->method = GET_FROM_BUFFER;
7663 it->object = WGET (it->w, buffer); 7663 it->object = it->w->buffer;
7664 reseat_at_next_visible_line_start (it, 1); 7664 reseat_at_next_visible_line_start (it, 1);
7665 it->face_before_selective_p = 1; 7665 it->face_before_selective_p = 1;
7666 } 7666 }
@@ -7924,7 +7924,7 @@ next_element_from_buffer (struct it *it)
7924 7924
7925 /* Record what we have and where it came from. */ 7925 /* Record what we have and where it came from. */
7926 it->what = IT_CHARACTER; 7926 it->what = IT_CHARACTER;
7927 it->object = WGET (it->w, buffer); 7927 it->object = it->w->buffer;
7928 it->position = it->current.pos; 7928 it->position = it->current.pos;
7929 7929
7930 /* Normally we return the character found above, except when we 7930 /* Normally we return the character found above, except when we
@@ -8030,7 +8030,7 @@ next_element_from_composition (struct it *it)
8030 return 0; 8030 return 0;
8031 } 8031 }
8032 it->position = it->current.pos; 8032 it->position = it->current.pos;
8033 it->object = WGET (it->w, buffer); 8033 it->object = it->w->buffer;
8034 it->c = composition_update_it (&it->cmp_it, IT_CHARPOS (*it), 8034 it->c = composition_update_it (&it->cmp_it, IT_CHARPOS (*it),
8035 IT_BYTEPOS (*it), Qnil); 8035 IT_BYTEPOS (*it), Qnil);
8036 } 8036 }
@@ -8891,7 +8891,7 @@ move_it_to (struct it *it, ptrdiff_t to_charpos, int to_x, int to_y, int to_vpos
8891 && it->current_x == it->last_visible_x - 1 8891 && it->current_x == it->last_visible_x - 1
8892 && it->c != '\n' 8892 && it->c != '\n'
8893 && it->c != '\t' 8893 && it->c != '\t'
8894 && it->vpos < XFASTINT (WGET (it->w, window_end_vpos))) 8894 && it->vpos < XFASTINT (it->w->window_end_vpos))
8895 { 8895 {
8896 it->continuation_lines_width += it->current_x; 8896 it->continuation_lines_width += it->current_x;
8897 it->current_x = it->hpos = it->max_ascent = it->max_descent = 0; 8897 it->current_x = it->hpos = it->max_ascent = it->max_descent = 0;
@@ -9643,7 +9643,7 @@ message3_nolog (Lisp_Object m, ptrdiff_t nbytes, int multibyte)
9643 /* Get the frame containing the mini-buffer 9643 /* Get the frame containing the mini-buffer
9644 that the selected frame is using. */ 9644 that the selected frame is using. */
9645 mini_window = FRAME_MINIBUF_WINDOW (sf); 9645 mini_window = FRAME_MINIBUF_WINDOW (sf);
9646 frame = WGET (XWINDOW (mini_window), frame); 9646 frame = XWINDOW (mini_window)->frame;
9647 f = XFRAME (frame); 9647 f = XFRAME (frame);
9648 9648
9649 FRAME_SAMPLE_VISIBILITY (f); 9649 FRAME_SAMPLE_VISIBILITY (f);
@@ -9970,7 +9970,7 @@ with_echo_area_buffer (struct window *w, int which,
9970 if (w) 9970 if (w)
9971 { 9971 {
9972 WSET (w, buffer, buffer); 9972 WSET (w, buffer, buffer);
9973 set_marker_both (WGET (w, pointm), buffer, BEG, BEG_BYTE); 9973 set_marker_both (w->pointm, buffer, BEG, BEG_BYTE);
9974 } 9974 }
9975 9975
9976 BVAR (current_buffer, undo_list) = Qt; 9976 BVAR (current_buffer, undo_list) = Qt;
@@ -10018,9 +10018,9 @@ with_echo_area_buffer_unwind_data (struct window *w)
10018 if (w) 10018 if (w)
10019 { 10019 {
10020 XSETWINDOW (tmp, w); ASET (vector, i, tmp); ++i; 10020 XSETWINDOW (tmp, w); ASET (vector, i, tmp); ++i;
10021 ASET (vector, i, WGET (w, buffer)); ++i; 10021 ASET (vector, i, w->buffer); ++i;
10022 ASET (vector, i, make_number (XMARKER (WGET (w, pointm))->charpos)); ++i; 10022 ASET (vector, i, make_number (XMARKER (w->pointm)->charpos)); ++i;
10023 ASET (vector, i, make_number (XMARKER (WGET (w, pointm))->bytepos)); ++i; 10023 ASET (vector, i, make_number (XMARKER (w->pointm)->bytepos)); ++i;
10024 } 10024 }
10025 else 10025 else
10026 { 10026 {
@@ -10055,7 +10055,7 @@ unwind_with_echo_area_buffer (Lisp_Object vector)
10055 bytepos = AREF (vector, 6); 10055 bytepos = AREF (vector, 6);
10056 10056
10057 WSET (w, buffer, buffer); 10057 WSET (w, buffer, buffer);
10058 set_marker_both (WGET (w, pointm), buffer, 10058 set_marker_both (w->pointm, buffer,
10059 XFASTINT (charpos), XFASTINT (bytepos)); 10059 XFASTINT (charpos), XFASTINT (bytepos));
10060 } 10060 }
10061 10061
@@ -10194,7 +10194,7 @@ display_echo_area_1 (ptrdiff_t a1, Lisp_Object a2, ptrdiff_t a3, ptrdiff_t a4)
10194 window_height_changed_p = resize_mini_window (w, 0); 10194 window_height_changed_p = resize_mini_window (w, 0);
10195 10195
10196 /* Use the starting position chosen by resize_mini_window. */ 10196 /* Use the starting position chosen by resize_mini_window. */
10197 SET_TEXT_POS_FROM_MARKER (start, WGET (w, start)); 10197 SET_TEXT_POS_FROM_MARKER (start, w->start);
10198 10198
10199 /* Display. */ 10199 /* Display. */
10200 clear_glyph_matrix (w->desired_matrix); 10200 clear_glyph_matrix (w->desired_matrix);
@@ -10265,15 +10265,15 @@ resize_mini_window_1 (ptrdiff_t a1, Lisp_Object exactly, ptrdiff_t a3, ptrdiff_t
10265int 10265int
10266resize_mini_window (struct window *w, int exact_p) 10266resize_mini_window (struct window *w, int exact_p)
10267{ 10267{
10268 struct frame *f = XFRAME (WGET (w, frame)); 10268 struct frame *f = XFRAME (w->frame);
10269 int window_height_changed_p = 0; 10269 int window_height_changed_p = 0;
10270 10270
10271 eassert (MINI_WINDOW_P (w)); 10271 eassert (MINI_WINDOW_P (w));
10272 10272
10273 /* By default, start display at the beginning. */ 10273 /* By default, start display at the beginning. */
10274 set_marker_both (WGET (w, start), WGET (w, buffer), 10274 set_marker_both (w->start, w->buffer,
10275 BUF_BEGV (XBUFFER (WGET (w, buffer))), 10275 BUF_BEGV (XBUFFER (w->buffer)),
10276 BUF_BEGV_BYTE (XBUFFER (WGET (w, buffer)))); 10276 BUF_BEGV_BYTE (XBUFFER (w->buffer)));
10277 10277
10278 /* Don't resize windows while redisplaying a window; it would 10278 /* Don't resize windows while redisplaying a window; it would
10279 confuse redisplay functions when the size of the window they are 10279 confuse redisplay functions when the size of the window they are
@@ -10300,10 +10300,10 @@ resize_mini_window (struct window *w, int exact_p)
10300 struct text_pos start; 10300 struct text_pos start;
10301 struct buffer *old_current_buffer = NULL; 10301 struct buffer *old_current_buffer = NULL;
10302 10302
10303 if (current_buffer != XBUFFER (WGET (w, buffer))) 10303 if (current_buffer != XBUFFER (w->buffer))
10304 { 10304 {
10305 old_current_buffer = current_buffer; 10305 old_current_buffer = current_buffer;
10306 set_buffer_internal (XBUFFER (WGET (w, buffer))); 10306 set_buffer_internal (XBUFFER (w->buffer));
10307 } 10307 }
10308 10308
10309 init_iterator (&it, w, BEGV, BEGV_BYTE, NULL, DEFAULT_FACE_ID); 10309 init_iterator (&it, w, BEGV, BEGV_BYTE, NULL, DEFAULT_FACE_ID);
@@ -10345,7 +10345,7 @@ resize_mini_window (struct window *w, int exact_p)
10345 } 10345 }
10346 else 10346 else
10347 SET_TEXT_POS (start, BEGV, BEGV_BYTE); 10347 SET_TEXT_POS (start, BEGV, BEGV_BYTE);
10348 SET_MARKER_FROM_TEXT_POS (WGET (w, start), start); 10348 SET_MARKER_FROM_TEXT_POS (w->start, start);
10349 10349
10350 if (EQ (Vresize_mini_windows, Qgrow_only)) 10350 if (EQ (Vresize_mini_windows, Qgrow_only))
10351 { 10351 {
@@ -11053,7 +11053,7 @@ x_consider_frame_title (Lisp_Object frame)
11053 11053
11054 Fselect_window (f->selected_window, Qt); 11054 Fselect_window (f->selected_window, Qt);
11055 set_buffer_internal_1 11055 set_buffer_internal_1
11056 (XBUFFER (WGET (XWINDOW (f->selected_window), buffer))); 11056 (XBUFFER (XWINDOW (f->selected_window)->buffer));
11057 fmt = FRAME_ICONIFIED_P (f) ? Vicon_title_format : Vframe_title_format; 11057 fmt = FRAME_ICONIFIED_P (f) ? Vicon_title_format : Vframe_title_format;
11058 11058
11059 mode_line_target = MODE_LINE_TITLE; 11059 mode_line_target = MODE_LINE_TITLE;
@@ -11172,8 +11172,7 @@ prepare_menu_bars (void)
11172 if (windows_or_buffers_changed 11172 if (windows_or_buffers_changed
11173 && FRAME_NS_P (f)) 11173 && FRAME_NS_P (f))
11174 ns_set_doc_edited 11174 ns_set_doc_edited
11175 (f, Fbuffer_modified_p 11175 (f, Fbuffer_modified_p (XWINDOW (f->selected_window)->buffer));
11176 (WGET (XWINDOW (f->selected_window), buffer)));
11177#endif 11176#endif
11178 UNGCPRO; 11177 UNGCPRO;
11179 } 11178 }
@@ -11238,19 +11237,19 @@ update_menu_bar (struct frame *f, int save_match_data, int hooks_run)
11238 /* This used to test w->update_mode_line, but we believe 11237 /* This used to test w->update_mode_line, but we believe
11239 there is no need to recompute the menu in that case. */ 11238 there is no need to recompute the menu in that case. */
11240 || update_mode_lines 11239 || update_mode_lines
11241 || ((BUF_SAVE_MODIFF (XBUFFER (WGET (w, buffer))) 11240 || ((BUF_SAVE_MODIFF (XBUFFER (w->buffer))
11242 < BUF_MODIFF (XBUFFER (WGET (w, buffer)))) 11241 < BUF_MODIFF (XBUFFER (w->buffer)))
11243 != w->last_had_star) 11242 != w->last_had_star)
11244 || ((!NILP (Vtransient_mark_mode) 11243 || ((!NILP (Vtransient_mark_mode)
11245 && !NILP (BVAR (XBUFFER (WGET (w, buffer)), mark_active))) 11244 && !NILP (BVAR (XBUFFER (w->buffer), mark_active)))
11246 != !NILP (WGET (w, region_showing)))) 11245 != !NILP (w->region_showing)))
11247 { 11246 {
11248 struct buffer *prev = current_buffer; 11247 struct buffer *prev = current_buffer;
11249 ptrdiff_t count = SPECPDL_INDEX (); 11248 ptrdiff_t count = SPECPDL_INDEX ();
11250 11249
11251 specbind (Qinhibit_menubar_update, Qt); 11250 specbind (Qinhibit_menubar_update, Qt);
11252 11251
11253 set_buffer_internal_1 (XBUFFER (WGET (w, buffer))); 11252 set_buffer_internal_1 (XBUFFER (w->buffer));
11254 if (save_match_data) 11253 if (save_match_data)
11255 record_unwind_save_match_data (); 11254 record_unwind_save_match_data ();
11256 if (NILP (Voverriding_local_map_menu_flag)) 11255 if (NILP (Voverriding_local_map_menu_flag))
@@ -11436,12 +11435,12 @@ update_tool_bar (struct frame *f, int save_match_data)
11436 if (windows_or_buffers_changed 11435 if (windows_or_buffers_changed
11437 || w->update_mode_line 11436 || w->update_mode_line
11438 || update_mode_lines 11437 || update_mode_lines
11439 || ((BUF_SAVE_MODIFF (XBUFFER (WGET (w, buffer))) 11438 || ((BUF_SAVE_MODIFF (XBUFFER (w->buffer))
11440 < BUF_MODIFF (XBUFFER (WGET (w, buffer)))) 11439 < BUF_MODIFF (XBUFFER (w->buffer)))
11441 != w->last_had_star) 11440 != w->last_had_star)
11442 || ((!NILP (Vtransient_mark_mode) 11441 || ((!NILP (Vtransient_mark_mode)
11443 && !NILP (BVAR (XBUFFER (WGET (w, buffer)), mark_active))) 11442 && !NILP (BVAR (XBUFFER (w->buffer), mark_active)))
11444 != !NILP (WGET (w, region_showing)))) 11443 != !NILP (w->region_showing)))
11445 { 11444 {
11446 struct buffer *prev = current_buffer; 11445 struct buffer *prev = current_buffer;
11447 ptrdiff_t count = SPECPDL_INDEX (); 11446 ptrdiff_t count = SPECPDL_INDEX ();
@@ -11452,7 +11451,7 @@ update_tool_bar (struct frame *f, int save_match_data)
11452 /* Set current_buffer to the buffer of the selected 11451 /* Set current_buffer to the buffer of the selected
11453 window of the frame, so that we get the right local 11452 window of the frame, so that we get the right local
11454 keymaps. */ 11453 keymaps. */
11455 set_buffer_internal_1 (XBUFFER (WGET (w, buffer))); 11454 set_buffer_internal_1 (XBUFFER (w->buffer));
11456 11455
11457 /* Save match data, if we must. */ 11456 /* Save match data, if we must. */
11458 if (save_match_data) 11457 if (save_match_data)
@@ -12323,10 +12322,10 @@ hscroll_window_tree (Lisp_Object window)
12323 { 12322 {
12324 struct window *w = XWINDOW (window); 12323 struct window *w = XWINDOW (window);
12325 12324
12326 if (WINDOWP (WGET (w, hchild))) 12325 if (WINDOWP (w->hchild))
12327 hscrolled_p |= hscroll_window_tree (WGET (w, hchild)); 12326 hscrolled_p |= hscroll_window_tree (w->hchild);
12328 else if (WINDOWP (WGET (w, vchild))) 12327 else if (WINDOWP (w->vchild))
12329 hscrolled_p |= hscroll_window_tree (WGET (w, vchild)); 12328 hscrolled_p |= hscroll_window_tree (w->vchild);
12330 else if (w->cursor.vpos >= 0) 12329 else if (w->cursor.vpos >= 0)
12331 { 12330 {
12332 int h_margin; 12331 int h_margin;
@@ -12346,7 +12345,7 @@ hscroll_window_tree (Lisp_Object window)
12346 /* Scroll when cursor is inside this scroll margin. */ 12345 /* Scroll when cursor is inside this scroll margin. */
12347 h_margin = hscroll_margin * WINDOW_FRAME_COLUMN_WIDTH (w); 12346 h_margin = hscroll_margin * WINDOW_FRAME_COLUMN_WIDTH (w);
12348 12347
12349 if (!NILP (Fbuffer_local_value (Qauto_hscroll_mode, WGET (w, buffer))) 12348 if (!NILP (Fbuffer_local_value (Qauto_hscroll_mode, w->buffer))
12350 /* For left-to-right rows, hscroll when cursor is either 12349 /* For left-to-right rows, hscroll when cursor is either
12351 (i) inside the right hscroll margin, or (ii) if it is 12350 (i) inside the right hscroll margin, or (ii) if it is
12352 inside the left margin and the window is already 12351 inside the left margin and the window is already
@@ -12381,13 +12380,13 @@ hscroll_window_tree (Lisp_Object window)
12381 12380
12382 /* Find point in a display of infinite width. */ 12381 /* Find point in a display of infinite width. */
12383 saved_current_buffer = current_buffer; 12382 saved_current_buffer = current_buffer;
12384 current_buffer = XBUFFER (WGET (w, buffer)); 12383 current_buffer = XBUFFER (w->buffer);
12385 12384
12386 if (w == XWINDOW (selected_window)) 12385 if (w == XWINDOW (selected_window))
12387 pt = PT; 12386 pt = PT;
12388 else 12387 else
12389 { 12388 {
12390 pt = marker_position (WGET (w, pointm)); 12389 pt = marker_position (w->pointm);
12391 pt = max (BEGV, pt); 12390 pt = max (BEGV, pt);
12392 pt = min (ZV, pt); 12391 pt = min (ZV, pt);
12393 } 12392 }
@@ -12438,14 +12437,14 @@ hscroll_window_tree (Lisp_Object window)
12438 redisplay. */ 12437 redisplay. */
12439 if (w->hscroll != hscroll) 12438 if (w->hscroll != hscroll)
12440 { 12439 {
12441 XBUFFER (WGET (w, buffer))->prevent_redisplay_optimizations_p = 1; 12440 XBUFFER (w->buffer)->prevent_redisplay_optimizations_p = 1;
12442 w->hscroll = hscroll; 12441 w->hscroll = hscroll;
12443 hscrolled_p = 1; 12442 hscrolled_p = 1;
12444 } 12443 }
12445 } 12444 }
12446 } 12445 }
12447 12446
12448 window = WGET (w, next); 12447 window = w->next;
12449 } 12448 }
12450 12449
12451 /* Value is non-zero if hscroll of any leaf window has been changed. */ 12450 /* Value is non-zero if hscroll of any leaf window has been changed. */
@@ -12527,9 +12526,9 @@ debug_method_add (struct window *w, char const *fmt, ...)
12527 if (trace_redisplay_p) 12526 if (trace_redisplay_p)
12528 fprintf (stderr, "%p (%s): %s\n", 12527 fprintf (stderr, "%p (%s): %s\n",
12529 w, 12528 w,
12530 ((BUFFERP (WGET (w, buffer)) 12529 ((BUFFERP (w->buffer)
12531 && STRINGP (BVAR (XBUFFER (WGET (w, buffer)), name))) 12530 && STRINGP (BVAR (XBUFFER (w->buffer), name)))
12532 ? SSDATA (BVAR (XBUFFER (WGET (w, buffer)), name)) 12531 ? SSDATA (BVAR (XBUFFER (w->buffer), name))
12533 : "no buffer"), 12532 : "no buffer"),
12534 method + len); 12533 method + len);
12535} 12534}
@@ -12594,8 +12593,8 @@ text_outside_line_unchanged_p (struct window *w,
12594 require to redisplay the whole paragraph. It might be worthwhile 12593 require to redisplay the whole paragraph. It might be worthwhile
12595 to find the paragraph limits and widen the range of redisplayed 12594 to find the paragraph limits and widen the range of redisplayed
12596 lines to that, but for now just give up this optimization. */ 12595 lines to that, but for now just give up this optimization. */
12597 if (!NILP (BVAR (XBUFFER (WGET (w, buffer)), bidi_display_reordering)) 12596 if (!NILP (BVAR (XBUFFER (w->buffer), bidi_display_reordering))
12598 && NILP (BVAR (XBUFFER (WGET (w, buffer)), bidi_paragraph_direction))) 12597 && NILP (BVAR (XBUFFER (w->buffer), bidi_paragraph_direction)))
12599 unchanged_p = 0; 12598 unchanged_p = 0;
12600 } 12599 }
12601 12600
@@ -12807,7 +12806,7 @@ static inline void
12807reconsider_clip_changes (struct window *w, struct buffer *b) 12806reconsider_clip_changes (struct window *w, struct buffer *b)
12808{ 12807{
12809 if (b->clip_changed 12808 if (b->clip_changed
12810 && !NILP (WGET (w, window_end_valid)) 12809 && !NILP (w->window_end_valid)
12811 && w->current_matrix->buffer == b 12810 && w->current_matrix->buffer == b
12812 && w->current_matrix->zv == BUF_ZV (b) 12811 && w->current_matrix->zv == BUF_ZV (b)
12813 && w->current_matrix->begv == BUF_BEGV (b)) 12812 && w->current_matrix->begv == BUF_BEGV (b))
@@ -12819,20 +12818,20 @@ reconsider_clip_changes (struct window *w, struct buffer *b)
12819 b->clip_changed has already been set to 1, we can skip this 12818 b->clip_changed has already been set to 1, we can skip this
12820 check. */ 12819 check. */
12821 if (!b->clip_changed 12820 if (!b->clip_changed
12822 && BUFFERP (WGET (w, buffer)) && !NILP (WGET (w, window_end_valid))) 12821 && BUFFERP (w->buffer) && !NILP (w->window_end_valid))
12823 { 12822 {
12824 ptrdiff_t pt; 12823 ptrdiff_t pt;
12825 12824
12826 if (w == XWINDOW (selected_window)) 12825 if (w == XWINDOW (selected_window))
12827 pt = PT; 12826 pt = PT;
12828 else 12827 else
12829 pt = marker_position (WGET (w, pointm)); 12828 pt = marker_position (w->pointm);
12830 12829
12831 if ((w->current_matrix->buffer != XBUFFER (WGET (w, buffer)) 12830 if ((w->current_matrix->buffer != XBUFFER (w->buffer)
12832 || pt != w->last_point) 12831 || pt != w->last_point)
12833 && check_point_in_composition (w->current_matrix->buffer, 12832 && check_point_in_composition (w->current_matrix->buffer,
12834 w->last_point, 12833 w->last_point,
12835 XBUFFER (WGET (w, buffer)), pt)) 12834 XBUFFER (w->buffer), pt))
12836 b->clip_changed = 1; 12835 b->clip_changed = 1;
12837 } 12836 }
12838} 12837}
@@ -12915,7 +12914,7 @@ redisplay_internal (void)
12915 /* Don't examine these until after testing Vinhibit_redisplay. 12914 /* Don't examine these until after testing Vinhibit_redisplay.
12916 When Emacs is shutting down, perhaps because its connection to 12915 When Emacs is shutting down, perhaps because its connection to
12917 X has dropped, we should not look at them at all. */ 12916 X has dropped, we should not look at them at all. */
12918 fr = XFRAME (WGET (w, frame)); 12917 fr = XFRAME (w->frame);
12919 sf = SELECTED_FRAME (); 12918 sf = SELECTED_FRAME ();
12920 12919
12921 if (!fr->glyphs_initialized_p) 12920 if (!fr->glyphs_initialized_p)
@@ -13051,18 +13050,18 @@ redisplay_internal (void)
13051 specbind (Qinhibit_point_motion_hooks, Qt); 13050 specbind (Qinhibit_point_motion_hooks, Qt);
13052 13051
13053 /* If %c is in the mode line, update it if needed. */ 13052 /* If %c is in the mode line, update it if needed. */
13054 if (!NILP (WGET (w, column_number_displayed)) 13053 if (!NILP (w->column_number_displayed)
13055 /* This alternative quickly identifies a common case 13054 /* This alternative quickly identifies a common case
13056 where no change is needed. */ 13055 where no change is needed. */
13057 && !(PT == w->last_point 13056 && !(PT == w->last_point
13058 && w->last_modified >= MODIFF 13057 && w->last_modified >= MODIFF
13059 && w->last_overlay_modified >= OVERLAY_MODIFF) 13058 && w->last_overlay_modified >= OVERLAY_MODIFF)
13060 && (XFASTINT (WGET (w, column_number_displayed)) != current_column ())) 13059 && (XFASTINT (w->column_number_displayed) != current_column ()))
13061 w->update_mode_line = 1; 13060 w->update_mode_line = 1;
13062 13061
13063 unbind_to (count1, Qnil); 13062 unbind_to (count1, Qnil);
13064 13063
13065 FRAME_SCROLL_BOTTOM_VPOS (XFRAME (WGET (w, frame))) = -1; 13064 FRAME_SCROLL_BOTTOM_VPOS (XFRAME (w->frame)) = -1;
13066 13065
13067 /* The variable buffer_shared is set in redisplay_window and 13066 /* The variable buffer_shared is set in redisplay_window and
13068 indicates that we redisplay a buffer in different windows. See 13067 indicates that we redisplay a buffer in different windows. See
@@ -13146,11 +13145,11 @@ redisplay_internal (void)
13146 the whole window. The assignment to this_line_start_pos prevents 13145 the whole window. The assignment to this_line_start_pos prevents
13147 the optimization directly below this if-statement. */ 13146 the optimization directly below this if-statement. */
13148 if (((!NILP (Vtransient_mark_mode) 13147 if (((!NILP (Vtransient_mark_mode)
13149 && !NILP (BVAR (XBUFFER (WGET (w, buffer)), mark_active))) 13148 && !NILP (BVAR (XBUFFER (w->buffer), mark_active)))
13150 != !NILP (WGET (w, region_showing))) 13149 != !NILP (w->region_showing))
13151 || (!NILP (WGET (w, region_showing)) 13150 || (!NILP (w->region_showing)
13152 && !EQ (WGET (w, region_showing), 13151 && !EQ (w->region_showing,
13153 Fmarker_position (BVAR (XBUFFER (WGET (w, buffer)), mark))))) 13152 Fmarker_position (BVAR (XBUFFER (w->buffer), mark)))))
13154 CHARPOS (this_line_start_pos) = 0; 13153 CHARPOS (this_line_start_pos) = 0;
13155 13154
13156 /* Optimize the case that only the line containing the cursor in the 13155 /* Optimize the case that only the line containing the cursor in the
@@ -13164,11 +13163,11 @@ redisplay_internal (void)
13164 && !w->update_mode_line 13163 && !w->update_mode_line
13165 && !current_buffer->clip_changed 13164 && !current_buffer->clip_changed
13166 && !current_buffer->prevent_redisplay_optimizations_p 13165 && !current_buffer->prevent_redisplay_optimizations_p
13167 && FRAME_VISIBLE_P (XFRAME (WGET (w, frame))) 13166 && FRAME_VISIBLE_P (XFRAME (w->frame))
13168 && !FRAME_OBSCURED_P (XFRAME (WGET (w, frame))) 13167 && !FRAME_OBSCURED_P (XFRAME (w->frame))
13169 /* Make sure recorded data applies to current buffer, etc. */ 13168 /* Make sure recorded data applies to current buffer, etc. */
13170 && this_line_buffer == current_buffer 13169 && this_line_buffer == current_buffer
13171 && current_buffer == XBUFFER (WGET (w, buffer)) 13170 && current_buffer == XBUFFER (w->buffer)
13172 && !w->force_start 13171 && !w->force_start
13173 && !w->optional_new_start 13172 && !w->optional_new_start
13174 /* Point must be on the line that we have info recorded about. */ 13173 /* Point must be on the line that we have info recorded about. */
@@ -13266,10 +13265,10 @@ redisplay_internal (void)
13266 adjusted. */ 13265 adjusted. */
13267 if ((it.glyph_row - 1)->displays_text_p) 13266 if ((it.glyph_row - 1)->displays_text_p)
13268 { 13267 {
13269 if (XFASTINT (WGET (w, window_end_vpos)) < this_line_vpos) 13268 if (XFASTINT (w->window_end_vpos) < this_line_vpos)
13270 WSET (w, window_end_vpos, make_number (this_line_vpos)); 13269 WSET (w, window_end_vpos, make_number (this_line_vpos));
13271 } 13270 }
13272 else if (XFASTINT (WGET (w, window_end_vpos)) == this_line_vpos 13271 else if (XFASTINT (w->window_end_vpos) == this_line_vpos
13273 && this_line_vpos > 0) 13272 && this_line_vpos > 0)
13274 WSET (w, window_end_vpos, make_number (this_line_vpos - 1)); 13273 WSET (w, window_end_vpos, make_number (this_line_vpos - 1));
13275 WSET (w, window_end_valid, Qnil); 13274 WSET (w, window_end_valid, Qnil);
@@ -13318,7 +13317,7 @@ redisplay_internal (void)
13318 && (EQ (selected_window, 13317 && (EQ (selected_window,
13319 BVAR (current_buffer, last_selected_window)) 13318 BVAR (current_buffer, last_selected_window))
13320 || highlight_nonselected_windows) 13319 || highlight_nonselected_windows)
13321 && NILP (WGET (w, region_showing)) 13320 && NILP (w->region_showing)
13322 && NILP (Vshow_trailing_whitespace) 13321 && NILP (Vshow_trailing_whitespace)
13323 && !cursor_in_echo_area) 13322 && !cursor_in_echo_area)
13324 { 13323 {
@@ -13479,7 +13478,7 @@ redisplay_internal (void)
13479 Lisp_Object mini_window = FRAME_MINIBUF_WINDOW (sf); 13478 Lisp_Object mini_window = FRAME_MINIBUF_WINDOW (sf);
13480 struct frame *mini_frame; 13479 struct frame *mini_frame;
13481 13480
13482 displayed_buffer = XBUFFER (WGET (XWINDOW (selected_window), buffer)); 13481 displayed_buffer = XBUFFER (XWINDOW (selected_window)->buffer);
13483 /* Use list_of_error, not Qerror, so that 13482 /* Use list_of_error, not Qerror, so that
13484 we catch only errors and don't run the debugger. */ 13483 we catch only errors and don't run the debugger. */
13485 internal_condition_case_1 (redisplay_window_1, selected_window, 13484 internal_condition_case_1 (redisplay_window_1, selected_window,
@@ -13545,7 +13544,7 @@ redisplay_internal (void)
13545 /* If we pause after scrolling, some rows in the current 13544 /* If we pause after scrolling, some rows in the current
13546 matrices of some windows are not valid. */ 13545 matrices of some windows are not valid. */
13547 if (!WINDOW_FULL_WIDTH_P (w) 13546 if (!WINDOW_FULL_WIDTH_P (w)
13548 && !FRAME_WINDOW_P (XFRAME (WGET (w, frame)))) 13547 && !FRAME_WINDOW_P (XFRAME (w->frame)))
13549 update_mode_lines = 1; 13548 update_mode_lines = 1;
13550 } 13549 }
13551 else 13550 else
@@ -13703,9 +13702,9 @@ unwind_redisplay (Lisp_Object val)
13703static void 13702static void
13704mark_window_display_accurate_1 (struct window *w, int accurate_p) 13703mark_window_display_accurate_1 (struct window *w, int accurate_p)
13705{ 13704{
13706 if (BUFFERP (WGET (w, buffer))) 13705 if (BUFFERP (w->buffer))
13707 { 13706 {
13708 struct buffer *b = XBUFFER (WGET (w, buffer)); 13707 struct buffer *b = XBUFFER (w->buffer);
13709 13708
13710 w->last_modified = accurate_p ? BUF_MODIFF(b) : 0; 13709 w->last_modified = accurate_p ? BUF_MODIFF(b) : 0;
13711 w->last_overlay_modified = accurate_p ? BUF_OVERLAY_MODIFF(b) : 0; 13710 w->last_overlay_modified = accurate_p ? BUF_OVERLAY_MODIFF(b) : 0;
@@ -13732,13 +13731,13 @@ mark_window_display_accurate_1 (struct window *w, int accurate_p)
13732 if (w == XWINDOW (selected_window)) 13731 if (w == XWINDOW (selected_window))
13733 w->last_point = BUF_PT (b); 13732 w->last_point = BUF_PT (b);
13734 else 13733 else
13735 w->last_point = XMARKER (WGET (w, pointm))->charpos; 13734 w->last_point = XMARKER (w->pointm)->charpos;
13736 } 13735 }
13737 } 13736 }
13738 13737
13739 if (accurate_p) 13738 if (accurate_p)
13740 { 13739 {
13741 WSET (w, window_end_valid, WGET (w, buffer)); 13740 WSET (w, window_end_valid, w->buffer);
13742 w->update_mode_line = 0; 13741 w->update_mode_line = 0;
13743 } 13742 }
13744} 13743}
@@ -13754,15 +13753,15 @@ mark_window_display_accurate (Lisp_Object window, int accurate_p)
13754{ 13753{
13755 struct window *w; 13754 struct window *w;
13756 13755
13757 for (; !NILP (window); window = WGET (w, next)) 13756 for (; !NILP (window); window = w->next)
13758 { 13757 {
13759 w = XWINDOW (window); 13758 w = XWINDOW (window);
13760 mark_window_display_accurate_1 (w, accurate_p); 13759 mark_window_display_accurate_1 (w, accurate_p);
13761 13760
13762 if (!NILP (WGET (w, vchild))) 13761 if (!NILP (w->vchild))
13763 mark_window_display_accurate (WGET (w, vchild), accurate_p); 13762 mark_window_display_accurate (w->vchild, accurate_p);
13764 if (!NILP (WGET (w, hchild))) 13763 if (!NILP (w->hchild))
13765 mark_window_display_accurate (WGET (w, hchild), accurate_p); 13764 mark_window_display_accurate (w->hchild, accurate_p);
13766 } 13765 }
13767 13766
13768 if (accurate_p) 13767 if (accurate_p)
@@ -13822,13 +13821,13 @@ redisplay_windows (Lisp_Object window)
13822 { 13821 {
13823 struct window *w = XWINDOW (window); 13822 struct window *w = XWINDOW (window);
13824 13823
13825 if (!NILP (WGET (w, hchild))) 13824 if (!NILP (w->hchild))
13826 redisplay_windows (WGET (w, hchild)); 13825 redisplay_windows (w->hchild);
13827 else if (!NILP (WGET (w, vchild))) 13826 else if (!NILP (w->vchild))
13828 redisplay_windows (WGET (w, vchild)); 13827 redisplay_windows (w->vchild);
13829 else if (!NILP (WGET (w, buffer))) 13828 else if (!NILP (w->buffer))
13830 { 13829 {
13831 displayed_buffer = XBUFFER (WGET (w, buffer)); 13830 displayed_buffer = XBUFFER (w->buffer);
13832 /* Use list_of_error, not Qerror, so that 13831 /* Use list_of_error, not Qerror, so that
13833 we catch only errors and don't run the debugger. */ 13832 we catch only errors and don't run the debugger. */
13834 internal_condition_case_1 (redisplay_window_0, window, 13833 internal_condition_case_1 (redisplay_window_0, window,
@@ -13836,7 +13835,7 @@ redisplay_windows (Lisp_Object window)
13836 redisplay_window_error); 13835 redisplay_window_error);
13837 } 13836 }
13838 13837
13839 window = WGET (w, next); 13838 window = w->next;
13840 } 13839 }
13841} 13840}
13842 13841
@@ -14470,7 +14469,7 @@ set_cursor_from_row (struct window *w, struct glyph_row *row,
14470 && !MATRIX_ROW_CONTINUATION_LINE_P (row) 14469 && !MATRIX_ROW_CONTINUATION_LINE_P (row)
14471 && row->x == 0) 14470 && row->x == 0)
14472 { 14471 {
14473 this_line_buffer = XBUFFER (WGET (w, buffer)); 14472 this_line_buffer = XBUFFER (w->buffer);
14474 14473
14475 CHARPOS (this_line_start_pos) 14474 CHARPOS (this_line_start_pos)
14476 = MATRIX_ROW_START_CHARPOS (row) + delta; 14475 = MATRIX_ROW_START_CHARPOS (row) + delta;
@@ -14504,19 +14503,19 @@ static inline struct text_pos
14504run_window_scroll_functions (Lisp_Object window, struct text_pos startp) 14503run_window_scroll_functions (Lisp_Object window, struct text_pos startp)
14505{ 14504{
14506 struct window *w = XWINDOW (window); 14505 struct window *w = XWINDOW (window);
14507 SET_MARKER_FROM_TEXT_POS (WGET (w, start), startp); 14506 SET_MARKER_FROM_TEXT_POS (w->start, startp);
14508 14507
14509 if (current_buffer != XBUFFER (WGET (w, buffer))) 14508 if (current_buffer != XBUFFER (w->buffer))
14510 abort (); 14509 abort ();
14511 14510
14512 if (!NILP (Vwindow_scroll_functions)) 14511 if (!NILP (Vwindow_scroll_functions))
14513 { 14512 {
14514 run_hook_with_args_2 (Qwindow_scroll_functions, window, 14513 run_hook_with_args_2 (Qwindow_scroll_functions, window,
14515 make_number (CHARPOS (startp))); 14514 make_number (CHARPOS (startp)));
14516 SET_TEXT_POS_FROM_MARKER (startp, WGET (w, start)); 14515 SET_TEXT_POS_FROM_MARKER (startp, w->start);
14517 /* In case the hook functions switch buffers. */ 14516 /* In case the hook functions switch buffers. */
14518 if (current_buffer != XBUFFER (WGET (w, buffer))) 14517 if (current_buffer != XBUFFER (w->buffer))
14519 set_buffer_internal_1 (XBUFFER (WGET (w, buffer))); 14518 set_buffer_internal_1 (XBUFFER (w->buffer));
14520 } 14519 }
14521 14520
14522 return startp; 14521 return startp;
@@ -14606,7 +14605,7 @@ try_scrolling (Lisp_Object window, int just_this_one_p,
14606 int temp_scroll_step, int last_line_misfit) 14605 int temp_scroll_step, int last_line_misfit)
14607{ 14606{
14608 struct window *w = XWINDOW (window); 14607 struct window *w = XWINDOW (window);
14609 struct frame *f = XFRAME (WGET (w, frame)); 14608 struct frame *f = XFRAME (w->frame);
14610 struct text_pos pos, startp; 14609 struct text_pos pos, startp;
14611 struct it it; 14610 struct it it;
14612 int this_scroll_margin, scroll_max, rc, height; 14611 int this_scroll_margin, scroll_max, rc, height;
@@ -14620,7 +14619,7 @@ try_scrolling (Lisp_Object window, int just_this_one_p,
14620 debug_method_add (w, "try_scrolling"); 14619 debug_method_add (w, "try_scrolling");
14621#endif 14620#endif
14622 14621
14623 SET_TEXT_POS_FROM_MARKER (startp, WGET (w, start)); 14622 SET_TEXT_POS_FROM_MARKER (startp, w->start);
14624 14623
14625 /* Compute scroll margin height in pixels. We scroll when point is 14624 /* Compute scroll margin height in pixels. We scroll when point is
14626 within this distance from the top or bottom of the window. */ 14625 within this distance from the top or bottom of the window. */
@@ -14881,7 +14880,7 @@ compute_window_start_on_continuation_line (struct window *w)
14881 struct text_pos pos, start_pos; 14880 struct text_pos pos, start_pos;
14882 int window_start_changed_p = 0; 14881 int window_start_changed_p = 0;
14883 14882
14884 SET_TEXT_POS_FROM_MARKER (start_pos, WGET (w, start)); 14883 SET_TEXT_POS_FROM_MARKER (start_pos, w->start);
14885 14884
14886 /* If window start is on a continuation line... Window start may be 14885 /* If window start is on a continuation line... Window start may be
14887 < BEGV in case there's invisible text at the start of the 14886 < BEGV in case there's invisible text at the start of the
@@ -14929,7 +14928,7 @@ compute_window_start_on_continuation_line (struct window *w)
14929 } 14928 }
14930 14929
14931 /* Set the window start there. */ 14930 /* Set the window start there. */
14932 SET_MARKER_FROM_TEXT_POS (WGET (w, start), pos); 14931 SET_MARKER_FROM_TEXT_POS (w->start, pos);
14933 window_start_changed_p = 1; 14932 window_start_changed_p = 1;
14934 } 14933 }
14935 } 14934 }
@@ -14965,7 +14964,7 @@ static int
14965try_cursor_movement (Lisp_Object window, struct text_pos startp, int *scroll_step) 14964try_cursor_movement (Lisp_Object window, struct text_pos startp, int *scroll_step)
14966{ 14965{
14967 struct window *w = XWINDOW (window); 14966 struct window *w = XWINDOW (window);
14968 struct frame *f = XFRAME (WGET (w, frame)); 14967 struct frame *f = XFRAME (w->frame);
14969 int rc = CURSOR_MOVEMENT_CANNOT_BE_USED; 14968 int rc = CURSOR_MOVEMENT_CANNOT_BE_USED;
14970 14969
14971#ifdef GLYPH_DEBUG 14970#ifdef GLYPH_DEBUG
@@ -14996,7 +14995,7 @@ try_cursor_movement (Lisp_Object window, struct text_pos startp, int *scroll_ste
14996 set the cursor. */ 14995 set the cursor. */
14997 && !(!NILP (Vtransient_mark_mode) 14996 && !(!NILP (Vtransient_mark_mode)
14998 && !NILP (BVAR (current_buffer, mark_active))) 14997 && !NILP (BVAR (current_buffer, mark_active)))
14999 && NILP (WGET (w, region_showing)) 14998 && NILP (w->region_showing)
15000 && NILP (Vshow_trailing_whitespace) 14999 && NILP (Vshow_trailing_whitespace)
15001 /* This code is not used for mini-buffer for the sake of the case 15000 /* This code is not used for mini-buffer for the sake of the case
15002 of redisplaying to replace an echo area message; since in 15001 of redisplaying to replace an echo area message; since in
@@ -15010,8 +15009,8 @@ try_cursor_movement (Lisp_Object window, struct text_pos startp, int *scroll_ste
15010 larger than the window. This should really be fixed in 15009 larger than the window. This should really be fixed in
15011 window.c. I don't have this on my list, now, so we do 15010 window.c. I don't have this on my list, now, so we do
15012 approximately the same as the old redisplay code. --gerd. */ 15011 approximately the same as the old redisplay code. --gerd. */
15013 && INTEGERP (WGET (w, window_end_vpos)) 15012 && INTEGERP (w->window_end_vpos)
15014 && XFASTINT (WGET (w, window_end_vpos)) < w->current_matrix->nrows 15013 && XFASTINT (w->window_end_vpos) < w->current_matrix->nrows
15015 && (FRAME_WINDOW_P (f) 15014 && (FRAME_WINDOW_P (f)
15016 || !overlay_arrow_in_current_buffer_p ())) 15015 || !overlay_arrow_in_current_buffer_p ()))
15017 { 15016 {
@@ -15148,7 +15147,7 @@ try_cursor_movement (Lisp_Object window, struct text_pos startp, int *scroll_ste
15148 must_scroll = 1; 15147 must_scroll = 1;
15149 } 15148 }
15150 else if (rc != CURSOR_MOVEMENT_SUCCESS 15149 else if (rc != CURSOR_MOVEMENT_SUCCESS
15151 && !NILP (BVAR (XBUFFER (WGET (w, buffer)), bidi_display_reordering))) 15150 && !NILP (BVAR (XBUFFER (w->buffer), bidi_display_reordering)))
15152 { 15151 {
15153 struct glyph_row *row1; 15152 struct glyph_row *row1;
15154 15153
@@ -15211,7 +15210,7 @@ try_cursor_movement (Lisp_Object window, struct text_pos startp, int *scroll_ste
15211 else if (scroll_p) 15210 else if (scroll_p)
15212 rc = CURSOR_MOVEMENT_MUST_SCROLL; 15211 rc = CURSOR_MOVEMENT_MUST_SCROLL;
15213 else if (rc != CURSOR_MOVEMENT_SUCCESS 15212 else if (rc != CURSOR_MOVEMENT_SUCCESS
15214 && !NILP (BVAR (XBUFFER (WGET (w, buffer)), bidi_display_reordering))) 15213 && !NILP (BVAR (XBUFFER (w->buffer), bidi_display_reordering)))
15215 { 15214 {
15216 /* With bidi-reordered rows, there could be more than 15215 /* With bidi-reordered rows, there could be more than
15217 one candidate row whose start and end positions 15216 one candidate row whose start and end positions
@@ -15318,12 +15317,12 @@ set_vertical_scroll_bar (struct window *w)
15318 || (w == XWINDOW (minibuf_window) 15317 || (w == XWINDOW (minibuf_window)
15319 && NILP (echo_area_buffer[0]))) 15318 && NILP (echo_area_buffer[0])))
15320 { 15319 {
15321 struct buffer *buf = XBUFFER (WGET (w, buffer)); 15320 struct buffer *buf = XBUFFER (w->buffer);
15322 whole = BUF_ZV (buf) - BUF_BEGV (buf); 15321 whole = BUF_ZV (buf) - BUF_BEGV (buf);
15323 start = marker_position (WGET (w, start)) - BUF_BEGV (buf); 15322 start = marker_position (w->start) - BUF_BEGV (buf);
15324 /* I don't think this is guaranteed to be right. For the 15323 /* I don't think this is guaranteed to be right. For the
15325 moment, we'll pretend it is. */ 15324 moment, we'll pretend it is. */
15326 end = BUF_Z (buf) - XFASTINT (WGET (w, window_end_pos)) - BUF_BEGV (buf); 15325 end = BUF_Z (buf) - XFASTINT (w->window_end_pos) - BUF_BEGV (buf);
15327 15326
15328 if (end < start) 15327 if (end < start)
15329 end = start; 15328 end = start;
@@ -15334,8 +15333,8 @@ set_vertical_scroll_bar (struct window *w)
15334 start = end = whole = 0; 15333 start = end = whole = 0;
15335 15334
15336 /* Indicate what this scroll bar ought to be displaying now. */ 15335 /* Indicate what this scroll bar ought to be displaying now. */
15337 if (FRAME_TERMINAL (XFRAME (WGET (w, frame)))->set_vertical_scroll_bar_hook) 15336 if (FRAME_TERMINAL (XFRAME (w->frame))->set_vertical_scroll_bar_hook)
15338 (*FRAME_TERMINAL (XFRAME (WGET (w, frame)))->set_vertical_scroll_bar_hook) 15337 (*FRAME_TERMINAL (XFRAME (w->frame))->set_vertical_scroll_bar_hook)
15339 (w, end - start, whole, start); 15338 (w, end - start, whole, start);
15340} 15339}
15341 15340
@@ -15351,8 +15350,8 @@ static void
15351redisplay_window (Lisp_Object window, int just_this_one_p) 15350redisplay_window (Lisp_Object window, int just_this_one_p)
15352{ 15351{
15353 struct window *w = XWINDOW (window); 15352 struct window *w = XWINDOW (window);
15354 struct frame *f = XFRAME (WGET (w, frame)); 15353 struct frame *f = XFRAME (w->frame);
15355 struct buffer *buffer = XBUFFER (WGET (w, buffer)); 15354 struct buffer *buffer = XBUFFER (w->buffer);
15356 struct buffer *old = current_buffer; 15355 struct buffer *old = current_buffer;
15357 struct text_pos lpoint, opoint, startp; 15356 struct text_pos lpoint, opoint, startp;
15358 int update_mode_line; 15357 int update_mode_line;
@@ -15375,7 +15374,7 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
15375 opoint = lpoint; 15374 opoint = lpoint;
15376 15375
15377 /* W must be a leaf window here. */ 15376 /* W must be a leaf window here. */
15378 eassert (!NILP (WGET (w, buffer))); 15377 eassert (!NILP (w->buffer));
15379#ifdef GLYPH_DEBUG 15378#ifdef GLYPH_DEBUG
15380 *w->desired_matrix->method = 0; 15379 *w->desired_matrix->method = 0;
15381#endif 15380#endif
@@ -15405,10 +15404,10 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
15405 else if ((w != XWINDOW (minibuf_window) 15404 else if ((w != XWINDOW (minibuf_window)
15406 || minibuf_level == 0) 15405 || minibuf_level == 0)
15407 /* When buffer is nonempty, redisplay window normally. */ 15406 /* When buffer is nonempty, redisplay window normally. */
15408 && BUF_Z (XBUFFER (WGET (w, buffer))) == BUF_BEG (XBUFFER (WGET (w, buffer))) 15407 && BUF_Z (XBUFFER (w->buffer)) == BUF_BEG (XBUFFER (w->buffer))
15409 /* Quail displays non-mini buffers in minibuffer window. 15408 /* Quail displays non-mini buffers in minibuffer window.
15410 In that case, redisplay the window normally. */ 15409 In that case, redisplay the window normally. */
15411 && !NILP (Fmemq (WGET (w, buffer), Vminibuffer_list))) 15410 && !NILP (Fmemq (w->buffer, Vminibuffer_list)))
15412 { 15411 {
15413 /* W is a mini-buffer window, but it's not active, so clear 15412 /* W is a mini-buffer window, but it's not active, so clear
15414 it. */ 15413 it. */
@@ -15430,10 +15429,10 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
15430 value. */ 15429 value. */
15431 /* Really select the buffer, for the sake of buffer-local 15430 /* Really select the buffer, for the sake of buffer-local
15432 variables. */ 15431 variables. */
15433 set_buffer_internal_1 (XBUFFER (WGET (w, buffer))); 15432 set_buffer_internal_1 (XBUFFER (w->buffer));
15434 15433
15435 current_matrix_up_to_date_p 15434 current_matrix_up_to_date_p
15436 = (!NILP (WGET (w, window_end_valid)) 15435 = (!NILP (w->window_end_valid)
15437 && !current_buffer->clip_changed 15436 && !current_buffer->clip_changed
15438 && !current_buffer->prevent_redisplay_optimizations_p 15437 && !current_buffer->prevent_redisplay_optimizations_p
15439 && w->last_modified >= MODIFF 15438 && w->last_modified >= MODIFF
@@ -15457,7 +15456,7 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
15457 specbind (Qinhibit_point_motion_hooks, Qt); 15456 specbind (Qinhibit_point_motion_hooks, Qt);
15458 15457
15459 buffer_unchanged_p 15458 buffer_unchanged_p
15460 = (!NILP (WGET (w, window_end_valid)) 15459 = (!NILP (w->window_end_valid)
15461 && !current_buffer->clip_changed 15460 && !current_buffer->clip_changed
15462 && w->last_modified >= MODIFF 15461 && w->last_modified >= MODIFF
15463 && w->last_overlay_modified >= OVERLAY_MODIFF); 15462 && w->last_overlay_modified >= OVERLAY_MODIFF);
@@ -15468,7 +15467,7 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
15468 { 15467 {
15469 /* If window starts on a continuation line, maybe adjust the 15468 /* If window starts on a continuation line, maybe adjust the
15470 window start in case the window's width changed. */ 15469 window start in case the window's width changed. */
15471 if (XMARKER (WGET (w, start))->buffer == current_buffer) 15470 if (XMARKER (w->start)->buffer == current_buffer)
15472 compute_window_start_on_continuation_line (w); 15471 compute_window_start_on_continuation_line (w);
15473 15472
15474 WSET (w, window_end_valid, Qnil); 15473 WSET (w, window_end_valid, Qnil);
@@ -15482,13 +15481,13 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
15482 abort (); 15481 abort ();
15483 15482
15484 /* If %c is in mode line, update it if needed. */ 15483 /* If %c is in mode line, update it if needed. */
15485 if (!NILP (WGET (w, column_number_displayed)) 15484 if (!NILP (w->column_number_displayed)
15486 /* This alternative quickly identifies a common case 15485 /* This alternative quickly identifies a common case
15487 where no change is needed. */ 15486 where no change is needed. */
15488 && !(PT == w->last_point 15487 && !(PT == w->last_point
15489 && w->last_modified >= MODIFF 15488 && w->last_modified >= MODIFF
15490 && w->last_overlay_modified >= OVERLAY_MODIFF) 15489 && w->last_overlay_modified >= OVERLAY_MODIFF)
15491 && (XFASTINT (WGET (w, column_number_displayed)) != current_column ())) 15490 && (XFASTINT (w->column_number_displayed) != current_column ()))
15492 update_mode_line = 1; 15491 update_mode_line = 1;
15493 15492
15494 /* Count number of windows showing the selected buffer. An indirect 15493 /* Count number of windows showing the selected buffer. An indirect
@@ -15497,7 +15496,7 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
15497 { 15496 {
15498 struct buffer *current_base, *window_base; 15497 struct buffer *current_base, *window_base;
15499 current_base = current_buffer; 15498 current_base = current_buffer;
15500 window_base = XBUFFER (WGET (XWINDOW (selected_window), buffer)); 15499 window_base = XBUFFER (XWINDOW (selected_window)->buffer);
15501 if (current_base->base_buffer) 15500 if (current_base->base_buffer)
15502 current_base = current_base->base_buffer; 15501 current_base = current_base->base_buffer;
15503 if (window_base->base_buffer) 15502 if (window_base->base_buffer)
@@ -15510,19 +15509,19 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
15510 window, set up appropriate value. */ 15509 window, set up appropriate value. */
15511 if (!EQ (window, selected_window)) 15510 if (!EQ (window, selected_window))
15512 { 15511 {
15513 ptrdiff_t new_pt = XMARKER (WGET (w, pointm))->charpos; 15512 ptrdiff_t new_pt = XMARKER (w->pointm)->charpos;
15514 ptrdiff_t new_pt_byte = marker_byte_position (WGET (w, pointm)); 15513 ptrdiff_t new_pt_byte = marker_byte_position (w->pointm);
15515 if (new_pt < BEGV) 15514 if (new_pt < BEGV)
15516 { 15515 {
15517 new_pt = BEGV; 15516 new_pt = BEGV;
15518 new_pt_byte = BEGV_BYTE; 15517 new_pt_byte = BEGV_BYTE;
15519 set_marker_both (WGET (w, pointm), Qnil, BEGV, BEGV_BYTE); 15518 set_marker_both (w->pointm, Qnil, BEGV, BEGV_BYTE);
15520 } 15519 }
15521 else if (new_pt > (ZV - 1)) 15520 else if (new_pt > (ZV - 1))
15522 { 15521 {
15523 new_pt = ZV; 15522 new_pt = ZV;
15524 new_pt_byte = ZV_BYTE; 15523 new_pt_byte = ZV_BYTE;
15525 set_marker_both (WGET (w, pointm), Qnil, ZV, ZV_BYTE); 15524 set_marker_both (w->pointm, Qnil, ZV, ZV_BYTE);
15526 } 15525 }
15527 15526
15528 /* We don't use SET_PT so that the point-motion hooks don't run. */ 15527 /* We don't use SET_PT so that the point-motion hooks don't run. */
@@ -15549,10 +15548,10 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
15549 } 15548 }
15550 15549
15551 /* If window-start is screwed up, choose a new one. */ 15550 /* If window-start is screwed up, choose a new one. */
15552 if (XMARKER (WGET (w, start))->buffer != current_buffer) 15551 if (XMARKER (w->start)->buffer != current_buffer)
15553 goto recenter; 15552 goto recenter;
15554 15553
15555 SET_TEXT_POS_FROM_MARKER (startp, WGET (w, start)); 15554 SET_TEXT_POS_FROM_MARKER (startp, w->start);
15556 15555
15557 /* If someone specified a new starting point but did not insist, 15556 /* If someone specified a new starting point but did not insist,
15558 check whether it can be used. */ 15557 check whether it can be used. */
@@ -15651,7 +15650,7 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
15651 MATRIX_ROW_START_BYTEPOS (row)); 15650 MATRIX_ROW_START_BYTEPOS (row));
15652 15651
15653 if (w != XWINDOW (selected_window)) 15652 if (w != XWINDOW (selected_window))
15654 set_marker_both (WGET (w, pointm), Qnil, PT, PT_BYTE); 15653 set_marker_both (w->pointm, Qnil, PT, PT_BYTE);
15655 else if (current_buffer == old) 15654 else if (current_buffer == old)
15656 SET_TEXT_POS (lpoint, PT, PT_BYTE); 15655 SET_TEXT_POS (lpoint, PT, PT_BYTE);
15657 15656
@@ -15753,7 +15752,7 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
15753 sets it. So, we need to check the return value of 15752 sets it. So, we need to check the return value of
15754 compute_window_start_on_continuation_line. (See also 15753 compute_window_start_on_continuation_line. (See also
15755 bug#197). */ 15754 bug#197). */
15756 && XMARKER (WGET (w, start))->buffer == current_buffer 15755 && XMARKER (w->start)->buffer == current_buffer
15757 && compute_window_start_on_continuation_line (w) 15756 && compute_window_start_on_continuation_line (w)
15758 /* It doesn't make sense to force the window start like we 15757 /* It doesn't make sense to force the window start like we
15759 do at label force_start if it is already known that point 15758 do at label force_start if it is already known that point
@@ -15764,7 +15763,7 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
15764 && pos_visible_p (w, PT, &d1, &d2, &d3, &d4, &d5, &d6)) 15763 && pos_visible_p (w, PT, &d1, &d2, &d3, &d4, &d5, &d6))
15765 { 15764 {
15766 w->force_start = 1; 15765 w->force_start = 1;
15767 SET_TEXT_POS_FROM_MARKER (startp, WGET (w, start)); 15766 SET_TEXT_POS_FROM_MARKER (startp, w->start);
15768 goto force_start; 15767 goto force_start;
15769 } 15768 }
15770 15769
@@ -15974,7 +15973,7 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
15974 /* Set the window start position here explicitly, to avoid an 15973 /* Set the window start position here explicitly, to avoid an
15975 infinite loop in case the functions in window-scroll-functions 15974 infinite loop in case the functions in window-scroll-functions
15976 get errors. */ 15975 get errors. */
15977 set_marker_both (WGET (w, start), Qnil, IT_CHARPOS (it), IT_BYTEPOS (it)); 15976 set_marker_both (w->start, Qnil, IT_CHARPOS (it), IT_BYTEPOS (it));
15978 15977
15979 /* Run scroll hooks. */ 15978 /* Run scroll hooks. */
15980 startp = run_window_scroll_functions (window, it.current.pos); 15979 startp = run_window_scroll_functions (window, it.current.pos);
@@ -16005,8 +16004,8 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
16005 line.) */ 16004 line.) */
16006 if (w->cursor.vpos < 0) 16005 if (w->cursor.vpos < 0)
16007 { 16006 {
16008 if (!NILP (WGET (w, window_end_valid)) 16007 if (!NILP (w->window_end_valid)
16009 && PT >= Z - XFASTINT (WGET (w, window_end_pos))) 16008 && PT >= Z - XFASTINT (w->window_end_pos))
16010 { 16009 {
16011 clear_glyph_matrix (w->desired_matrix); 16010 clear_glyph_matrix (w->desired_matrix);
16012 move_it_by_lines (&it, 1); 16011 move_it_by_lines (&it, 1);
@@ -16078,7 +16077,7 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
16078 16077
16079 done: 16078 done:
16080 16079
16081 SET_TEXT_POS_FROM_MARKER (startp, WGET (w, start)); 16080 SET_TEXT_POS_FROM_MARKER (startp, w->start);
16082 w->start_at_line_beg = (CHARPOS (startp) == BEGV 16081 w->start_at_line_beg = (CHARPOS (startp) == BEGV
16083 || FETCH_BYTE (BYTEPOS (startp) - 1) == '\n'); 16082 || FETCH_BYTE (BYTEPOS (startp) - 1) == '\n');
16084 16083
@@ -16092,10 +16091,10 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
16092 && !FRAME_WINDOW_P (f) 16091 && !FRAME_WINDOW_P (f)
16093 && !WINDOW_FULL_WIDTH_P (w)) 16092 && !WINDOW_FULL_WIDTH_P (w))
16094 /* Line number to display. */ 16093 /* Line number to display. */
16095 || INTEGERP (WGET (w, base_line_pos)) 16094 || INTEGERP (w->base_line_pos)
16096 /* Column number is displayed and different from the one displayed. */ 16095 /* Column number is displayed and different from the one displayed. */
16097 || (!NILP (WGET (w, column_number_displayed)) 16096 || (!NILP (w->column_number_displayed)
16098 && (XFASTINT (WGET (w, column_number_displayed)) != current_column ()))) 16097 && (XFASTINT (w->column_number_displayed) != current_column ())))
16099 /* This means that the window has a mode line. */ 16098 /* This means that the window has a mode line. */
16100 && (WINDOW_WANTS_MODELINE_P (w) 16099 && (WINDOW_WANTS_MODELINE_P (w)
16101 || WINDOW_WANTS_HEADER_LINE_P (w))) 16100 || WINDOW_WANTS_HEADER_LINE_P (w)))
@@ -16127,7 +16126,7 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
16127 } 16126 }
16128 16127
16129 if (!line_number_displayed 16128 if (!line_number_displayed
16130 && !BUFFERP (WGET (w, base_line_pos))) 16129 && !BUFFERP (w->base_line_pos))
16131 { 16130 {
16132 WSET (w, base_line_pos, Qnil); 16131 WSET (w, base_line_pos, Qnil);
16133 WSET (w, base_line_number, Qnil); 16132 WSET (w, base_line_number, Qnil);
@@ -16243,10 +16242,10 @@ try_window (Lisp_Object window, struct text_pos pos, int flags)
16243 struct window *w = XWINDOW (window); 16242 struct window *w = XWINDOW (window);
16244 struct it it; 16243 struct it it;
16245 struct glyph_row *last_text_row = NULL; 16244 struct glyph_row *last_text_row = NULL;
16246 struct frame *f = XFRAME (WGET (w, frame)); 16245 struct frame *f = XFRAME (w->frame);
16247 16246
16248 /* Make POS the new window start. */ 16247 /* Make POS the new window start. */
16249 set_marker_both (WGET (w, start), Qnil, CHARPOS (pos), BYTEPOS (pos)); 16248 set_marker_both (w->start, Qnil, CHARPOS (pos), BYTEPOS (pos));
16250 16249
16251 /* Mark cursor position as unknown. No overlay arrow seen. */ 16250 /* Mark cursor position as unknown. No overlay arrow seen. */
16252 w->cursor.vpos = -1; 16251 w->cursor.vpos = -1;
@@ -16295,7 +16294,7 @@ try_window (Lisp_Object window, struct text_pos pos, int flags)
16295 } 16294 }
16296 16295
16297 /* If bottom moved off end of frame, change mode line percentage. */ 16296 /* If bottom moved off end of frame, change mode line percentage. */
16298 if (XFASTINT (WGET (w, window_end_pos)) <= 0 16297 if (XFASTINT (w->window_end_pos) <= 0
16299 && Z != IT_CHARPOS (it)) 16298 && Z != IT_CHARPOS (it))
16300 w->update_mode_line = 1; 16299 w->update_mode_line = 1;
16301 16300
@@ -16308,12 +16307,12 @@ try_window (Lisp_Object window, struct text_pos pos, int flags)
16308 w->window_end_bytepos 16307 w->window_end_bytepos
16309 = Z_BYTE - MATRIX_ROW_END_BYTEPOS (last_text_row); 16308 = Z_BYTE - MATRIX_ROW_END_BYTEPOS (last_text_row);
16310 WSET (w, window_end_pos, 16309 WSET (w, window_end_pos,
16311 make_number (Z - MATRIX_ROW_END_CHARPOS (last_text_row))); 16310 make_number (Z - MATRIX_ROW_END_CHARPOS (last_text_row)));
16312 WSET (w, window_end_vpos, 16311 WSET (w, window_end_vpos,
16313 make_number (MATRIX_ROW_VPOS (last_text_row, w->desired_matrix))); 16312 make_number (MATRIX_ROW_VPOS (last_text_row, w->desired_matrix)));
16314 eassert 16313 eassert
16315 (MATRIX_ROW (w->desired_matrix, 16314 (MATRIX_ROW (w->desired_matrix,
16316 XFASTINT (WGET (w, window_end_vpos)))->displays_text_p); 16315 XFASTINT (w->window_end_vpos))->displays_text_p);
16317 } 16316 }
16318 else 16317 else
16319 { 16318 {
@@ -16341,7 +16340,7 @@ try_window (Lisp_Object window, struct text_pos pos, int flags)
16341static int 16340static int
16342try_window_reusing_current_matrix (struct window *w) 16341try_window_reusing_current_matrix (struct window *w)
16343{ 16342{
16344 struct frame *f = XFRAME (WGET (w, frame)); 16343 struct frame *f = XFRAME (w->frame);
16345 struct glyph_row *bottom_row; 16344 struct glyph_row *bottom_row;
16346 struct it it; 16345 struct it it;
16347 struct run run; 16346 struct run run;
@@ -16368,7 +16367,7 @@ try_window_reusing_current_matrix (struct window *w)
16368 /* Can't do this if region may have changed. */ 16367 /* Can't do this if region may have changed. */
16369 if ((!NILP (Vtransient_mark_mode) 16368 if ((!NILP (Vtransient_mark_mode)
16370 && !NILP (BVAR (current_buffer, mark_active))) 16369 && !NILP (BVAR (current_buffer, mark_active)))
16371 || !NILP (WGET (w, region_showing)) 16370 || !NILP (w->region_showing)
16372 || !NILP (Vshow_trailing_whitespace)) 16371 || !NILP (Vshow_trailing_whitespace))
16373 return 0; 16372 return 0;
16374 16373
@@ -16385,7 +16384,7 @@ try_window_reusing_current_matrix (struct window *w)
16385 16384
16386 /* The variable new_start now holds the new window start. The old 16385 /* The variable new_start now holds the new window start. The old
16387 start `start' can be determined from the current matrix. */ 16386 start `start' can be determined from the current matrix. */
16388 SET_TEXT_POS_FROM_MARKER (new_start, WGET (w, start)); 16387 SET_TEXT_POS_FROM_MARKER (new_start, w->start);
16389 start = start_row->minpos; 16388 start = start_row->minpos;
16390 start_vpos = MATRIX_ROW_VPOS (start_row, w->current_matrix); 16389 start_vpos = MATRIX_ROW_VPOS (start_row, w->current_matrix);
16391 16390
@@ -16548,18 +16547,18 @@ try_window_reusing_current_matrix (struct window *w)
16548 w->window_end_bytepos 16547 w->window_end_bytepos
16549 = Z_BYTE - MATRIX_ROW_END_BYTEPOS (last_reused_text_row); 16548 = Z_BYTE - MATRIX_ROW_END_BYTEPOS (last_reused_text_row);
16550 WSET (w, window_end_pos, 16549 WSET (w, window_end_pos,
16551 make_number (Z - MATRIX_ROW_END_CHARPOS (last_reused_text_row))); 16550 make_number (Z - MATRIX_ROW_END_CHARPOS (last_reused_text_row)));
16552 WSET (w, window_end_vpos, 16551 WSET (w, window_end_vpos,
16553 make_number (MATRIX_ROW_VPOS (last_reused_text_row, w->current_matrix))); 16552 make_number (MATRIX_ROW_VPOS (last_reused_text_row, w->current_matrix)));
16554 } 16553 }
16555 else if (last_text_row) 16554 else if (last_text_row)
16556 { 16555 {
16557 w->window_end_bytepos 16556 w->window_end_bytepos
16558 = Z_BYTE - MATRIX_ROW_END_BYTEPOS (last_text_row); 16557 = Z_BYTE - MATRIX_ROW_END_BYTEPOS (last_text_row);
16559 WSET (w, window_end_pos, 16558 WSET (w, window_end_pos,
16560 make_number (Z - MATRIX_ROW_END_CHARPOS (last_text_row))); 16559 make_number (Z - MATRIX_ROW_END_CHARPOS (last_text_row)));
16561 WSET (w, window_end_vpos, 16560 WSET (w, window_end_vpos,
16562 make_number (MATRIX_ROW_VPOS (last_text_row, w->desired_matrix))); 16561 make_number (MATRIX_ROW_VPOS (last_text_row, w->desired_matrix)));
16563 } 16562 }
16564 else 16563 else
16565 { 16564 {
@@ -16722,7 +16721,7 @@ try_window_reusing_current_matrix (struct window *w)
16722 16721
16723 /* Can't use this optimization with bidi-reordered glyph 16722 /* Can't use this optimization with bidi-reordered glyph
16724 rows, unless cursor is already at point. */ 16723 rows, unless cursor is already at point. */
16725 if (!NILP (BVAR (XBUFFER (WGET (w, buffer)), bidi_display_reordering))) 16724 if (!NILP (BVAR (XBUFFER (w->buffer), bidi_display_reordering)))
16726 { 16725 {
16727 if (!(w->cursor.hpos >= 0 16726 if (!(w->cursor.hpos >= 0
16728 && w->cursor.hpos < row->used[TEXT_AREA] 16727 && w->cursor.hpos < row->used[TEXT_AREA]
@@ -16750,14 +16749,14 @@ try_window_reusing_current_matrix (struct window *w)
16750 w->window_end_bytepos 16749 w->window_end_bytepos
16751 = Z_BYTE - MATRIX_ROW_END_BYTEPOS (last_text_row); 16750 = Z_BYTE - MATRIX_ROW_END_BYTEPOS (last_text_row);
16752 WSET (w, window_end_pos, 16751 WSET (w, window_end_pos,
16753 make_number (Z - MATRIX_ROW_END_CHARPOS (last_text_row))); 16752 make_number (Z - MATRIX_ROW_END_CHARPOS (last_text_row)));
16754 WSET (w, window_end_vpos, 16753 WSET (w, window_end_vpos,
16755 make_number (MATRIX_ROW_VPOS (last_text_row, w->desired_matrix))); 16754 make_number (MATRIX_ROW_VPOS (last_text_row, w->desired_matrix)));
16756 } 16755 }
16757 else 16756 else
16758 { 16757 {
16759 WSET (w, window_end_vpos, 16758 WSET (w, window_end_vpos,
16760 make_number (XFASTINT (WGET (w, window_end_vpos)) - nrows_scrolled)); 16759 make_number (XFASTINT (w->window_end_vpos) - nrows_scrolled));
16761 } 16760 }
16762 16761
16763 WSET (w, window_end_valid, Qnil); 16762 WSET (w, window_end_valid, Qnil);
@@ -16893,16 +16892,16 @@ find_first_unchanged_at_end_row (struct window *w,
16893 16892
16894 /* Display must not have been paused, otherwise the current matrix 16893 /* Display must not have been paused, otherwise the current matrix
16895 is not up to date. */ 16894 is not up to date. */
16896 eassert (!NILP (WGET (w, window_end_valid))); 16895 eassert (!NILP (w->window_end_valid));
16897 16896
16898 /* A value of window_end_pos >= END_UNCHANGED means that the window 16897 /* A value of window_end_pos >= END_UNCHANGED means that the window
16899 end is in the range of changed text. If so, there is no 16898 end is in the range of changed text. If so, there is no
16900 unchanged row at the end of W's current matrix. */ 16899 unchanged row at the end of W's current matrix. */
16901 if (XFASTINT (WGET (w, window_end_pos)) >= END_UNCHANGED) 16900 if (XFASTINT (w->window_end_pos) >= END_UNCHANGED)
16902 return NULL; 16901 return NULL;
16903 16902
16904 /* Set row to the last row in W's current matrix displaying text. */ 16903 /* Set row to the last row in W's current matrix displaying text. */
16905 row = MATRIX_ROW (w->current_matrix, XFASTINT (WGET (w, window_end_vpos))); 16904 row = MATRIX_ROW (w->current_matrix, XFASTINT (w->window_end_vpos));
16906 16905
16907 /* If matrix is entirely empty, no unchanged row exists. */ 16906 /* If matrix is entirely empty, no unchanged row exists. */
16908 if (MATRIX_ROW_DISPLAYS_TEXT_P (row)) 16907 if (MATRIX_ROW_DISPLAYS_TEXT_P (row))
@@ -16913,7 +16912,7 @@ find_first_unchanged_at_end_row (struct window *w,
16913 buffer positions in the current matrix to current buffer 16912 buffer positions in the current matrix to current buffer
16914 positions for characters not in changed text. */ 16913 positions for characters not in changed text. */
16915 ptrdiff_t Z_old = 16914 ptrdiff_t Z_old =
16916 MATRIX_ROW_END_CHARPOS (row) + XFASTINT (WGET (w, window_end_pos)); 16915 MATRIX_ROW_END_CHARPOS (row) + XFASTINT (w->window_end_pos);
16917 ptrdiff_t Z_BYTE_old = 16916 ptrdiff_t Z_BYTE_old =
16918 MATRIX_ROW_END_BYTEPOS (row) + w->window_end_bytepos; 16917 MATRIX_ROW_END_BYTEPOS (row) + w->window_end_bytepos;
16919 ptrdiff_t last_unchanged_pos, last_unchanged_pos_old; 16918 ptrdiff_t last_unchanged_pos, last_unchanged_pos_old;
@@ -16961,12 +16960,12 @@ find_first_unchanged_at_end_row (struct window *w,
16961static void 16960static void
16962sync_frame_with_window_matrix_rows (struct window *w) 16961sync_frame_with_window_matrix_rows (struct window *w)
16963{ 16962{
16964 struct frame *f = XFRAME (WGET (w, frame)); 16963 struct frame *f = XFRAME (w->frame);
16965 struct glyph_row *window_row, *window_row_end, *frame_row; 16964 struct glyph_row *window_row, *window_row_end, *frame_row;
16966 16965
16967 /* Preconditions: W must be a leaf window and full-width. Its frame 16966 /* Preconditions: W must be a leaf window and full-width. Its frame
16968 must have a frame matrix. */ 16967 must have a frame matrix. */
16969 eassert (NILP (WGET (w, hchild)) && NILP (WGET (w, vchild))); 16968 eassert (NILP (w->hchild) && NILP (w->vchild));
16970 eassert (WINDOW_FULL_WIDTH_P (w)); 16969 eassert (WINDOW_FULL_WIDTH_P (w));
16971 eassert (!FRAME_WINDOW_P (f)); 16970 eassert (!FRAME_WINDOW_P (f));
16972 16971
@@ -17008,7 +17007,7 @@ row_containing_pos (struct window *w, ptrdiff_t charpos,
17008{ 17007{
17009 struct glyph_row *row = start; 17008 struct glyph_row *row = start;
17010 struct glyph_row *best_row = NULL; 17009 struct glyph_row *best_row = NULL;
17011 ptrdiff_t mindif = BUF_ZV (XBUFFER (WGET (w, buffer))) + 1; 17010 ptrdiff_t mindif = BUF_ZV (XBUFFER (w->buffer)) + 1;
17012 int last_y; 17011 int last_y;
17013 17012
17014 /* If we happen to start on a header-line, skip that. */ 17013 /* If we happen to start on a header-line, skip that. */
@@ -17044,7 +17043,7 @@ row_containing_pos (struct window *w, ptrdiff_t charpos,
17044 { 17043 {
17045 struct glyph *g; 17044 struct glyph *g;
17046 17045
17047 if (NILP (BVAR (XBUFFER (WGET (w, buffer)), bidi_display_reordering)) 17046 if (NILP (BVAR (XBUFFER (w->buffer), bidi_display_reordering))
17048 || (!best_row && !row->continued_p)) 17047 || (!best_row && !row->continued_p))
17049 return row; 17048 return row;
17050 /* In bidi-reordered rows, there could be several rows 17049 /* In bidi-reordered rows, there could be several rows
@@ -17113,7 +17112,7 @@ row_containing_pos (struct window *w, ptrdiff_t charpos,
17113static int 17112static int
17114try_window_id (struct window *w) 17113try_window_id (struct window *w)
17115{ 17114{
17116 struct frame *f = XFRAME (WGET (w, frame)); 17115 struct frame *f = XFRAME (w->frame);
17117 struct glyph_matrix *current_matrix = w->current_matrix; 17116 struct glyph_matrix *current_matrix = w->current_matrix;
17118 struct glyph_matrix *desired_matrix = w->desired_matrix; 17117 struct glyph_matrix *desired_matrix = w->desired_matrix;
17119 struct glyph_row *last_unchanged_at_beg_row; 17118 struct glyph_row *last_unchanged_at_beg_row;
@@ -17147,7 +17146,7 @@ try_window_id (struct window *w)
17147#define GIVE_UP(X) return 0 17146#define GIVE_UP(X) return 0
17148#endif 17147#endif
17149 17148
17150 SET_TEXT_POS_FROM_MARKER (start, WGET (w, start)); 17149 SET_TEXT_POS_FROM_MARKER (start, w->start);
17151 17150
17152 /* Don't use this for mini-windows because these can show 17151 /* Don't use this for mini-windows because these can show
17153 messages and mini-buffers, and we don't handle that here. */ 17152 messages and mini-buffers, and we don't handle that here. */
@@ -17185,7 +17184,7 @@ try_window_id (struct window *w)
17185 GIVE_UP (7); 17184 GIVE_UP (7);
17186 17185
17187 /* Verify that display wasn't paused. */ 17186 /* Verify that display wasn't paused. */
17188 if (NILP (WGET (w, window_end_valid))) 17187 if (NILP (w->window_end_valid))
17189 GIVE_UP (8); 17188 GIVE_UP (8);
17190 17189
17191 /* Can't use this if highlighting a region because a cursor movement 17190 /* Can't use this if highlighting a region because a cursor movement
@@ -17199,7 +17198,7 @@ try_window_id (struct window *w)
17199 GIVE_UP (11); 17198 GIVE_UP (11);
17200 17199
17201 /* Likewise if showing a region. */ 17200 /* Likewise if showing a region. */
17202 if (!NILP (WGET (w, region_showing))) 17201 if (!NILP (w->region_showing))
17203 GIVE_UP (10); 17202 GIVE_UP (10);
17204 17203
17205 /* Can't use this if overlay arrow position and/or string have 17204 /* Can't use this if overlay arrow position and/or string have
@@ -17211,7 +17210,7 @@ try_window_id (struct window *w)
17211 wrapped line can change the wrap position, altering the line 17210 wrapped line can change the wrap position, altering the line
17212 above it. It might be worthwhile to handle this more 17211 above it. It might be worthwhile to handle this more
17213 intelligently, but for now just redisplay from scratch. */ 17212 intelligently, but for now just redisplay from scratch. */
17214 if (!NILP (BVAR (XBUFFER (WGET (w, buffer)), word_wrap))) 17213 if (!NILP (BVAR (XBUFFER (w->buffer), word_wrap)))
17215 GIVE_UP (21); 17214 GIVE_UP (21);
17216 17215
17217 /* Under bidi reordering, adding or deleting a character in the 17216 /* Under bidi reordering, adding or deleting a character in the
@@ -17222,8 +17221,8 @@ try_window_id (struct window *w)
17222 to find the paragraph limits and widen the range of redisplayed 17221 to find the paragraph limits and widen the range of redisplayed
17223 lines to that, but for now just give up this optimization and 17222 lines to that, but for now just give up this optimization and
17224 redisplay from scratch. */ 17223 redisplay from scratch. */
17225 if (!NILP (BVAR (XBUFFER (WGET (w, buffer)), bidi_display_reordering)) 17224 if (!NILP (BVAR (XBUFFER (w->buffer), bidi_display_reordering))
17226 && NILP (BVAR (XBUFFER (WGET (w, buffer)), bidi_paragraph_direction))) 17225 && NILP (BVAR (XBUFFER (w->buffer), bidi_paragraph_direction)))
17227 GIVE_UP (22); 17226 GIVE_UP (22);
17228 17227
17229 /* Make sure beg_unchanged and end_unchanged are up to date. Do it 17228 /* Make sure beg_unchanged and end_unchanged are up to date. Do it
@@ -17249,7 +17248,7 @@ try_window_id (struct window *w)
17249 This case happens with stealth-fontification. Note that although 17248 This case happens with stealth-fontification. Note that although
17250 the display is unchanged, glyph positions in the matrix have to 17249 the display is unchanged, glyph positions in the matrix have to
17251 be adjusted, of course. */ 17250 be adjusted, of course. */
17252 row = MATRIX_ROW (w->current_matrix, XFASTINT (WGET (w, window_end_vpos))); 17251 row = MATRIX_ROW (w->current_matrix, XFASTINT (w->window_end_vpos));
17253 if (MATRIX_ROW_DISPLAYS_TEXT_P (row) 17252 if (MATRIX_ROW_DISPLAYS_TEXT_P (row)
17254 && ((last_changed_charpos < CHARPOS (start) 17253 && ((last_changed_charpos < CHARPOS (start)
17255 && CHARPOS (start) == BEGV) 17254 && CHARPOS (start) == BEGV)
@@ -17261,7 +17260,7 @@ try_window_id (struct window *w)
17261 17260
17262 /* Compute how many chars/bytes have been added to or removed 17261 /* Compute how many chars/bytes have been added to or removed
17263 from the buffer. */ 17262 from the buffer. */
17264 Z_old = MATRIX_ROW_END_CHARPOS (row) + XFASTINT (WGET (w, window_end_pos)); 17263 Z_old = MATRIX_ROW_END_CHARPOS (row) + XFASTINT (w->window_end_pos);
17265 Z_BYTE_old = MATRIX_ROW_END_BYTEPOS (row) + w->window_end_bytepos; 17264 Z_BYTE_old = MATRIX_ROW_END_BYTEPOS (row) + w->window_end_bytepos;
17266 Z_delta = Z - Z_old; 17265 Z_delta = Z - Z_old;
17267 Z_delta_bytes = Z_BYTE - Z_BYTE_old; 17266 Z_delta_bytes = Z_BYTE - Z_BYTE_old;
@@ -17368,7 +17367,7 @@ try_window_id (struct window *w)
17368 17367
17369 /* Give up if the window ends in strings. Overlay strings 17368 /* Give up if the window ends in strings. Overlay strings
17370 at the end are difficult to handle, so don't try. */ 17369 at the end are difficult to handle, so don't try. */
17371 row = MATRIX_ROW (current_matrix, XFASTINT (WGET (w, window_end_vpos))); 17370 row = MATRIX_ROW (current_matrix, XFASTINT (w->window_end_vpos));
17372 if (MATRIX_ROW_START_CHARPOS (row) == MATRIX_ROW_END_CHARPOS (row)) 17371 if (MATRIX_ROW_START_CHARPOS (row) == MATRIX_ROW_END_CHARPOS (row))
17373 GIVE_UP (20); 17372 GIVE_UP (20);
17374 17373
@@ -17711,7 +17710,7 @@ try_window_id (struct window *w)
17711 /* Set last_row to the glyph row in the current matrix where the 17710 /* Set last_row to the glyph row in the current matrix where the
17712 window end line is found. It has been moved up or down in 17711 window end line is found. It has been moved up or down in
17713 the matrix by dvpos. */ 17712 the matrix by dvpos. */
17714 int last_vpos = XFASTINT (WGET (w, window_end_vpos)) + dvpos; 17713 int last_vpos = XFASTINT (w->window_end_vpos) + dvpos;
17715 struct glyph_row *last_row = MATRIX_ROW (current_matrix, last_vpos); 17714 struct glyph_row *last_row = MATRIX_ROW (current_matrix, last_vpos);
17716 17715
17717 /* If last_row is the window end line, it should display text. */ 17716 /* If last_row is the window end line, it should display text. */
@@ -17770,18 +17769,18 @@ try_window_id (struct window *w)
17770 WSET (w, window_end_pos, make_number (Z - MATRIX_ROW_END_CHARPOS (row))); 17769 WSET (w, window_end_pos, make_number (Z - MATRIX_ROW_END_CHARPOS (row)));
17771 w->window_end_bytepos = Z_BYTE - MATRIX_ROW_END_BYTEPOS (row); 17770 w->window_end_bytepos = Z_BYTE - MATRIX_ROW_END_BYTEPOS (row);
17772 WSET (w, window_end_vpos, 17771 WSET (w, window_end_vpos,
17773 make_number (MATRIX_ROW_VPOS (row, w->current_matrix))); 17772 make_number (MATRIX_ROW_VPOS (row, w->current_matrix)));
17774 eassert (w->window_end_bytepos >= 0); 17773 eassert (w->window_end_bytepos >= 0);
17775 IF_DEBUG (debug_method_add (w, "A")); 17774 IF_DEBUG (debug_method_add (w, "A"));
17776 } 17775 }
17777 else if (last_text_row_at_end) 17776 else if (last_text_row_at_end)
17778 { 17777 {
17779 WSET (w, window_end_pos, 17778 WSET (w, window_end_pos,
17780 make_number (Z - MATRIX_ROW_END_CHARPOS (last_text_row_at_end))); 17779 make_number (Z - MATRIX_ROW_END_CHARPOS (last_text_row_at_end)));
17781 w->window_end_bytepos 17780 w->window_end_bytepos
17782 = Z_BYTE - MATRIX_ROW_END_BYTEPOS (last_text_row_at_end); 17781 = Z_BYTE - MATRIX_ROW_END_BYTEPOS (last_text_row_at_end);
17783 WSET (w, window_end_vpos, 17782 WSET (w, window_end_vpos,
17784 make_number (MATRIX_ROW_VPOS (last_text_row_at_end, desired_matrix))); 17783 make_number (MATRIX_ROW_VPOS (last_text_row_at_end, desired_matrix)));
17785 eassert (w->window_end_bytepos >= 0); 17784 eassert (w->window_end_bytepos >= 0);
17786 IF_DEBUG (debug_method_add (w, "B")); 17785 IF_DEBUG (debug_method_add (w, "B"));
17787 } 17786 }
@@ -17791,11 +17790,11 @@ try_window_id (struct window *w)
17791 end of the window, i.e. the last row with text is to be found 17790 end of the window, i.e. the last row with text is to be found
17792 in the desired matrix. */ 17791 in the desired matrix. */
17793 WSET (w, window_end_pos, 17792 WSET (w, window_end_pos,
17794 make_number (Z - MATRIX_ROW_END_CHARPOS (last_text_row))); 17793 make_number (Z - MATRIX_ROW_END_CHARPOS (last_text_row)));
17795 w->window_end_bytepos 17794 w->window_end_bytepos
17796 = Z_BYTE - MATRIX_ROW_END_BYTEPOS (last_text_row); 17795 = Z_BYTE - MATRIX_ROW_END_BYTEPOS (last_text_row);
17797 WSET (w, window_end_vpos, 17796 WSET (w, window_end_vpos,
17798 make_number (MATRIX_ROW_VPOS (last_text_row, desired_matrix))); 17797 make_number (MATRIX_ROW_VPOS (last_text_row, desired_matrix)));
17799 eassert (w->window_end_bytepos >= 0); 17798 eassert (w->window_end_bytepos >= 0);
17800 } 17799 }
17801 else if (first_unchanged_at_end_row == NULL 17800 else if (first_unchanged_at_end_row == NULL
@@ -17805,7 +17804,7 @@ try_window_id (struct window *w)
17805 /* Displayed to end of window, but no line containing text was 17804 /* Displayed to end of window, but no line containing text was
17806 displayed. Lines were deleted at the end of the window. */ 17805 displayed. Lines were deleted at the end of the window. */
17807 int first_vpos = WINDOW_WANTS_HEADER_LINE_P (w) ? 1 : 0; 17806 int first_vpos = WINDOW_WANTS_HEADER_LINE_P (w) ? 1 : 0;
17808 int vpos = XFASTINT (WGET (w, window_end_vpos)); 17807 int vpos = XFASTINT (w->window_end_vpos);
17809 struct glyph_row *current_row = current_matrix->rows + vpos; 17808 struct glyph_row *current_row = current_matrix->rows + vpos;
17810 struct glyph_row *desired_row = desired_matrix->rows + vpos; 17809 struct glyph_row *desired_row = desired_matrix->rows + vpos;
17811 17810
@@ -17832,8 +17831,8 @@ try_window_id (struct window *w)
17832 else 17831 else
17833 abort (); 17832 abort ();
17834 17833
17835 IF_DEBUG (debug_end_pos = XFASTINT (WGET (w, window_end_pos)); 17834 IF_DEBUG (debug_end_pos = XFASTINT (w->window_end_pos);
17836 debug_end_vpos = XFASTINT (WGET (w, window_end_vpos))); 17835 debug_end_vpos = XFASTINT (w->window_end_vpos));
17837 17836
17838 /* Record that display has not been completed. */ 17837 /* Record that display has not been completed. */
17839 WSET (w, window_end_valid, Qnil); 17838 WSET (w, window_end_valid, Qnil);
@@ -18066,7 +18065,7 @@ glyphs in short form, otherwise show glyphs in long form. */)
18066 (Lisp_Object glyphs) 18065 (Lisp_Object glyphs)
18067{ 18066{
18068 struct window *w = XWINDOW (selected_window); 18067 struct window *w = XWINDOW (selected_window);
18069 struct buffer *buffer = XBUFFER (WGET (w, buffer)); 18068 struct buffer *buffer = XBUFFER (w->buffer);
18070 18069
18071 fprintf (stderr, "PT = %"pI"d, BEGV = %"pI"d. ZV = %"pI"d\n", 18070 fprintf (stderr, "PT = %"pI"d, BEGV = %"pI"d. ZV = %"pI"d\n",
18072 BUF_PT (buffer), BUF_BEGV (buffer), BUF_ZV (buffer)); 18071 BUF_PT (buffer), BUF_BEGV (buffer), BUF_ZV (buffer));
@@ -18172,7 +18171,7 @@ static struct glyph_row *
18172get_overlay_arrow_glyph_row (struct window *w, Lisp_Object overlay_arrow_string) 18171get_overlay_arrow_glyph_row (struct window *w, Lisp_Object overlay_arrow_string)
18173{ 18172{
18174 struct frame *f = XFRAME (WINDOW_FRAME (w)); 18173 struct frame *f = XFRAME (WINDOW_FRAME (w));
18175 struct buffer *buffer = XBUFFER (WGET (w, buffer)); 18174 struct buffer *buffer = XBUFFER (w->buffer);
18176 struct buffer *old = current_buffer; 18175 struct buffer *old = current_buffer;
18177 const unsigned char *arrow_string = SDATA (overlay_arrow_string); 18176 const unsigned char *arrow_string = SDATA (overlay_arrow_string);
18178 int arrow_len = SCHARS (overlay_arrow_string); 18177 int arrow_len = SCHARS (overlay_arrow_string);
@@ -19364,7 +19363,7 @@ display_line (struct it *it)
19364 row->glyphs[TEXT_AREA]->charpos = -1; 19363 row->glyphs[TEXT_AREA]->charpos = -1;
19365 row->displays_text_p = 0; 19364 row->displays_text_p = 0;
19366 19365
19367 if (!NILP (BVAR (XBUFFER (WGET (it->w, buffer)), indicate_empty_lines)) 19366 if (!NILP (BVAR (XBUFFER (it->w->buffer), indicate_empty_lines))
19368 && (!MINI_WINDOW_P (it->w) 19367 && (!MINI_WINDOW_P (it->w)
19369 || (minibuf_level && EQ (it->window, minibuf_window)))) 19368 || (minibuf_level && EQ (it->window, minibuf_window))))
19370 row->indicate_empty_line_p = 1; 19369 row->indicate_empty_line_p = 1;
@@ -20187,12 +20186,12 @@ redisplay_mode_lines (Lisp_Object window, int force)
20187 { 20186 {
20188 struct window *w = XWINDOW (window); 20187 struct window *w = XWINDOW (window);
20189 20188
20190 if (WINDOWP (WGET (w, hchild))) 20189 if (WINDOWP (w->hchild))
20191 nwindows += redisplay_mode_lines (WGET (w, hchild), force); 20190 nwindows += redisplay_mode_lines (w->hchild, force);
20192 else if (WINDOWP (WGET (w, vchild))) 20191 else if (WINDOWP (w->vchild))
20193 nwindows += redisplay_mode_lines (WGET (w, vchild), force); 20192 nwindows += redisplay_mode_lines (w->vchild, force);
20194 else if (force 20193 else if (force
20195 || FRAME_GARBAGED_P (XFRAME (WGET (w, frame))) 20194 || FRAME_GARBAGED_P (XFRAME (w->frame))
20196 || !MATRIX_MODE_LINE_ROW (w->current_matrix)->enabled_p) 20195 || !MATRIX_MODE_LINE_ROW (w->current_matrix)->enabled_p)
20197 { 20196 {
20198 struct text_pos lpoint; 20197 struct text_pos lpoint;
@@ -20200,7 +20199,7 @@ redisplay_mode_lines (Lisp_Object window, int force)
20200 20199
20201 /* Set the window's buffer for the mode line display. */ 20200 /* Set the window's buffer for the mode line display. */
20202 SET_TEXT_POS (lpoint, PT, PT_BYTE); 20201 SET_TEXT_POS (lpoint, PT, PT_BYTE);
20203 set_buffer_internal_1 (XBUFFER (WGET (w, buffer))); 20202 set_buffer_internal_1 (XBUFFER (w->buffer));
20204 20203
20205 /* Point refers normally to the selected window. For any 20204 /* Point refers normally to the selected window. For any
20206 other window, set up appropriate value. */ 20205 other window, set up appropriate value. */
@@ -20208,7 +20207,7 @@ redisplay_mode_lines (Lisp_Object window, int force)
20208 { 20207 {
20209 struct text_pos pt; 20208 struct text_pos pt;
20210 20209
20211 SET_TEXT_POS_FROM_MARKER (pt, WGET (w, pointm)); 20210 SET_TEXT_POS_FROM_MARKER (pt, w->pointm);
20212 if (CHARPOS (pt) < BEGV) 20211 if (CHARPOS (pt) < BEGV)
20213 TEMP_SET_PT_BOTH (BEGV, BEGV_BYTE); 20212 TEMP_SET_PT_BOTH (BEGV, BEGV_BYTE);
20214 else if (CHARPOS (pt) > (ZV - 1)) 20213 else if (CHARPOS (pt) > (ZV - 1))
@@ -20230,7 +20229,7 @@ redisplay_mode_lines (Lisp_Object window, int force)
20230 TEMP_SET_PT_BOTH (CHARPOS (lpoint), BYTEPOS (lpoint)); 20229 TEMP_SET_PT_BOTH (CHARPOS (lpoint), BYTEPOS (lpoint));
20231 } 20230 }
20232 20231
20233 window = WGET (w, next); 20232 window = w->next;
20234 } 20233 }
20235 20234
20236 return nwindows; 20235 return nwindows;
@@ -20247,7 +20246,7 @@ display_mode_lines (struct window *w)
20247 int n = 0; 20246 int n = 0;
20248 20247
20249 old_selected_frame = selected_frame; 20248 old_selected_frame = selected_frame;
20250 selected_frame = WGET (w, frame); 20249 selected_frame = w->frame;
20251 old_selected_window = selected_window; 20250 old_selected_window = selected_window;
20252 XSETWINDOW (selected_window, w); 20251 XSETWINDOW (selected_window, w);
20253 20252
@@ -20983,7 +20982,7 @@ are the selected window and the WINDOW's buffer). */)
20983 w = XWINDOW (window); 20982 w = XWINDOW (window);
20984 20983
20985 if (NILP (buffer)) 20984 if (NILP (buffer))
20986 buffer = WGET (w, buffer); 20985 buffer = w->buffer;
20987 CHECK_BUFFER (buffer); 20986 CHECK_BUFFER (buffer);
20988 20987
20989 /* Make formatting the modeline a non-op when noninteractive, otherwise 20988 /* Make formatting the modeline a non-op when noninteractive, otherwise
@@ -21442,16 +21441,16 @@ decode_mode_spec (struct window *w, register int c, int field_width,
21442 if (mode_line_target == MODE_LINE_TITLE) 21441 if (mode_line_target == MODE_LINE_TITLE)
21443 return ""; 21442 return "";
21444 21443
21445 startpos = XMARKER (WGET (w, start))->charpos; 21444 startpos = XMARKER (w->start)->charpos;
21446 startpos_byte = marker_byte_position (WGET (w, start)); 21445 startpos_byte = marker_byte_position (w->start);
21447 height = WINDOW_TOTAL_LINES (w); 21446 height = WINDOW_TOTAL_LINES (w);
21448 21447
21449 /* If we decided that this buffer isn't suitable for line numbers, 21448 /* If we decided that this buffer isn't suitable for line numbers,
21450 don't forget that too fast. */ 21449 don't forget that too fast. */
21451 if (EQ (WGET (w, base_line_pos), WGET (w, buffer))) 21450 if (EQ (w->base_line_pos, w->buffer))
21452 goto no_value; 21451 goto no_value;
21453 /* But do forget it, if the window shows a different buffer now. */ 21452 /* But do forget it, if the window shows a different buffer now. */
21454 else if (BUFFERP (WGET (w, base_line_pos))) 21453 else if (BUFFERP (w->base_line_pos))
21455 WSET (w, base_line_pos, Qnil); 21454 WSET (w, base_line_pos, Qnil);
21456 21455
21457 /* If the buffer is very big, don't waste time. */ 21456 /* If the buffer is very big, don't waste time. */
@@ -21463,12 +21462,12 @@ decode_mode_spec (struct window *w, register int c, int field_width,
21463 goto no_value; 21462 goto no_value;
21464 } 21463 }
21465 21464
21466 if (INTEGERP (WGET (w, base_line_number)) 21465 if (INTEGERP (w->base_line_number)
21467 && INTEGERP (WGET (w, base_line_pos)) 21466 && INTEGERP (w->base_line_pos)
21468 && XFASTINT (WGET (w, base_line_pos)) <= startpos) 21467 && XFASTINT (w->base_line_pos) <= startpos)
21469 { 21468 {
21470 line = XFASTINT (WGET (w, base_line_number)); 21469 line = XFASTINT (w->base_line_number);
21471 linepos = XFASTINT (WGET (w, base_line_pos)); 21470 linepos = XFASTINT (w->base_line_pos);
21472 linepos_byte = buf_charpos_to_bytepos (b, linepos); 21471 linepos_byte = buf_charpos_to_bytepos (b, linepos);
21473 } 21472 }
21474 else 21473 else
@@ -21518,7 +21517,7 @@ decode_mode_spec (struct window *w, register int c, int field_width,
21518 give up on line numbers for this window. */ 21517 give up on line numbers for this window. */
21519 if (position == limit_byte && limit == startpos - distance) 21518 if (position == limit_byte && limit == startpos - distance)
21520 { 21519 {
21521 WSET (w, base_line_pos, WGET (w, buffer)); 21520 WSET (w, base_line_pos, w->buffer);
21522 WSET (w, base_line_number, Qnil); 21521 WSET (w, base_line_number, Qnil);
21523 goto no_value; 21522 goto no_value;
21524 } 21523 }
@@ -21562,10 +21561,10 @@ decode_mode_spec (struct window *w, register int c, int field_width,
21562 21561
21563 case 'p': 21562 case 'p':
21564 { 21563 {
21565 ptrdiff_t pos = marker_position (WGET (w, start)); 21564 ptrdiff_t pos = marker_position (w->start);
21566 ptrdiff_t total = BUF_ZV (b) - BUF_BEGV (b); 21565 ptrdiff_t total = BUF_ZV (b) - BUF_BEGV (b);
21567 21566
21568 if (XFASTINT (WGET (w, window_end_pos)) <= BUF_Z (b) - BUF_ZV (b)) 21567 if (XFASTINT (w->window_end_pos) <= BUF_Z (b) - BUF_ZV (b))
21569 { 21568 {
21570 if (pos <= BUF_BEGV (b)) 21569 if (pos <= BUF_BEGV (b))
21571 return "All"; 21570 return "All";
@@ -21593,8 +21592,8 @@ decode_mode_spec (struct window *w, register int c, int field_width,
21593 /* Display percentage of size above the bottom of the screen. */ 21592 /* Display percentage of size above the bottom of the screen. */
21594 case 'P': 21593 case 'P':
21595 { 21594 {
21596 ptrdiff_t toppos = marker_position (WGET (w, start)); 21595 ptrdiff_t toppos = marker_position (w->start);
21597 ptrdiff_t botpos = BUF_Z (b) - XFASTINT (WGET (w, window_end_pos)); 21596 ptrdiff_t botpos = BUF_Z (b) - XFASTINT (w->window_end_pos);
21598 ptrdiff_t total = BUF_ZV (b) - BUF_BEGV (b); 21597 ptrdiff_t total = BUF_ZV (b) - BUF_BEGV (b);
21599 21598
21600 if (botpos >= BUF_ZV (b)) 21599 if (botpos >= BUF_ZV (b))
@@ -22301,7 +22300,7 @@ calc_pixel_width_or_height (double *res, struct it *it, Lisp_Object prop,
22301 return OK_PIXELS (WINDOW_SCROLL_BAR_AREA_WIDTH (it->w)); 22300 return OK_PIXELS (WINDOW_SCROLL_BAR_AREA_WIDTH (it->w));
22302 } 22301 }
22303 22302
22304 prop = buffer_local_value_1 (prop, WGET (it->w, buffer)); 22303 prop = buffer_local_value_1 (prop, it->w->buffer);
22305 if (EQ (prop, Qunbound)) 22304 if (EQ (prop, Qunbound))
22306 prop = Qnil; 22305 prop = Qnil;
22307 } 22306 }
@@ -22353,7 +22352,7 @@ calc_pixel_width_or_height (double *res, struct it *it, Lisp_Object prop,
22353 return OK_PIXELS (pixels); 22352 return OK_PIXELS (pixels);
22354 } 22353 }
22355 22354
22356 car = buffer_local_value_1 (car, WGET (it->w, buffer)); 22355 car = buffer_local_value_1 (car, it->w->buffer);
22357 if (EQ (car, Qunbound)) 22356 if (EQ (car, Qunbound))
22358 car = Qnil; 22357 car = Qnil;
22359 } 22358 }
@@ -22434,7 +22433,7 @@ init_glyph_string (struct glyph_string *s,
22434{ 22433{
22435 memset (s, 0, sizeof *s); 22434 memset (s, 0, sizeof *s);
22436 s->w = w; 22435 s->w = w;
22437 s->f = XFRAME (WGET (w, frame)); 22436 s->f = XFRAME (w->frame);
22438#ifdef HAVE_NTGUI 22437#ifdef HAVE_NTGUI
22439 s->hdc = hdc; 22438 s->hdc = hdc;
22440#endif 22439#endif
@@ -22766,7 +22765,7 @@ fill_glyph_string (struct glyph_string *s, int face_id,
22766 int voffset; 22765 int voffset;
22767 int glyph_not_available_p; 22766 int glyph_not_available_p;
22768 22767
22769 eassert (s->f == XFRAME (WGET (s->w, frame))); 22768 eassert (s->f == XFRAME (s->w->frame));
22770 eassert (s->nchars == 0); 22769 eassert (s->nchars == 0);
22771 eassert (start >= 0 && end > start); 22770 eassert (start >= 0 && end > start);
22772 22771
@@ -24161,7 +24160,7 @@ produce_stretch_glyph (struct it *it)
24161 int n = width; 24160 int n = width;
24162 24161
24163 if (!STRINGP (object)) 24162 if (!STRINGP (object))
24164 object = WGET (it->w, buffer); 24163 object = it->w->buffer;
24165#ifdef HAVE_WINDOW_SYSTEM 24164#ifdef HAVE_WINDOW_SYSTEM
24166 if (FRAME_WINDOW_P (it->f)) 24165 if (FRAME_WINDOW_P (it->f))
24167 append_stretch_glyph (it, object, width, height, ascent); 24166 append_stretch_glyph (it, object, width, height, ascent);
@@ -25388,7 +25387,7 @@ x_clear_end_of_line (int to_x)
25388 int from_x, from_y, to_y; 25387 int from_x, from_y, to_y;
25389 25388
25390 eassert (updated_window && updated_row); 25389 eassert (updated_window && updated_row);
25391 f = XFRAME (WGET (w, frame)); 25390 f = XFRAME (w->frame);
25392 25391
25393 if (updated_row->full_width_p) 25392 if (updated_row->full_width_p)
25394 max_x = WINDOW_TOTAL_WIDTH (w); 25393 max_x = WINDOW_TOTAL_WIDTH (w);
@@ -25546,8 +25545,8 @@ static enum text_cursor_kinds
25546get_window_cursor_type (struct window *w, struct glyph *glyph, int *width, 25545get_window_cursor_type (struct window *w, struct glyph *glyph, int *width,
25547 int *active_cursor) 25546 int *active_cursor)
25548{ 25547{
25549 struct frame *f = XFRAME (WGET (w, frame)); 25548 struct frame *f = XFRAME (w->frame);
25550 struct buffer *b = XBUFFER (WGET (w, buffer)); 25549 struct buffer *b = XBUFFER (w->buffer);
25551 int cursor_type = DEFAULT_CURSOR; 25550 int cursor_type = DEFAULT_CURSOR;
25552 Lisp_Object alt_cursor; 25551 Lisp_Object alt_cursor;
25553 int non_selected = 0; 25552 int non_selected = 0;
@@ -25858,7 +25857,7 @@ draw_phys_cursor_glyph (struct window *w, struct glyph_row *row,
25858void 25857void
25859erase_phys_cursor (struct window *w) 25858erase_phys_cursor (struct window *w)
25860{ 25859{
25861 struct frame *f = XFRAME (WGET (w, frame)); 25860 struct frame *f = XFRAME (w->frame);
25862 Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f); 25861 Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f);
25863 int hpos = w->phys_cursor.hpos; 25862 int hpos = w->phys_cursor.hpos;
25864 int vpos = w->phys_cursor.vpos; 25863 int vpos = w->phys_cursor.vpos;
@@ -25977,7 +25976,7 @@ void
25977display_and_set_cursor (struct window *w, int on, 25976display_and_set_cursor (struct window *w, int on,
25978 int hpos, int vpos, int x, int y) 25977 int hpos, int vpos, int x, int y)
25979{ 25978{
25980 struct frame *f = XFRAME (WGET (w, frame)); 25979 struct frame *f = XFRAME (w->frame);
25981 int new_cursor_type; 25980 int new_cursor_type;
25982 int new_cursor_width; 25981 int new_cursor_width;
25983 int active_cursor; 25982 int active_cursor;
@@ -26098,14 +26097,14 @@ update_cursor_in_window_tree (struct window *w, int on_p)
26098{ 26097{
26099 while (w) 26098 while (w)
26100 { 26099 {
26101 if (!NILP (WGET (w, hchild))) 26100 if (!NILP (w->hchild))
26102 update_cursor_in_window_tree (XWINDOW (WGET (w, hchild)), on_p); 26101 update_cursor_in_window_tree (XWINDOW (w->hchild), on_p);
26103 else if (!NILP (WGET (w, vchild))) 26102 else if (!NILP (w->vchild))
26104 update_cursor_in_window_tree (XWINDOW (WGET (w, vchild)), on_p); 26103 update_cursor_in_window_tree (XWINDOW (w->vchild), on_p);
26105 else 26104 else
26106 update_window_cursor (w, on_p); 26105 update_window_cursor (w, on_p);
26107 26106
26108 w = NILP (WGET (w, next)) ? 0 : XWINDOW (WGET (w, next)); 26107 w = NILP (w->next) ? 0 : XWINDOW (w->next);
26109 } 26108 }
26110} 26109}
26111 26110
@@ -26129,7 +26128,7 @@ x_update_cursor (struct frame *f, int on_p)
26129void 26128void
26130x_clear_cursor (struct window *w) 26129x_clear_cursor (struct window *w)
26131{ 26130{
26132 if (FRAME_VISIBLE_P (XFRAME (WGET (w, frame))) && w->phys_cursor_on_p) 26131 if (FRAME_VISIBLE_P (XFRAME (w->frame)) && w->phys_cursor_on_p)
26133 update_window_cursor (w, 0); 26132 update_window_cursor (w, 0);
26134} 26133}
26135 26134
@@ -26143,7 +26142,7 @@ draw_row_with_mouse_face (struct window *w, int start_x, struct glyph_row *row,
26143 enum draw_glyphs_face draw) 26142 enum draw_glyphs_face draw)
26144{ 26143{
26145#ifdef HAVE_WINDOW_SYSTEM 26144#ifdef HAVE_WINDOW_SYSTEM
26146 if (FRAME_WINDOW_P (XFRAME (WGET (w, frame)))) 26145 if (FRAME_WINDOW_P (XFRAME (w->frame)))
26147 { 26146 {
26148 draw_glyphs (w, start_x, row, TEXT_AREA, start_hpos, end_hpos, draw, 0); 26147 draw_glyphs (w, start_x, row, TEXT_AREA, start_hpos, end_hpos, draw, 0);
26149 return; 26148 return;
@@ -26314,7 +26313,7 @@ clear_mouse_face (Mouse_HLInfo *hlinfo)
26314static int 26313static int
26315coords_in_mouse_face_p (struct window *w, int hpos, int vpos) 26314coords_in_mouse_face_p (struct window *w, int hpos, int vpos)
26316{ 26315{
26317 Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (XFRAME (WGET (w, frame))); 26316 Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (XFRAME (w->frame));
26318 26317
26319 /* Quickly resolve the easy cases. */ 26318 /* Quickly resolve the easy cases. */
26320 if (!(WINDOWP (hlinfo->mouse_face_window) 26319 if (!(WINDOWP (hlinfo->mouse_face_window)
@@ -26566,7 +26565,7 @@ mouse_face_from_buffer_pos (Lisp_Object window,
26566 /* Find the rows corresponding to START_CHARPOS and END_CHARPOS. */ 26565 /* Find the rows corresponding to START_CHARPOS and END_CHARPOS. */
26567 rows_from_pos_range (w, start_charpos, end_charpos, disp_string, &r1, &r2); 26566 rows_from_pos_range (w, start_charpos, end_charpos, disp_string, &r1, &r2);
26568 if (r1 == NULL) 26567 if (r1 == NULL)
26569 r1 = MATRIX_ROW (w->current_matrix, XFASTINT (WGET (w, window_end_vpos))); 26568 r1 = MATRIX_ROW (w->current_matrix, XFASTINT (w->window_end_vpos));
26570 /* If the before-string or display-string contains newlines, 26569 /* If the before-string or display-string contains newlines,
26571 rows_from_pos_range skips to its last row. Move back. */ 26570 rows_from_pos_range skips to its last row. Move back. */
26572 if (!NILP (before_string) || !NILP (disp_string)) 26571 if (!NILP (before_string) || !NILP (disp_string))
@@ -26588,7 +26587,7 @@ mouse_face_from_buffer_pos (Lisp_Object window,
26588 } 26587 }
26589 if (r2 == NULL) 26588 if (r2 == NULL)
26590 { 26589 {
26591 r2 = MATRIX_ROW (w->current_matrix, XFASTINT (WGET (w, window_end_vpos))); 26590 r2 = MATRIX_ROW (w->current_matrix, XFASTINT (w->window_end_vpos));
26592 hlinfo->mouse_face_past_end = 1; 26591 hlinfo->mouse_face_past_end = 1;
26593 } 26592 }
26594 else if (!NILP (after_string)) 26593 else if (!NILP (after_string))
@@ -26596,7 +26595,7 @@ mouse_face_from_buffer_pos (Lisp_Object window,
26596 /* If the after-string has newlines, advance to its last row. */ 26595 /* If the after-string has newlines, advance to its last row. */
26597 struct glyph_row *next; 26596 struct glyph_row *next;
26598 struct glyph_row *last 26597 struct glyph_row *last
26599 = MATRIX_ROW (w->current_matrix, XFASTINT (WGET (w, window_end_vpos))); 26598 = MATRIX_ROW (w->current_matrix, XFASTINT (w->window_end_vpos));
26600 26599
26601 for (next = r2 + 1; 26600 for (next = r2 + 1;
26602 next <= last 26601 next <= last
@@ -27261,7 +27260,7 @@ note_mode_line_or_margin_highlight (Lisp_Object window, int x, int y,
27261 enum window_part area) 27260 enum window_part area)
27262{ 27261{
27263 struct window *w = XWINDOW (window); 27262 struct window *w = XWINDOW (window);
27264 struct frame *f = XFRAME (WGET (w, frame)); 27263 struct frame *f = XFRAME (w->frame);
27265 Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f); 27264 Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f);
27266#ifdef HAVE_WINDOW_SYSTEM 27265#ifdef HAVE_WINDOW_SYSTEM
27267 Display_Info *dpyinfo; 27266 Display_Info *dpyinfo;
@@ -27345,7 +27344,7 @@ note_mode_line_or_margin_highlight (Lisp_Object window, int x, int y,
27345 { 27344 {
27346 help_echo_string = help; 27345 help_echo_string = help;
27347 XSETWINDOW (help_echo_window, w); 27346 XSETWINDOW (help_echo_window, w);
27348 help_echo_object = WGET (w, buffer); 27347 help_echo_object = w->buffer;
27349 help_echo_pos = charpos; 27348 help_echo_pos = charpos;
27350 } 27349 }
27351 } 27350 }
@@ -27381,7 +27380,7 @@ note_mode_line_or_margin_highlight (Lisp_Object window, int x, int y,
27381 { 27380 {
27382 Lisp_Object default_help 27381 Lisp_Object default_help
27383 = buffer_local_value_1 (Qmode_line_default_help_echo, 27382 = buffer_local_value_1 (Qmode_line_default_help_echo,
27384 WGET (w, buffer)); 27383 w->buffer);
27385 27384
27386 if (STRINGP (default_help)) 27385 if (STRINGP (default_help))
27387 { 27386 {
@@ -27662,9 +27661,9 @@ note_mouse_highlight (struct frame *f, int x, int y)
27662 27661
27663 /* Are we in a window whose display is up to date? 27662 /* Are we in a window whose display is up to date?
27664 And verify the buffer's text has not changed. */ 27663 And verify the buffer's text has not changed. */
27665 b = XBUFFER (WGET (w, buffer)); 27664 b = XBUFFER (w->buffer);
27666 if (part == ON_TEXT 27665 if (part == ON_TEXT
27667 && EQ (WGET (w, window_end_valid), WGET (w, buffer)) 27666 && EQ (w->window_end_valid, w->buffer)
27668 && w->last_modified == BUF_MODIFF (b) 27667 && w->last_modified == BUF_MODIFF (b)
27669 && w->last_overlay_modified == BUF_OVERLAY_MODIFF (b)) 27668 && w->last_overlay_modified == BUF_OVERLAY_MODIFF (b))
27670 { 27669 {
@@ -27871,8 +27870,8 @@ note_mouse_highlight (struct frame *f, int x, int y)
27871 if (pos > 0) 27870 if (pos > 0)
27872 { 27871 {
27873 mouse_face = get_char_property_and_overlay 27872 mouse_face = get_char_property_and_overlay
27874 (make_number (pos), Qmouse_face, WGET (w, buffer), &overlay); 27873 (make_number (pos), Qmouse_face, w->buffer, &overlay);
27875 buffer = WGET (w, buffer); 27874 buffer = w->buffer;
27876 disp_string = object; 27875 disp_string = object;
27877 } 27876 }
27878 } 27877 }
@@ -27898,12 +27897,12 @@ note_mouse_highlight (struct frame *f, int x, int y)
27898 is the smallest. */ 27897 is the smallest. */
27899 Lisp_Object lim1 = 27898 Lisp_Object lim1 =
27900 NILP (BVAR (XBUFFER (buffer), bidi_display_reordering)) 27899 NILP (BVAR (XBUFFER (buffer), bidi_display_reordering))
27901 ? Fmarker_position (WGET (w, start)) 27900 ? Fmarker_position (w->start)
27902 : Qnil; 27901 : Qnil;
27903 Lisp_Object lim2 = 27902 Lisp_Object lim2 =
27904 NILP (BVAR (XBUFFER (buffer), bidi_display_reordering)) 27903 NILP (BVAR (XBUFFER (buffer), bidi_display_reordering))
27905 ? make_number (BUF_Z (XBUFFER (buffer)) 27904 ? make_number (BUF_Z (XBUFFER (buffer))
27906 - XFASTINT (WGET (w, window_end_pos))) 27905 - XFASTINT (w->window_end_pos))
27907 : Qnil; 27906 : Qnil;
27908 27907
27909 if (NILP (overlay)) 27908 if (NILP (overlay))
@@ -27985,11 +27984,11 @@ note_mouse_highlight (struct frame *f, int x, int y)
27985 if (p > 0) 27984 if (p > 0)
27986 { 27985 {
27987 help = Fget_char_property (make_number (p), 27986 help = Fget_char_property (make_number (p),
27988 Qhelp_echo, WGET (w, buffer)); 27987 Qhelp_echo, w->buffer);
27989 if (!NILP (help)) 27988 if (!NILP (help))
27990 { 27989 {
27991 charpos = p; 27990 charpos = p;
27992 obj = WGET (w, buffer); 27991 obj = w->buffer;
27993 } 27992 }
27994 } 27993 }
27995 } 27994 }
@@ -28040,7 +28039,7 @@ note_mouse_highlight (struct frame *f, int x, int y)
28040 ptrdiff_t p = string_buffer_position (obj, start); 28039 ptrdiff_t p = string_buffer_position (obj, start);
28041 if (p > 0) 28040 if (p > 0)
28042 pointer = Fget_char_property (make_number (p), 28041 pointer = Fget_char_property (make_number (p),
28043 Qpointer, WGET (w, buffer)); 28042 Qpointer, w->buffer);
28044 } 28043 }
28045 } 28044 }
28046 else if (BUFFERP (obj) 28045 else if (BUFFERP (obj)
@@ -28078,7 +28077,7 @@ note_mouse_highlight (struct frame *f, int x, int y)
28078void 28077void
28079x_clear_window_mouse_face (struct window *w) 28078x_clear_window_mouse_face (struct window *w)
28080{ 28079{
28081 Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (XFRAME (WGET (w, frame))); 28080 Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (XFRAME (w->frame));
28082 Lisp_Object window; 28081 Lisp_Object window;
28083 28082
28084 BLOCK_INPUT; 28083 BLOCK_INPUT;
@@ -28100,7 +28099,7 @@ cancel_mouse_face (struct frame *f)
28100 Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f); 28099 Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f);
28101 28100
28102 window = hlinfo->mouse_face_window; 28101 window = hlinfo->mouse_face_window;
28103 if (! NILP (window) && XFRAME (WGET (XWINDOW (window), frame)) == f) 28102 if (! NILP (window) && XFRAME (XWINDOW (window)->frame) == f)
28104 { 28103 {
28105 hlinfo->mouse_face_beg_row = hlinfo->mouse_face_beg_col = -1; 28104 hlinfo->mouse_face_beg_row = hlinfo->mouse_face_beg_col = -1;
28106 hlinfo->mouse_face_end_row = hlinfo->mouse_face_end_col = -1; 28105 hlinfo->mouse_face_end_row = hlinfo->mouse_face_end_col = -1;
@@ -28294,7 +28293,7 @@ x_draw_vertical_border (struct window *w)
28294 do it for frames with vertical scroll bars because either the 28293 do it for frames with vertical scroll bars because either the
28295 right scroll bar of a window, or the left scroll bar of its 28294 right scroll bar of a window, or the left scroll bar of its
28296 neighbor will suffice as a border. */ 28295 neighbor will suffice as a border. */
28297 if (FRAME_HAS_VERTICAL_SCROLL_BARS (XFRAME (WGET (w, frame)))) 28296 if (FRAME_HAS_VERTICAL_SCROLL_BARS (XFRAME (w->frame)))
28298 return; 28297 return;
28299 28298
28300 if (!WINDOW_RIGHTMOST_P (w) 28299 if (!WINDOW_RIGHTMOST_P (w)
@@ -28334,7 +28333,7 @@ x_draw_vertical_border (struct window *w)
28334static int 28333static int
28335expose_window (struct window *w, XRectangle *fr) 28334expose_window (struct window *w, XRectangle *fr)
28336{ 28335{
28337 struct frame *f = XFRAME (WGET (w, frame)); 28336 struct frame *f = XFRAME (w->frame);
28338 XRectangle wr, r; 28337 XRectangle wr, r;
28339 int mouse_face_overwritten_p = 0; 28338 int mouse_face_overwritten_p = 0;
28340 28339
@@ -28475,21 +28474,21 @@ expose_window (struct window *w, XRectangle *fr)
28475static int 28474static int
28476expose_window_tree (struct window *w, XRectangle *r) 28475expose_window_tree (struct window *w, XRectangle *r)
28477{ 28476{
28478 struct frame *f = XFRAME (WGET (w, frame)); 28477 struct frame *f = XFRAME (w->frame);
28479 int mouse_face_overwritten_p = 0; 28478 int mouse_face_overwritten_p = 0;
28480 28479
28481 while (w && !FRAME_GARBAGED_P (f)) 28480 while (w && !FRAME_GARBAGED_P (f))
28482 { 28481 {
28483 if (!NILP (WGET (w, hchild))) 28482 if (!NILP (w->hchild))
28484 mouse_face_overwritten_p 28483 mouse_face_overwritten_p
28485 |= expose_window_tree (XWINDOW (WGET (w, hchild)), r); 28484 |= expose_window_tree (XWINDOW (w->hchild), r);
28486 else if (!NILP (WGET (w, vchild))) 28485 else if (!NILP (w->vchild))
28487 mouse_face_overwritten_p 28486 mouse_face_overwritten_p
28488 |= expose_window_tree (XWINDOW (WGET (w, vchild)), r); 28487 |= expose_window_tree (XWINDOW (w->vchild), r);
28489 else 28488 else
28490 mouse_face_overwritten_p |= expose_window (w, r); 28489 mouse_face_overwritten_p |= expose_window (w, r);
28491 28490
28492 w = NILP (WGET (w, next)) ? NULL : XWINDOW (WGET (w, next)); 28491 w = NILP (w->next) ? NULL : XWINDOW (w->next);
28493 } 28492 }
28494 28493
28495 return mouse_face_overwritten_p; 28494 return mouse_face_overwritten_p;
@@ -29281,7 +29280,7 @@ init_xdisp (void)
29281 if (!noninteractive) 29280 if (!noninteractive)
29282 { 29281 {
29283 struct window *m = XWINDOW (minibuf_window); 29282 struct window *m = XWINDOW (minibuf_window);
29284 Lisp_Object frame = WGET (m, frame); 29283 Lisp_Object frame = m->frame;
29285 struct frame *f = XFRAME (frame); 29284 struct frame *f = XFRAME (frame);
29286 Lisp_Object root = FRAME_ROOT_WINDOW (f); 29285 Lisp_Object root = FRAME_ROOT_WINDOW (f);
29287 struct window *r = XWINDOW (root); 29286 struct window *r = XWINDOW (root);
diff --git a/src/xfaces.c b/src/xfaces.c
index 66d7d348c9c..ea73001f758 100644
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -6032,7 +6032,7 @@ face_at_buffer_position (struct window *w, ptrdiff_t pos,
6032 ptrdiff_t *endptr, ptrdiff_t limit, 6032 ptrdiff_t *endptr, ptrdiff_t limit,
6033 int mouse, int base_face_id) 6033 int mouse, int base_face_id)
6034{ 6034{
6035 struct frame *f = XFRAME (WGET (w, frame)); 6035 struct frame *f = XFRAME (w->frame);
6036 Lisp_Object attrs[LFACE_VECTOR_SIZE]; 6036 Lisp_Object attrs[LFACE_VECTOR_SIZE];
6037 Lisp_Object prop, position; 6037 Lisp_Object prop, position;
6038 ptrdiff_t i, noverlays; 6038 ptrdiff_t i, noverlays;
@@ -6054,9 +6054,9 @@ face_at_buffer_position (struct window *w, ptrdiff_t pos,
6054 6054
6055 /* Get the `face' or `mouse_face' text property at POS, and 6055 /* Get the `face' or `mouse_face' text property at POS, and
6056 determine the next position at which the property changes. */ 6056 determine the next position at which the property changes. */
6057 prop = Fget_text_property (position, propname, WGET (w, buffer)); 6057 prop = Fget_text_property (position, propname, w->buffer);
6058 XSETFASTINT (limit1, (limit < endpos ? limit : endpos)); 6058 XSETFASTINT (limit1, (limit < endpos ? limit : endpos));
6059 end = Fnext_single_property_change (position, propname, WGET (w, buffer), limit1); 6059 end = Fnext_single_property_change (position, propname, w->buffer, limit1);
6060 if (INTEGERP (end)) 6060 if (INTEGERP (end))
6061 endpos = XINT (end); 6061 endpos = XINT (end);
6062 6062
@@ -6142,7 +6142,7 @@ face_for_overlay_string (struct window *w, ptrdiff_t pos,
6142 ptrdiff_t *endptr, ptrdiff_t limit, 6142 ptrdiff_t *endptr, ptrdiff_t limit,
6143 int mouse, Lisp_Object overlay) 6143 int mouse, Lisp_Object overlay)
6144{ 6144{
6145 struct frame *f = XFRAME (WGET (w, frame)); 6145 struct frame *f = XFRAME (w->frame);
6146 Lisp_Object attrs[LFACE_VECTOR_SIZE]; 6146 Lisp_Object attrs[LFACE_VECTOR_SIZE];
6147 Lisp_Object prop, position; 6147 Lisp_Object prop, position;
6148 ptrdiff_t endpos; 6148 ptrdiff_t endpos;
@@ -6162,9 +6162,9 @@ face_for_overlay_string (struct window *w, ptrdiff_t pos,
6162 6162
6163 /* Get the `face' or `mouse_face' text property at POS, and 6163 /* Get the `face' or `mouse_face' text property at POS, and
6164 determine the next position at which the property changes. */ 6164 determine the next position at which the property changes. */
6165 prop = Fget_text_property (position, propname, WGET (w, buffer)); 6165 prop = Fget_text_property (position, propname, w->buffer);
6166 XSETFASTINT (limit1, (limit < endpos ? limit : endpos)); 6166 XSETFASTINT (limit1, (limit < endpos ? limit : endpos));
6167 end = Fnext_single_property_change (position, propname, WGET (w, buffer), limit1); 6167 end = Fnext_single_property_change (position, propname, w->buffer, limit1);
6168 if (INTEGERP (end)) 6168 if (INTEGERP (end))
6169 endpos = XINT (end); 6169 endpos = XINT (end);
6170 6170
diff --git a/src/xfns.c b/src/xfns.c
index 58c1efc2803..b4d3e84602e 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -2260,7 +2260,7 @@ free_frame_xic (struct frame *f)
2260void 2260void
2261xic_set_preeditarea (struct window *w, int x, int y) 2261xic_set_preeditarea (struct window *w, int x, int y)
2262{ 2262{
2263 struct frame *f = XFRAME (WGET (w, frame)); 2263 struct frame *f = XFRAME (w->frame);
2264 XVaNestedList attr; 2264 XVaNestedList attr;
2265 XPoint spot; 2265 XPoint spot;
2266 2266
@@ -5085,13 +5085,13 @@ Text larger than the specified size is clipped. */)
5085 WSET (w, total_lines, make_number (40)); 5085 WSET (w, total_lines, make_number (40));
5086 } 5086 }
5087 5087
5088 FRAME_TOTAL_COLS (f) = XINT (WGET (w, total_cols)); 5088 FRAME_TOTAL_COLS (f) = XINT (w->total_cols);
5089 adjust_glyphs (f); 5089 adjust_glyphs (f);
5090 w->pseudo_window_p = 1; 5090 w->pseudo_window_p = 1;
5091 5091
5092 /* Display the tooltip text in a temporary buffer. */ 5092 /* Display the tooltip text in a temporary buffer. */
5093 old_buffer = current_buffer; 5093 old_buffer = current_buffer;
5094 set_buffer_internal_1 (XBUFFER (WGET (XWINDOW (FRAME_ROOT_WINDOW (f)), buffer))); 5094 set_buffer_internal_1 (XBUFFER (XWINDOW (FRAME_ROOT_WINDOW (f))->buffer));
5095 BVAR (current_buffer, truncate_lines) = Qnil; 5095 BVAR (current_buffer, truncate_lines) = Qnil;
5096 clear_glyph_matrix (w->desired_matrix); 5096 clear_glyph_matrix (w->desired_matrix);
5097 clear_glyph_matrix (w->current_matrix); 5097 clear_glyph_matrix (w->current_matrix);
diff --git a/src/xmenu.c b/src/xmenu.c
index 24d17c1836e..ab790094f85 100644
--- a/src/xmenu.c
+++ b/src/xmenu.c
@@ -985,7 +985,7 @@ set_frame_menubar (FRAME_PTR f, int first_time, int deep_p)
985 if (! menubar_widget) 985 if (! menubar_widget)
986 previous_menu_items_used = 0; 986 previous_menu_items_used = 0;
987 987
988 buffer = WGET (XWINDOW (FRAME_SELECTED_WINDOW (f)), buffer); 988 buffer = XWINDOW (FRAME_SELECTED_WINDOW (f))->buffer;
989 specbind (Qinhibit_quit, Qt); 989 specbind (Qinhibit_quit, Qt);
990 /* Don't let the debugger step into this code 990 /* Don't let the debugger step into this code
991 because it is not reentrant. */ 991 because it is not reentrant. */
diff --git a/src/xterm.c b/src/xterm.c
index 84b3a2aaddf..85b9cc8dfba 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -628,7 +628,7 @@ x_draw_vertical_window_border (struct window *w, int x, int y0, int y1)
628static void 628static void
629x_update_window_end (struct window *w, int cursor_on_p, int mouse_face_overwritten_p) 629x_update_window_end (struct window *w, int cursor_on_p, int mouse_face_overwritten_p)
630{ 630{
631 Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (XFRAME (WGET (w, frame))); 631 Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (XFRAME (w->frame));
632 632
633 if (!w->pseudo_window_p) 633 if (!w->pseudo_window_p)
634 { 634 {
@@ -728,7 +728,7 @@ x_after_update_window_line (struct glyph_row *desired_row)
728 overhead is very small. */ 728 overhead is very small. */
729 if (windows_or_buffers_changed 729 if (windows_or_buffers_changed
730 && desired_row->full_width_p 730 && desired_row->full_width_p
731 && (f = XFRAME (WGET (w, frame)), 731 && (f = XFRAME (w->frame),
732 width = FRAME_INTERNAL_BORDER_WIDTH (f), 732 width = FRAME_INTERNAL_BORDER_WIDTH (f),
733 width != 0) 733 width != 0)
734 && (height = desired_row->visible_height, 734 && (height = desired_row->visible_height,
@@ -3295,7 +3295,7 @@ x_ins_del_lines (struct frame *f, int vpos, int n)
3295static void 3295static void
3296x_scroll_run (struct window *w, struct run *run) 3296x_scroll_run (struct window *w, struct run *run)
3297{ 3297{
3298 struct frame *f = XFRAME (WGET (w, frame)); 3298 struct frame *f = XFRAME (w->frame);
3299 int x, y, width, height, from_y, to_y, bottom_y; 3299 int x, y, width, height, from_y, to_y, bottom_y;
3300 3300
3301 /* Get frame-relative bounding box of the text display area of W, 3301 /* Get frame-relative bounding box of the text display area of W,
@@ -4244,9 +4244,9 @@ xt_action_hook (Widget widget, XtPointer client_data, String action_name,
4244 scroll_bar_end_scroll, 0, 0); 4244 scroll_bar_end_scroll, 0, 0);
4245 w = XWINDOW (window_being_scrolled); 4245 w = XWINDOW (window_being_scrolled);
4246 4246
4247 if (!NILP (XSCROLL_BAR (WGET (w, vertical_scroll_bar))->dragging)) 4247 if (!NILP (XSCROLL_BAR (w->vertical_scroll_bar)->dragging))
4248 { 4248 {
4249 XSCROLL_BAR (WGET (w, vertical_scroll_bar))->dragging = Qnil; 4249 XSCROLL_BAR (w->vertical_scroll_bar)->dragging = Qnil;
4250 /* The thumb size is incorrect while dragging: fix it. */ 4250 /* The thumb size is incorrect while dragging: fix it. */
4251 set_vertical_scroll_bar (w); 4251 set_vertical_scroll_bar (w);
4252 } 4252 }
@@ -4277,7 +4277,7 @@ x_send_scroll_bar_event (Lisp_Object window, int part, int portion, int whole)
4277 XEvent event; 4277 XEvent event;
4278 XClientMessageEvent *ev = (XClientMessageEvent *) &event; 4278 XClientMessageEvent *ev = (XClientMessageEvent *) &event;
4279 struct window *w = XWINDOW (window); 4279 struct window *w = XWINDOW (window);
4280 struct frame *f = XFRAME (WGET (w, frame)); 4280 struct frame *f = XFRAME (w->frame);
4281 ptrdiff_t i; 4281 ptrdiff_t i;
4282 4282
4283 BLOCK_INPUT; 4283 BLOCK_INPUT;
@@ -4353,7 +4353,7 @@ x_scroll_bar_to_input_event (XEvent *event, struct input_event *ievent)
4353 ievent->timestamp = CurrentTime; 4353 ievent->timestamp = CurrentTime;
4354#else 4354#else
4355 ievent->timestamp = 4355 ievent->timestamp =
4356 XtLastTimestampProcessed (FRAME_X_DISPLAY (XFRAME (WGET (w, frame)))); 4356 XtLastTimestampProcessed (FRAME_X_DISPLAY (XFRAME (w->frame)));
4357#endif 4357#endif
4358 ievent->part = ev->data.l[1]; 4358 ievent->part = ev->data.l[1];
4359 ievent->code = ev->data.l[2]; 4359 ievent->code = ev->data.l[2];
@@ -4954,7 +4954,7 @@ x_set_toolkit_scroll_bar_thumb (struct scroll_bar *bar, int portion, int positio
4954static struct scroll_bar * 4954static struct scroll_bar *
4955x_scroll_bar_create (struct window *w, int top, int left, int width, int height) 4955x_scroll_bar_create (struct window *w, int top, int left, int width, int height)
4956{ 4956{
4957 struct frame *f = XFRAME (WGET (w, frame)); 4957 struct frame *f = XFRAME (w->frame);
4958 struct scroll_bar *bar 4958 struct scroll_bar *bar
4959 = ALLOCATE_PSEUDOVECTOR (struct scroll_bar, x_window, PVEC_OTHER); 4959 = ALLOCATE_PSEUDOVECTOR (struct scroll_bar, x_window, PVEC_OTHER);
4960 Lisp_Object barobj; 4960 Lisp_Object barobj;
@@ -5196,7 +5196,7 @@ x_scroll_bar_remove (struct scroll_bar *bar)
5196static void 5196static void
5197XTset_vertical_scroll_bar (struct window *w, int portion, int whole, int position) 5197XTset_vertical_scroll_bar (struct window *w, int portion, int whole, int position)
5198{ 5198{
5199 struct frame *f = XFRAME (WGET (w, frame)); 5199 struct frame *f = XFRAME (w->frame);
5200 Lisp_Object barobj; 5200 Lisp_Object barobj;
5201 struct scroll_bar *bar; 5201 struct scroll_bar *bar;
5202 int top, height, left, sb_left, width, sb_width; 5202 int top, height, left, sb_left, width, sb_width;
@@ -5248,7 +5248,7 @@ XTset_vertical_scroll_bar (struct window *w, int portion, int whole, int positio
5248#endif 5248#endif
5249 5249
5250 /* Does the scroll bar exist yet? */ 5250 /* Does the scroll bar exist yet? */
5251 if (NILP (WGET (w, vertical_scroll_bar))) 5251 if (NILP (w->vertical_scroll_bar))
5252 { 5252 {
5253 if (width > 0 && height > 0) 5253 if (width > 0 && height > 0)
5254 { 5254 {
@@ -5271,7 +5271,7 @@ XTset_vertical_scroll_bar (struct window *w, int portion, int whole, int positio
5271 /* It may just need to be moved and resized. */ 5271 /* It may just need to be moved and resized. */
5272 unsigned int mask = 0; 5272 unsigned int mask = 0;
5273 5273
5274 bar = XSCROLL_BAR (WGET (w, vertical_scroll_bar)); 5274 bar = XSCROLL_BAR (w->vertical_scroll_bar);
5275 5275
5276 BLOCK_INPUT; 5276 BLOCK_INPUT;
5277 5277
@@ -5441,10 +5441,10 @@ XTredeem_scroll_bar (struct window *window)
5441 Lisp_Object barobj; 5441 Lisp_Object barobj;
5442 5442
5443 /* We can't redeem this window's scroll bar if it doesn't have one. */ 5443 /* We can't redeem this window's scroll bar if it doesn't have one. */
5444 if (NILP (WGET (window, vertical_scroll_bar))) 5444 if (NILP (window->vertical_scroll_bar))
5445 abort (); 5445 abort ();
5446 5446
5447 bar = XSCROLL_BAR (WGET (window, vertical_scroll_bar)); 5447 bar = XSCROLL_BAR (window->vertical_scroll_bar);
5448 5448
5449 /* Unlink it from the condemned list. */ 5449 /* Unlink it from the condemned list. */
5450 f = XFRAME (WINDOW_FRAME (window)); 5450 f = XFRAME (WINDOW_FRAME (window));
@@ -5452,11 +5452,11 @@ XTredeem_scroll_bar (struct window *window)
5452 { 5452 {
5453 /* If the prev pointer is nil, it must be the first in one of 5453 /* If the prev pointer is nil, it must be the first in one of
5454 the lists. */ 5454 the lists. */
5455 if (EQ (FRAME_SCROLL_BARS (f), WGET (window, vertical_scroll_bar))) 5455 if (EQ (FRAME_SCROLL_BARS (f), window->vertical_scroll_bar))
5456 /* It's not condemned. Everything's fine. */ 5456 /* It's not condemned. Everything's fine. */
5457 return; 5457 return;
5458 else if (EQ (FRAME_CONDEMNED_SCROLL_BARS (f), 5458 else if (EQ (FRAME_CONDEMNED_SCROLL_BARS (f),
5459 WGET (window, vertical_scroll_bar))) 5459 window->vertical_scroll_bar))
5460 FSET (f, condemned_scroll_bars, bar->next); 5460 FSET (f, condemned_scroll_bars, bar->next);
5461 else 5461 else
5462 /* If its prev pointer is nil, it must be at the front of 5462 /* If its prev pointer is nil, it must be at the front of
@@ -5616,7 +5616,7 @@ x_scroll_bar_handle_click (struct scroll_bar *bar, XEvent *event, struct input_e
5616static void 5616static void
5617x_scroll_bar_note_movement (struct scroll_bar *bar, XEvent *event) 5617x_scroll_bar_note_movement (struct scroll_bar *bar, XEvent *event)
5618{ 5618{
5619 FRAME_PTR f = XFRAME (WGET (XWINDOW (bar->window), frame)); 5619 FRAME_PTR f = XFRAME (XWINDOW (bar->window)->frame);
5620 5620
5621 last_mouse_movement_time = event->xmotion.time; 5621 last_mouse_movement_time = event->xmotion.time;
5622 5622
@@ -6790,8 +6790,8 @@ handle_one_xevent (struct x_display_info *dpyinfo, XEvent *eventptr,
6790 create event iff we don't leave the 6790 create event iff we don't leave the
6791 selected frame. */ 6791 selected frame. */
6792 && (focus_follows_mouse 6792 && (focus_follows_mouse
6793 || (EQ (WGET (XWINDOW (window), frame), 6793 || (EQ (XWINDOW (window)->frame,
6794 WGET (XWINDOW (selected_window), frame))))) 6794 XWINDOW (selected_window)->frame))))
6795 { 6795 {
6796 inev.ie.kind = SELECT_WINDOW_EVENT; 6796 inev.ie.kind = SELECT_WINDOW_EVENT;
6797 inev.ie.frame_or_window = window; 6797 inev.ie.frame_or_window = window;
@@ -7340,7 +7340,7 @@ x_draw_hollow_cursor (struct window *w, struct glyph_row *row)
7340static void 7340static void
7341x_draw_bar_cursor (struct window *w, struct glyph_row *row, int width, enum text_cursor_kinds kind) 7341x_draw_bar_cursor (struct window *w, struct glyph_row *row, int width, enum text_cursor_kinds kind)
7342{ 7342{
7343 struct frame *f = XFRAME (WGET (w, frame)); 7343 struct frame *f = XFRAME (w->frame);
7344 struct glyph *cursor_glyph; 7344 struct glyph *cursor_glyph;
7345 7345
7346 /* If cursor is out of bounds, don't draw garbage. This can happen 7346 /* If cursor is out of bounds, don't draw garbage. This can happen