aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDmitry Antipov2012-08-06 14:24:26 +0400
committerDmitry Antipov2012-08-06 14:24:26 +0400
commit077288cf3f654776ee44bc9b56954c4e26b10d96 (patch)
tree00bbcb4dab9c879efde73a01786977b1c1364f67 /src
parent71688bd7f9169c12ea8be54e084470f19d44ce44 (diff)
downloademacs-077288cf3f654776ee44bc9b56954c4e26b10d96.tar.gz
emacs-077288cf3f654776ee44bc9b56954c4e26b10d96.zip
Separate read and write access to Lisp_Object slots of struct window.
* window.h (WGET, WSET): New macros similar to AREF and ASET. * 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/ChangeLog11
-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.c265
-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.c64
-rw-r--r--src/frame.h2
-rw-r--r--src/fringe.c14
-rw-r--r--src/indent.c28
-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.m32
-rw-r--r--src/print.c4
-rw-r--r--src/textprop.c2
-rw-r--r--src/w32fns.c17
-rw-r--r--src/w32menu.c2
-rw-r--r--src/w32term.c30
-rw-r--r--src/window.c1278
-rw-r--r--src/window.h77
-rw-r--r--src/xdisp.c673
-rw-r--r--src/xfaces.c12
-rw-r--r--src/xfns.c19
-rw-r--r--src/xmenu.c4
-rw-r--r--src/xterm.c44
35 files changed, 1357 insertions, 1339 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index d216ecc4e4b..f443a948331 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,16 @@
12012-08-06 Dmitry Antipov <dmantipov@yandex.ru> 12012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2 2
3 Separate read and write access to Lisp_Object slots of struct window.
4 * window.h (WGET, WSET): New macros similar to AREF and ASET.
5 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
6 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
7 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
8 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
9 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
10 Adjust users.
11
122012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
13
3 Fix Windows build errors introduced after converting to FGET and FSET. 14 Fix Windows build errors introduced after converting to FGET and FSET.
4 * w32term.c (x_frame_rehighlight, x_scroll_bar_create): 15 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
5 (w32_condemn_scroll_bars, w32_redeem_scroll_bar): 16 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
diff --git a/src/alloc.c b/src/alloc.c
index 7d1ff7625f2..0f425668a11 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -6015,7 +6015,7 @@ mark_object (Lisp_Object arg)
6015 /* Mark glyphs for leaf windows. Marking window 6015 /* Mark glyphs for leaf windows. Marking window
6016 matrices is sufficient because frame matrices 6016 matrices is sufficient because frame matrices
6017 use the same glyph memory. */ 6017 use the same glyph memory. */
6018 if (NILP (WVAR (w, hchild)) && NILP (WVAR (w, vchild)) 6018 if (NILP (WGET (w, hchild)) && NILP (WGET (w, vchild))
6019 && w->current_matrix) 6019 && w->current_matrix)
6020 { 6020 {
6021 mark_glyph_matrix (w->current_matrix); 6021 mark_glyph_matrix (w->current_matrix);
diff --git a/src/buffer.c b/src/buffer.c
index 445f7bea263..6085746ee6e 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, WVAR (XWINDOW (minibuf_window), buffer))) 1563 if (EQ (buffer, WGET (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, WVAR (XWINDOW (minibuf_window), buffer)) 1614 if (EQ (tem, WGET (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 (WVAR (XWINDOW (w), pointm)) 2196 if (MARKERP (WGET (XWINDOW (w), pointm))
2197 && (EQ (WVAR (XWINDOW (w), buffer), buf1) 2197 && (EQ (WGET (XWINDOW (w), buffer), buf1)
2198 || EQ (WVAR (XWINDOW (w), buffer), buf2))) 2198 || EQ (WGET (XWINDOW (w), buffer), buf2)))
2199 Fset_marker (WVAR (XWINDOW (w), pointm), 2199 Fset_marker (WGET (XWINDOW (w), pointm),
2200 make_number 2200 make_number
2201 (BUF_BEGV (XBUFFER (WVAR (XWINDOW (w), buffer)))), 2201 (BUF_BEGV (XBUFFER (WGET (XWINDOW (w), buffer)))),
2202 WVAR (XWINDOW (w), buffer)); 2202 WGET (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 (WVAR (XWINDOW (selected_window), buffer))) 3678 if (buf != XBUFFER (WGET (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 269bdc88bfe..16fa3cce684 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 (WVAR (win, frame)); 912 FRAME_PTR f = XFRAME (WGET (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 = WVAR (win, frame); 948 font_object = WGET (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 47a3f971f25..09869501ad9 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 (WVAR (W, frame)), \ 1382 : estimate_mode_line_height (XFRAME (WGET (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 (WVAR (W, frame)),\ 1395 : estimate_mode_line_height (XFRAME (WGET (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 (WVAR (W, buffer)) \ 1414 && BUFFERP (WGET (W, buffer)) \
1415 && !NILP (BVAR (XBUFFER (WVAR (W, buffer)), mode_line_format)) \ 1415 && !NILP (BVAR (XBUFFER (WGET (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 (WVAR (W, buffer)) \ 1424 && BUFFERP (WGET (W, buffer)) \
1425 && !NILP (BVAR (XBUFFER (WVAR (W, buffer)), header_line_format)) \ 1425 && !NILP (BVAR (XBUFFER (WGET (W, buffer)), header_line_format)) \
1426 && WINDOW_TOTAL_LINES (W) > 1 \ 1426 && WINDOW_TOTAL_LINES (W) > 1 \
1427 + !NILP (BVAR (XBUFFER (WVAR (W, buffer)), mode_line_format))) 1427 + !NILP (BVAR (XBUFFER (WGET (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 63fc35fd93e..10206ecd43b 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -268,9 +268,9 @@ add_window_display_history (struct window *w, const char *msg, int paused_p)
268 "%"pMu": window %p (`%s')%s\n%s", 268 "%"pMu": window %p (`%s')%s\n%s",
269 history_tick++, 269 history_tick++,
270 w, 270 w,
271 ((BUFFERP (WVAR (w, buffer)) 271 ((BUFFERP (WGET (w, buffer))
272 && STRINGP (BVAR (XBUFFER (WVAR (w, buffer)), name))) 272 && STRINGP (BVAR (XBUFFER (WGET (w, buffer)), name)))
273 ? SSDATA (BVAR (XBUFFER (WVAR (w, buffer)), name)) 273 ? SSDATA (BVAR (XBUFFER (WGET (w, buffer)), name))
274 : "???"), 274 : "???"),
275 paused_p ? " ***paused***" : "", 275 paused_p ? " ***paused***" : "",
276 msg); 276 msg);
@@ -408,7 +408,7 @@ margin_glyphs_to_reserve (struct window *w, int total_glyphs, Lisp_Object margin
408 408
409 if (NUMBERP (margin)) 409 if (NUMBERP (margin))
410 { 410 {
411 int width = XFASTINT (WVAR (w, total_cols)); 411 int width = XFASTINT (WGET (w, total_cols));
412 double d = max (0, XFLOATINT (margin)); 412 double d = max (0, XFLOATINT (margin));
413 d = min (width / 2 - 1, d); 413 d = min (width / 2 - 1, d);
414 n = (int) ((double) total_glyphs / width * d); 414 n = (int) ((double) total_glyphs / width * d);
@@ -478,8 +478,8 @@ adjust_glyph_matrix (struct window *w, struct glyph_matrix *matrix, int x, int y
478 the matrix means preventing redisplay. */ 478 the matrix means preventing redisplay. */
479 if (matrix->pool == NULL) 479 if (matrix->pool == NULL)
480 { 480 {
481 left = margin_glyphs_to_reserve (w, dim.width, WVAR (w, left_margin_cols)); 481 left = margin_glyphs_to_reserve (w, dim.width, WGET (w, left_margin_cols));
482 right = margin_glyphs_to_reserve (w, dim.width, WVAR (w, right_margin_cols)); 482 right = margin_glyphs_to_reserve (w, dim.width, WGET (w, right_margin_cols));
483 eassert (left >= 0 && right >= 0); 483 eassert (left >= 0 && right >= 0);
484 marginal_areas_changed_p = (left != matrix->left_margin_glyphs 484 marginal_areas_changed_p = (left != matrix->left_margin_glyphs
485 || right != matrix->right_margin_glyphs); 485 || right != matrix->right_margin_glyphs);
@@ -518,9 +518,9 @@ adjust_glyph_matrix (struct window *w, struct glyph_matrix *matrix, int x, int y
518 if (w) 518 if (w)
519 { 519 {
520 left = margin_glyphs_to_reserve (w, dim.width, 520 left = margin_glyphs_to_reserve (w, dim.width,
521 WVAR (w, left_margin_cols)); 521 WGET (w, left_margin_cols));
522 right = margin_glyphs_to_reserve (w, dim.width, 522 right = margin_glyphs_to_reserve (w, dim.width,
523 WVAR (w, right_margin_cols)); 523 WGET (w, right_margin_cols));
524 } 524 }
525 else 525 else
526 left = right = 0; 526 left = right = 0;
@@ -643,9 +643,9 @@ adjust_glyph_matrix (struct window *w, struct glyph_matrix *matrix, int x, int y
643 643
644 /* Window end is invalid, if inside of the rows that 644 /* Window end is invalid, if inside of the rows that
645 are invalidated below. */ 645 are invalidated below. */
646 if (INTEGERP (WVAR (w, window_end_vpos)) 646 if (INTEGERP (WGET (w, window_end_vpos))
647 && XFASTINT (WVAR (w, window_end_vpos)) >= i) 647 && XFASTINT (WGET (w, window_end_vpos)) >= i)
648 WVAR (w, window_end_valid) = Qnil; 648 WSET (w, window_end_valid, Qnil);
649 649
650 while (i < matrix->nrows) 650 while (i < matrix->nrows)
651 matrix->rows[i++].enabled_p = 0; 651 matrix->rows[i++].enabled_p = 0;
@@ -885,15 +885,15 @@ clear_window_matrices (struct window *w, int desired_p)
885{ 885{
886 while (w) 886 while (w)
887 { 887 {
888 if (!NILP (WVAR (w, hchild))) 888 if (!NILP (WGET (w, hchild)))
889 { 889 {
890 eassert (WINDOWP (WVAR (w, hchild))); 890 eassert (WINDOWP (WGET (w, hchild)));
891 clear_window_matrices (XWINDOW (WVAR (w, hchild)), desired_p); 891 clear_window_matrices (XWINDOW (WGET (w, hchild)), desired_p);
892 } 892 }
893 else if (!NILP (WVAR (w, vchild))) 893 else if (!NILP (WGET (w, vchild)))
894 { 894 {
895 eassert (WINDOWP (WVAR (w, vchild))); 895 eassert (WINDOWP (WGET (w, vchild)));
896 clear_window_matrices (XWINDOW (WVAR (w, vchild)), desired_p); 896 clear_window_matrices (XWINDOW (WGET (w, vchild)), desired_p);
897 } 897 }
898 else 898 else
899 { 899 {
@@ -902,11 +902,11 @@ clear_window_matrices (struct window *w, int desired_p)
902 else 902 else
903 { 903 {
904 clear_glyph_matrix (w->current_matrix); 904 clear_glyph_matrix (w->current_matrix);
905 WVAR (w, window_end_valid) = Qnil; 905 WSET (w, window_end_valid, Qnil);
906 } 906 }
907 } 907 }
908 908
909 w = NILP (WVAR (w, next)) ? 0 : XWINDOW (WVAR (w, next)); 909 w = NILP (WGET (w, next)) ? 0 : XWINDOW (WGET (w, next));
910 } 910 }
911} 911}
912 912
@@ -970,7 +970,7 @@ blank_row (struct window *w, struct glyph_row *row, int y)
970 clear_glyph_row (row); 970 clear_glyph_row (row);
971 row->y = y; 971 row->y = y;
972 row->ascent = row->phys_ascent = 0; 972 row->ascent = row->phys_ascent = 0;
973 row->height = row->phys_height = FRAME_LINE_HEIGHT (XFRAME (WVAR (w, frame))); 973 row->height = row->phys_height = FRAME_LINE_HEIGHT (XFRAME (WGET (w, frame)));
974 row->visible_height = row->height; 974 row->visible_height = row->height;
975 975
976 if (row->y < min_y) 976 if (row->y < min_y)
@@ -1516,7 +1516,7 @@ check_matrix_invariants (struct window *w)
1516 struct glyph_row *row = matrix->rows; 1516 struct glyph_row *row = matrix->rows;
1517 struct glyph_row *last_text_row = NULL; 1517 struct glyph_row *last_text_row = NULL;
1518 struct buffer *saved = current_buffer; 1518 struct buffer *saved = current_buffer;
1519 struct buffer *buffer = XBUFFER (WVAR (w, buffer)); 1519 struct buffer *buffer = XBUFFER (WGET (w, buffer));
1520 int c; 1520 int c;
1521 1521
1522 /* This can sometimes happen for a fresh window. */ 1522 /* This can sometimes happen for a fresh window. */
@@ -1679,8 +1679,8 @@ allocate_matrices_for_frame_redisplay (Lisp_Object window, int x, int y,
1679 points to the mini-buffer window, if any, which is arranged 1679 points to the mini-buffer window, if any, which is arranged
1680 vertically below other windows. */ 1680 vertically below other windows. */
1681 in_horz_combination_p 1681 in_horz_combination_p
1682 = (!NILP (WVAR (XWINDOW (window), parent)) 1682 = (!NILP (WGET (XWINDOW (window), parent))
1683 && !NILP (WVAR (XWINDOW (WVAR (XWINDOW (window), parent)), hchild))); 1683 && !NILP (WGET (XWINDOW (WGET (XWINDOW (window), parent)), hchild)));
1684 1684
1685 /* For WINDOW and all windows on the same level. */ 1685 /* For WINDOW and all windows on the same level. */
1686 do 1686 do
@@ -1689,12 +1689,12 @@ allocate_matrices_for_frame_redisplay (Lisp_Object window, int x, int y,
1689 1689
1690 /* Get the dimension of the window sub-matrix for W, depending 1690 /* Get the dimension of the window sub-matrix for W, depending
1691 on whether this is a combination or a leaf window. */ 1691 on whether this is a combination or a leaf window. */
1692 if (!NILP (WVAR (w, hchild))) 1692 if (!NILP (WGET (w, hchild)))
1693 dim = allocate_matrices_for_frame_redisplay (WVAR (w, hchild), x, y, 1693 dim = allocate_matrices_for_frame_redisplay (WGET (w, hchild), x, y,
1694 dim_only_p, 1694 dim_only_p,
1695 window_change_flags); 1695 window_change_flags);
1696 else if (!NILP (WVAR (w, vchild))) 1696 else if (!NILP (WGET (w, vchild)))
1697 dim = allocate_matrices_for_frame_redisplay (WVAR (w, vchild), x, y, 1697 dim = allocate_matrices_for_frame_redisplay (WGET (w, vchild), x, y,
1698 dim_only_p, 1698 dim_only_p,
1699 window_change_flags); 1699 window_change_flags);
1700 else 1700 else
@@ -1718,10 +1718,10 @@ allocate_matrices_for_frame_redisplay (Lisp_Object window, int x, int y,
1718 || dim.width != w->desired_matrix->matrix_w 1718 || dim.width != w->desired_matrix->matrix_w
1719 || dim.height != w->desired_matrix->matrix_h 1719 || dim.height != w->desired_matrix->matrix_h
1720 || (margin_glyphs_to_reserve (w, dim.width, 1720 || (margin_glyphs_to_reserve (w, dim.width,
1721 WVAR (w, left_margin_cols)) 1721 WGET (w, left_margin_cols))
1722 != w->desired_matrix->left_margin_glyphs) 1722 != w->desired_matrix->left_margin_glyphs)
1723 || (margin_glyphs_to_reserve (w, dim.width, 1723 || (margin_glyphs_to_reserve (w, dim.width,
1724 WVAR (w, right_margin_cols)) 1724 WGET (w, right_margin_cols))
1725 != w->desired_matrix->right_margin_glyphs)) 1725 != w->desired_matrix->right_margin_glyphs))
1726 *window_change_flags |= CHANGED_LEAF_MATRIX; 1726 *window_change_flags |= CHANGED_LEAF_MATRIX;
1727 1727
@@ -1750,7 +1750,7 @@ allocate_matrices_for_frame_redisplay (Lisp_Object window, int x, int y,
1750 hmax = max (hmax, dim.height); 1750 hmax = max (hmax, dim.height);
1751 1751
1752 /* Next window on same level. */ 1752 /* Next window on same level. */
1753 window = WVAR (w, next); 1753 window = WGET (w, next);
1754 } 1754 }
1755 while (!NILP (window)); 1755 while (!NILP (window));
1756 1756
@@ -1781,7 +1781,7 @@ static int
1781required_matrix_height (struct window *w) 1781required_matrix_height (struct window *w)
1782{ 1782{
1783#ifdef HAVE_WINDOW_SYSTEM 1783#ifdef HAVE_WINDOW_SYSTEM
1784 struct frame *f = XFRAME (WVAR (w, frame)); 1784 struct frame *f = XFRAME (WGET (w, frame));
1785 1785
1786 if (FRAME_WINDOW_P (f)) 1786 if (FRAME_WINDOW_P (f))
1787 { 1787 {
@@ -1807,7 +1807,7 @@ static int
1807required_matrix_width (struct window *w) 1807required_matrix_width (struct window *w)
1808{ 1808{
1809#ifdef HAVE_WINDOW_SYSTEM 1809#ifdef HAVE_WINDOW_SYSTEM
1810 struct frame *f = XFRAME (WVAR (w, frame)); 1810 struct frame *f = XFRAME (WGET (w, frame));
1811 if (FRAME_WINDOW_P (f)) 1811 if (FRAME_WINDOW_P (f))
1812 { 1812 {
1813 int ch_width = FRAME_SMALLEST_CHAR_WIDTH (f); 1813 int ch_width = FRAME_SMALLEST_CHAR_WIDTH (f);
@@ -1824,7 +1824,7 @@ required_matrix_width (struct window *w)
1824 } 1824 }
1825#endif /* HAVE_WINDOW_SYSTEM */ 1825#endif /* HAVE_WINDOW_SYSTEM */
1826 1826
1827 return XINT (WVAR (w, total_cols)); 1827 return XINT (WGET (w, total_cols));
1828} 1828}
1829 1829
1830 1830
@@ -1836,10 +1836,10 @@ allocate_matrices_for_window_redisplay (struct window *w)
1836{ 1836{
1837 while (w) 1837 while (w)
1838 { 1838 {
1839 if (!NILP (WVAR (w, vchild))) 1839 if (!NILP (WGET (w, vchild)))
1840 allocate_matrices_for_window_redisplay (XWINDOW (WVAR (w, vchild))); 1840 allocate_matrices_for_window_redisplay (XWINDOW (WGET (w, vchild)));
1841 else if (!NILP (WVAR (w, hchild))) 1841 else if (!NILP (WGET (w, hchild)))
1842 allocate_matrices_for_window_redisplay (XWINDOW (WVAR (w, hchild))); 1842 allocate_matrices_for_window_redisplay (XWINDOW (WGET (w, hchild)));
1843 else 1843 else
1844 { 1844 {
1845 /* W is a leaf window. */ 1845 /* W is a leaf window. */
@@ -1858,7 +1858,7 @@ allocate_matrices_for_window_redisplay (struct window *w)
1858 adjust_glyph_matrix (w, w->current_matrix, 0, 0, dim); 1858 adjust_glyph_matrix (w, w->current_matrix, 0, 0, dim);
1859 } 1859 }
1860 1860
1861 w = NILP (WVAR (w, next)) ? NULL : XWINDOW (WVAR (w, next)); 1861 w = NILP (WGET (w, next)) ? NULL : XWINDOW (WGET (w, next));
1862 } 1862 }
1863} 1863}
1864 1864
@@ -1905,20 +1905,20 @@ adjust_frame_glyphs_initially (void)
1905{ 1905{
1906 struct frame *sf = SELECTED_FRAME (); 1906 struct frame *sf = SELECTED_FRAME ();
1907 struct window *root = XWINDOW (FGET (sf, root_window)); 1907 struct window *root = XWINDOW (FGET (sf, root_window));
1908 struct window *mini = XWINDOW (WVAR (root, next)); 1908 struct window *mini = XWINDOW (WGET (root, next));
1909 int frame_lines = FRAME_LINES (sf); 1909 int frame_lines = FRAME_LINES (sf);
1910 int frame_cols = FRAME_COLS (sf); 1910 int frame_cols = FRAME_COLS (sf);
1911 int top_margin = FRAME_TOP_MARGIN (sf); 1911 int top_margin = FRAME_TOP_MARGIN (sf);
1912 1912
1913 /* Do it for the root window. */ 1913 /* Do it for the root window. */
1914 XSETFASTINT (WVAR (root, top_line), top_margin); 1914 WSET (root, top_line, make_number (top_margin));
1915 XSETFASTINT (WVAR (root, total_lines), frame_lines - 1 - top_margin); 1915 WSET (root, total_lines, make_number (frame_lines - 1 - top_margin));
1916 XSETFASTINT (WVAR (root, total_cols), frame_cols); 1916 WSET (root, total_cols, make_number (frame_cols));
1917 1917
1918 /* Do it for the mini-buffer window. */ 1918 /* Do it for the mini-buffer window. */
1919 XSETFASTINT (WVAR (mini, top_line), frame_lines - 1); 1919 WSET (mini, top_line, make_number (frame_lines - 1));
1920 XSETFASTINT (WVAR (mini, total_lines), 1); 1920 WSET (mini, total_lines, make_number (1));
1921 XSETFASTINT (WVAR (mini, total_cols), frame_cols); 1921 WSET (mini, total_cols, make_number (frame_cols));
1922 1922
1923 adjust_frame_glyphs (sf); 1923 adjust_frame_glyphs (sf);
1924 glyphs_initialized_initially_p = 1; 1924 glyphs_initialized_initially_p = 1;
@@ -1950,21 +1950,21 @@ showing_window_margins_p (struct window *w)
1950{ 1950{
1951 while (w) 1951 while (w)
1952 { 1952 {
1953 if (!NILP (WVAR (w, hchild))) 1953 if (!NILP (WGET (w, hchild)))
1954 { 1954 {
1955 if (showing_window_margins_p (XWINDOW (WVAR (w, hchild)))) 1955 if (showing_window_margins_p (XWINDOW (WGET (w, hchild))))
1956 return 1; 1956 return 1;
1957 } 1957 }
1958 else if (!NILP (WVAR (w, vchild))) 1958 else if (!NILP (WGET (w, vchild)))
1959 { 1959 {
1960 if (showing_window_margins_p (XWINDOW (WVAR (w, vchild)))) 1960 if (showing_window_margins_p (XWINDOW (WGET (w, vchild))))
1961 return 1; 1961 return 1;
1962 } 1962 }
1963 else if (!NILP (WVAR (w, left_margin_cols)) 1963 else if (!NILP (WGET (w, left_margin_cols))
1964 || !NILP (WVAR (w, right_margin_cols))) 1964 || !NILP (WGET (w, right_margin_cols)))
1965 return 1; 1965 return 1;
1966 1966
1967 w = NILP (WVAR (w, next)) ? 0 : XWINDOW (WVAR (w, next)); 1967 w = NILP (WGET (w, next)) ? 0 : XWINDOW (WGET (w, next));
1968 } 1968 }
1969 return 0; 1969 return 0;
1970} 1970}
@@ -1978,18 +1978,18 @@ fake_current_matrices (Lisp_Object window)
1978{ 1978{
1979 struct window *w; 1979 struct window *w;
1980 1980
1981 for (; !NILP (window); window = WVAR (w, next)) 1981 for (; !NILP (window); window = WGET (w, next))
1982 { 1982 {
1983 w = XWINDOW (window); 1983 w = XWINDOW (window);
1984 1984
1985 if (!NILP (WVAR (w, hchild))) 1985 if (!NILP (WGET (w, hchild)))
1986 fake_current_matrices (WVAR (w, hchild)); 1986 fake_current_matrices (WGET (w, hchild));
1987 else if (!NILP (WVAR (w, vchild))) 1987 else if (!NILP (WGET (w, vchild)))
1988 fake_current_matrices (WVAR (w, vchild)); 1988 fake_current_matrices (WGET (w, vchild));
1989 else 1989 else
1990 { 1990 {
1991 int i; 1991 int i;
1992 struct frame *f = XFRAME (WVAR (w, frame)); 1992 struct frame *f = XFRAME (WGET (w, frame));
1993 struct glyph_matrix *m = w->current_matrix; 1993 struct glyph_matrix *m = w->current_matrix;
1994 struct glyph_matrix *fm = f->current_matrix; 1994 struct glyph_matrix *fm = f->current_matrix;
1995 1995
@@ -2189,9 +2189,11 @@ adjust_frame_glyphs_for_window_redisplay (struct frame *f)
2189 struct window *w; 2189 struct window *w;
2190 if (NILP (FGET (f, menu_bar_window))) 2190 if (NILP (FGET (f, menu_bar_window)))
2191 { 2191 {
2192 Lisp_Object frame;
2192 FSET (f, menu_bar_window, make_window ()); 2193 FSET (f, menu_bar_window, make_window ());
2193 w = XWINDOW (FGET (f, menu_bar_window)); 2194 w = XWINDOW (FGET (f, menu_bar_window));
2194 XSETFRAME (WVAR (w, frame), f); 2195 XSETFRAME (frame, f);
2196 WSET (w, frame, frame);
2195 w->pseudo_window_p = 1; 2197 w->pseudo_window_p = 1;
2196 } 2198 }
2197 else 2199 else
@@ -2199,10 +2201,10 @@ adjust_frame_glyphs_for_window_redisplay (struct frame *f)
2199 2201
2200 /* Set window dimensions to frame dimensions and allocate or 2202 /* Set window dimensions to frame dimensions and allocate or
2201 adjust glyph matrices of W. */ 2203 adjust glyph matrices of W. */
2202 XSETFASTINT (WVAR (w, top_line), 0); 2204 WSET (w, top_line, make_number (0));
2203 XSETFASTINT (WVAR (w, left_col), 0); 2205 WSET (w, left_col, make_number (0));
2204 XSETFASTINT (WVAR (w, total_lines), FRAME_MENU_BAR_LINES (f)); 2206 WSET (w, total_lines, make_number (FRAME_MENU_BAR_LINES (f)));
2205 XSETFASTINT (WVAR (w, total_cols), FRAME_TOTAL_COLS (f)); 2207 WSET (w, total_cols, make_number (FRAME_TOTAL_COLS (f)));
2206 allocate_matrices_for_window_redisplay (w); 2208 allocate_matrices_for_window_redisplay (w);
2207 } 2209 }
2208#endif /* not USE_X_TOOLKIT && not USE_GTK */ 2210#endif /* not USE_X_TOOLKIT && not USE_GTK */
@@ -2215,18 +2217,20 @@ adjust_frame_glyphs_for_window_redisplay (struct frame *f)
2215 struct window *w; 2217 struct window *w;
2216 if (NILP (FGET (f, tool_bar_window))) 2218 if (NILP (FGET (f, tool_bar_window)))
2217 { 2219 {
2220 Lisp_Object frame;
2218 FSET (f, tool_bar_window, make_window ()); 2221 FSET (f, tool_bar_window, make_window ());
2219 w = XWINDOW (FGET (f, tool_bar_window)); 2222 w = XWINDOW (FGET (f, tool_bar_window));
2220 XSETFRAME (WVAR (w, frame), f); 2223 XSETFRAME (frame, f);
2224 WSET (w, frame, frame);
2221 w->pseudo_window_p = 1; 2225 w->pseudo_window_p = 1;
2222 } 2226 }
2223 else 2227 else
2224 w = XWINDOW (FGET (f, tool_bar_window)); 2228 w = XWINDOW (FGET (f, tool_bar_window));
2225 2229
2226 XSETFASTINT (WVAR (w, top_line), FRAME_MENU_BAR_LINES (f)); 2230 WSET (w, top_line, make_number (FRAME_MENU_BAR_LINES (f)));
2227 XSETFASTINT (WVAR (w, left_col), 0); 2231 WSET (w, left_col, make_number (0));
2228 XSETFASTINT (WVAR (w, total_lines), FRAME_TOOL_BAR_LINES (f)); 2232 WSET (w, total_lines, make_number (FRAME_TOOL_BAR_LINES (f)));
2229 XSETFASTINT (WVAR (w, total_cols), FRAME_TOTAL_COLS (f)); 2233 WSET (w, total_cols, make_number (FRAME_TOTAL_COLS (f)));
2230 allocate_matrices_for_window_redisplay (w); 2234 allocate_matrices_for_window_redisplay (w);
2231 } 2235 }
2232#endif 2236#endif
@@ -2336,10 +2340,10 @@ free_window_matrices (struct window *w)
2336{ 2340{
2337 while (w) 2341 while (w)
2338 { 2342 {
2339 if (!NILP (WVAR (w, hchild))) 2343 if (!NILP (WGET (w, hchild)))
2340 free_window_matrices (XWINDOW (WVAR (w, hchild))); 2344 free_window_matrices (XWINDOW (WGET (w, hchild)));
2341 else if (!NILP (WVAR (w, vchild))) 2345 else if (!NILP (WGET (w, vchild)))
2342 free_window_matrices (XWINDOW (WVAR (w, vchild))); 2346 free_window_matrices (XWINDOW (WGET (w, vchild)));
2343 else 2347 else
2344 { 2348 {
2345 /* This is a leaf window. Free its memory and reset fields 2349 /* This is a leaf window. Free its memory and reset fields
@@ -2351,7 +2355,7 @@ free_window_matrices (struct window *w)
2351 } 2355 }
2352 2356
2353 /* Next window on same level. */ 2357 /* Next window on same level. */
2354 w = NILP (WVAR (w, next)) ? 0 : XWINDOW (WVAR (w, next)); 2358 w = NILP (WGET (w, next)) ? 0 : XWINDOW (WGET (w, next));
2355 } 2359 }
2356} 2360}
2357 2361
@@ -2472,14 +2476,14 @@ build_frame_matrix_from_window_tree (struct glyph_matrix *matrix, struct window
2472{ 2476{
2473 while (w) 2477 while (w)
2474 { 2478 {
2475 if (!NILP (WVAR (w, hchild))) 2479 if (!NILP (WGET (w, hchild)))
2476 build_frame_matrix_from_window_tree (matrix, XWINDOW (WVAR (w, hchild))); 2480 build_frame_matrix_from_window_tree (matrix, XWINDOW (WGET (w, hchild)));
2477 else if (!NILP (WVAR (w, vchild))) 2481 else if (!NILP (WGET (w, vchild)))
2478 build_frame_matrix_from_window_tree (matrix, XWINDOW (WVAR (w, vchild))); 2482 build_frame_matrix_from_window_tree (matrix, XWINDOW (WGET (w, vchild)));
2479 else 2483 else
2480 build_frame_matrix_from_leaf_window (matrix, w); 2484 build_frame_matrix_from_leaf_window (matrix, w);
2481 2485
2482 w = NILP (WVAR (w, next)) ? 0 : XWINDOW (WVAR (w, next)); 2486 w = NILP (WGET (w, next)) ? 0 : XWINDOW (WGET (w, next));
2483 } 2487 }
2484} 2488}
2485 2489
@@ -2618,7 +2622,7 @@ spec_glyph_lookup_face (struct window *w, GLYPH *glyph)
2618 /* Convert the glyph's specified face to a realized (cache) face. */ 2622 /* Convert the glyph's specified face to a realized (cache) face. */
2619 if (lface_id > 0) 2623 if (lface_id > 0)
2620 { 2624 {
2621 int face_id = merge_faces (XFRAME (WVAR (w, frame)), 2625 int face_id = merge_faces (XFRAME (WGET (w, frame)),
2622 Qt, lface_id, DEFAULT_FACE_ID); 2626 Qt, lface_id, DEFAULT_FACE_ID);
2623 SET_GLYPH_FACE (*glyph, face_id); 2627 SET_GLYPH_FACE (*glyph, face_id);
2624 } 2628 }
@@ -2739,10 +2743,10 @@ mirror_make_current (struct window *w, int frame_row)
2739{ 2743{
2740 while (w) 2744 while (w)
2741 { 2745 {
2742 if (!NILP (WVAR (w, hchild))) 2746 if (!NILP (WGET (w, hchild)))
2743 mirror_make_current (XWINDOW (WVAR (w, hchild)), frame_row); 2747 mirror_make_current (XWINDOW (WGET (w, hchild)), frame_row);
2744 else if (!NILP (WVAR (w, vchild))) 2748 else if (!NILP (WGET (w, vchild)))
2745 mirror_make_current (XWINDOW (WVAR (w, vchild)), frame_row); 2749 mirror_make_current (XWINDOW (WGET (w, vchild)), frame_row);
2746 else 2750 else
2747 { 2751 {
2748 /* Row relative to window W. Don't use FRAME_TO_WINDOW_VPOS 2752 /* Row relative to window W. Don't use FRAME_TO_WINDOW_VPOS
@@ -2775,7 +2779,7 @@ mirror_make_current (struct window *w, int frame_row)
2775 } 2779 }
2776 } 2780 }
2777 2781
2778 w = NILP (WVAR (w, next)) ? 0 : XWINDOW (WVAR (w, next)); 2782 w = NILP (WGET (w, next)) ? 0 : XWINDOW (WGET (w, next));
2779 } 2783 }
2780} 2784}
2781 2785
@@ -2834,16 +2838,16 @@ mirrored_line_dance (struct glyph_matrix *matrix, int unchanged_at_top, int nlin
2834static void 2838static void
2835sync_window_with_frame_matrix_rows (struct window *w) 2839sync_window_with_frame_matrix_rows (struct window *w)
2836{ 2840{
2837 struct frame *f = XFRAME (WVAR (w, frame)); 2841 struct frame *f = XFRAME (WGET (w, frame));
2838 struct glyph_row *window_row, *window_row_end, *frame_row; 2842 struct glyph_row *window_row, *window_row_end, *frame_row;
2839 int left, right, x, width; 2843 int left, right, x, width;
2840 2844
2841 /* Preconditions: W must be a leaf window on a tty frame. */ 2845 /* Preconditions: W must be a leaf window on a tty frame. */
2842 eassert (NILP (WVAR (w, hchild)) && NILP (WVAR (w, vchild))); 2846 eassert (NILP (WGET (w, hchild)) && NILP (WGET (w, vchild)));
2843 eassert (!FRAME_WINDOW_P (f)); 2847 eassert (!FRAME_WINDOW_P (f));
2844 2848
2845 left = margin_glyphs_to_reserve (w, 1, WVAR (w, left_margin_cols)); 2849 left = margin_glyphs_to_reserve (w, 1, WGET (w, left_margin_cols));
2846 right = margin_glyphs_to_reserve (w, 1, WVAR (w, right_margin_cols)); 2850 right = margin_glyphs_to_reserve (w, 1, WGET (w, right_margin_cols));
2847 x = w->current_matrix->matrix_x; 2851 x = w->current_matrix->matrix_x;
2848 width = w->current_matrix->matrix_w; 2852 width = w->current_matrix->matrix_w;
2849 2853
@@ -2875,15 +2879,15 @@ frame_row_to_window (struct window *w, int row)
2875 2879
2876 while (w && !found) 2880 while (w && !found)
2877 { 2881 {
2878 if (!NILP (WVAR (w, hchild))) 2882 if (!NILP (WGET (w, hchild)))
2879 found = frame_row_to_window (XWINDOW (WVAR (w, hchild)), row); 2883 found = frame_row_to_window (XWINDOW (WGET (w, hchild)), row);
2880 else if (!NILP (WVAR (w, vchild))) 2884 else if (!NILP (WGET (w, vchild)))
2881 found = frame_row_to_window (XWINDOW (WVAR (w, vchild)), row); 2885 found = frame_row_to_window (XWINDOW (WGET (w, vchild)), row);
2882 else if (row >= WINDOW_TOP_EDGE_LINE (w) 2886 else if (row >= WINDOW_TOP_EDGE_LINE (w)
2883 && row < WINDOW_BOTTOM_EDGE_LINE (w)) 2887 && row < WINDOW_BOTTOM_EDGE_LINE (w))
2884 found = w; 2888 found = w;
2885 2889
2886 w = NILP (WVAR (w, next)) ? 0 : XWINDOW (WVAR (w, next)); 2890 w = NILP (WGET (w, next)) ? 0 : XWINDOW (WGET (w, next));
2887 } 2891 }
2888 2892
2889 return found; 2893 return found;
@@ -2906,11 +2910,11 @@ mirror_line_dance (struct window *w, int unchanged_at_top, int nlines, int *copy
2906{ 2910{
2907 while (w) 2911 while (w)
2908 { 2912 {
2909 if (!NILP (WVAR (w, hchild))) 2913 if (!NILP (WGET (w, hchild)))
2910 mirror_line_dance (XWINDOW (WVAR (w, hchild)), unchanged_at_top, 2914 mirror_line_dance (XWINDOW (WGET (w, hchild)), unchanged_at_top,
2911 nlines, copy_from, retained_p); 2915 nlines, copy_from, retained_p);
2912 else if (!NILP (WVAR (w, vchild))) 2916 else if (!NILP (WGET (w, vchild)))
2913 mirror_line_dance (XWINDOW (WVAR (w, vchild)), unchanged_at_top, 2917 mirror_line_dance (XWINDOW (WGET (w, vchild)), unchanged_at_top,
2914 nlines, copy_from, retained_p); 2918 nlines, copy_from, retained_p);
2915 else 2919 else
2916 { 2920 {
@@ -2966,7 +2970,7 @@ mirror_line_dance (struct window *w, int unchanged_at_top, int nlines, int *copy
2966 { 2970 {
2967 /* A copy between windows. This is an infrequent 2971 /* A copy between windows. This is an infrequent
2968 case not worth optimizing. */ 2972 case not worth optimizing. */
2969 struct frame *f = XFRAME (WVAR (w, frame)); 2973 struct frame *f = XFRAME (WGET (w, frame));
2970 struct window *root = XWINDOW (FRAME_ROOT_WINDOW (f)); 2974 struct window *root = XWINDOW (FRAME_ROOT_WINDOW (f));
2971 struct window *w2; 2975 struct window *w2;
2972 struct glyph_matrix *m2; 2976 struct glyph_matrix *m2;
@@ -3003,7 +3007,7 @@ mirror_line_dance (struct window *w, int unchanged_at_top, int nlines, int *copy
3003 } 3007 }
3004 3008
3005 /* Next window on same level. */ 3009 /* Next window on same level. */
3006 w = NILP (WVAR (w, next)) ? 0 : XWINDOW (WVAR (w, next)); 3010 w = NILP (WGET (w, next)) ? 0 : XWINDOW (WGET (w, next));
3007 } 3011 }
3008} 3012}
3009 3013
@@ -3021,18 +3025,18 @@ check_window_matrix_pointers (struct window *w)
3021{ 3025{
3022 while (w) 3026 while (w)
3023 { 3027 {
3024 if (!NILP (WVAR (w, hchild))) 3028 if (!NILP (WGET (w, hchild)))
3025 check_window_matrix_pointers (XWINDOW (WVAR (w, hchild))); 3029 check_window_matrix_pointers (XWINDOW (WGET (w, hchild)));
3026 else if (!NILP (WVAR (w, vchild))) 3030 else if (!NILP (WGET (w, vchild)))
3027 check_window_matrix_pointers (XWINDOW (WVAR (w, vchild))); 3031 check_window_matrix_pointers (XWINDOW (WGET (w, vchild)));
3028 else 3032 else
3029 { 3033 {
3030 struct frame *f = XFRAME (WVAR (w, frame)); 3034 struct frame *f = XFRAME (WGET (w, frame));
3031 check_matrix_pointers (w->desired_matrix, f->desired_matrix); 3035 check_matrix_pointers (w->desired_matrix, f->desired_matrix);
3032 check_matrix_pointers (w->current_matrix, f->current_matrix); 3036 check_matrix_pointers (w->current_matrix, f->current_matrix);
3033 } 3037 }
3034 3038
3035 w = NILP (WVAR (w, next)) ? 0 : XWINDOW (WVAR (w, next)); 3039 w = NILP (WGET (w, next)) ? 0 : XWINDOW (WGET (w, next));
3036 } 3040 }
3037} 3041}
3038 3042
@@ -3080,10 +3084,10 @@ check_matrix_pointers (struct glyph_matrix *window_matrix,
3080static int 3084static int
3081window_to_frame_vpos (struct window *w, int vpos) 3085window_to_frame_vpos (struct window *w, int vpos)
3082{ 3086{
3083 eassert (!FRAME_WINDOW_P (XFRAME (WVAR (w, frame)))); 3087 eassert (!FRAME_WINDOW_P (XFRAME (WGET (w, frame))));
3084 eassert (vpos >= 0 && vpos <= w->desired_matrix->nrows); 3088 eassert (vpos >= 0 && vpos <= w->desired_matrix->nrows);
3085 vpos += WINDOW_TOP_EDGE_LINE (w); 3089 vpos += WINDOW_TOP_EDGE_LINE (w);
3086 eassert (vpos >= 0 && vpos <= FRAME_LINES (XFRAME (WVAR (w, frame)))); 3090 eassert (vpos >= 0 && vpos <= FRAME_LINES (XFRAME (WGET (w, frame))));
3087 return vpos; 3091 return vpos;
3088} 3092}
3089 3093
@@ -3094,7 +3098,7 @@ window_to_frame_vpos (struct window *w, int vpos)
3094static int 3098static int
3095window_to_frame_hpos (struct window *w, int hpos) 3099window_to_frame_hpos (struct window *w, int hpos)
3096{ 3100{
3097 eassert (!FRAME_WINDOW_P (XFRAME (WVAR (w, frame)))); 3101 eassert (!FRAME_WINDOW_P (XFRAME (WGET (w, frame))));
3098 hpos += WINDOW_LEFT_EDGE_COL (w); 3102 hpos += WINDOW_LEFT_EDGE_COL (w);
3099 return hpos; 3103 return hpos;
3100} 3104}
@@ -3314,14 +3318,14 @@ update_window_tree (struct window *w, int force_p)
3314 3318
3315 while (w && !paused_p) 3319 while (w && !paused_p)
3316 { 3320 {
3317 if (!NILP (WVAR (w, hchild))) 3321 if (!NILP (WGET (w, hchild)))
3318 paused_p |= update_window_tree (XWINDOW (WVAR (w, hchild)), force_p); 3322 paused_p |= update_window_tree (XWINDOW (WGET (w, hchild)), force_p);
3319 else if (!NILP (WVAR (w, vchild))) 3323 else if (!NILP (WGET (w, vchild)))
3320 paused_p |= update_window_tree (XWINDOW (WVAR (w, vchild)), force_p); 3324 paused_p |= update_window_tree (XWINDOW (WGET (w, vchild)), force_p);
3321 else if (w->must_be_updated_p) 3325 else if (w->must_be_updated_p)
3322 paused_p |= update_window (w, force_p); 3326 paused_p |= update_window (w, force_p);
3323 3327
3324 w = NILP (WVAR (w, next)) ? 0 : XWINDOW (WVAR (w, next)); 3328 w = NILP (WGET (w, next)) ? 0 : XWINDOW (WGET (w, next));
3325 } 3329 }
3326 3330
3327 return paused_p; 3331 return paused_p;
@@ -3809,7 +3813,7 @@ update_text_area (struct window *w, int vpos)
3809 struct glyph *glyph = &current_row->glyphs[TEXT_AREA][i - 1]; 3813 struct glyph *glyph = &current_row->glyphs[TEXT_AREA][i - 1];
3810 int left, right; 3814 int left, right;
3811 3815
3812 rif->get_glyph_overhangs (glyph, XFRAME (WVAR (w, frame)), 3816 rif->get_glyph_overhangs (glyph, XFRAME (WGET (w, frame)),
3813 &left, &right); 3817 &left, &right);
3814 can_skip_p = (right == 0 && !abort_skipping); 3818 can_skip_p = (right == 0 && !abort_skipping);
3815 } 3819 }
@@ -3842,7 +3846,7 @@ update_text_area (struct window *w, int vpos)
3842 int left, right; 3846 int left, right;
3843 3847
3844 rif->get_glyph_overhangs (current_glyph, 3848 rif->get_glyph_overhangs (current_glyph,
3845 XFRAME (WVAR (w, frame)), 3849 XFRAME (WGET (w, frame)),
3846 &left, &right); 3850 &left, &right);
3847 while (left > 0 && i > 0) 3851 while (left > 0 && i > 0)
3848 { 3852 {
@@ -3985,7 +3989,7 @@ update_window_line (struct window *w, int vpos, int *mouse_face_overwritten_p)
3985 3989
3986 /* Update display of the left margin area, if there is one. */ 3990 /* Update display of the left margin area, if there is one. */
3987 if (!desired_row->full_width_p 3991 if (!desired_row->full_width_p
3988 && !NILP (WVAR (w, left_margin_cols))) 3992 && !NILP (WGET (w, left_margin_cols)))
3989 { 3993 {
3990 changed_p = 1; 3994 changed_p = 1;
3991 update_marginal_area (w, LEFT_MARGIN_AREA, vpos); 3995 update_marginal_area (w, LEFT_MARGIN_AREA, vpos);
@@ -4001,7 +4005,7 @@ update_window_line (struct window *w, int vpos, int *mouse_face_overwritten_p)
4001 4005
4002 /* Update display of the right margin area, if there is one. */ 4006 /* Update display of the right margin area, if there is one. */
4003 if (!desired_row->full_width_p 4007 if (!desired_row->full_width_p
4004 && !NILP (WVAR (w, right_margin_cols))) 4008 && !NILP (WGET (w, right_margin_cols)))
4005 { 4009 {
4006 changed_p = 1; 4010 changed_p = 1;
4007 update_marginal_area (w, RIGHT_MARGIN_AREA, vpos); 4011 update_marginal_area (w, RIGHT_MARGIN_AREA, vpos);
@@ -4034,7 +4038,7 @@ update_window_line (struct window *w, int vpos, int *mouse_face_overwritten_p)
4034static void 4038static void
4035set_window_cursor_after_update (struct window *w) 4039set_window_cursor_after_update (struct window *w)
4036{ 4040{
4037 struct frame *f = XFRAME (WVAR (w, frame)); 4041 struct frame *f = XFRAME (WGET (w, frame));
4038 struct redisplay_interface *rif = FRAME_RIF (f); 4042 struct redisplay_interface *rif = FRAME_RIF (f);
4039 int cx, cy, vpos, hpos; 4043 int cx, cy, vpos, hpos;
4040 4044
@@ -4120,14 +4124,14 @@ set_window_update_flags (struct window *w, int on_p)
4120{ 4124{
4121 while (w) 4125 while (w)
4122 { 4126 {
4123 if (!NILP (WVAR (w, hchild))) 4127 if (!NILP (WGET (w, hchild)))
4124 set_window_update_flags (XWINDOW (WVAR (w, hchild)), on_p); 4128 set_window_update_flags (XWINDOW (WGET (w, hchild)), on_p);
4125 else if (!NILP (WVAR (w, vchild))) 4129 else if (!NILP (WGET (w, vchild)))
4126 set_window_update_flags (XWINDOW (WVAR (w, vchild)), on_p); 4130 set_window_update_flags (XWINDOW (WGET (w, vchild)), on_p);
4127 else 4131 else
4128 w->must_be_updated_p = on_p; 4132 w->must_be_updated_p = on_p;
4129 4133
4130 w = NILP (WVAR (w, next)) ? 0 : XWINDOW (WVAR (w, next)); 4134 w = NILP (WGET (w, next)) ? 0 : XWINDOW (WGET (w, next));
4131 } 4135 }
4132} 4136}
4133 4137
@@ -4810,8 +4814,8 @@ update_frame_1 (struct frame *f, int force_p, int inhibit_id_p)
4810 int x = WINDOW_TO_FRAME_HPOS (w, w->cursor.hpos); 4814 int x = WINDOW_TO_FRAME_HPOS (w, w->cursor.hpos);
4811 int y = WINDOW_TO_FRAME_VPOS (w, w->cursor.vpos); 4815 int y = WINDOW_TO_FRAME_VPOS (w, w->cursor.vpos);
4812 4816
4813 if (INTEGERP (WVAR (w, left_margin_cols))) 4817 if (INTEGERP (WGET (w, left_margin_cols)))
4814 x += XFASTINT (WVAR (w, left_margin_cols)); 4818 x += XFASTINT (WGET (w, left_margin_cols));
4815 4819
4816 /* x = max (min (x, FRAME_TOTAL_COLS (f) - 1), 0); */ 4820 /* x = max (min (x, FRAME_TOTAL_COLS (f) - 1), 0); */
4817 cursor_to (f, y, x); 4821 cursor_to (f, y, x);
@@ -5301,9 +5305,9 @@ buffer_posn_from_coords (struct window *w, int *x, int *y, struct display_pos *p
5301 5305
5302 /* We used to set current_buffer directly here, but that does the 5306 /* We used to set current_buffer directly here, but that does the
5303 wrong thing with `face-remapping-alist' (bug#2044). */ 5307 wrong thing with `face-remapping-alist' (bug#2044). */
5304 Fset_buffer (WVAR (w, buffer)); 5308 Fset_buffer (WGET (w, buffer));
5305 itdata = bidi_shelve_cache (); 5309 itdata = bidi_shelve_cache ();
5306 SET_TEXT_POS_FROM_MARKER (startp, WVAR (w, start)); 5310 SET_TEXT_POS_FROM_MARKER (startp, WGET (w, start));
5307 CHARPOS (startp) = min (ZV, max (BEGV, CHARPOS (startp))); 5311 CHARPOS (startp) = min (ZV, max (BEGV, CHARPOS (startp)));
5308 BYTEPOS (startp) = min (ZV_BYTE, max (BEGV_BYTE, BYTEPOS (startp))); 5312 BYTEPOS (startp) = min (ZV_BYTE, max (BEGV_BYTE, BYTEPOS (startp)));
5309 start_display (&it, w, startp); 5313 start_display (&it, w, startp);
@@ -5347,7 +5351,7 @@ buffer_posn_from_coords (struct window *w, int *x, int *y, struct display_pos *p
5347 *dx = x0 + it.first_visible_x - it.current_x; 5351 *dx = x0 + it.first_visible_x - it.current_x;
5348 *dy = *y - it.current_y; 5352 *dy = *y - it.current_y;
5349 5353
5350 string = WVAR (w, buffer); 5354 string = WGET (w, buffer);
5351 if (STRINGP (it.string)) 5355 if (STRINGP (it.string))
5352 string = it.string; 5356 string = it.string;
5353 *pos = it.current; 5357 *pos = it.current;
@@ -5365,7 +5369,7 @@ buffer_posn_from_coords (struct window *w, int *x, int *y, struct display_pos *p
5365 if (STRINGP (it.string)) 5369 if (STRINGP (it.string))
5366 BYTEPOS (pos->pos) = string_char_to_byte (string, CHARPOS (pos->pos)); 5370 BYTEPOS (pos->pos) = string_char_to_byte (string, CHARPOS (pos->pos));
5367 else 5371 else
5368 BYTEPOS (pos->pos) = buf_charpos_to_bytepos (XBUFFER (WVAR (w, buffer)), 5372 BYTEPOS (pos->pos) = buf_charpos_to_bytepos (XBUFFER (WGET (w, buffer)),
5369 CHARPOS (pos->pos)); 5373 CHARPOS (pos->pos));
5370 } 5374 }
5371 5375
@@ -5765,7 +5769,8 @@ change_frame_size_1 (register struct frame *f, int newheight, int newwidth, int
5765 FrameCols (FRAME_TTY (f)) = newwidth; 5769 FrameCols (FRAME_TTY (f)) = newwidth;
5766 5770
5767 if (WINDOWP (FGET (f, tool_bar_window))) 5771 if (WINDOWP (FGET (f, tool_bar_window)))
5768 XSETFASTINT (WVAR (XWINDOW (FGET (f, tool_bar_window)), total_cols), newwidth); 5772 WSET (XWINDOW (FGET (f, tool_bar_window)),
5773 total_cols, make_number (newwidth));
5769 } 5774 }
5770 5775
5771 FRAME_LINES (f) = newheight; 5776 FRAME_LINES (f) = newheight;
diff --git a/src/editfns.c b/src/editfns.c
index f86b4c12f58..f86e66928f2 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 = WVAR (XWINDOW (object), buffer); 369 object = WGET (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 (WVAR (XWINDOW (selected_window), buffer)) 824 int visible = (XBUFFER (WGET (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 (WVAR (XWINDOW (selected_window), buffer))) 877 && current_buffer != XBUFFER (WGET (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 = WVAR (XWINDOW (tem), buffer), 910 && (tem1 = WGET (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 9578f1f9f1a..bd037cb81c1 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 (WVAR (XWINDOW (selected_window), buffer)) == current_buffer) 3734 if (XBUFFER (WGET (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 (WVAR (XWINDOW (selected_window), buffer)) == current_buffer) 3891 if (XBUFFER (WGET (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 ca0ccc171eb..db1d12de8a2 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 (WVAR (w, frame)); 3668 f = XFRAME (WGET (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 (WVAR (w, frame)), face_id); 3726 face = FACE_FROM_ID (XFRAME (WGET (w, frame)), face_id);
3727 } 3727 }
3728 } 3728 }
3729 else 3729 else
diff --git a/src/fontset.c b/src/fontset.c
index 7f6fdeda36f..7a2c0912d6f 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 (WVAR (w, frame)); 1844 f = XFRAME (WGET (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 f488a534984..cb94143a1d5 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 XSETFASTINT (WVAR (w, top_line), XFASTINT (WVAR (w, top_line)) + n); 135 WSET (w, top_line, make_number (XFASTINT (WGET (w, top_line)) + n));
136 XSETFASTINT (WVAR (w, total_lines), XFASTINT (WVAR (w, total_lines)) - n); 136 WSET (w, total_lines, make_number (XFASTINT (WGET (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 (WVAR (w, vchild))) 139 if (!NILP (WGET (w, vchild)))
140 set_menu_bar_lines_1 (WVAR (w, vchild), n); 140 set_menu_bar_lines_1 (WGET (w, vchild), n);
141 141
142 /* Adjust all children in a horizontal split. */ 142 /* Adjust all children in a horizontal split. */
143 for (window = WVAR (w, hchild); !NILP (window); window = WVAR (w, next)) 143 for (window = WGET (w, hchild); !NILP (window); window = WGET (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);
@@ -289,20 +289,20 @@ make_frame (int mini_p)
289 if (mini_p) 289 if (mini_p)
290 { 290 {
291 mini_window = make_window (); 291 mini_window = make_window ();
292 WVAR (XWINDOW (root_window), next) = mini_window; 292 WSET (XWINDOW (root_window), next, mini_window);
293 WVAR (XWINDOW (mini_window), prev) = root_window; 293 WSET (XWINDOW (mini_window), prev, root_window);
294 XWINDOW (mini_window)->mini = 1; 294 XWINDOW (mini_window)->mini = 1;
295 WVAR (XWINDOW (mini_window), frame) = frame; 295 WSET (XWINDOW (mini_window), frame, frame);
296 FSET (f, minibuffer_window, mini_window); 296 FSET (f, minibuffer_window, mini_window);
297 } 297 }
298 else 298 else
299 { 299 {
300 mini_window = Qnil; 300 mini_window = Qnil;
301 WVAR (XWINDOW (root_window), next) = Qnil; 301 WSET (XWINDOW (root_window), next, Qnil);
302 FSET (f, minibuffer_window, Qnil); 302 FSET (f, minibuffer_window, Qnil);
303 } 303 }
304 304
305 WVAR (XWINDOW (root_window), frame) = frame; 305 WSET (XWINDOW (root_window), frame, frame);
306 306
307 /* 10 is arbitrary, 307 /* 10 is arbitrary,
308 just so that there is "something there." 308 just so that there is "something there."
@@ -311,21 +311,21 @@ make_frame (int mini_p)
311 SET_FRAME_COLS (f, 10); 311 SET_FRAME_COLS (f, 10);
312 FRAME_LINES (f) = 10; 312 FRAME_LINES (f) = 10;
313 313
314 XSETFASTINT (WVAR (XWINDOW (root_window), total_cols), 10); 314 WSET (XWINDOW (root_window), total_cols, make_number (10));
315 XSETFASTINT (WVAR (XWINDOW (root_window), total_lines), (mini_p ? 9 : 10)); 315 WSET (XWINDOW (root_window), total_lines, make_number (mini_p ? 9 : 10));
316 316
317 if (mini_p) 317 if (mini_p)
318 { 318 {
319 XSETFASTINT (WVAR (XWINDOW (mini_window), total_cols), 10); 319 WSET (XWINDOW (mini_window), total_cols, make_number (10));
320 XSETFASTINT (WVAR (XWINDOW (mini_window), top_line), 9); 320 WSET (XWINDOW (mini_window), top_line, make_number (9));
321 XSETFASTINT (WVAR (XWINDOW (mini_window), total_lines), 1); 321 WSET (XWINDOW (mini_window), total_lines, make_number (1));
322 } 322 }
323 323
324 /* Choose a buffer for the frame's root window. */ 324 /* Choose a buffer for the frame's root window. */
325 { 325 {
326 Lisp_Object buf; 326 Lisp_Object buf;
327 327
328 WVAR (XWINDOW (root_window), buffer) = Qt; 328 WSET (XWINDOW (root_window), buffer, Qt);
329 buf = Fcurrent_buffer (); 329 buf = Fcurrent_buffer ();
330 /* If buf is a 'hidden' buffer (i.e. one whose name starts with 330 /* If buf is a 'hidden' buffer (i.e. one whose name starts with
331 a space), try to find another one. */ 331 a space), try to find another one. */
@@ -344,7 +344,7 @@ make_frame (int mini_p)
344 344
345 if (mini_p) 345 if (mini_p)
346 { 346 {
347 WVAR (XWINDOW (mini_window), buffer) = Qt; 347 WSET (XWINDOW (mini_window), buffer, Qt);
348 set_window_buffer (mini_window, 348 set_window_buffer (mini_window,
349 (NILP (Vminibuffer_list) 349 (NILP (Vminibuffer_list)
350 ? get_minibuffer (0) 350 ? get_minibuffer (0)
@@ -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 (WVAR (XWINDOW (mini_window), frame))) != kb) 379 && FRAME_KBOARD (XFRAME (WGET (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 (WVAR (XWINDOW (mini_window), buffer), Vminibuffer_list))) 409 if (NILP (Fmemq (WGET (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)
@@ -439,9 +439,9 @@ make_minibuffer_frame (void)
439 439
440 mini_window = FSET (f, minibuffer_window, FGET (f, root_window)); 440 mini_window = FSET (f, minibuffer_window, FGET (f, root_window));
441 XWINDOW (mini_window)->mini = 1; 441 XWINDOW (mini_window)->mini = 1;
442 WVAR (XWINDOW (mini_window), next) = Qnil; 442 WSET (XWINDOW (mini_window), next, Qnil);
443 WVAR (XWINDOW (mini_window), prev) = Qnil; 443 WSET (XWINDOW (mini_window), prev, Qnil);
444 WVAR (XWINDOW (mini_window), frame) = frame; 444 WSET (XWINDOW (mini_window), frame, frame);
445 445
446 /* Put the proper buffer in that window. */ 446 /* Put the proper buffer in that window. */
447 447
@@ -1241,7 +1241,7 @@ delete_frame (Lisp_Object frame, Lisp_Object force)
1241 if (EQ (FGET (f, minibuffer_window), minibuf_window)) 1241 if (EQ (FGET (f, minibuffer_window), minibuf_window))
1242 { 1242 {
1243 Fset_window_buffer (FGET (sf, minibuffer_window), 1243 Fset_window_buffer (FGET (sf, minibuffer_window),
1244 WVAR (XWINDOW (minibuf_window), buffer), Qnil); 1244 WGET (XWINDOW (minibuf_window), buffer), Qnil);
1245 minibuf_window = FGET (sf, minibuffer_window); 1245 minibuf_window = FGET (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 = WVAR (w, next)) 1675 for (;!NILP (window); window = WGET (w, next))
1676 { 1676 {
1677 w = XWINDOW (window); 1677 w = XWINDOW (window);
1678 1678
1679 if (!NILP (WVAR (w, buffer))) 1679 if (!NILP (WGET (w, buffer)))
1680 BVAR (XBUFFER (WVAR (w, buffer)), display_time) = Fcurrent_time (); 1680 BVAR (XBUFFER (WGET (w, buffer)), display_time) = Fcurrent_time ();
1681 1681
1682 if (!NILP (WVAR (w, vchild))) 1682 if (!NILP (WGET (w, vchild)))
1683 make_frame_visible_1 (WVAR (w, vchild)); 1683 make_frame_visible_1 (WGET (w, vchild));
1684 if (!NILP (WVAR (w, hchild))) 1684 if (!NILP (WGET (w, hchild)))
1685 make_frame_visible_1 (WVAR (w, hchild)); 1685 make_frame_visible_1 (WGET (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 (FGET (sf, minibuffer_window), 1716 Fset_window_buffer (FGET (sf, minibuffer_window),
1717 WVAR (XWINDOW (minibuf_window), buffer), Qnil); 1717 WGET (XWINDOW (minibuf_window), buffer), Qnil);
1718 minibuf_window = FGET (sf, minibuffer_window); 1718 minibuf_window = FGET (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 (FGET (sf, minibuffer_window), 1754 Fset_window_buffer (FGET (sf, minibuffer_window),
1755 WVAR (XWINDOW (minibuf_window), buffer), Qnil); 1755 WGET (XWINDOW (minibuf_window), buffer), Qnil);
1756 minibuf_window = FGET (sf, minibuffer_window); 1756 minibuf_window = FGET (sf, minibuffer_window);
1757 } 1757 }
1758 1758
diff --git a/src/frame.h b/src/frame.h
index cf9d48f6245..7c4ccc17bff 100644
--- a/src/frame.h
+++ b/src/frame.h
@@ -517,7 +517,7 @@ typedef struct frame *FRAME_PTR;
517#define XSETFRAME(a, b) (XSETPSEUDOVECTOR (a, b, PVEC_FRAME)) 517#define XSETFRAME(a, b) (XSETPSEUDOVECTOR (a, b, PVEC_FRAME))
518 518
519/* Given a window, return its frame as a Lisp_Object. */ 519/* Given a window, return its frame as a Lisp_Object. */
520#define WINDOW_FRAME(w) WVAR (w, frame) 520#define WINDOW_FRAME(w) WGET (w, frame)
521 521
522/* Test a frame for particular kinds of display methods. */ 522/* Test a frame for particular kinds of display methods. */
523#define FRAME_INITIAL_P(f) ((f)->output_method == output_initial) 523#define FRAME_INITIAL_P(f) ((f)->output_method == output_initial)
diff --git a/src/fringe.c b/src/fringe.c
index 95aec9ebbe7..25ab1ad665c 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 (WVAR (w, buffer)), fringe_cursor_alist)), !NILP (cmap)) 695 if ((cmap = BVAR (XBUFFER (WGET (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 (WVAR (w, buffer)), fringe_indicator_alist)), !NILP (cmap)) 732 if ((cmap = BVAR (XBUFFER (WGET (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 (WVAR (w, buffer)), indicate_buffer_boundaries), !NILP (ind))) 959 && (ind = BVAR (XBUFFER (WGET (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 (WVAR (w, buffer))) 1000 if (MATRIX_ROW_START_CHARPOS (row) <= BUF_BEGV (XBUFFER (WGET (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 (WVAR (w, buffer))) 1010 if (MATRIX_ROW_END_CHARPOS (row) >= BUF_ZV (XBUFFER (WGET (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 (WVAR (w, buffer)), indicate_empty_lines); 1020 empty_pos = BVAR (XBUFFER (WGET (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 (WVAR (w, pointm))->charpos; 1743 textpos = XMARKER (WGET (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 a6a9a9a0073..fca9f4c9271 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 (WVAR (XWINDOW (window), buffer), buffer)) 261 && EQ (WGET (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 (WVAR (win, frame)))) 1176 if (!FRAME_WINDOW_P (XFRAME (WGET (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 (WVAR (win, frame)))) 1183 if (FRAME_WINDOW_P (XFRAME (WGET (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 (WVAR (w, frame))) ? 0 : 1790 FRAME_WINDOW_P (XFRAME (WGET (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 (WVAR (w, buffer), Fcurrent_buffer ())) 1840 if (EQ (WGET (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 (WVAR (w, buffer)) != current_buffer) 2001 if (XBUFFER (WGET (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 = WVAR (w, buffer); 2004 old_buffer = WGET (w, buffer);
2005 old_charpos = XMARKER (WVAR (w, pointm))->charpos; 2005 old_charpos = XMARKER (WGET (w, pointm))->charpos;
2006 old_bytepos = XMARKER (WVAR (w, pointm))->bytepos; 2006 old_bytepos = XMARKER (WGET (w, pointm))->bytepos;
2007 XSETBUFFER (WVAR (w, buffer), current_buffer); 2007 WSET (w, buffer, Fcurrent_buffer ());
2008 set_marker_both (WVAR (w, pointm), WVAR (w, buffer), 2008 set_marker_both (WGET (w, pointm), WGET (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 (WVAR (w, frame))) + 0.5), 2140 (int)(cols * FRAME_COLUMN_WIDTH (XFRAME (WGET (w, frame))) + 0.5),
2141 MOVE_TO_X); 2141 MOVE_TO_X);
2142 } 2142 }
2143 2143
@@ -2147,8 +2147,8 @@ whether or not it is currently displayed in some window. */)
2147 2147
2148 if (BUFFERP (old_buffer)) 2148 if (BUFFERP (old_buffer))
2149 { 2149 {
2150 WVAR (w, buffer) = old_buffer; 2150 WSET (w, buffer, old_buffer);
2151 set_marker_both (WVAR (w, pointm), WVAR (w, buffer), 2151 set_marker_both (WGET (w, pointm), WGET (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 705cd77dc0d..1753d8c75a8 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 (WVAR (XWINDOW (selected_window), buffer)) != current_buffer) 1823 if (XBUFFER (WGET (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 de77f7cf33a..758085d3862 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 (WVAR (XWINDOW (selected_window), buffer))) 803 && current_buffer != XBUFFER (WGET (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 (WVAR (XWINDOW (selected_window), buffer)) != current_buffer) 1385 if (XBUFFER (WGET (XWINDOW (selected_window), buffer)) != current_buffer)
1386 set_buffer_internal (XBUFFER (WVAR (XWINDOW (selected_window), buffer))); 1386 set_buffer_internal (XBUFFER (WGET (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 (WVAR (XWINDOW (selected_window), buffer)) != current_buffer) 1455 if (XBUFFER (WGET (XWINDOW (selected_window), buffer)) != current_buffer)
1456 set_buffer_internal (XBUFFER (WVAR (XWINDOW (selected_window), buffer))); 1456 set_buffer_internal (XBUFFER (WGET (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 (WVAR (XWINDOW (selected_window), buffer)); 1487 b = XBUFFER (WGET (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
@@ -5174,8 +5174,8 @@ make_lispy_position (struct frame *f, Lisp_Object x, Lisp_Object y,
5174 if (STRINGP (string)) 5174 if (STRINGP (string))
5175 string_info = Fcons (string, make_number (charpos)); 5175 string_info = Fcons (string, make_number (charpos));
5176 textpos = (w == XWINDOW (selected_window) 5176 textpos = (w == XWINDOW (selected_window)
5177 && current_buffer == XBUFFER (WVAR (w, buffer))) 5177 && current_buffer == XBUFFER (WGET (w, buffer)))
5178 ? PT : XMARKER (WVAR (w, pointm))->charpos; 5178 ? PT : XMARKER (WGET (w, pointm))->charpos;
5179 5179
5180 xret = wx; 5180 xret = wx;
5181 yret = wy; 5181 yret = wy;
@@ -5563,7 +5563,7 @@ make_lispy_event (struct input_event *event)
5563 int fuzz; 5563 int fuzz;
5564 5564
5565 if (WINDOWP (event->frame_or_window)) 5565 if (WINDOWP (event->frame_or_window))
5566 f = XFRAME (WVAR (XWINDOW (event->frame_or_window), frame)); 5566 f = XFRAME (WGET (XWINDOW (event->frame_or_window), frame));
5567 else if (FRAMEP (event->frame_or_window)) 5567 else if (FRAMEP (event->frame_or_window))
5568 f = XFRAME (event->frame_or_window); 5568 f = XFRAME (event->frame_or_window);
5569 else 5569 else
@@ -5731,7 +5731,7 @@ make_lispy_event (struct input_event *event)
5731 int is_double; 5731 int is_double;
5732 5732
5733 if (WINDOWP (event->frame_or_window)) 5733 if (WINDOWP (event->frame_or_window))
5734 fr = XFRAME (WVAR (XWINDOW (event->frame_or_window), frame)); 5734 fr = XFRAME (WGET (XWINDOW (event->frame_or_window), frame));
5735 else if (FRAMEP (event->frame_or_window)) 5735 else if (FRAMEP (event->frame_or_window))
5736 fr = XFRAME (event->frame_or_window); 5736 fr = XFRAME (event->frame_or_window);
5737 else 5737 else
@@ -9401,8 +9401,8 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt,
9401 { 9401 {
9402 if (! FRAME_LIVE_P (XFRAME (selected_frame))) 9402 if (! FRAME_LIVE_P (XFRAME (selected_frame)))
9403 Fkill_emacs (Qnil); 9403 Fkill_emacs (Qnil);
9404 if (XBUFFER (WVAR (XWINDOW (selected_window), buffer)) != current_buffer) 9404 if (XBUFFER (WGET (XWINDOW (selected_window), buffer)) != current_buffer)
9405 Fset_buffer (WVAR (XWINDOW (selected_window), buffer)); 9405 Fset_buffer (WGET (XWINDOW (selected_window), buffer));
9406 } 9406 }
9407 9407
9408 orig_local_map = get_local_map (PT, current_buffer, Qlocal_map); 9408 orig_local_map = get_local_map (PT, current_buffer, Qlocal_map);
@@ -9494,8 +9494,8 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt,
9494 not the current buffer. If we're at the 9494 not the current buffer. If we're at the
9495 beginning of a key sequence, switch buffers. */ 9495 beginning of a key sequence, switch buffers. */
9496 if (WINDOWP (window) 9496 if (WINDOWP (window)
9497 && BUFFERP (WVAR (XWINDOW (window), buffer)) 9497 && BUFFERP (WGET (XWINDOW (window), buffer))
9498 && XBUFFER (WVAR (XWINDOW (window), buffer)) != current_buffer) 9498 && XBUFFER (WGET (XWINDOW (window), buffer)) != current_buffer)
9499 { 9499 {
9500 ASET (raw_keybuf, raw_keybuf_count, key); 9500 ASET (raw_keybuf, raw_keybuf_count, key);
9501 raw_keybuf_count++; 9501 raw_keybuf_count++;
@@ -9516,7 +9516,7 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt,
9516 9516
9517 if (! FRAME_LIVE_P (XFRAME (selected_frame))) 9517 if (! FRAME_LIVE_P (XFRAME (selected_frame)))
9518 Fkill_emacs (Qnil); 9518 Fkill_emacs (Qnil);
9519 set_buffer_internal (XBUFFER (WVAR (XWINDOW (window), buffer))); 9519 set_buffer_internal (XBUFFER (WGET (XWINDOW (window), buffer)));
9520 orig_local_map = get_local_map (PT, current_buffer, 9520 orig_local_map = get_local_map (PT, current_buffer,
9521 Qlocal_map); 9521 Qlocal_map);
9522 orig_keymap = get_local_map (PT, current_buffer, 9522 orig_keymap = get_local_map (PT, current_buffer,
@@ -11200,7 +11200,7 @@ The `posn-' functions access elements of such lists. */)
11200 ? window_box_left_offset (w, TEXT_AREA) 11200 ? window_box_left_offset (w, TEXT_AREA)
11201 : 0))); 11201 : 0)));
11202 XSETINT (y, WINDOW_TO_FRAME_PIXEL_Y (w, XINT (y))); 11202 XSETINT (y, WINDOW_TO_FRAME_PIXEL_Y (w, XINT (y)));
11203 frame_or_window = WVAR (w, frame); 11203 frame_or_window = WGET (w, frame);
11204 } 11204 }
11205 11205
11206 CHECK_LIVE_FRAME (frame_or_window); 11206 CHECK_LIVE_FRAME (frame_or_window);
diff --git a/src/keymap.c b/src/keymap.c
index bd2f3c99c26..a0a35285131 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 (WVAR (XWINDOW (window), buffer)) 1563 && BUFFERP (WGET (XWINDOW (window), buffer))
1564 && XBUFFER (WVAR (XWINDOW (window), buffer)) != current_buffer) 1564 && XBUFFER (WGET (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 (WVAR (XWINDOW (window), buffer))); 1576 set_buffer_internal (XBUFFER (WGET (XWINDOW (window), buffer)));
1577 } 1577 }
1578 } 1578 }
1579 1579
diff --git a/src/lisp.h b/src/lisp.h
index 8a6a2a99791..aa06daa3cc5 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 (WVAR (XWINDOW (x), buffer)), \ 1790 CHECK_TYPE (WINDOWP (x) && !NILP (WGET (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 a5f963de4be..4ef433b3c86 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 = WVAR (XWINDOW (minibuf_window), buffer); 118 buffer = WGET (XWINDOW (minibuf_window), buffer);
119 if (BUFFERP (buffer)) 119 if (BUFFERP (buffer))
120 Fset_window_buffer (FGET (sf, minibuffer_window), buffer, Qnil); 120 Fset_window_buffer (FGET (sf, minibuffer_window), buffer, Qnil);
121 minibuf_window = FGET (sf, minibuffer_window); 121 minibuf_window = FGET (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 = WVAR (XWINDOW (root_window), next); 615 Lisp_Object mini_window = WGET (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 (WVAR (XWINDOW (minibuf_window), frame)); 690 struct frame *f = XFRAME (WGET (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 (WVAR (XWINDOW (window), buffer)); 847 Fset_buffer (WGET (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 8ff038791ca..cc206b6643c 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 (WVAR (XWINDOW (window), frame)) == f) 597 if (! NILP (window) && XFRAME (WGET (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 (WVAR (w, buffer))) 1258 if (NILP (WGET (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 (WVAR (w, buffer)) || i < w->desired_matrix->nrows) 1268 if (NILP (WGET (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 (WVAR (sw, buffer)); 1330 struct buffer *b = XBUFFER (WGET (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 9a5ecd49105..98477c90094 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 = WVAR (XWINDOW (FGET (f, selected_window)), buffer); 610 Lisp_Object buf = WGET (XWINDOW (FGET (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 619cd2c1797..f13c513940f 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 = WVAR (XWINDOW (FRAME_SELECTED_WINDOW (f)), buffer); 196 buffer = WGET (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 d420275f612..67f3205a897 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 (WVAR (w, frame))); 670 Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (XFRAME (WGET (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 (WVAR (w, frame)); 2038 struct frame *f = XFRAME (WGET (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 (WVAR (w, frame)), 2117 && (f = XFRAME (WGET (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 (WVAR (window, vertical_scroll_bar))) 3625 if (!NILP (WGET (window, vertical_scroll_bar)))
3626 { 3626 {
3627 bar = XNS_SCROLL_BAR (WVAR (window, vertical_scroll_bar)); 3627 bar = XNS_SCROLL_BAR (WGET (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,27 +3672,27 @@ 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 (WVAR (window, vertical_scroll_bar))) 3675 if (!NILP (WGET (window, vertical_scroll_bar)))
3676 { 3676 {
3677 bar = XNS_SCROLL_BAR (WVAR (window, vertical_scroll_bar)); 3677 bar = XNS_SCROLL_BAR (WGET (window, vertical_scroll_bar));
3678 [bar removeFromSuperview]; 3678 [bar removeFromSuperview];
3679 WVAR (window, vertical_scroll_bar) = Qnil; 3679 WSET (window, vertical_scroll_bar, Qnil);
3680 } 3680 }
3681 ns_clear_frame_area (f, sb_left, top, width, height); 3681 ns_clear_frame_area (f, sb_left, top, width, height);
3682 UNBLOCK_INPUT; 3682 UNBLOCK_INPUT;
3683 return; 3683 return;
3684 } 3684 }
3685 3685
3686 if (NILP (WVAR (window, vertical_scroll_bar))) 3686 if (NILP (WGET (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];
3690 WVAR (window, vertical_scroll_bar) = make_save_value (bar, 0); 3690 WSET (window, vertical_scroll_bar, make_save_value (bar, 0));
3691 } 3691 }
3692 else 3692 else
3693 { 3693 {
3694 NSRect oldRect; 3694 NSRect oldRect;
3695 bar = XNS_SCROLL_BAR (WVAR (window, vertical_scroll_bar)); 3695 bar = XNS_SCROLL_BAR (WGET (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 (WVAR (window, vertical_scroll_bar))) 3742 if (!NILP (WGET (window, vertical_scroll_bar)))
3743 { 3743 {
3744 bar = XNS_SCROLL_BAR (WVAR (window, vertical_scroll_bar)); 3744 bar = XNS_SCROLL_BAR (WGET (window, vertical_scroll_bar));
3745 [bar reprieve]; 3745 [bar reprieve];
3746 } 3746 }
3747} 3747}
@@ -6062,7 +6062,7 @@ ns_term_shutdown (int sig)
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
6065 = XBUFFER (WVAR (XWINDOW (FGET (f, selected_window)), buffer)); 6065 = XBUFFER (WGET (XWINDOW (FGET (f, selected_window)), buffer));
6066 6066
6067 if ([attribute isEqualToString:NSAccessibilityRoleAttribute]) 6067 if ([attribute isEqualToString:NSAccessibilityRoleAttribute])
6068 return NSAccessibilityTextFieldRole; 6068 return NSAccessibilityTextFieldRole;
@@ -6237,7 +6237,7 @@ ns_term_shutdown (int sig)
6237 if (pixel_height == 0) pixel_height = 1; 6237 if (pixel_height == 0) pixel_height = 1;
6238 min_portion = 20 / pixel_height; 6238 min_portion = 20 / pixel_height;
6239 6239
6240 frame = XFRAME (WVAR (XWINDOW (win), frame)); 6240 frame = XFRAME (WGET (XWINDOW (win), frame));
6241 if (FRAME_LIVE_P (frame)) 6241 if (FRAME_LIVE_P (frame))
6242 { 6242 {
6243 int i; 6243 int i;
@@ -6276,7 +6276,7 @@ ns_term_shutdown (int sig)
6276{ 6276{
6277 NSTRACE (EmacsScroller_dealloc); 6277 NSTRACE (EmacsScroller_dealloc);
6278 if (!NILP (win)) 6278 if (!NILP (win))
6279 WVAR (XWINDOW (win), vertical_scroll_bar) = Qnil; 6279 WSET (XWINDOW (win), vertical_scroll_bar, Qnil);
6280 [super dealloc]; 6280 [super dealloc];
6281} 6281}
6282 6282
diff --git a/src/print.c b/src/print.c
index 8db222334e5..d45d3194c55 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 (WVAR (XWINDOW (obj), buffer))) 1776 if (!NILP (WGET (XWINDOW (obj), buffer)))
1777 { 1777 {
1778 strout (" on ", -1, -1, printcharfun); 1778 strout (" on ", -1, -1, printcharfun);
1779 print_string (BVAR (XBUFFER (WVAR (XWINDOW (obj), buffer)), name), 1779 print_string (BVAR (XBUFFER (WGET (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 ee5d82fa170..02f134ec033 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 = WVAR (w, buffer); 590 object = WGET (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 be64e27224b..b82d4bcef3f 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -5617,7 +5617,8 @@ Text larger than the specified size is clipped. */)
5617 5617
5618 /* Set up the frame's root window. */ 5618 /* Set up the frame's root window. */
5619 w = XWINDOW (FRAME_ROOT_WINDOW (f)); 5619 w = XWINDOW (FRAME_ROOT_WINDOW (f));
5620 WVAR (w, left_col) = WVAR (w, top_line) = make_number (0); 5620 WSET (w, left_col, make_number (0));
5621 WSET (w, top_line, make_number (0));
5621 5622
5622 if (CONSP (Vx_max_tooltip_size) 5623 if (CONSP (Vx_max_tooltip_size)
5623 && INTEGERP (XCAR (Vx_max_tooltip_size)) 5624 && INTEGERP (XCAR (Vx_max_tooltip_size))
@@ -5625,22 +5626,22 @@ Text larger than the specified size is clipped. */)
5625 && INTEGERP (XCDR (Vx_max_tooltip_size)) 5626 && INTEGERP (XCDR (Vx_max_tooltip_size))
5626 && XINT (XCDR (Vx_max_tooltip_size)) > 0) 5627 && XINT (XCDR (Vx_max_tooltip_size)) > 0)
5627 { 5628 {
5628 WVAR (w, total_cols) = XCAR (Vx_max_tooltip_size); 5629 WSET (w, total_cols, XCAR (Vx_max_tooltip_size));
5629 WVAR (w, total_lines) = XCDR (Vx_max_tooltip_size); 5630 WSET (w, total_lines, XCDR (Vx_max_tooltip_size));
5630 } 5631 }
5631 else 5632 else
5632 { 5633 {
5633 WVAR (w, total_cols) = make_number (80); 5634 WSET (w, total_cols, make_number (80));
5634 WVAR (w, total_lines) = make_number (40); 5635 WSET (w, total_lines, make_number (40));
5635 } 5636 }
5636 5637
5637 FRAME_TOTAL_COLS (f) = XINT (WVAR (w, total_cols)); 5638 FRAME_TOTAL_COLS (f) = XINT (WGET (w, total_cols));
5638 adjust_glyphs (f); 5639 adjust_glyphs (f);
5639 w->pseudo_window_p = 1; 5640 w->pseudo_window_p = 1;
5640 5641
5641 /* Display the tooltip text in a temporary buffer. */ 5642 /* Display the tooltip text in a temporary buffer. */
5642 old_buffer = current_buffer; 5643 old_buffer = current_buffer;
5643 set_buffer_internal_1 (XBUFFER (WVAR (XWINDOW (FRAME_ROOT_WINDOW (f)), buffer))); 5644 set_buffer_internal_1 (XBUFFER (WGET (XWINDOW (FRAME_ROOT_WINDOW (f)), buffer)));
5644 BVAR (current_buffer, truncate_lines) = Qnil; 5645 BVAR (current_buffer, truncate_lines) = Qnil;
5645 clear_glyph_matrix (w->desired_matrix); 5646 clear_glyph_matrix (w->desired_matrix);
5646 clear_glyph_matrix (w->current_matrix); 5647 clear_glyph_matrix (w->current_matrix);
@@ -5702,7 +5703,7 @@ Text larger than the specified size is clipped. */)
5702 /* w->total_cols and FRAME_TOTAL_COLS want the width in columns, 5703 /* w->total_cols and FRAME_TOTAL_COLS want the width in columns,
5703 not in pixels. */ 5704 not in pixels. */
5704 width /= WINDOW_FRAME_COLUMN_WIDTH (w); 5705 width /= WINDOW_FRAME_COLUMN_WIDTH (w);
5705 WVAR (w, total_cols) = make_number (width); 5706 WSET (w, total_cols, make_number (width));
5706 FRAME_TOTAL_COLS (f) = width; 5707 FRAME_TOTAL_COLS (f) = width;
5707 adjust_glyphs (f); 5708 adjust_glyphs (f);
5708 w->pseudo_window_p = 1; 5709 w->pseudo_window_p = 1;
diff --git a/src/w32menu.c b/src/w32menu.c
index a40bb662af8..80f48bdf705 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 = WVAR (XWINDOW (FRAME_SELECTED_WINDOW (f)), buffer); 397 buffer = WGET (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 96072ac69e1..fc4522d56fd 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 (WVAR (w, frame))); 652 Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (XFRAME (WGET (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 (WVAR (w, frame)), 757 && (f = XFRAME (WGET (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 (WVAR (w, frame)); 2721 struct frame *f = XFRAME (WGET (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;
@@ -3670,7 +3670,7 @@ x_scroll_bar_remove (struct scroll_bar *bar)
3670 my_destroy_window (f, SCROLL_BAR_W32_WINDOW (bar)); 3670 my_destroy_window (f, SCROLL_BAR_W32_WINDOW (bar));
3671 3671
3672 /* Dissociate this scroll bar from its window. */ 3672 /* Dissociate this scroll bar from its window. */
3673 WVAR (XWINDOW (bar->window), vertical_scroll_bar) = Qnil; 3673 WSET (XWINDOW (bar->window), vertical_scroll_bar, Qnil);
3674 3674
3675 UNBLOCK_INPUT; 3675 UNBLOCK_INPUT;
3676} 3676}
@@ -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 (WVAR (w, frame)); 3686 struct frame *f = XFRAME (WGET (w, frame));
3687 struct scroll_bar *bar; 3687 struct scroll_bar *bar;
3688 int top, height, left, sb_left, width, sb_width; 3688 int top, height, left, sb_left, width, sb_width;
3689 int window_y, window_height; 3689 int window_y, window_height;
@@ -3723,7 +3723,7 @@ w32_set_vertical_scroll_bar (struct window *w,
3723 || WINDOW_RIGHT_MARGIN_COLS (w) == 0)); 3723 || WINDOW_RIGHT_MARGIN_COLS (w) == 0));
3724 3724
3725 /* Does the scroll bar exist yet? */ 3725 /* Does the scroll bar exist yet? */
3726 if (NILP (WVAR (w, vertical_scroll_bar))) 3726 if (NILP (WGET (w, vertical_scroll_bar)))
3727 { 3727 {
3728 HDC hdc; 3728 HDC hdc;
3729 BLOCK_INPUT; 3729 BLOCK_INPUT;
@@ -3745,7 +3745,7 @@ w32_set_vertical_scroll_bar (struct window *w,
3745 /* It may just need to be moved and resized. */ 3745 /* It may just need to be moved and resized. */
3746 HWND hwnd; 3746 HWND hwnd;
3747 3747
3748 bar = XSCROLL_BAR (WVAR (w, vertical_scroll_bar)); 3748 bar = XSCROLL_BAR (WGET (w, vertical_scroll_bar));
3749 hwnd = SCROLL_BAR_W32_WINDOW (bar); 3749 hwnd = SCROLL_BAR_W32_WINDOW (bar);
3750 3750
3751 /* If already correctly positioned, do nothing. */ 3751 /* If already correctly positioned, do nothing. */
@@ -3807,7 +3807,7 @@ w32_set_vertical_scroll_bar (struct window *w,
3807 3807
3808 w32_set_scroll_bar_thumb (bar, portion, position, whole); 3808 w32_set_scroll_bar_thumb (bar, portion, position, whole);
3809 3809
3810 XSETVECTOR (WVAR (w, vertical_scroll_bar), bar); 3810 XSETVECTOR (WGET (w, vertical_scroll_bar), bar);
3811} 3811}
3812 3812
3813 3813
@@ -3852,10 +3852,10 @@ w32_redeem_scroll_bar (struct window *window)
3852 struct frame *f; 3852 struct frame *f;
3853 3853
3854 /* We can't redeem this window's scroll bar if it doesn't have one. */ 3854 /* We can't redeem this window's scroll bar if it doesn't have one. */
3855 if (NILP (WVAR (window, vertical_scroll_bar))) 3855 if (NILP (WGET (window, vertical_scroll_bar)))
3856 abort (); 3856 abort ();
3857 3857
3858 bar = XSCROLL_BAR (WVAR (window, vertical_scroll_bar)); 3858 bar = XSCROLL_BAR (WGET (window, vertical_scroll_bar));
3859 3859
3860 /* Unlink it from the condemned list. */ 3860 /* Unlink it from the condemned list. */
3861 f = XFRAME (WINDOW_FRAME (window)); 3861 f = XFRAME (WINDOW_FRAME (window));
@@ -3863,11 +3863,11 @@ w32_redeem_scroll_bar (struct window *window)
3863 { 3863 {
3864 /* If the prev pointer is nil, it must be the first in one of 3864 /* If the prev pointer is nil, it must be the first in one of
3865 the lists. */ 3865 the lists. */
3866 if (EQ (FRAME_SCROLL_BARS (f), WVAR (window, vertical_scroll_bar))) 3866 if (EQ (FRAME_SCROLL_BARS (f), WGET (window, vertical_scroll_bar)))
3867 /* It's not condemned. Everything's fine. */ 3867 /* It's not condemned. Everything's fine. */
3868 return; 3868 return;
3869 else if (EQ (FRAME_CONDEMNED_SCROLL_BARS (f), 3869 else if (EQ (FRAME_CONDEMNED_SCROLL_BARS (f),
3870 WVAR (window, vertical_scroll_bar))) 3870 WGET (window, vertical_scroll_bar)))
3871 FSET (f, condemned_scroll_bars, bar->next); 3871 FSET (f, condemned_scroll_bars, bar->next);
3872 else 3872 else
3873 /* If its prev pointer is nil, it must be at the front of 3873 /* If its prev pointer is nil, it must be at the front of
@@ -4426,8 +4426,8 @@ w32_read_socket (struct terminal *terminal, int expected,
4426 create event iff we don't leave the 4426 create event iff we don't leave the
4427 selected frame. */ 4427 selected frame. */
4428 && (focus_follows_mouse 4428 && (focus_follows_mouse
4429 || (EQ (WVAR (XWINDOW (window), frame), 4429 || (EQ (WGET (XWINDOW (window), frame),
4430 WVAR (XWINDOW (selected_window), frame))))) 4430 WGET (XWINDOW (selected_window), frame)))))
4431 { 4431 {
4432 inev.kind = SELECT_WINDOW_EVENT; 4432 inev.kind = SELECT_WINDOW_EVENT;
4433 inev.frame_or_window = window; 4433 inev.frame_or_window = window;
@@ -5042,7 +5042,7 @@ static void
5042x_draw_bar_cursor (struct window *w, struct glyph_row *row, 5042x_draw_bar_cursor (struct window *w, struct glyph_row *row,
5043 int width, enum text_cursor_kinds kind) 5043 int width, enum text_cursor_kinds kind)
5044{ 5044{
5045 struct frame *f = XFRAME (WVAR (w, frame)); 5045 struct frame *f = XFRAME (WGET (w, frame));
5046 struct glyph *cursor_glyph; 5046 struct glyph *cursor_glyph;
5047 5047
5048 /* If cursor is out of bounds, don't draw garbage. This can happen 5048 /* If cursor is out of bounds, don't draw garbage. This can happen
diff --git a/src/window.c b/src/window.c
index 1c62e6f00a7..a71fa0b1088 100644
--- a/src/window.c
+++ b/src/window.c
@@ -178,7 +178,7 @@ DEFUN ("window-frame", Fwindow_frame, Swindow_frame, 1, 1, 0,
178If WINDOW is omitted or nil, it defaults to the selected window. */) 178If WINDOW is omitted or nil, it defaults to the selected window. */)
179 (Lisp_Object window) 179 (Lisp_Object window)
180{ 180{
181 return WVAR (decode_any_window (window), frame); 181 return WGET (decode_any_window (window), frame);
182} 182}
183 183
184DEFUN ("frame-root-window", Fframe_root_window, Sframe_root_window, 0, 1, 0, 184DEFUN ("frame-root-window", Fframe_root_window, Sframe_root_window, 0, 1, 0,
@@ -244,12 +244,12 @@ the first window of that frame. */)
244 window = FGET (XFRAME (frame_or_window), root_window); 244 window = FGET (XFRAME (frame_or_window), root_window);
245 } 245 }
246 246
247 while (NILP (WVAR (XWINDOW (window), buffer))) 247 while (NILP (WGET (XWINDOW (window), buffer)))
248 { 248 {
249 if (! NILP (WVAR (XWINDOW (window), hchild))) 249 if (! NILP (WGET (XWINDOW (window), hchild)))
250 window = WVAR (XWINDOW (window), hchild); 250 window = WGET (XWINDOW (window), hchild);
251 else if (! NILP (WVAR (XWINDOW (window), vchild))) 251 else if (! NILP (WGET (XWINDOW (window), vchild)))
252 window = WVAR (XWINDOW (window), vchild); 252 window = WGET (XWINDOW (window), vchild);
253 else 253 else
254 abort (); 254 abort ();
255 } 255 }
@@ -338,7 +338,7 @@ select_window (Lisp_Object window, Lisp_Object norecord, int inhibit_point_swap)
338 if (NILP (norecord)) 338 if (NILP (norecord))
339 { 339 {
340 w->use_time = ++window_select_count; 340 w->use_time = ++window_select_count;
341 record_buffer (WVAR (w, buffer)); 341 record_buffer (WGET (w, buffer));
342 } 342 }
343 343
344 if (EQ (window, selected_window) && !inhibit_point_swap) 344 if (EQ (window, selected_window) && !inhibit_point_swap)
@@ -366,17 +366,17 @@ select_window (Lisp_Object window, Lisp_Object norecord, int inhibit_point_swap)
366 if (!inhibit_point_swap) 366 if (!inhibit_point_swap)
367 { 367 {
368 ow = XWINDOW (selected_window); 368 ow = XWINDOW (selected_window);
369 if (! NILP (WVAR (ow, buffer))) 369 if (! NILP (WGET (ow, buffer)))
370 set_marker_both (WVAR (ow, pointm), WVAR (ow, buffer), 370 set_marker_both (WGET (ow, pointm), WGET (ow, buffer),
371 BUF_PT (XBUFFER (WVAR (ow, buffer))), 371 BUF_PT (XBUFFER (WGET (ow, buffer))),
372 BUF_PT_BYTE (XBUFFER (WVAR (ow, buffer)))); 372 BUF_PT_BYTE (XBUFFER (WGET (ow, buffer))));
373 } 373 }
374 374
375 selected_window = window; 375 selected_window = window;
376 376
377 Fset_buffer (WVAR (w, buffer)); 377 Fset_buffer (WGET (w, buffer));
378 378
379 BVAR (XBUFFER (WVAR (w, buffer)), last_selected_window) = window; 379 BVAR (XBUFFER (WGET (w, buffer)), last_selected_window) = window;
380 380
381 /* Go to the point recorded in the window. 381 /* Go to the point recorded in the window.
382 This is important when the buffer is in more 382 This is important when the buffer is in more
@@ -384,7 +384,7 @@ select_window (Lisp_Object window, Lisp_Object norecord, int inhibit_point_swap)
384 redisplay_window has altered point after scrolling, 384 redisplay_window has altered point after scrolling,
385 because it makes the change only in the window. */ 385 because it makes the change only in the window. */
386 { 386 {
387 register ptrdiff_t new_point = marker_position (WVAR (w, pointm)); 387 register ptrdiff_t new_point = marker_position (WGET (w, pointm));
388 if (new_point < BEGV) 388 if (new_point < BEGV)
389 SET_PT (BEGV); 389 SET_PT (BEGV);
390 else if (new_point > ZV) 390 else if (new_point > ZV)
@@ -419,7 +419,7 @@ If WINDOW is omitted or nil, it defaults to the selected window.
419Return nil for an internal window or a deleted window. */) 419Return nil for an internal window or a deleted window. */)
420 (Lisp_Object window) 420 (Lisp_Object window)
421{ 421{
422 return WVAR (decode_any_window (window), buffer); 422 return WGET (decode_any_window (window), buffer);
423} 423}
424 424
425DEFUN ("window-parent", Fwindow_parent, Swindow_parent, 0, 1, 0, 425DEFUN ("window-parent", Fwindow_parent, Swindow_parent, 0, 1, 0,
@@ -428,7 +428,7 @@ If WINDOW is omitted or nil, it defaults to the selected window.
428Return nil for a window with no parent (e.g. a root window). */) 428Return nil for a window with no parent (e.g. a root window). */)
429 (Lisp_Object window) 429 (Lisp_Object window)
430{ 430{
431 return WVAR (decode_any_window (window), parent); 431 return WGET (decode_any_window (window), parent);
432} 432}
433 433
434DEFUN ("window-top-child", Fwindow_top_child, Swindow_top_child, 1, 1, 0, 434DEFUN ("window-top-child", Fwindow_top_child, Swindow_top_child, 1, 1, 0,
@@ -439,7 +439,7 @@ horizontal combination. */)
439 (Lisp_Object window) 439 (Lisp_Object window)
440{ 440{
441 CHECK_WINDOW (window); 441 CHECK_WINDOW (window);
442 return WVAR (decode_any_window (window), vchild); 442 return WGET (decode_any_window (window), vchild);
443} 443}
444 444
445DEFUN ("window-left-child", Fwindow_left_child, Swindow_left_child, 1, 1, 0, 445DEFUN ("window-left-child", Fwindow_left_child, Swindow_left_child, 1, 1, 0,
@@ -450,7 +450,7 @@ vertical combination. */)
450 (Lisp_Object window) 450 (Lisp_Object window)
451{ 451{
452 CHECK_WINDOW (window); 452 CHECK_WINDOW (window);
453 return WVAR (decode_any_window (window), hchild); 453 return WGET (decode_any_window (window), hchild);
454} 454}
455 455
456DEFUN ("window-next-sibling", Fwindow_next_sibling, Swindow_next_sibling, 0, 1, 0, 456DEFUN ("window-next-sibling", Fwindow_next_sibling, Swindow_next_sibling, 0, 1, 0,
@@ -459,7 +459,7 @@ If WINDOW is omitted or nil, it defaults to the selected window.
459Return nil if WINDOW has no next sibling. */) 459Return nil if WINDOW has no next sibling. */)
460 (Lisp_Object window) 460 (Lisp_Object window)
461{ 461{
462 return WVAR (decode_any_window (window), next); 462 return WGET (decode_any_window (window), next);
463} 463}
464 464
465DEFUN ("window-prev-sibling", Fwindow_prev_sibling, Swindow_prev_sibling, 0, 1, 0, 465DEFUN ("window-prev-sibling", Fwindow_prev_sibling, Swindow_prev_sibling, 0, 1, 0,
@@ -468,7 +468,7 @@ If WINDOW is omitted or nil, it defaults to the selected window.
468Return nil if WINDOW has no previous sibling. */) 468Return nil if WINDOW has no previous sibling. */)
469 (Lisp_Object window) 469 (Lisp_Object window)
470{ 470{
471 return WVAR (decode_any_window (window), prev); 471 return WGET (decode_any_window (window), prev);
472} 472}
473 473
474DEFUN ("window-combination-limit", Fwindow_combination_limit, Swindow_combination_limit, 1, 1, 0, 474DEFUN ("window-combination-limit", Fwindow_combination_limit, Swindow_combination_limit, 1, 1, 0,
@@ -478,7 +478,7 @@ WINDOW's siblings. A return value of t means that child windows of
478WINDOW are never \(re-)combined with WINDOW's siblings. */) 478WINDOW are never \(re-)combined with WINDOW's siblings. */)
479 (Lisp_Object window) 479 (Lisp_Object window)
480{ 480{
481 return WVAR (decode_any_window (window), combination_limit); 481 return WGET (decode_any_window (window), combination_limit);
482} 482}
483 483
484DEFUN ("set-window-combination-limit", Fset_window_combination_limit, Sset_window_combination_limit, 2, 2, 0, 484DEFUN ("set-window-combination-limit", Fset_window_combination_limit, Sset_window_combination_limit, 2, 2, 0,
@@ -489,9 +489,7 @@ never \(re-)combined with WINDOW's siblings. Other values are reserved
489for future use. */) 489for future use. */)
490 (Lisp_Object window, Lisp_Object limit) 490 (Lisp_Object window, Lisp_Object limit)
491{ 491{
492 register struct window *w = decode_any_window (window); 492 return WSET (decode_any_window (window), combination_limit, limit);
493 WVAR (w, combination_limit) = limit;
494 return WVAR (w, combination_limit);
495} 493}
496 494
497DEFUN ("window-use-time", Fwindow_use_time, Swindow_use_time, 0, 1, 0, 495DEFUN ("window-use-time", Fwindow_use_time, Swindow_use_time, 0, 1, 0,
@@ -517,7 +515,7 @@ On a graphical display, this total height is reported as an
517integer multiple of the default character height. */) 515integer multiple of the default character height. */)
518 (Lisp_Object window) 516 (Lisp_Object window)
519{ 517{
520 return WVAR (decode_any_window (window), total_lines); 518 return WGET (decode_any_window (window), total_lines);
521} 519}
522 520
523DEFUN ("window-total-width", Fwindow_total_width, Swindow_total_width, 0, 1, 0, 521DEFUN ("window-total-width", Fwindow_total_width, Swindow_total_width, 0, 1, 0,
@@ -532,7 +530,7 @@ On a graphical display, this total width is reported as an
532integer multiple of the default character width. */) 530integer multiple of the default character width. */)
533 (Lisp_Object window) 531 (Lisp_Object window)
534{ 532{
535 return WVAR (decode_any_window (window), total_cols); 533 return WGET (decode_any_window (window), total_cols);
536} 534}
537 535
538DEFUN ("window-new-total", Fwindow_new_total, Swindow_new_total, 0, 1, 0, 536DEFUN ("window-new-total", Fwindow_new_total, Swindow_new_total, 0, 1, 0,
@@ -540,7 +538,7 @@ DEFUN ("window-new-total", Fwindow_new_total, Swindow_new_total, 0, 1, 0,
540If WINDOW is omitted or nil, it defaults to the selected window. */) 538If WINDOW is omitted or nil, it defaults to the selected window. */)
541 (Lisp_Object window) 539 (Lisp_Object window)
542{ 540{
543 return WVAR (decode_any_window (window), new_total); 541 return WGET (decode_any_window (window), new_total);
544} 542}
545 543
546DEFUN ("window-normal-size", Fwindow_normal_size, Swindow_normal_size, 0, 2, 0, 544DEFUN ("window-normal-size", Fwindow_normal_size, Swindow_normal_size, 0, 2, 0,
@@ -550,9 +548,9 @@ If HORIZONTAL is non-nil, return the normal width of WINDOW. */)
550 (Lisp_Object window, Lisp_Object horizontal) 548 (Lisp_Object window, Lisp_Object horizontal)
551{ 549{
552 if (NILP (horizontal)) 550 if (NILP (horizontal))
553 return WVAR (decode_any_window (window), normal_lines); 551 return WGET (decode_any_window (window), normal_lines);
554 else 552 else
555 return WVAR (decode_any_window (window), normal_cols); 553 return WGET (decode_any_window (window), normal_cols);
556} 554}
557 555
558DEFUN ("window-new-normal", Fwindow_new_normal, Swindow_new_normal, 0, 1, 0, 556DEFUN ("window-new-normal", Fwindow_new_normal, Swindow_new_normal, 0, 1, 0,
@@ -560,7 +558,7 @@ DEFUN ("window-new-normal", Fwindow_new_normal, Swindow_new_normal, 0, 1, 0,
560If WINDOW is omitted or nil, it defaults to the selected window. */) 558If WINDOW is omitted or nil, it defaults to the selected window. */)
561 (Lisp_Object window) 559 (Lisp_Object window)
562{ 560{
563 return WVAR (decode_any_window (window), new_normal); 561 return WGET (decode_any_window (window), new_normal);
564} 562}
565 563
566DEFUN ("window-left-column", Fwindow_left_column, Swindow_left_column, 0, 1, 0, 564DEFUN ("window-left-column", Fwindow_left_column, Swindow_left_column, 0, 1, 0,
@@ -572,7 +570,7 @@ value is 0 if there is no window to the left of WINDOW.
572If WINDOW is omitted or nil, it defaults to the selected window. */) 570If WINDOW is omitted or nil, it defaults to the selected window. */)
573 (Lisp_Object window) 571 (Lisp_Object window)
574{ 572{
575 return WVAR (decode_any_window (window), left_col); 573 return WGET (decode_any_window (window), left_col);
576} 574}
577 575
578DEFUN ("window-top-line", Fwindow_top_line, Swindow_top_line, 0, 1, 0, 576DEFUN ("window-top-line", Fwindow_top_line, Swindow_top_line, 0, 1, 0,
@@ -584,7 +582,7 @@ there is no window above WINDOW.
584If WINDOW is omitted or nil, it defaults to the selected window. */) 582If WINDOW is omitted or nil, it defaults to the selected window. */)
585 (Lisp_Object window) 583 (Lisp_Object window)
586{ 584{
587 return WVAR (decode_any_window (window), top_line); 585 return WGET (decode_any_window (window), top_line);
588} 586}
589 587
590/* Return the number of lines of W's body. Don't count any mode or 588/* Return the number of lines of W's body. Don't count any mode or
@@ -593,7 +591,7 @@ If WINDOW is omitted or nil, it defaults to the selected window. */)
593static int 591static int
594window_body_lines (struct window *w) 592window_body_lines (struct window *w)
595{ 593{
596 int height = XFASTINT (WVAR (w, total_lines)); 594 int height = XFASTINT (WGET (w, total_lines));
597 595
598 if (!MINI_WINDOW_P (w)) 596 if (!MINI_WINDOW_P (w))
599 { 597 {
@@ -615,7 +613,7 @@ int
615window_body_cols (struct window *w) 613window_body_cols (struct window *w)
616{ 614{
617 struct frame *f = XFRAME (WINDOW_FRAME (w)); 615 struct frame *f = XFRAME (WINDOW_FRAME (w));
618 int width = XINT (WVAR (w, total_cols)); 616 int width = XINT (WGET (w, total_cols));
619 617
620 if (WINDOW_HAS_VERTICAL_SCROLL_BAR (w)) 618 if (WINDOW_HAS_VERTICAL_SCROLL_BAR (w))
621 /* Scroll bars occupy a few columns. */ 619 /* Scroll bars occupy a few columns. */
@@ -690,7 +688,7 @@ set_window_hscroll (struct window *w, EMACS_INT hscroll)
690 688
691 /* Prevent redisplay shortcuts when changing the hscroll. */ 689 /* Prevent redisplay shortcuts when changing the hscroll. */
692 if (w->hscroll != new_hscroll) 690 if (w->hscroll != new_hscroll)
693 XBUFFER (WVAR (w, buffer))->prevent_redisplay_optimizations_p = 1; 691 XBUFFER (WGET (w, buffer))->prevent_redisplay_optimizations_p = 1;
694 692
695 w->hscroll = new_hscroll; 693 w->hscroll = new_hscroll;
696 return make_number (new_hscroll); 694 return make_number (new_hscroll);
@@ -719,7 +717,7 @@ WINDOW defaults to the selected window.
719See `set-window-redisplay-end-trigger' for more information. */) 717See `set-window-redisplay-end-trigger' for more information. */)
720 (Lisp_Object window) 718 (Lisp_Object window)
721{ 719{
722 return WVAR (decode_window (window), redisplay_end_trigger); 720 return WGET (decode_window (window), redisplay_end_trigger);
723} 721}
724 722
725DEFUN ("set-window-redisplay-end-trigger", Fset_window_redisplay_end_trigger, 723DEFUN ("set-window-redisplay-end-trigger", Fset_window_redisplay_end_trigger,
@@ -732,11 +730,7 @@ with two arguments: WINDOW, and the end trigger value.
732Afterwards the end-trigger value is reset to nil. */) 730Afterwards the end-trigger value is reset to nil. */)
733 (register Lisp_Object window, Lisp_Object value) 731 (register Lisp_Object window, Lisp_Object value)
734{ 732{
735 register struct window *w; 733 return WSET (decode_window (window), redisplay_end_trigger, value);
736
737 w = decode_window (window);
738 WVAR (w, redisplay_end_trigger) = value;
739 return value;
740} 734}
741 735
742DEFUN ("window-edges", Fwindow_edges, Swindow_edges, 0, 1, 0, 736DEFUN ("window-edges", Fwindow_edges, Swindow_edges, 0, 1, 0,
@@ -785,7 +779,7 @@ of just the text area, use `window-inside-pixel-edges'. */)
785static void 779static void
786calc_absolute_offset (struct window *w, int *add_x, int *add_y) 780calc_absolute_offset (struct window *w, int *add_x, int *add_y)
787{ 781{
788 struct frame *f = XFRAME (WVAR (w, frame)); 782 struct frame *f = XFRAME (WGET (w, frame));
789 *add_y = f->top_pos; 783 *add_y = f->top_pos;
790#ifdef FRAME_MENUBAR_HEIGHT 784#ifdef FRAME_MENUBAR_HEIGHT
791 *add_y += FRAME_MENUBAR_HEIGHT (f); 785 *add_y += FRAME_MENUBAR_HEIGHT (f);
@@ -1095,7 +1089,7 @@ If they are in the windows's left or right marginal areas, `left-margin'\n\
1095 1089
1096 CHECK_LIVE_WINDOW (window); 1090 CHECK_LIVE_WINDOW (window);
1097 w = XWINDOW (window); 1091 w = XWINDOW (window);
1098 f = XFRAME (WVAR (w, frame)); 1092 f = XFRAME (WGET (w, frame));
1099 CHECK_CONS (coordinates); 1093 CHECK_CONS (coordinates);
1100 lx = Fcar (coordinates); 1094 lx = Fcar (coordinates);
1101 ly = Fcdr (coordinates); 1095 ly = Fcdr (coordinates);
@@ -1275,9 +1269,9 @@ But that is hard to define. */)
1275 register struct window *w = decode_window (window); 1269 register struct window *w = decode_window (window);
1276 1270
1277 if (w == XWINDOW (selected_window) 1271 if (w == XWINDOW (selected_window)
1278 && current_buffer == XBUFFER (WVAR (w, buffer))) 1272 && current_buffer == XBUFFER (WGET (w, buffer)))
1279 return Fpoint (); 1273 return Fpoint ();
1280 return Fmarker_position (WVAR (w, pointm)); 1274 return Fmarker_position (WGET (w, pointm));
1281} 1275}
1282 1276
1283DEFUN ("window-start", Fwindow_start, Swindow_start, 0, 1, 0, 1277DEFUN ("window-start", Fwindow_start, Swindow_start, 0, 1, 0,
@@ -1286,7 +1280,7 @@ WINDOW must be a live window and defaults to the selected one.
1286This is updated by redisplay or by calling `set-window-start'. */) 1280This is updated by redisplay or by calling `set-window-start'. */)
1287 (Lisp_Object window) 1281 (Lisp_Object window)
1288{ 1282{
1289 return Fmarker_position (WVAR (decode_window (window), start)); 1283 return Fmarker_position (WGET (decode_window (window), start));
1290} 1284}
1291 1285
1292/* This is text temporarily removed from the doc string below. 1286/* This is text temporarily removed from the doc string below.
@@ -1317,7 +1311,7 @@ if it isn't already recorded. */)
1317 Lisp_Object buf; 1311 Lisp_Object buf;
1318 struct buffer *b; 1312 struct buffer *b;
1319 1313
1320 buf = WVAR (w, buffer); 1314 buf = WGET (w, buffer);
1321 CHECK_BUFFER (buf); 1315 CHECK_BUFFER (buf);
1322 b = XBUFFER (buf); 1316 b = XBUFFER (buf);
1323 1317
@@ -1326,12 +1320,12 @@ if it isn't already recorded. */)
1326 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.
1327 It would be nicer to do it automatically, 1321 It would be nicer to do it automatically,
1328 but that's so slow that it would probably bother people. */ 1322 but that's so slow that it would probably bother people. */
1329 if (NILP (WVAR (w, window_end_valid))) 1323 if (NILP (WGET (w, window_end_valid)))
1330 return Qnil; 1324 return Qnil;
1331#endif 1325#endif
1332 1326
1333 if (! NILP (update) 1327 if (! NILP (update)
1334 && ! (! NILP (WVAR (w, window_end_valid)) 1328 && ! (! NILP (WGET (w, window_end_valid))
1335 && w->last_modified >= BUF_MODIFF (b) 1329 && w->last_modified >= BUF_MODIFF (b)
1336 && w->last_overlay_modified >= BUF_OVERLAY_MODIFF (b)) 1330 && w->last_overlay_modified >= BUF_OVERLAY_MODIFF (b))
1337 && !noninteractive) 1331 && !noninteractive)
@@ -1354,12 +1348,12 @@ if it isn't already recorded. */)
1354 `-l' containing a call to `rmail' with subsequent other 1348 `-l' containing a call to `rmail' with subsequent other
1355 commands. At the end, W->start happened to be BEG, while 1349 commands. At the end, W->start happened to be BEG, while
1356 rmail had already narrowed the buffer. */ 1350 rmail had already narrowed the buffer. */
1357 if (XMARKER (WVAR (w, start))->charpos < BEGV) 1351 if (XMARKER (WGET (w, start))->charpos < BEGV)
1358 SET_TEXT_POS (startp, BEGV, BEGV_BYTE); 1352 SET_TEXT_POS (startp, BEGV, BEGV_BYTE);
1359 else if (XMARKER (WVAR (w, start))->charpos > ZV) 1353 else if (XMARKER (WGET (w, start))->charpos > ZV)
1360 SET_TEXT_POS (startp, ZV, ZV_BYTE); 1354 SET_TEXT_POS (startp, ZV, ZV_BYTE);
1361 else 1355 else
1362 SET_TEXT_POS_FROM_MARKER (startp, WVAR (w, start)); 1356 SET_TEXT_POS_FROM_MARKER (startp, WGET (w, start));
1363 1357
1364 itdata = bidi_shelve_cache (); 1358 itdata = bidi_shelve_cache ();
1365 start_display (&it, w, startp); 1359 start_display (&it, w, startp);
@@ -1373,7 +1367,7 @@ if it isn't already recorded. */)
1373 set_buffer_internal (old_buffer); 1367 set_buffer_internal (old_buffer);
1374 } 1368 }
1375 else 1369 else
1376 XSETINT (value, BUF_Z (b) - XFASTINT (WVAR (w, window_end_pos))); 1370 XSETINT (value, BUF_Z (b) - XFASTINT (WGET (w, window_end_pos)));
1377 1371
1378 return value; 1372 return value;
1379} 1373}
@@ -1387,10 +1381,10 @@ Return POS. */)
1387 1381
1388 CHECK_NUMBER_COERCE_MARKER (pos); 1382 CHECK_NUMBER_COERCE_MARKER (pos);
1389 if (w == XWINDOW (selected_window) 1383 if (w == XWINDOW (selected_window)
1390 && XBUFFER (WVAR (w, buffer)) == current_buffer) 1384 && XBUFFER (WGET (w, buffer)) == current_buffer)
1391 Fgoto_char (pos); 1385 Fgoto_char (pos);
1392 else 1386 else
1393 set_marker_restricted (WVAR (w, pointm), pos, WVAR (w, buffer)); 1387 set_marker_restricted (WGET (w, pointm), pos, WGET (w, buffer));
1394 1388
1395 /* 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
1396 the new value of point. */ 1390 the new value of point. */
@@ -1410,7 +1404,7 @@ overriding motion of point in order to display at this exact start. */)
1410 register struct window *w = decode_window (window); 1404 register struct window *w = decode_window (window);
1411 1405
1412 CHECK_NUMBER_COERCE_MARKER (pos); 1406 CHECK_NUMBER_COERCE_MARKER (pos);
1413 set_marker_restricted (WVAR (w, start), pos, WVAR (w, buffer)); 1407 set_marker_restricted (WGET (w, start), pos, WGET (w, buffer));
1414 /* 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. */
1415 w->start_at_line_beg = 0; 1409 w->start_at_line_beg = 0;
1416 if (NILP (noforce)) 1410 if (NILP (noforce))
@@ -1452,8 +1446,8 @@ display row, and VPOS is the row number (0-based) containing POS. */)
1452 int x, y; 1446 int x, y;
1453 1447
1454 w = decode_window (window); 1448 w = decode_window (window);
1455 buf = XBUFFER (WVAR (w, buffer)); 1449 buf = XBUFFER (WGET (w, buffer));
1456 SET_TEXT_POS_FROM_MARKER (top, WVAR (w, start)); 1450 SET_TEXT_POS_FROM_MARKER (top, WGET (w, start));
1457 1451
1458 if (EQ (pos, Qt)) 1452 if (EQ (pos, Qt))
1459 posint = -1; 1453 posint = -1;
@@ -1465,7 +1459,7 @@ display row, and VPOS is the row number (0-based) containing POS. */)
1465 else if (w == XWINDOW (selected_window)) 1459 else if (w == XWINDOW (selected_window))
1466 posint = PT; 1460 posint = PT;
1467 else 1461 else
1468 posint = XMARKER (WVAR (w, pointm))->charpos; 1462 posint = XMARKER (WGET (w, pointm))->charpos;
1469 1463
1470 /* If position is above window start or outside buffer boundaries, 1464 /* If position is above window start or outside buffer boundaries,
1471 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. */
@@ -1522,11 +1516,11 @@ Return nil if window display is not up-to-date. In that case, use
1522 if (noninteractive || w->pseudo_window_p) 1516 if (noninteractive || w->pseudo_window_p)
1523 return Qnil; 1517 return Qnil;
1524 1518
1525 CHECK_BUFFER (WVAR (w, buffer)); 1519 CHECK_BUFFER (WGET (w, buffer));
1526 b = XBUFFER (WVAR (w, buffer)); 1520 b = XBUFFER (WGET (w, buffer));
1527 1521
1528 /* Fail if current matrix is not up-to-date. */ 1522 /* Fail if current matrix is not up-to-date. */
1529 if (NILP (WVAR (w, window_end_valid)) 1523 if (NILP (WGET (w, window_end_valid))
1530 || current_buffer->clip_changed 1524 || current_buffer->clip_changed
1531 || current_buffer->prevent_redisplay_optimizations_p 1525 || current_buffer->prevent_redisplay_optimizations_p
1532 || w->last_modified < BUF_MODIFF (b) 1526 || w->last_modified < BUF_MODIFF (b)
@@ -1619,7 +1613,7 @@ window, unless that window is "strongly" dedicated to its buffer, that
1619is the value returned by `window-dedicated-p' is t. */) 1613is the value returned by `window-dedicated-p' is t. */)
1620 (Lisp_Object window) 1614 (Lisp_Object window)
1621{ 1615{
1622 return WVAR (decode_window (window), dedicated); 1616 return WGET (decode_window (window), dedicated);
1623} 1617}
1624 1618
1625DEFUN ("set-window-dedicated-p", Fset_window_dedicated_p, 1619DEFUN ("set-window-dedicated-p", Fset_window_dedicated_p,
@@ -1643,10 +1637,7 @@ buffer. If and when `set-window-buffer' displays another buffer in a
1643window, it also makes sure that the window is no more dedicated. */) 1637window, it also makes sure that the window is no more dedicated. */)
1644 (Lisp_Object window, Lisp_Object flag) 1638 (Lisp_Object window, Lisp_Object flag)
1645{ 1639{
1646 register struct window *w = decode_window (window); 1640 return WSET (decode_window (window), dedicated, flag);
1647
1648 WVAR (w, dedicated) = flag;
1649 return WVAR (w, dedicated);
1650} 1641}
1651 1642
1652DEFUN ("window-prev-buffers", Fwindow_prev_buffers, Swindow_prev_buffers, 1643DEFUN ("window-prev-buffers", Fwindow_prev_buffers, Swindow_prev_buffers,
@@ -1659,7 +1650,7 @@ where BUFFER is a buffer, WINDOW-START is the start position of the
1659window for that buffer, and POS is a window-specific point value. */) 1650window for that buffer, and POS is a window-specific point value. */)
1660 (Lisp_Object window) 1651 (Lisp_Object window)
1661{ 1652{
1662 return WVAR (decode_window (window), prev_buffers); 1653 return WGET (decode_window (window), prev_buffers);
1663} 1654}
1664 1655
1665DEFUN ("set-window-prev-buffers", Fset_window_prev_buffers, 1656DEFUN ("set-window-prev-buffers", Fset_window_prev_buffers,
@@ -1672,7 +1663,7 @@ where BUFFER is a buffer, WINDOW-START is the start position of the
1672window for that buffer, and POS is a window-specific point value. */) 1663window for that buffer, and POS is a window-specific point value. */)
1673 (Lisp_Object window, Lisp_Object prev_buffers) 1664 (Lisp_Object window, Lisp_Object prev_buffers)
1674{ 1665{
1675 return WVAR (decode_window (window), prev_buffers) = prev_buffers; 1666 return WSET (decode_window (window), prev_buffers, prev_buffers);
1676} 1667}
1677 1668
1678DEFUN ("window-next-buffers", Fwindow_next_buffers, Swindow_next_buffers, 1669DEFUN ("window-next-buffers", Fwindow_next_buffers, Swindow_next_buffers,
@@ -1681,7 +1672,7 @@ DEFUN ("window-next-buffers", Fwindow_next_buffers, Swindow_next_buffers,
1681WINDOW must be a live window and defaults to the selected one. */) 1672WINDOW must be a live window and defaults to the selected one. */)
1682 (Lisp_Object window) 1673 (Lisp_Object window)
1683{ 1674{
1684 return WVAR (decode_window (window), next_buffers); 1675 return WGET (decode_window (window), next_buffers);
1685} 1676}
1686 1677
1687DEFUN ("set-window-next-buffers", Fset_window_next_buffers, 1678DEFUN ("set-window-next-buffers", Fset_window_next_buffers,
@@ -1691,7 +1682,7 @@ WINDOW must be a live window and defaults to the selected one.
1691NEXT-BUFFERS should be a list of buffers. */) 1682NEXT-BUFFERS should be a list of buffers. */)
1692 (Lisp_Object window, Lisp_Object next_buffers) 1683 (Lisp_Object window, Lisp_Object next_buffers)
1693{ 1684{
1694 return WVAR (decode_window (window), next_buffers) = next_buffers; 1685 return WSET (decode_window (window), next_buffers, next_buffers);
1695} 1686}
1696 1687
1697DEFUN ("window-parameters", Fwindow_parameters, Swindow_parameters, 1688DEFUN ("window-parameters", Fwindow_parameters, Swindow_parameters,
@@ -1701,7 +1692,7 @@ WINDOW defaults to the selected window. The return value is a list of
1701elements of the form (PARAMETER . VALUE). */) 1692elements of the form (PARAMETER . VALUE). */)
1702 (Lisp_Object window) 1693 (Lisp_Object window)
1703{ 1694{
1704 return Fcopy_alist (WVAR (decode_any_window (window), window_parameters)); 1695 return Fcopy_alist (WGET (decode_any_window (window), window_parameters));
1705} 1696}
1706 1697
1707DEFUN ("window-parameter", Fwindow_parameter, Swindow_parameter, 1698DEFUN ("window-parameter", Fwindow_parameter, Swindow_parameter,
@@ -1712,7 +1703,7 @@ WINDOW defaults to the selected window. */)
1712{ 1703{
1713 Lisp_Object result; 1704 Lisp_Object result;
1714 1705
1715 result = Fassq (parameter, WVAR (decode_any_window (window), 1706 result = Fassq (parameter, WGET (decode_any_window (window),
1716 window_parameters)); 1707 window_parameters));
1717 return CDR_SAFE (result); 1708 return CDR_SAFE (result);
1718} 1709}
@@ -1726,10 +1717,10 @@ WINDOW defaults to the selected window. Return VALUE. */)
1726 register struct window *w = decode_any_window (window); 1717 register struct window *w = decode_any_window (window);
1727 Lisp_Object old_alist_elt; 1718 Lisp_Object old_alist_elt;
1728 1719
1729 old_alist_elt = Fassq (parameter, WVAR (w, window_parameters)); 1720 old_alist_elt = Fassq (parameter, WGET (w, window_parameters));
1730 if (NILP (old_alist_elt)) 1721 if (NILP (old_alist_elt))
1731 WVAR (w, window_parameters) 1722 WSET (w, window_parameters,
1732 = Fcons (Fcons (parameter, value), WVAR (w, window_parameters)); 1723 Fcons (Fcons (parameter, value), WGET (w, window_parameters)));
1733 else 1724 else
1734 Fsetcdr (old_alist_elt, value); 1725 Fsetcdr (old_alist_elt, value);
1735 return value; 1726 return value;
@@ -1741,7 +1732,7 @@ DEFUN ("window-display-table", Fwindow_display_table, Swindow_display_table,
1741WINDOW defaults to the selected window. */) 1732WINDOW defaults to the selected window. */)
1742 (Lisp_Object window) 1733 (Lisp_Object window)
1743{ 1734{
1744 return WVAR (decode_window (window), display_table); 1735 return WGET (decode_window (window), display_table);
1745} 1736}
1746 1737
1747/* Get the display table for use on window W. This is either W's 1738/* Get the display table for use on window W. This is either W's
@@ -1754,11 +1745,11 @@ window_display_table (struct window *w)
1754{ 1745{
1755 struct Lisp_Char_Table *dp = NULL; 1746 struct Lisp_Char_Table *dp = NULL;
1756 1747
1757 if (DISP_TABLE_P (WVAR (w, display_table))) 1748 if (DISP_TABLE_P (WGET (w, display_table)))
1758 dp = XCHAR_TABLE (WVAR (w, display_table)); 1749 dp = XCHAR_TABLE (WGET (w, display_table));
1759 else if (BUFFERP (WVAR (w, buffer))) 1750 else if (BUFFERP (WGET (w, buffer)))
1760 { 1751 {
1761 struct buffer *b = XBUFFER (WVAR (w, buffer)); 1752 struct buffer *b = XBUFFER (WGET (w, buffer));
1762 1753
1763 if (DISP_TABLE_P (BVAR (b, display_table))) 1754 if (DISP_TABLE_P (BVAR (b, display_table)))
1764 dp = XCHAR_TABLE (BVAR (b, display_table)); 1755 dp = XCHAR_TABLE (BVAR (b, display_table));
@@ -1773,11 +1764,7 @@ DEFUN ("set-window-display-table", Fset_window_display_table, Sset_window_displa
1773 doc: /* Set WINDOW's display-table to TABLE. */) 1764 doc: /* Set WINDOW's display-table to TABLE. */)
1774 (register Lisp_Object window, Lisp_Object table) 1765 (register Lisp_Object window, Lisp_Object table)
1775{ 1766{
1776 register struct window *w; 1767 return WSET (decode_window (window), display_table, table);
1777
1778 w = decode_window (window);
1779 WVAR (w, display_table) = table;
1780 return table;
1781} 1768}
1782 1769
1783/* Record info on buffer window W is displaying 1770/* Record info on buffer window W is displaying
@@ -1788,14 +1775,14 @@ unshow_buffer (register struct window *w)
1788 Lisp_Object buf; 1775 Lisp_Object buf;
1789 struct buffer *b; 1776 struct buffer *b;
1790 1777
1791 buf = WVAR (w, buffer); 1778 buf = WGET (w, buffer);
1792 b = XBUFFER (buf); 1779 b = XBUFFER (buf);
1793 if (b != XMARKER (WVAR (w, pointm))->buffer) 1780 if (b != XMARKER (WGET (w, pointm))->buffer)
1794 abort (); 1781 abort ();
1795 1782
1796#if 0 1783#if 0
1797 if (w == XWINDOW (selected_window) 1784 if (w == XWINDOW (selected_window)
1798 || ! EQ (buf, WVAR (XWINDOW (selected_window), buffer))) 1785 || ! EQ (buf, WGET (XWINDOW (selected_window), buffer)))
1799 /* Do this except when the selected window's buffer 1786 /* Do this except when the selected window's buffer
1800 is being removed from some other window. */ 1787 is being removed from some other window. */
1801#endif 1788#endif
@@ -1806,22 +1793,22 @@ unshow_buffer (register struct window *w)
1806 selected window, while last_window_start reflects another 1793 selected window, while last_window_start reflects another
1807 window which was recently showing the same buffer. 1794 window which was recently showing the same buffer.
1808 Some people might say that might be a good thing. Let's see. */ 1795 Some people might say that might be a good thing. Let's see. */
1809 b->last_window_start = marker_position (WVAR (w, start)); 1796 b->last_window_start = marker_position (WGET (w, start));
1810 1797
1811 /* Point in the selected window's buffer 1798 /* Point in the selected window's buffer
1812 is actually stored in that buffer, and the window's pointm isn't used. 1799 is actually stored in that buffer, and the window's pointm isn't used.
1813 So don't clobber point in that buffer. */ 1800 So don't clobber point in that buffer. */
1814 if (! EQ (buf, WVAR (XWINDOW (selected_window), buffer)) 1801 if (! EQ (buf, WGET (XWINDOW (selected_window), buffer))
1815 /* This line helps to fix Horsley's testbug.el bug. */ 1802 /* This line helps to fix Horsley's testbug.el bug. */
1816 && !(WINDOWP (BVAR (b, last_selected_window)) 1803 && !(WINDOWP (BVAR (b, last_selected_window))
1817 && w != XWINDOW (BVAR (b, last_selected_window)) 1804 && w != XWINDOW (BVAR (b, last_selected_window))
1818 && EQ (buf, WVAR (XWINDOW (BVAR (b, last_selected_window)), buffer)))) 1805 && EQ (buf, WGET (XWINDOW (BVAR (b, last_selected_window)), buffer))))
1819 temp_set_point_both (b, 1806 temp_set_point_both (b,
1820 clip_to_bounds (BUF_BEGV (b), 1807 clip_to_bounds (BUF_BEGV (b),
1821 XMARKER (WVAR (w, pointm))->charpos, 1808 XMARKER (WGET (w, pointm))->charpos,
1822 BUF_ZV (b)), 1809 BUF_ZV (b)),
1823 clip_to_bounds (BUF_BEGV_BYTE (b), 1810 clip_to_bounds (BUF_BEGV_BYTE (b),
1824 marker_byte_position (WVAR (w, pointm)), 1811 marker_byte_position (WGET (w, pointm)),
1825 BUF_ZV_BYTE (b))); 1812 BUF_ZV_BYTE (b)));
1826 1813
1827 if (WINDOWP (BVAR (b, last_selected_window)) 1814 if (WINDOWP (BVAR (b, last_selected_window))
@@ -1840,19 +1827,19 @@ replace_window (Lisp_Object old, Lisp_Object new, int setflag)
1840 1827
1841 /* If OLD is its frame's root window, then NEW is the new 1828 /* If OLD is its frame's root window, then NEW is the new
1842 root window for that frame. */ 1829 root window for that frame. */
1843 if (EQ (old, FRAME_ROOT_WINDOW (XFRAME (WVAR (o, frame))))) 1830 if (EQ (old, FRAME_ROOT_WINDOW (XFRAME (WGET (o, frame)))))
1844 FSET (XFRAME (WVAR (o, frame)), root_window, new); 1831 FSET (XFRAME (WGET (o, frame)), root_window, new);
1845 1832
1846 if (setflag) 1833 if (setflag)
1847 { 1834 {
1848 WVAR (n, left_col) = WVAR (o, left_col); 1835 WSET (n, left_col, WGET (o, left_col));
1849 WVAR (n, top_line) = WVAR (o, top_line); 1836 WSET (n, top_line, WGET (o, top_line));
1850 WVAR (n, total_cols) = WVAR (o, total_cols); 1837 WSET (n, total_cols, WGET (o, total_cols));
1851 WVAR (n, total_lines) = WVAR (o, total_lines); 1838 WSET (n, total_lines, WGET (o, total_lines));
1852 WVAR (n, normal_cols) = WVAR (o, normal_cols); 1839 WSET (n, normal_cols, WGET (o, normal_cols));
1853 WVAR (o, normal_cols) = make_float (1.0); 1840 WSET (o, normal_cols, make_float (1.0));
1854 WVAR (n, normal_lines) = WVAR (o, normal_lines); 1841 WSET (n, normal_lines, WGET (o, normal_lines));
1855 WVAR (o, normal_lines) = make_float (1.0); 1842 WSET (o, normal_lines, make_float (1.0));
1856 n->desired_matrix = n->current_matrix = 0; 1843 n->desired_matrix = n->current_matrix = 0;
1857 n->vscroll = 0; 1844 n->vscroll = 0;
1858 memset (&n->cursor, 0, sizeof (n->cursor)); 1845 memset (&n->cursor, 0, sizeof (n->cursor));
@@ -1862,27 +1849,30 @@ replace_window (Lisp_Object old, Lisp_Object new, int setflag)
1862 n->phys_cursor_width = -1; 1849 n->phys_cursor_width = -1;
1863 n->must_be_updated_p = 0; 1850 n->must_be_updated_p = 0;
1864 n->pseudo_window_p = 0; 1851 n->pseudo_window_p = 0;
1865 XSETFASTINT (WVAR (n, window_end_vpos), 0); 1852 WSET (n, window_end_vpos, make_number (0));
1866 XSETFASTINT (WVAR (n, window_end_pos), 0); 1853 WSET (n, window_end_pos, make_number (0));
1867 WVAR (n, window_end_valid) = Qnil; 1854 WSET (n, window_end_valid, Qnil);
1868 n->frozen_window_start_p = 0; 1855 n->frozen_window_start_p = 0;
1869 } 1856 }
1870 1857
1871 WVAR (n, next) = tem = WVAR (o, next); 1858 tem = WGET (o, next);
1859 WSET (n, next, tem);
1872 if (!NILP (tem)) 1860 if (!NILP (tem))
1873 WVAR (XWINDOW (tem), prev) = new; 1861 WSET (XWINDOW (tem), prev, new);
1874 1862
1875 WVAR (n, prev) = tem = WVAR (o, prev); 1863 tem = WGET (o, prev);
1864 WSET (n, prev, tem);
1876 if (!NILP (tem)) 1865 if (!NILP (tem))
1877 WVAR (XWINDOW (tem), next) = new; 1866 WSET (XWINDOW (tem), next, new);
1878 1867
1879 WVAR (n, parent) = tem = WVAR (o, parent); 1868 tem = WGET (o, parent);
1869 WSET (n, parent, tem);
1880 if (!NILP (tem)) 1870 if (!NILP (tem))
1881 { 1871 {
1882 if (EQ (WVAR (XWINDOW (tem), vchild), old)) 1872 if (EQ (WGET (XWINDOW (tem), vchild), old))
1883 WVAR (XWINDOW (tem), vchild) = new; 1873 WSET (XWINDOW (tem), vchild, new);
1884 if (EQ (WVAR (XWINDOW (tem), hchild), old)) 1874 if (EQ (WGET (XWINDOW (tem), hchild), old))
1885 WVAR (XWINDOW (tem), hchild) = new; 1875 WSET (XWINDOW (tem), hchild, new);
1886 } 1876 }
1887} 1877}
1888 1878
@@ -1898,64 +1888,65 @@ recombine_windows (Lisp_Object window)
1898 int horflag; 1888 int horflag;
1899 1889
1900 w = XWINDOW (window); 1890 w = XWINDOW (window);
1901 parent = WVAR (w, parent); 1891 parent = WGET (w, parent);
1902 if (!NILP (parent) && NILP (WVAR (w, combination_limit))) 1892 if (!NILP (parent) && NILP (WGET (w, combination_limit)))
1903 { 1893 {
1904 p = XWINDOW (parent); 1894 p = XWINDOW (parent);
1905 if (((!NILP (WVAR (p, vchild)) && !NILP (WVAR (w, vchild))) 1895 if (((!NILP (WGET (p, vchild)) && !NILP (WGET (w, vchild)))
1906 || (!NILP (WVAR (p, hchild)) && !NILP (WVAR (w, hchild))))) 1896 || (!NILP (WGET (p, hchild)) && !NILP (WGET (w, hchild)))))
1907 /* WINDOW and PARENT are both either a vertical or a horizontal 1897 /* WINDOW and PARENT are both either a vertical or a horizontal
1908 combination. */ 1898 combination. */
1909 { 1899 {
1910 horflag = NILP (WVAR (w, vchild)); 1900 horflag = NILP (WGET (w, vchild));
1911 child = horflag ? WVAR (w, hchild) : WVAR (w, vchild); 1901 child = horflag ? WGET (w, hchild) : WGET (w, vchild);
1912 c = XWINDOW (child); 1902 c = XWINDOW (child);
1913 1903
1914 /* Splice WINDOW's children into its parent's children and 1904 /* Splice WINDOW's children into its parent's children and
1915 assign new normal sizes. */ 1905 assign new normal sizes. */
1916 if (NILP (WVAR (w, prev))) 1906 if (NILP (WGET (w, prev)))
1917 if (horflag) 1907 if (horflag)
1918 WVAR (p, hchild) = child; 1908 WSET (p, hchild, child);
1919 else 1909 else
1920 WVAR (p, vchild) = child; 1910 WSET (p, vchild, child);
1921 else 1911 else
1922 { 1912 {
1923 WVAR (c, prev) = WVAR (w, prev); 1913 WSET (c, prev, WGET (w, prev));
1924 WVAR (XWINDOW (WVAR (w, prev)), next) = child; 1914 WSET (XWINDOW (WGET (w, prev)), next, child);
1925 } 1915 }
1926 1916
1927 while (c) 1917 while (c)
1928 { 1918 {
1929 WVAR (c, parent) = parent; 1919 WSET (c, parent, parent);
1930 1920
1931 if (horflag) 1921 if (horflag)
1932 WVAR (c, normal_cols) 1922 WSET (c, normal_cols,
1933 = make_float (XFLOATINT (WVAR (c, total_cols)) 1923 make_float (XFLOATINT (WGET (c, total_cols))
1934 / XFLOATINT (WVAR (p, total_cols))); 1924 / XFLOATINT (WGET (p, total_cols))));
1935 else 1925 else
1936 WVAR (c, normal_lines) 1926 WSET (c, normal_lines,
1937 = make_float (XFLOATINT (WVAR (c, total_lines)) 1927 make_float (XFLOATINT (WGET (c, total_lines))
1938 / XFLOATINT (WVAR (p, total_lines))); 1928 / XFLOATINT (WGET (p, total_lines))));
1939 1929
1940 if (NILP (WVAR (c, next))) 1930 if (NILP (WGET (c, next)))
1941 { 1931 {
1942 if (!NILP (WVAR (w, next))) 1932 if (!NILP (WGET (w, next)))
1943 { 1933 {
1944 WVAR (c, next) = WVAR (w, next); 1934 WSET (c, next, WGET (w, next));
1945 WVAR (XWINDOW (WVAR (c, next)), prev) = child; 1935 WSET (XWINDOW (WGET (c, next)), prev, child);
1946 } 1936 }
1947 1937
1948 c = 0; 1938 c = 0;
1949 } 1939 }
1950 else 1940 else
1951 { 1941 {
1952 child = WVAR (c, next); 1942 child = WGET (c, next);
1953 c = XWINDOW (child); 1943 c = XWINDOW (child);
1954 } 1944 }
1955 } 1945 }
1956 1946
1957 /* WINDOW can be deleted now. */ 1947 /* WINDOW can be deleted now. */
1958 WVAR (w, vchild) = WVAR (w, hchild) = Qnil; 1948 WSET (w, vchild, Qnil);
1949 WSET (w, hchild, Qnil);
1959 } 1950 }
1960 } 1951 }
1961} 1952}
@@ -2038,10 +2029,10 @@ static int
2038candidate_window_p (Lisp_Object window, Lisp_Object owindow, Lisp_Object minibuf, Lisp_Object all_frames) 2029candidate_window_p (Lisp_Object window, Lisp_Object owindow, Lisp_Object minibuf, Lisp_Object all_frames)
2039{ 2030{
2040 struct window *w = XWINDOW (window); 2031 struct window *w = XWINDOW (window);
2041 struct frame *f = XFRAME (WVAR (w, frame)); 2032 struct frame *f = XFRAME (WGET (w, frame));
2042 int candidate_p = 1; 2033 int candidate_p = 1;
2043 2034
2044 if (!BUFFERP (WVAR (w, buffer))) 2035 if (!BUFFERP (WGET (w, buffer)))
2045 candidate_p = 0; 2036 candidate_p = 0;
2046 else if (MINI_WINDOW_P (w) 2037 else if (MINI_WINDOW_P (w)
2047 && (EQ (minibuf, Qlambda) 2038 && (EQ (minibuf, Qlambda)
@@ -2056,13 +2047,13 @@ candidate_window_p (Lisp_Object window, Lisp_Object owindow, Lisp_Object minibuf
2056 else if (NILP (all_frames)) 2047 else if (NILP (all_frames))
2057 { 2048 {
2058 eassert (WINDOWP (owindow)); 2049 eassert (WINDOWP (owindow));
2059 candidate_p = EQ (WVAR (w, frame), WVAR (XWINDOW (owindow), frame)); 2050 candidate_p = EQ (WGET (w, frame), WGET (XWINDOW (owindow), frame));
2060 } 2051 }
2061 else if (EQ (all_frames, Qvisible)) 2052 else if (EQ (all_frames, Qvisible))
2062 { 2053 {
2063 FRAME_SAMPLE_VISIBILITY (f); 2054 FRAME_SAMPLE_VISIBILITY (f);
2064 candidate_p = FRAME_VISIBLE_P (f) 2055 candidate_p = FRAME_VISIBLE_P (f)
2065 && (FRAME_TERMINAL (XFRAME (WVAR (w, frame))) 2056 && (FRAME_TERMINAL (XFRAME (WGET (w, frame)))
2066 == FRAME_TERMINAL (XFRAME (selected_frame))); 2057 == FRAME_TERMINAL (XFRAME (selected_frame)));
2067 2058
2068 } 2059 }
@@ -2081,15 +2072,15 @@ candidate_window_p (Lisp_Object window, Lisp_Object owindow, Lisp_Object minibuf
2081 && !f->output_data.x->has_been_visible) 2072 && !f->output_data.x->has_been_visible)
2082#endif 2073#endif
2083 ) 2074 )
2084 && (FRAME_TERMINAL (XFRAME (WVAR (w, frame))) 2075 && (FRAME_TERMINAL (XFRAME (WGET (w, frame)))
2085 == FRAME_TERMINAL (XFRAME (selected_frame))); 2076 == FRAME_TERMINAL (XFRAME (selected_frame)));
2086 } 2077 }
2087 else if (WINDOWP (all_frames)) 2078 else if (WINDOWP (all_frames))
2088 candidate_p = (EQ (FRAME_MINIBUF_WINDOW (f), all_frames) 2079 candidate_p = (EQ (FRAME_MINIBUF_WINDOW (f), all_frames)
2089 || EQ (WVAR (XWINDOW (all_frames), frame), WVAR (w, frame)) 2080 || EQ (WGET (XWINDOW (all_frames), frame), WGET (w, frame))
2090 || EQ (WVAR (XWINDOW (all_frames), frame), FRAME_FOCUS_FRAME (f))); 2081 || EQ (WGET (XWINDOW (all_frames), frame), FRAME_FOCUS_FRAME (f)));
2091 else if (FRAMEP (all_frames)) 2082 else if (FRAMEP (all_frames))
2092 candidate_p = EQ (all_frames, WVAR (w, frame)); 2083 candidate_p = EQ (all_frames, WGET (w, frame));
2093 2084
2094 return candidate_p; 2085 return candidate_p;
2095} 2086}
@@ -2122,7 +2113,7 @@ decode_next_window_args (Lisp_Object *window, Lisp_Object *minibuf, Lisp_Object
2122 if (NILP (*all_frames)) 2113 if (NILP (*all_frames))
2123 *all_frames 2114 *all_frames
2124 = (!EQ (*minibuf, Qlambda) 2115 = (!EQ (*minibuf, Qlambda)
2125 ? FRAME_MINIBUF_WINDOW (XFRAME (WVAR (XWINDOW (*window), frame))) 2116 ? FRAME_MINIBUF_WINDOW (XFRAME (WGET (XWINDOW (*window), frame)))
2126 : Qnil); 2117 : Qnil);
2127 else if (EQ (*all_frames, Qvisible)) 2118 else if (EQ (*all_frames, Qvisible))
2128 ; 2119 ;
@@ -2148,7 +2139,7 @@ next_window (Lisp_Object window, Lisp_Object minibuf, Lisp_Object all_frames, in
2148 /* If ALL_FRAMES is a frame, and WINDOW isn't on that frame, just 2139 /* If ALL_FRAMES is a frame, and WINDOW isn't on that frame, just
2149 return the first window on the frame. */ 2140 return the first window on the frame. */
2150 if (FRAMEP (all_frames) 2141 if (FRAMEP (all_frames)
2151 && !EQ (all_frames, WVAR (XWINDOW (window), frame))) 2142 && !EQ (all_frames, WGET (XWINDOW (window), frame)))
2152 return Fframe_first_window (all_frames); 2143 return Fframe_first_window (all_frames);
2153 2144
2154 if (next_p) 2145 if (next_p)
@@ -2328,7 +2319,7 @@ MINIBUF neither nil nor t means never include the minibuffer window. */)
2328 if (NILP (frame)) 2319 if (NILP (frame))
2329 frame = selected_frame; 2320 frame = selected_frame;
2330 2321
2331 if (!EQ (frame, WVAR (XWINDOW (window), frame))) 2322 if (!EQ (frame, WGET (XWINDOW (window), frame)))
2332 error ("Window is on a different frame"); 2323 error ("Window is on a different frame");
2333 2324
2334 return window_list_1 (window, minibuf, frame); 2325 return window_list_1 (window, minibuf, frame);
@@ -2449,7 +2440,7 @@ window_loop (enum window_loop type, Lisp_Object obj, int mini, Lisp_Object frame
2449 switch (type) 2440 switch (type)
2450 { 2441 {
2451 case GET_BUFFER_WINDOW: 2442 case GET_BUFFER_WINDOW:
2452 if (EQ (WVAR (w, buffer), obj) 2443 if (EQ (WGET (w, buffer), obj)
2453 /* Don't find any minibuffer window except the one that 2444 /* Don't find any minibuffer window except the one that
2454 is currently in use. */ 2445 is currently in use. */
2455 && (MINI_WINDOW_P (w) ? EQ (window, minibuf_window) : 1)) 2446 && (MINI_WINDOW_P (w) ? EQ (window, minibuf_window) : 1))
@@ -2457,7 +2448,7 @@ window_loop (enum window_loop type, Lisp_Object obj, int mini, Lisp_Object frame
2457 if (EQ (window, selected_window)) 2448 if (EQ (window, selected_window))
2458 /* Preferably return the selected window. */ 2449 /* Preferably return the selected window. */
2459 RETURN_UNGCPRO (window); 2450 RETURN_UNGCPRO (window);
2460 else if (EQ (WVAR (XWINDOW (window), frame), selected_frame) 2451 else if (EQ (WGET (XWINDOW (window), frame), selected_frame)
2461 && !frame_best_window_flag) 2452 && !frame_best_window_flag)
2462 /* Prefer windows on the current frame (but don't 2453 /* Prefer windows on the current frame (but don't
2463 choose another one if we have one already). */ 2454 choose another one if we have one already). */
@@ -2473,25 +2464,25 @@ window_loop (enum window_loop type, Lisp_Object obj, int mini, Lisp_Object frame
2473 case REPLACE_BUFFER_IN_WINDOWS_SAFELY: 2464 case REPLACE_BUFFER_IN_WINDOWS_SAFELY:
2474 /* We could simply check whether the buffer shown by window 2465 /* We could simply check whether the buffer shown by window
2475 is live, and show another buffer in case it isn't. */ 2466 is live, and show another buffer in case it isn't. */
2476 if (EQ (WVAR (w, buffer), obj)) 2467 if (EQ (WGET (w, buffer), obj))
2477 { 2468 {
2478 /* Undedicate WINDOW. */ 2469 /* Undedicate WINDOW. */
2479 WVAR (w, dedicated) = Qnil; 2470 WSET (w, dedicated, Qnil);
2480 /* Make WINDOW show the buffer returned by 2471 /* Make WINDOW show the buffer returned by
2481 other_buffer_safely, don't run any hooks. */ 2472 other_buffer_safely, don't run any hooks. */
2482 set_window_buffer 2473 set_window_buffer
2483 (window, other_buffer_safely (WVAR (w, buffer)), 0, 0); 2474 (window, other_buffer_safely (WGET (w, buffer)), 0, 0);
2484 /* If WINDOW is the selected window, make its buffer 2475 /* If WINDOW is the selected window, make its buffer
2485 current. But do so only if the window shows the 2476 current. But do so only if the window shows the
2486 current buffer (Bug#6454). */ 2477 current buffer (Bug#6454). */
2487 if (EQ (window, selected_window) 2478 if (EQ (window, selected_window)
2488 && XBUFFER (WVAR (w, buffer)) == current_buffer) 2479 && XBUFFER (WGET (w, buffer)) == current_buffer)
2489 Fset_buffer (WVAR (w, buffer)); 2480 Fset_buffer (WGET (w, buffer));
2490 } 2481 }
2491 break; 2482 break;
2492 2483
2493 case REDISPLAY_BUFFER_WINDOWS: 2484 case REDISPLAY_BUFFER_WINDOWS:
2494 if (EQ (WVAR (w, buffer), obj)) 2485 if (EQ (WGET (w, buffer), obj))
2495 { 2486 {
2496 mark_window_display_accurate (window, 0); 2487 mark_window_display_accurate (window, 0);
2497 w->update_mode_line = 1; 2488 w->update_mode_line = 1;
@@ -2503,8 +2494,8 @@ window_loop (enum window_loop type, Lisp_Object obj, int mini, Lisp_Object frame
2503 2494
2504 /* Check for a window that has a killed buffer. */ 2495 /* Check for a window that has a killed buffer. */
2505 case CHECK_ALL_WINDOWS: 2496 case CHECK_ALL_WINDOWS:
2506 if (! NILP (WVAR (w, buffer)) 2497 if (! NILP (WGET (w, buffer))
2507 && NILP (BVAR (XBUFFER (WVAR (w, buffer)), name))) 2498 && NILP (BVAR (XBUFFER (WGET (w, buffer)), name)))
2508 abort (); 2499 abort ();
2509 break; 2500 break;
2510 2501
@@ -2591,7 +2582,7 @@ window-start value is reasonable when this function is called. */)
2591 2582
2592 w = decode_any_window (window); 2583 w = decode_any_window (window);
2593 XSETWINDOW (window, w); 2584 XSETWINDOW (window, w);
2594 f = XFRAME (WVAR (w, frame)); 2585 f = XFRAME (WGET (w, frame));
2595 2586
2596 if (NILP (root)) 2587 if (NILP (root))
2597 /* ROOT is the frame's root window. */ 2588 /* ROOT is the frame's root window. */
@@ -2603,12 +2594,12 @@ window-start value is reasonable when this function is called. */)
2603 /* ROOT must be an ancestor of WINDOW. */ 2594 /* ROOT must be an ancestor of WINDOW. */
2604 { 2595 {
2605 r = decode_any_window (root); 2596 r = decode_any_window (root);
2606 pwindow = WVAR (XWINDOW (window), parent); 2597 pwindow = WGET (XWINDOW (window), parent);
2607 while (!NILP (pwindow)) 2598 while (!NILP (pwindow))
2608 if (EQ (pwindow, root)) 2599 if (EQ (pwindow, root))
2609 break; 2600 break;
2610 else 2601 else
2611 pwindow = WVAR (XWINDOW (pwindow), parent); 2602 pwindow = WGET (XWINDOW (pwindow), parent);
2612 if (!EQ (pwindow, root)) 2603 if (!EQ (pwindow, root))
2613 error ("Specified root is not an ancestor of specified window"); 2604 error ("Specified root is not an ancestor of specified window");
2614 } 2605 }
@@ -2622,15 +2613,15 @@ window-start value is reasonable when this function is called. */)
2622 else if (MINI_WINDOW_P (w)) /* && top > 0) */ 2613 else if (MINI_WINDOW_P (w)) /* && top > 0) */
2623 error ("Can't expand minibuffer to full frame"); 2614 error ("Can't expand minibuffer to full frame");
2624 2615
2625 if (!NILP (WVAR (w, buffer))) 2616 if (!NILP (WGET (w, buffer)))
2626 { 2617 {
2627 startpos = marker_position (WVAR (w, start)); 2618 startpos = marker_position (WGET (w, start));
2628 top = WINDOW_TOP_EDGE_LINE (w) 2619 top = WINDOW_TOP_EDGE_LINE (w)
2629 - FRAME_TOP_MARGIN (XFRAME (WINDOW_FRAME (w))); 2620 - FRAME_TOP_MARGIN (XFRAME (WINDOW_FRAME (w)));
2630 /* Make sure WINDOW is the frame's selected window. */ 2621 /* Make sure WINDOW is the frame's selected window. */
2631 if (!EQ (window, FRAME_SELECTED_WINDOW (f))) 2622 if (!EQ (window, FRAME_SELECTED_WINDOW (f)))
2632 { 2623 {
2633 if (EQ (selected_frame, WVAR (w, frame))) 2624 if (EQ (selected_frame, WGET (w, frame)))
2634 Fselect_window (window, Qnil); 2625 Fselect_window (window, Qnil);
2635 else 2626 else
2636 FSET (f, selected_window, window); 2627 FSET (f, selected_window, window);
@@ -2647,7 +2638,7 @@ window-start value is reasonable when this function is called. */)
2647 { 2638 {
2648 pwindow = swindow; 2639 pwindow = swindow;
2649 while (!NILP (pwindow) && !EQ (window, pwindow)) 2640 while (!NILP (pwindow) && !EQ (window, pwindow))
2650 pwindow = WVAR (XWINDOW (pwindow), parent); 2641 pwindow = WGET (XWINDOW (pwindow), parent);
2651 2642
2652 if (EQ (window, pwindow)) 2643 if (EQ (window, pwindow))
2653 /* If WINDOW is an ancestor of SWINDOW, then SWINDOW is ok 2644 /* If WINDOW is an ancestor of SWINDOW, then SWINDOW is ok
@@ -2660,7 +2651,7 @@ window-start value is reasonable when this function is called. */)
2660 2651
2661 if (!EQ (swindow, FRAME_SELECTED_WINDOW (f))) 2652 if (!EQ (swindow, FRAME_SELECTED_WINDOW (f)))
2662 { 2653 {
2663 if (EQ (selected_frame, WVAR (w, frame))) 2654 if (EQ (selected_frame, WGET (w, frame)))
2664 Fselect_window (swindow, Qnil); 2655 Fselect_window (swindow, Qnil);
2665 else 2656 else
2666 FSET (f, selected_window, swindow); 2657 FSET (f, selected_window, swindow);
@@ -2693,12 +2684,12 @@ window-start value is reasonable when this function is called. */)
2693 FRAME_WINDOW_SIZES_CHANGED (f) = 1; 2684 FRAME_WINDOW_SIZES_CHANGED (f) = 1;
2694 resize_failed = 0; 2685 resize_failed = 0;
2695 2686
2696 if (NILP (WVAR (w, buffer))) 2687 if (NILP (WGET (w, buffer)))
2697 { 2688 {
2698 /* Resize child windows vertically. */ 2689 /* Resize child windows vertically. */
2699 XSETINT (delta, XINT (WVAR (r, total_lines)) 2690 XSETINT (delta, XINT (WGET (r, total_lines))
2700 - XINT (WVAR (w, total_lines))); 2691 - XINT (WGET (w, total_lines)));
2701 WVAR (w, top_line) = WVAR (r, top_line); 2692 WSET (w, top_line, WGET (r, top_line));
2702 resize_root_window (window, delta, Qnil, Qnil); 2693 resize_root_window (window, delta, Qnil, Qnil);
2703 if (window_resize_check (w, 0)) 2694 if (window_resize_check (w, 0))
2704 window_resize_apply (w, 0); 2695 window_resize_apply (w, 0);
@@ -2714,10 +2705,10 @@ window-start value is reasonable when this function is called. */)
2714 /* Resize child windows horizontally. */ 2705 /* Resize child windows horizontally. */
2715 if (!resize_failed) 2706 if (!resize_failed)
2716 { 2707 {
2717 WVAR (w, left_col) = WVAR (r, left_col); 2708 WSET (w, left_col, WGET (r, left_col));
2718 XSETINT (delta, XINT (WVAR (r, total_cols)) 2709 XSETINT (delta, XINT (WGET (r, total_cols))
2719 - XINT (WVAR (w, total_cols))); 2710 - XINT (WGET (w, total_cols)));
2720 WVAR (w, left_col) = WVAR (r, left_col); 2711 WSET (w, left_col, WGET (r, left_col));
2721 resize_root_window (window, delta, Qt, Qnil); 2712 resize_root_window (window, delta, Qt, Qnil);
2722 if (window_resize_check (w, 1)) 2713 if (window_resize_check (w, 1))
2723 window_resize_apply (w, 1); 2714 window_resize_apply (w, 1);
@@ -2740,43 +2731,43 @@ window-start value is reasonable when this function is called. */)
2740 } 2731 }
2741 2732
2742 /* Cleanly unlink WINDOW from window-tree. */ 2733 /* Cleanly unlink WINDOW from window-tree. */
2743 if (!NILP (WVAR (w, prev))) 2734 if (!NILP (WGET (w, prev)))
2744 /* Get SIBLING above (on the left of) WINDOW. */ 2735 /* Get SIBLING above (on the left of) WINDOW. */
2745 { 2736 {
2746 sibling = WVAR (w, prev); 2737 sibling = WGET (w, prev);
2747 s = XWINDOW (sibling); 2738 s = XWINDOW (sibling);
2748 WVAR (s, next) = WVAR (w, next); 2739 WSET (s, next, WGET (w, next));
2749 if (!NILP (WVAR (s, next))) 2740 if (!NILP (WGET (s, next)))
2750 WVAR (XWINDOW (WVAR (s, next)), prev) = sibling; 2741 WSET (XWINDOW (WGET (s, next)), prev, sibling);
2751 } 2742 }
2752 else 2743 else
2753 /* Get SIBLING below (on the right of) WINDOW. */ 2744 /* Get SIBLING below (on the right of) WINDOW. */
2754 { 2745 {
2755 sibling = WVAR (w, next); 2746 sibling = WGET (w, next);
2756 s = XWINDOW (sibling); 2747 s = XWINDOW (sibling);
2757 WVAR (s, prev) = Qnil; 2748 WSET (s, prev, Qnil);
2758 if (!NILP (WVAR (XWINDOW (WVAR (w, parent)), vchild))) 2749 if (!NILP (WGET (XWINDOW (WGET (w, parent)), vchild)))
2759 WVAR (XWINDOW (WVAR (w, parent)), vchild) = sibling; 2750 WSET (XWINDOW (WGET (w, parent)), vchild, sibling);
2760 else 2751 else
2761 WVAR (XWINDOW (WVAR (w, parent)), hchild) = sibling; 2752 WSET (XWINDOW (WGET (w, parent)), hchild, sibling);
2762 } 2753 }
2763 2754
2764 /* Delete ROOT and all child windows of ROOT. */ 2755 /* Delete ROOT and all child windows of ROOT. */
2765 if (!NILP (WVAR (r, vchild))) 2756 if (!NILP (WGET (r, vchild)))
2766 { 2757 {
2767 delete_all_child_windows (WVAR (r, vchild)); 2758 delete_all_child_windows (WGET (r, vchild));
2768 WVAR (r, vchild) = Qnil; 2759 WSET (r, vchild, Qnil);
2769 } 2760 }
2770 else if (!NILP (WVAR (r, hchild))) 2761 else if (!NILP (WGET (r, hchild)))
2771 { 2762 {
2772 delete_all_child_windows (WVAR (r, hchild)); 2763 delete_all_child_windows (WGET (r, hchild));
2773 WVAR (r, hchild) = Qnil; 2764 WSET (r, hchild, Qnil);
2774 } 2765 }
2775 2766
2776 replace_window (root, window, 1); 2767 replace_window (root, window, 1);
2777 2768
2778 /* This must become SWINDOW anyway ....... */ 2769 /* This must become SWINDOW anyway ....... */
2779 if (!NILP (WVAR (w, buffer)) && !resize_failed) 2770 if (!NILP (WGET (w, buffer)) && !resize_failed)
2780 { 2771 {
2781 /* Try to minimize scrolling, by setting the window start to the 2772 /* Try to minimize scrolling, by setting the window start to the
2782 point will cause the text at the old window start to be at the 2773 point will cause the text at the old window start to be at the
@@ -2785,19 +2776,19 @@ window-start value is reasonable when this function is called. */)
2785 when the display is not current, due to typeahead). */ 2776 when the display is not current, due to typeahead). */
2786 new_top = WINDOW_TOP_EDGE_LINE (w) - FRAME_TOP_MARGIN (XFRAME (WINDOW_FRAME (w))); 2777 new_top = WINDOW_TOP_EDGE_LINE (w) - FRAME_TOP_MARGIN (XFRAME (WINDOW_FRAME (w)));
2787 if (new_top != top 2778 if (new_top != top
2788 && startpos >= BUF_BEGV (XBUFFER (WVAR (w, buffer))) 2779 && startpos >= BUF_BEGV (XBUFFER (WGET (w, buffer)))
2789 && startpos <= BUF_ZV (XBUFFER (WVAR (w, buffer)))) 2780 && startpos <= BUF_ZV (XBUFFER (WGET (w, buffer))))
2790 { 2781 {
2791 struct position pos; 2782 struct position pos;
2792 struct buffer *obuf = current_buffer; 2783 struct buffer *obuf = current_buffer;
2793 2784
2794 Fset_buffer (WVAR (w, buffer)); 2785 Fset_buffer (WGET (w, buffer));
2795 /* This computation used to temporarily move point, but that 2786 /* This computation used to temporarily move point, but that
2796 can have unwanted side effects due to text properties. */ 2787 can have unwanted side effects due to text properties. */
2797 pos = *vmotion (startpos, -top, w); 2788 pos = *vmotion (startpos, -top, w);
2798 2789
2799 set_marker_both (WVAR (w, start), WVAR (w, buffer), pos.bufpos, pos.bytepos); 2790 set_marker_both (WGET (w, start), WGET (w, buffer), pos.bufpos, pos.bytepos);
2800 WVAR (w, window_end_valid) = Qnil; 2791 WSET (w, window_end_valid, Qnil);
2801 w->start_at_line_beg = (pos.bytepos == BEGV_BYTE 2792 w->start_at_line_beg = (pos.bytepos == BEGV_BYTE
2802 || FETCH_BYTE (pos.bytepos - 1) == '\n'); 2793 || FETCH_BYTE (pos.bytepos - 1) == '\n');
2803 /* We need to do this, so that the window-scroll-functions 2794 /* We need to do this, so that the window-scroll-functions
@@ -2887,13 +2878,15 @@ adjust_window_margins (struct window *w)
2887 if (WINDOW_RIGHT_MARGIN_COLS (w) > 0) 2878 if (WINDOW_RIGHT_MARGIN_COLS (w) > 0)
2888 { 2879 {
2889 if (WINDOW_LEFT_MARGIN_COLS (w) > 0) 2880 if (WINDOW_LEFT_MARGIN_COLS (w) > 0)
2890 WVAR (w, left_margin_cols) = WVAR (w, right_margin_cols) 2881 {
2891 = make_number (margin_cols/2); 2882 WSET (w, left_margin_cols, make_number (margin_cols / 2));
2883 WSET (w, right_margin_cols, make_number (margin_cols / 2));
2884 }
2892 else 2885 else
2893 WVAR (w, right_margin_cols) = make_number (margin_cols); 2886 WSET (w, right_margin_cols, make_number (margin_cols));
2894 } 2887 }
2895 else 2888 else
2896 WVAR (w, left_margin_cols) = make_number (margin_cols); 2889 WSET (w, left_margin_cols, make_number (margin_cols));
2897 return 1; 2890 return 1;
2898} 2891}
2899 2892
@@ -2991,9 +2984,9 @@ set_window_buffer (Lisp_Object window, Lisp_Object buffer, int run_hooks_p, int
2991 struct window *w = XWINDOW (window); 2984 struct window *w = XWINDOW (window);
2992 struct buffer *b = XBUFFER (buffer); 2985 struct buffer *b = XBUFFER (buffer);
2993 ptrdiff_t count = SPECPDL_INDEX (); 2986 ptrdiff_t count = SPECPDL_INDEX ();
2994 int samebuf = EQ (buffer, WVAR (w, buffer)); 2987 int samebuf = EQ (buffer, WGET (w, buffer));
2995 2988
2996 WVAR (w, buffer) = buffer; 2989 WSET (w, buffer, buffer);
2997 2990
2998 if (EQ (window, selected_window)) 2991 if (EQ (window, selected_window))
2999 BVAR (b, last_selected_window) = window; 2992 BVAR (b, last_selected_window) = window;
@@ -3006,10 +2999,10 @@ set_window_buffer (Lisp_Object window, Lisp_Object buffer, int run_hooks_p, int
3006 XSETINT (BVAR (b, display_count), XINT (BVAR (b, display_count)) + 1); 2999 XSETINT (BVAR (b, display_count), XINT (BVAR (b, display_count)) + 1);
3007 BVAR (b, display_time) = Fcurrent_time (); 3000 BVAR (b, display_time) = Fcurrent_time ();
3008 3001
3009 XSETFASTINT (WVAR (w, window_end_pos), 0); 3002 WSET (w, window_end_pos, make_number (0));
3010 XSETFASTINT (WVAR (w, window_end_vpos), 0); 3003 WSET (w, window_end_vpos, make_number (0));
3011 memset (&w->last_cursor, 0, sizeof w->last_cursor); 3004 memset (&w->last_cursor, 0, sizeof w->last_cursor);
3012 WVAR (w, window_end_valid) = Qnil; 3005 WSET (w, window_end_valid, Qnil);
3013 if (!(keep_margins_p && samebuf)) 3006 if (!(keep_margins_p && samebuf))
3014 { /* If we're not actually changing the buffer, don't reset hscroll and 3007 { /* If we're not actually changing the buffer, don't reset hscroll and
3015 vscroll. This case happens for example when called from 3008 vscroll. This case happens for example when called from
@@ -3021,8 +3014,8 @@ set_window_buffer (Lisp_Object window, Lisp_Object buffer, int run_hooks_p, int
3021 whenever we resize the frame. */ 3014 whenever we resize the frame. */
3022 w->hscroll = w->min_hscroll = 0; 3015 w->hscroll = w->min_hscroll = 0;
3023 w->vscroll = 0; 3016 w->vscroll = 0;
3024 set_marker_both (WVAR (w, pointm), buffer, BUF_PT (b), BUF_PT_BYTE (b)); 3017 set_marker_both (WGET (w, pointm), buffer, BUF_PT (b), BUF_PT_BYTE (b));
3025 set_marker_restricted (WVAR (w, start), 3018 set_marker_restricted (WGET (w, start),
3026 make_number (b->last_window_start), 3019 make_number (b->last_window_start),
3027 buffer); 3020 buffer);
3028 w->start_at_line_beg = 0; 3021 w->start_at_line_beg = 0;
@@ -3043,7 +3036,7 @@ set_window_buffer (Lisp_Object window, Lisp_Object buffer, int run_hooks_p, int
3043 Fset_buffer (buffer); 3036 Fset_buffer (buffer);
3044 } 3037 }
3045 3038
3046 XMARKER (WVAR (w, pointm))->insertion_type = !NILP (Vwindow_point_insertion_type); 3039 XMARKER (WGET (w, pointm))->insertion_type = !NILP (Vwindow_point_insertion_type);
3047 3040
3048 if (!keep_margins_p) 3041 if (!keep_margins_p)
3049 { 3042 {
@@ -3051,10 +3044,11 @@ set_window_buffer (Lisp_Object window, Lisp_Object buffer, int run_hooks_p, int
3051 3044
3052 /* This may call adjust_window_margins three times, so 3045 /* This may call adjust_window_margins three times, so
3053 temporarily disable window margins. */ 3046 temporarily disable window margins. */
3054 Lisp_Object save_left = WVAR (w, left_margin_cols); 3047 Lisp_Object save_left = WGET (w, left_margin_cols);
3055 Lisp_Object save_right = WVAR (w, right_margin_cols); 3048 Lisp_Object save_right = WGET (w, right_margin_cols);
3056 3049
3057 WVAR (w, left_margin_cols) = WVAR (w, right_margin_cols) = Qnil; 3050 WSET (w, left_margin_cols, Qnil);
3051 WSET (w, right_margin_cols, Qnil);
3058 3052
3059 Fset_window_fringes (window, 3053 Fset_window_fringes (window,
3060 BVAR (b, left_fringe_width), BVAR (b, right_fringe_width), 3054 BVAR (b, left_fringe_width), BVAR (b, right_fringe_width),
@@ -3064,8 +3058,8 @@ set_window_buffer (Lisp_Object window, Lisp_Object buffer, int run_hooks_p, int
3064 BVAR (b, scroll_bar_width), 3058 BVAR (b, scroll_bar_width),
3065 BVAR (b, vertical_scroll_bar_type), Qnil); 3059 BVAR (b, vertical_scroll_bar_type), Qnil);
3066 3060
3067 WVAR (w, left_margin_cols) = save_left; 3061 WSET (w, left_margin_cols, save_left);
3068 WVAR (w, right_margin_cols) = save_right; 3062 WSET (w, right_margin_cols, save_right);
3069 3063
3070 Fset_window_margins (window, 3064 Fset_window_margins (window,
3071 BVAR (b, left_margin_cols), BVAR (b, right_margin_cols)); 3065 BVAR (b, left_margin_cols), BVAR (b, right_margin_cols));
@@ -3075,7 +3069,7 @@ set_window_buffer (Lisp_Object window, Lisp_Object buffer, int run_hooks_p, int
3075 { 3069 {
3076 if (! NILP (Vwindow_scroll_functions)) 3070 if (! NILP (Vwindow_scroll_functions))
3077 run_hook_with_args_2 (Qwindow_scroll_functions, window, 3071 run_hook_with_args_2 (Qwindow_scroll_functions, window,
3078 Fmarker_position (WVAR (w, start))); 3072 Fmarker_position (WGET (w, start)));
3079 run_window_configuration_change_hook (XFRAME (WINDOW_FRAME (w))); 3073 run_window_configuration_change_hook (XFRAME (WINDOW_FRAME (w)));
3080 } 3074 }
3081 3075
@@ -3109,7 +3103,7 @@ This function runs `window-scroll-functions' before running
3109 if (NILP (BVAR (XBUFFER (buffer), name))) 3103 if (NILP (BVAR (XBUFFER (buffer), name)))
3110 error ("Attempt to display deleted buffer"); 3104 error ("Attempt to display deleted buffer");
3111 3105
3112 tem = WVAR (w, buffer); 3106 tem = WGET (w, buffer);
3113 if (NILP (tem)) 3107 if (NILP (tem))
3114 error ("Window is deleted"); 3108 error ("Window is deleted");
3115 else if (!EQ (tem, Qt)) 3109 else if (!EQ (tem, Qt))
@@ -3117,14 +3111,14 @@ This function runs `window-scroll-functions' before running
3117 { 3111 {
3118 if (!EQ (tem, buffer)) 3112 if (!EQ (tem, buffer))
3119 { 3113 {
3120 if (EQ (WVAR (w, dedicated), Qt)) 3114 if (EQ (WGET (w, dedicated), Qt))
3121 /* WINDOW is strongly dedicated to its buffer, signal an 3115 /* WINDOW is strongly dedicated to its buffer, signal an
3122 error. */ 3116 error. */
3123 error ("Window is dedicated to `%s'", SDATA (BVAR (XBUFFER (tem), name))); 3117 error ("Window is dedicated to `%s'", SDATA (BVAR (XBUFFER (tem), name)));
3124 else 3118 else
3125 /* WINDOW is weakly dedicated to its buffer, reset 3119 /* WINDOW is weakly dedicated to its buffer, reset
3126 dedication. */ 3120 dedication. */
3127 WVAR (w, dedicated) = Qnil; 3121 WSET (w, dedicated, Qnil);
3128 3122
3129 call1 (Qrecord_window_buffer, window); 3123 call1 (Qrecord_window_buffer, window);
3130 } 3124 }
@@ -3163,8 +3157,8 @@ displaying that buffer. */)
3163 struct window *w = XWINDOW (object); 3157 struct window *w = XWINDOW (object);
3164 mark_window_display_accurate (object, 0); 3158 mark_window_display_accurate (object, 0);
3165 w->update_mode_line = 1; 3159 w->update_mode_line = 1;
3166 if (BUFFERP (WVAR (w, buffer))) 3160 if (BUFFERP (WGET (w, buffer)))
3167 XBUFFER (WVAR (w, buffer))->prevent_redisplay_optimizations_p = 1; 3161 XBUFFER (WGET (w, buffer))->prevent_redisplay_optimizations_p = 1;
3168 ++update_mode_lines; 3162 ++update_mode_lines;
3169 return Qt; 3163 return Qt;
3170 } 3164 }
@@ -3209,14 +3203,14 @@ temp_output_buffer_show (register Lisp_Object buf)
3209 { 3203 {
3210 window = display_buffer (buf, Qnil, Qnil); 3204 window = display_buffer (buf, Qnil, Qnil);
3211 3205
3212 if (!EQ (WVAR (XWINDOW (window), frame), selected_frame)) 3206 if (!EQ (WGET (XWINDOW (window), frame), selected_frame))
3213 Fmake_frame_visible (WINDOW_FRAME (XWINDOW (window))); 3207 Fmake_frame_visible (WINDOW_FRAME (XWINDOW (window)));
3214 Vminibuf_scroll_window = window; 3208 Vminibuf_scroll_window = window;
3215 w = XWINDOW (window); 3209 w = XWINDOW (window);
3216 w->hscroll = 0; 3210 w->hscroll = 0;
3217 w->min_hscroll = 0; 3211 w->min_hscroll = 0;
3218 set_marker_restricted_both (WVAR (w, start), buf, BEG, BEG); 3212 set_marker_restricted_both (WGET (w, start), buf, BEG, BEG);
3219 set_marker_restricted_both (WVAR (w, pointm), buf, BEG, BEG); 3213 set_marker_restricted_both (WGET (w, pointm), buf, BEG, BEG);
3220 3214
3221 /* Run temp-buffer-show-hook, with the chosen window selected 3215 /* Run temp-buffer-show-hook, with the chosen window selected
3222 and its buffer current. */ 3216 and its buffer current. */
@@ -3233,7 +3227,7 @@ temp_output_buffer_show (register Lisp_Object buf)
3233 record_unwind_protect (Fset_buffer, prev_buffer); 3227 record_unwind_protect (Fset_buffer, prev_buffer);
3234 record_unwind_protect (select_window_norecord, prev_window); 3228 record_unwind_protect (select_window_norecord, prev_window);
3235 Fselect_window (window, Qt); 3229 Fselect_window (window, Qt);
3236 Fset_buffer (WVAR (w, buffer)); 3230 Fset_buffer (WGET (w, buffer));
3237 Frun_hooks (1, &Qtemp_buffer_show_hook); 3231 Frun_hooks (1, &Qtemp_buffer_show_hook);
3238 unbind_to (count, Qnil); 3232 unbind_to (count, Qnil);
3239 } 3233 }
@@ -3270,17 +3264,17 @@ make_parent_window (Lisp_Object window, int horflag)
3270 3264
3271 replace_window (window, parent, 1); 3265 replace_window (window, parent, 1);
3272 3266
3273 WVAR (o, next) = Qnil; 3267 WSET (o, next, Qnil);
3274 WVAR (o, prev) = Qnil; 3268 WSET (o, prev, Qnil);
3275 WVAR (o, parent) = parent; 3269 WSET (o, parent, parent);
3276 3270
3277 WVAR (p, hchild) = horflag ? window : Qnil; 3271 WSET (p, hchild, horflag ? window : Qnil);
3278 WVAR (p, vchild) = horflag ? Qnil : window; 3272 WSET (p, vchild, horflag ? Qnil : window);
3279 WVAR (p, start) = Qnil; 3273 WSET (p, start, Qnil);
3280 WVAR (p, pointm) = Qnil; 3274 WSET (p, pointm, Qnil);
3281 WVAR (p, buffer) = Qnil; 3275 WSET (p, buffer, Qnil);
3282 WVAR (p, combination_limit) = Qnil; 3276 WSET (p, combination_limit, Qnil);
3283 WVAR (p, window_parameters) = Qnil; 3277 WSET (p, window_parameters, Qnil);
3284} 3278}
3285 3279
3286/* Make new window from scratch. */ 3280/* Make new window from scratch. */
@@ -3293,19 +3287,19 @@ make_window (void)
3293 w = allocate_window (); 3287 w = allocate_window ();
3294 /* Initialize Lisp data. Note that allocate_window initializes all 3288 /* Initialize Lisp data. Note that allocate_window initializes all
3295 Lisp data to nil, so do it only for slots which should not be nil. */ 3289 Lisp data to nil, so do it only for slots which should not be nil. */
3296 XSETFASTINT (WVAR (w, left_col), 0); 3290 WSET (w, left_col, make_number (0));
3297 XSETFASTINT (WVAR (w, top_line), 0); 3291 WSET (w, top_line, make_number (0));
3298 XSETFASTINT (WVAR (w, total_lines), 0); 3292 WSET (w, total_lines, make_number (0));
3299 XSETFASTINT (WVAR (w, total_cols), 0); 3293 WSET (w, total_cols, make_number (0));
3300 WVAR (w, normal_lines) = make_float (1.0); 3294 WSET (w, normal_lines, make_float (1.0));
3301 WVAR (w, normal_cols) = make_float (1.0); 3295 WSET (w, normal_cols, make_float (1.0));
3302 XSETFASTINT (WVAR (w, new_total), 0); 3296 WSET (w, new_total, make_number (0));
3303 XSETFASTINT (WVAR (w, new_normal), 0); 3297 WSET (w, new_normal, make_number (0));
3304 WVAR (w, start) = Fmake_marker (); 3298 WSET (w, start, Fmake_marker ());
3305 WVAR (w, pointm) = Fmake_marker (); 3299 WSET (w, pointm, Fmake_marker ());
3306 WVAR (w, vertical_scroll_bar_type) = Qt; 3300 WSET (w, vertical_scroll_bar_type, Qt);
3307 XSETFASTINT (WVAR (w, window_end_pos), 0); 3301 WSET (w, window_end_pos, make_number (0));
3308 XSETFASTINT (WVAR (w, window_end_vpos), 0); 3302 WSET (w, window_end_vpos, make_number (0));
3309 3303
3310 /* Initialize non-Lisp data. Note that allocate_window zeroes out all 3304 /* Initialize non-Lisp data. Note that allocate_window zeroes out all
3311 non-Lisp data, so do it only for slots which should not be zero. */ 3305 non-Lisp data, so do it only for slots which should not be zero. */
@@ -3335,11 +3329,11 @@ Note: This function does not operate on any child windows of WINDOW. */)
3335 3329
3336 CHECK_NUMBER (size); 3330 CHECK_NUMBER (size);
3337 if (NILP (add)) 3331 if (NILP (add))
3338 XSETINT (WVAR (w, new_total), XINT (size)); 3332 WSET (w, new_total, size);
3339 else 3333 else
3340 XSETINT (WVAR (w, new_total), XINT (WVAR (w, new_total)) + XINT (size)); 3334 WSET (w, new_total, make_number (XINT (WGET (w, new_total)) + XINT (size)));
3341 3335
3342 return WVAR (w, new_total); 3336 return WGET (w, new_total);
3343} 3337}
3344 3338
3345DEFUN ("set-window-new-normal", Fset_window_new_normal, Sset_window_new_normal, 1, 2, 0, 3339DEFUN ("set-window-new-normal", Fset_window_new_normal, Sset_window_new_normal, 1, 2, 0,
@@ -3349,10 +3343,7 @@ Return SIZE.
3349Note: This function does not operate on any child windows of WINDOW. */) 3343Note: This function does not operate on any child windows of WINDOW. */)
3350 (Lisp_Object window, Lisp_Object size) 3344 (Lisp_Object window, Lisp_Object size)
3351{ 3345{
3352 struct window *w = decode_any_window (window); 3346 return WSET (decode_any_window (window), new_normal, size);
3353
3354 WVAR (w, new_normal) = size;
3355 return WVAR (w, new_normal);
3356} 3347}
3357 3348
3358/* Return 1 if setting w->total_lines (w->total_cols if HORFLAG is 3349/* Return 1 if setting w->total_lines (w->total_cols if HORFLAG is
@@ -3367,19 +3358,19 @@ window_resize_check (struct window *w, int horflag)
3367{ 3358{
3368 struct window *c; 3359 struct window *c;
3369 3360
3370 if (!NILP (WVAR (w, vchild))) 3361 if (!NILP (WGET (w, vchild)))
3371 /* W is a vertical combination. */ 3362 /* W is a vertical combination. */
3372 { 3363 {
3373 c = XWINDOW (WVAR (w, vchild)); 3364 c = XWINDOW (WGET (w, vchild));
3374 if (horflag) 3365 if (horflag)
3375 /* All child windows of W must have the same width as W. */ 3366 /* All child windows of W must have the same width as W. */
3376 { 3367 {
3377 while (c) 3368 while (c)
3378 { 3369 {
3379 if ((XINT (WVAR (c, new_total)) != XINT (WVAR (w, new_total))) 3370 if ((XINT (WGET (c, new_total)) != XINT (WGET (w, new_total)))
3380 || !window_resize_check (c, horflag)) 3371 || !window_resize_check (c, horflag))
3381 return 0; 3372 return 0;
3382 c = NILP (WVAR (c, next)) ? 0 : XWINDOW (WVAR (c, next)); 3373 c = NILP (WGET (c, next)) ? 0 : XWINDOW (WGET (c, next));
3383 } 3374 }
3384 return 1; 3375 return 1;
3385 } 3376 }
@@ -3392,16 +3383,16 @@ window_resize_check (struct window *w, int horflag)
3392 { 3383 {
3393 if (!window_resize_check (c, horflag)) 3384 if (!window_resize_check (c, horflag))
3394 return 0; 3385 return 0;
3395 sum_of_sizes = sum_of_sizes + XINT (WVAR (c, new_total)); 3386 sum_of_sizes = sum_of_sizes + XINT (WGET (c, new_total));
3396 c = NILP (WVAR (c, next)) ? 0 : XWINDOW (WVAR (c, next)); 3387 c = NILP (WGET (c, next)) ? 0 : XWINDOW (WGET (c, next));
3397 } 3388 }
3398 return (sum_of_sizes == XINT (WVAR (w, new_total))); 3389 return (sum_of_sizes == XINT (WGET (w, new_total)));
3399 } 3390 }
3400 } 3391 }
3401 else if (!NILP (WVAR (w, hchild))) 3392 else if (!NILP (WGET (w, hchild)))
3402 /* W is a horizontal combination. */ 3393 /* W is a horizontal combination. */
3403 { 3394 {
3404 c = XWINDOW (WVAR (w, hchild)); 3395 c = XWINDOW (WGET (w, hchild));
3405 if (horflag) 3396 if (horflag)
3406 /* The sum of the widths of the child windows of W must equal W's 3397 /* The sum of the widths of the child windows of W must equal W's
3407 width. */ 3398 width. */
@@ -3411,20 +3402,20 @@ window_resize_check (struct window *w, int horflag)
3411 { 3402 {
3412 if (!window_resize_check (c, horflag)) 3403 if (!window_resize_check (c, horflag))
3413 return 0; 3404 return 0;
3414 sum_of_sizes = sum_of_sizes + XINT (WVAR (c, new_total)); 3405 sum_of_sizes = sum_of_sizes + XINT (WGET (c, new_total));
3415 c = NILP (WVAR (c, next)) ? 0 : XWINDOW (WVAR (c, next)); 3406 c = NILP (WGET (c, next)) ? 0 : XWINDOW (WGET (c, next));
3416 } 3407 }
3417 return (sum_of_sizes == XINT (WVAR (w, new_total))); 3408 return (sum_of_sizes == XINT (WGET (w, new_total)));
3418 } 3409 }
3419 else 3410 else
3420 /* All child windows of W must have the same height as W. */ 3411 /* All child windows of W must have the same height as W. */
3421 { 3412 {
3422 while (c) 3413 while (c)
3423 { 3414 {
3424 if ((XINT (WVAR (c, new_total)) != XINT (WVAR (w, new_total))) 3415 if ((XINT (WGET (c, new_total)) != XINT (WGET (w, new_total)))
3425 || !window_resize_check (c, horflag)) 3416 || !window_resize_check (c, horflag))
3426 return 0; 3417 return 0;
3427 c = NILP (WVAR (c, next)) ? 0 : XWINDOW (WVAR (c, next)); 3418 c = NILP (WGET (c, next)) ? 0 : XWINDOW (WGET (c, next));
3428 } 3419 }
3429 return 1; 3420 return 1;
3430 } 3421 }
@@ -3433,7 +3424,7 @@ window_resize_check (struct window *w, int horflag)
3433 /* A leaf window. Make sure it's not too small. The following 3424 /* A leaf window. Make sure it's not too small. The following
3434 hardcodes the values of `window-safe-min-width' (2) and 3425 hardcodes the values of `window-safe-min-width' (2) and
3435 `window-safe-min-height' (1) which are defined in window.el. */ 3426 `window-safe-min-height' (1) which are defined in window.el. */
3436 return XINT (WVAR (w, new_total)) >= (horflag ? 2 : 1); 3427 return XINT (WGET (w, new_total)) >= (horflag ? 2 : 1);
3437} 3428}
3438 3429
3439/* Set w->total_lines (w->total_cols if HORIZONTAL is non-zero) to 3430/* Set w->total_lines (w->total_cols if HORIZONTAL is non-zero) to
@@ -3453,51 +3444,51 @@ window_resize_apply (struct window *w, int horflag)
3453 parent window has been set *before*. */ 3444 parent window has been set *before*. */
3454 if (horflag) 3445 if (horflag)
3455 { 3446 {
3456 WVAR (w, total_cols) = WVAR (w, new_total); 3447 WSET (w, total_cols, WGET (w, new_total));
3457 if (NUMBERP (WVAR (w, new_normal))) 3448 if (NUMBERP (WGET (w, new_normal)))
3458 WVAR (w, normal_cols) = WVAR (w, new_normal); 3449 WSET (w, normal_cols, WGET (w, new_normal));
3459 3450
3460 pos = XINT (WVAR (w, left_col)); 3451 pos = XINT (WGET (w, left_col));
3461 } 3452 }
3462 else 3453 else
3463 { 3454 {
3464 WVAR (w, total_lines) = WVAR (w, new_total); 3455 WSET (w, total_lines, WGET (w, new_total));
3465 if (NUMBERP (WVAR (w, new_normal))) 3456 if (NUMBERP (WGET (w, new_normal)))
3466 WVAR (w, normal_lines) = WVAR (w, new_normal); 3457 WSET (w, normal_lines, WGET (w, new_normal));
3467 3458
3468 pos = XINT (WVAR (w, top_line)); 3459 pos = XINT (WGET (w, top_line));
3469 } 3460 }
3470 3461
3471 if (!NILP (WVAR (w, vchild))) 3462 if (!NILP (WGET (w, vchild)))
3472 /* W is a vertical combination. */ 3463 /* W is a vertical combination. */
3473 { 3464 {
3474 c = XWINDOW (WVAR (w, vchild)); 3465 c = XWINDOW (WGET (w, vchild));
3475 while (c) 3466 while (c)
3476 { 3467 {
3477 if (horflag) 3468 if (horflag)
3478 XSETFASTINT (WVAR (c, left_col), pos); 3469 WSET (c, left_col, make_number (pos));
3479 else 3470 else
3480 XSETFASTINT (WVAR (c, top_line), pos); 3471 WSET (c, top_line, make_number (pos));
3481 window_resize_apply (c, horflag); 3472 window_resize_apply (c, horflag);
3482 if (!horflag) 3473 if (!horflag)
3483 pos = pos + XINT (WVAR (c, total_lines)); 3474 pos = pos + XINT (WGET (c, total_lines));
3484 c = NILP (WVAR (c, next)) ? 0 : XWINDOW (WVAR (c, next)); 3475 c = NILP (WGET (c, next)) ? 0 : XWINDOW (WGET (c, next));
3485 } 3476 }
3486 } 3477 }
3487 else if (!NILP (WVAR (w, hchild))) 3478 else if (!NILP (WGET (w, hchild)))
3488 /* W is a horizontal combination. */ 3479 /* W is a horizontal combination. */
3489 { 3480 {
3490 c = XWINDOW (WVAR (w, hchild)); 3481 c = XWINDOW (WGET (w, hchild));
3491 while (c) 3482 while (c)
3492 { 3483 {
3493 if (horflag) 3484 if (horflag)
3494 XSETFASTINT (WVAR (c, left_col), pos); 3485 WSET (c, left_col, make_number (pos));
3495 else 3486 else
3496 XSETFASTINT (WVAR (c, top_line), pos); 3487 WSET (c, top_line, make_number (pos));
3497 window_resize_apply (c, horflag); 3488 window_resize_apply (c, horflag);
3498 if (horflag) 3489 if (horflag)
3499 pos = pos + XINT (WVAR (c, total_cols)); 3490 pos = pos + XINT (WGET (c, total_cols));
3500 c = NILP (WVAR (c, next)) ? 0 : XWINDOW (WVAR (c, next)); 3491 c = NILP (WGET (c, next)) ? 0 : XWINDOW (WGET (c, next));
3501 } 3492 }
3502 } 3493 }
3503 3494
@@ -3533,8 +3524,8 @@ be applied on the Elisp level. */)
3533 r = XWINDOW (FRAME_ROOT_WINDOW (f)); 3524 r = XWINDOW (FRAME_ROOT_WINDOW (f));
3534 3525
3535 if (!window_resize_check (r, horflag) 3526 if (!window_resize_check (r, horflag)
3536 || ! EQ (WVAR (r, new_total), 3527 || ! EQ (WGET (r, new_total),
3537 (horflag ? WVAR (r, total_cols) : WVAR (r, total_lines)))) 3528 (horflag ? WGET (r, total_cols) : WGET (r, total_lines))))
3538 return Qnil; 3529 return Qnil;
3539 3530
3540 BLOCK_INPUT; 3531 BLOCK_INPUT;
@@ -3574,39 +3565,39 @@ resize_frame_windows (struct frame *f, int size, int horflag)
3574 - ((FRAME_HAS_MINIBUF_P (f) && !FRAME_MINIBUF_ONLY_P (f)) 3565 - ((FRAME_HAS_MINIBUF_P (f) && !FRAME_MINIBUF_ONLY_P (f))
3575 ? 1 : 0))); 3566 ? 1 : 0)));
3576 3567
3577 XSETFASTINT (WVAR (r, top_line), FRAME_TOP_MARGIN (f)); 3568 WSET (r, top_line, make_number (FRAME_TOP_MARGIN (f)));
3578 if (NILP (WVAR (r, vchild)) && NILP (WVAR (r, hchild))) 3569 if (NILP (WGET (r, vchild)) && NILP (WGET (r, hchild)))
3579 /* For a leaf root window just set the size. */ 3570 /* For a leaf root window just set the size. */
3580 if (horflag) 3571 if (horflag)
3581 XSETFASTINT (WVAR (r, total_cols), new_size); 3572 WSET (r, total_cols, make_number (new_size));
3582 else 3573 else
3583 XSETFASTINT (WVAR (r, total_lines), new_size); 3574 WSET (r, total_lines, make_number (new_size));
3584 else 3575 else
3585 { 3576 {
3586 /* old_size is the old size of the frame's root window. */ 3577 /* old_size is the old size of the frame's root window. */
3587 int old_size = XFASTINT (horflag ? WVAR (r, total_cols) 3578 int old_size = XFASTINT (horflag ? WGET (r, total_cols)
3588 : WVAR (r, total_lines)); 3579 : WGET (r, total_lines));
3589 Lisp_Object delta; 3580 Lisp_Object delta;
3590 3581
3591 XSETINT (delta, new_size - old_size); 3582 XSETINT (delta, new_size - old_size);
3592 /* Try a "normal" resize first. */ 3583 /* Try a "normal" resize first. */
3593 resize_root_window (root, delta, horflag ? Qt : Qnil, Qnil); 3584 resize_root_window (root, delta, horflag ? Qt : Qnil, Qnil);
3594 if (window_resize_check (r, horflag) 3585 if (window_resize_check (r, horflag)
3595 && new_size == XINT (WVAR (r, new_total))) 3586 && new_size == XINT (WGET (r, new_total)))
3596 window_resize_apply (r, horflag); 3587 window_resize_apply (r, horflag);
3597 else 3588 else
3598 { 3589 {
3599 /* Try with "reasonable" minimum sizes next. */ 3590 /* Try with "reasonable" minimum sizes next. */
3600 resize_root_window (root, delta, horflag ? Qt : Qnil, Qt); 3591 resize_root_window (root, delta, horflag ? Qt : Qnil, Qt);
3601 if (window_resize_check (r, horflag) 3592 if (window_resize_check (r, horflag)
3602 && new_size == XINT (WVAR (r, new_total))) 3593 && new_size == XINT (WGET (r, new_total)))
3603 window_resize_apply (r, horflag); 3594 window_resize_apply (r, horflag);
3604 else 3595 else
3605 { 3596 {
3606 /* Finally, try with "safe" minimum sizes. */ 3597 /* Finally, try with "safe" minimum sizes. */
3607 resize_root_window (root, delta, horflag ? Qt : Qnil, Qsafe); 3598 resize_root_window (root, delta, horflag ? Qt : Qnil, Qsafe);
3608 if (window_resize_check (r, horflag) 3599 if (window_resize_check (r, horflag)
3609 && new_size == XINT (WVAR (r, new_total))) 3600 && new_size == XINT (WGET (r, new_total)))
3610 window_resize_apply (r, horflag); 3601 window_resize_apply (r, horflag);
3611 else 3602 else
3612 { 3603 {
@@ -3615,9 +3606,9 @@ resize_frame_windows (struct frame *f, int size, int horflag)
3615 root = FGET (f, selected_window); 3606 root = FGET (f, selected_window);
3616 Fdelete_other_windows_internal (root, Qnil); 3607 Fdelete_other_windows_internal (root, Qnil);
3617 if (horflag) 3608 if (horflag)
3618 XSETFASTINT (WVAR (XWINDOW (root), total_cols), new_size); 3609 WSET (XWINDOW (root), total_cols, make_number (new_size));
3619 else 3610 else
3620 XSETFASTINT (WVAR (XWINDOW (root), total_lines), new_size); 3611 WSET (XWINDOW (root), total_lines, make_number (new_size));
3621 } 3612 }
3622 } 3613 }
3623 } 3614 }
@@ -3627,13 +3618,13 @@ resize_frame_windows (struct frame *f, int size, int horflag)
3627 { 3618 {
3628 m = XWINDOW (mini); 3619 m = XWINDOW (mini);
3629 if (horflag) 3620 if (horflag)
3630 XSETFASTINT (WVAR (m, total_cols), size); 3621 WSET (m, total_cols, make_number (size));
3631 else 3622 else
3632 { 3623 {
3633 /* Are we sure we always want 1 line here? */ 3624 /* Are we sure we always want 1 line here? */
3634 XSETFASTINT (WVAR (m, total_lines), 1); 3625 WSET (m, total_lines, make_number (1));
3635 XSETFASTINT (WVAR (m, top_line), XINT (WVAR (r, top_line)) 3626 WSET (m, top_line,
3636 + XINT (WVAR (r, total_lines))); 3627 make_number (XINT (WGET (r, top_line)) + XINT (WGET (r, total_lines))));
3637 } 3628 }
3638 } 3629 }
3639} 3630}
@@ -3689,10 +3680,10 @@ set correctly. See the code of `split-window' for how this is done. */)
3689 parent, or OLD is ortho-combined. */ 3680 parent, or OLD is ortho-combined. */
3690 combination_limit = 3681 combination_limit =
3691 !NILP (Vwindow_combination_limit) 3682 !NILP (Vwindow_combination_limit)
3692 || NILP (WVAR (o, parent)) 3683 || NILP (WGET (o, parent))
3693 || NILP (horflag 3684 || NILP (horflag
3694 ? (WVAR (XWINDOW (WVAR (o, parent)), hchild)) 3685 ? (WGET (XWINDOW (WGET (o, parent)), hchild))
3695 : (WVAR (XWINDOW (WVAR (o, parent)), vchild))); 3686 : (WGET (XWINDOW (WGET (o, parent)), vchild)));
3696 3687
3697 /* We need a live reference window to initialize some parameters. */ 3688 /* We need a live reference window to initialize some parameters. */
3698 if (WINDOW_LIVE_P (old)) 3689 if (WINDOW_LIVE_P (old))
@@ -3712,24 +3703,24 @@ set correctly. See the code of `split-window' for how this is done. */)
3712 /* `window-combination-resize' non-nil means try to resize OLD's siblings 3703 /* `window-combination-resize' non-nil means try to resize OLD's siblings
3713 proportionally. */ 3704 proportionally. */
3714 { 3705 {
3715 p = XWINDOW (WVAR (o, parent)); 3706 p = XWINDOW (WGET (o, parent));
3716 /* Temporarily pretend we split the parent window. */ 3707 /* Temporarily pretend we split the parent window. */
3717 XSETINT (WVAR (p, new_total), 3708 WSET (p, new_total,
3718 XINT (horflag ? WVAR (p, total_cols) : WVAR (p, total_lines)) 3709 make_number (XINT (horflag ? WGET (p, total_cols) : WGET (p, total_lines))
3719 - XINT (total_size)); 3710 - XINT (total_size)));
3720 if (!window_resize_check (p, horflag)) 3711 if (!window_resize_check (p, horflag))
3721 error ("Window sizes don't fit"); 3712 error ("Window sizes don't fit");
3722 else 3713 else
3723 /* Undo the temporary pretension. */ 3714 /* Undo the temporary pretension. */
3724 WVAR (p, new_total) 3715 WSET (p, new_total,
3725 = horflag ? WVAR (p, total_cols) : WVAR (p, total_lines); 3716 horflag ? WGET (p, total_cols) : WGET (p, total_lines));
3726 } 3717 }
3727 else 3718 else
3728 { 3719 {
3729 if (!window_resize_check (o, horflag)) 3720 if (!window_resize_check (o, horflag))
3730 error ("Resizing old window failed"); 3721 error ("Resizing old window failed");
3731 else if (XINT (total_size) + XINT (WVAR (o, new_total)) 3722 else if (XINT (total_size) + XINT (WGET (o, new_total))
3732 != XINT (horflag ? WVAR (o, total_cols) : WVAR (o, total_lines))) 3723 != XINT (horflag ? WGET (o, total_cols) : WGET (o, total_lines)))
3733 error ("Sum of sizes of old and new window don't fit"); 3724 error ("Sum of sizes of old and new window don't fit");
3734 } 3725 }
3735 3726
@@ -3740,94 +3731,95 @@ set correctly. See the code of `split-window' for how this is done. */)
3740 by make_parent_window and we need it below for assigning it to 3731 by make_parent_window and we need it below for assigning it to
3741 p->new_normal. */ 3732 p->new_normal. */
3742 Lisp_Object new_normal 3733 Lisp_Object new_normal
3743 = horflag ? WVAR (o, normal_cols) : WVAR (o, normal_lines); 3734 = horflag ? WGET (o, normal_cols) : WGET (o, normal_lines);
3744 3735
3745 make_parent_window (old, horflag); 3736 make_parent_window (old, horflag);
3746 p = XWINDOW (WVAR (o, parent)); 3737 p = XWINDOW (WGET (o, parent));
3747 /* Store value of `window-combination-limit' in new parent's 3738 /* Store value of `window-combination-limit' in new parent's
3748 combination_limit slot. */ 3739 combination_limit slot. */
3749 WVAR (p, combination_limit) = Vwindow_combination_limit; 3740 WSET (p, combination_limit, Vwindow_combination_limit);
3750 /* These get applied below. */ 3741 /* These get applied below. */
3751 WVAR (p, new_total) 3742 WSET (p, new_total,
3752 = horflag ? WVAR (o, total_cols) : WVAR (o, total_lines); 3743 horflag ? WGET (o, total_cols) : WGET (o, total_lines));
3753 WVAR (p, new_normal) = new_normal; 3744 WSET (p, new_normal, new_normal);
3754 } 3745 }
3755 else 3746 else
3756 p = XWINDOW (WVAR (o, parent)); 3747 p = XWINDOW (WGET (o, parent));
3757 3748
3758 windows_or_buffers_changed++; 3749 windows_or_buffers_changed++;
3759 FRAME_WINDOW_SIZES_CHANGED (f) = 1; 3750 FRAME_WINDOW_SIZES_CHANGED (f) = 1;
3760 new = make_window (); 3751 new = make_window ();
3761 n = XWINDOW (new); 3752 n = XWINDOW (new);
3762 WVAR (n, frame) = frame; 3753 WSET (n, frame, frame);
3763 WVAR (n, parent) = WVAR (o, parent); 3754 WSET (n, parent, WGET (o, parent));
3764 WVAR (n, vchild) = WVAR (n, hchild) = Qnil; 3755 WSET (n, vchild, Qnil);
3756 WSET (n, hchild, Qnil);
3765 3757
3766 if (EQ (side, Qabove) || EQ (side, Qleft)) 3758 if (EQ (side, Qabove) || EQ (side, Qleft))
3767 { 3759 {
3768 WVAR (n, prev) = WVAR (o, prev); 3760 WSET (n, prev, WGET (o, prev));
3769 if (NILP (WVAR (n, prev))) 3761 if (NILP (WGET (n, prev)))
3770 if (horflag) 3762 if (horflag)
3771 WVAR (p, hchild) = new; 3763 WSET (p, hchild, new);
3772 else 3764 else
3773 WVAR (p, vchild) = new; 3765 WSET (p, vchild, new);
3774 else 3766 else
3775 WVAR (XWINDOW (WVAR (n, prev)), next) = new; 3767 WSET (XWINDOW (WGET (n, prev)), next, new);
3776 WVAR (n, next) = old; 3768 WSET (n, next, old);
3777 WVAR (o, prev) = new; 3769 WSET (o, prev, new);
3778 } 3770 }
3779 else 3771 else
3780 { 3772 {
3781 WVAR (n, next) = WVAR (o, next); 3773 WSET (n, next, WGET (o, next));
3782 if (!NILP (WVAR (n, next))) 3774 if (!NILP (WGET (n, next)))
3783 WVAR (XWINDOW (WVAR (n, next)), prev) = new; 3775 WSET (XWINDOW (WGET (n, next)), prev, new);
3784 WVAR (n, prev) = old; 3776 WSET (n, prev, old);
3785 WVAR (o, next) = new; 3777 WSET (o, next, new);
3786 } 3778 }
3787 3779
3788 WVAR (n, buffer) = Qt; 3780 WSET (n, buffer, Qt);
3789 WVAR (n, window_end_valid) = Qnil; 3781 WSET (n, window_end_valid, Qnil);
3790 memset (&n->last_cursor, 0, sizeof n->last_cursor); 3782 memset (&n->last_cursor, 0, sizeof n->last_cursor);
3791 3783
3792 /* Get special geometry settings from reference window. */ 3784 /* Get special geometry settings from reference window. */
3793 WVAR (n, left_margin_cols) = WVAR (r, left_margin_cols); 3785 WSET (n, left_margin_cols, WGET (r, left_margin_cols));
3794 WVAR (n, right_margin_cols) = WVAR (r, right_margin_cols); 3786 WSET (n, right_margin_cols, WGET (r, right_margin_cols));
3795 WVAR (n, left_fringe_width) = WVAR (r, left_fringe_width); 3787 WSET (n, left_fringe_width, WGET (r, left_fringe_width));
3796 WVAR (n, right_fringe_width) = WVAR (r, right_fringe_width); 3788 WSET (n, right_fringe_width, WGET (r, right_fringe_width));
3797 n->fringes_outside_margins = r->fringes_outside_margins; 3789 n->fringes_outside_margins = r->fringes_outside_margins;
3798 WVAR (n, scroll_bar_width) = WVAR (r, scroll_bar_width); 3790 WSET (n, scroll_bar_width, WGET (r, scroll_bar_width));
3799 WVAR (n, vertical_scroll_bar_type) = WVAR (r, vertical_scroll_bar_type); 3791 WSET (n, vertical_scroll_bar_type, WGET (r, vertical_scroll_bar_type));
3800 3792
3801 /* Directly assign orthogonal coordinates and sizes. */ 3793 /* Directly assign orthogonal coordinates and sizes. */
3802 if (horflag) 3794 if (horflag)
3803 { 3795 {
3804 WVAR (n, top_line) = WVAR (o, top_line); 3796 WSET (n, top_line, WGET (o, top_line));
3805 WVAR (n, total_lines) = WVAR (o, total_lines); 3797 WSET (n, total_lines, WGET (o, total_lines));
3806 } 3798 }
3807 else 3799 else
3808 { 3800 {
3809 WVAR (n, left_col) = WVAR (o, left_col); 3801 WSET (n, left_col, WGET (o, left_col));
3810 WVAR (n, total_cols) = WVAR (o, total_cols); 3802 WSET (n, total_cols, WGET (o, total_cols));
3811 } 3803 }
3812 3804
3813 /* Iso-coordinates and sizes are assigned by window_resize_apply, 3805 /* Iso-coordinates and sizes are assigned by window_resize_apply,
3814 get them ready here. */ 3806 get them ready here. */
3815 WVAR (n, new_total) = total_size; 3807 WSET (n, new_total, total_size);
3816 WVAR (n, new_normal) = normal_size; 3808 WSET (n, new_normal, normal_size);
3817 3809
3818 BLOCK_INPUT; 3810 BLOCK_INPUT;
3819 window_resize_apply (p, horflag); 3811 window_resize_apply (p, horflag);
3820 adjust_glyphs (f); 3812 adjust_glyphs (f);
3821 /* 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
3822 any hooks. */ 3814 any hooks. */
3823 set_window_buffer (new, WVAR (r, buffer), 0, 1); 3815 set_window_buffer (new, WGET (r, buffer), 0, 1);
3824 UNBLOCK_INPUT; 3816 UNBLOCK_INPUT;
3825 3817
3826 /* Maybe we should run the scroll functions in Elisp (which already 3818 /* Maybe we should run the scroll functions in Elisp (which already
3827 runs the configuration change hook). */ 3819 runs the configuration change hook). */
3828 if (! NILP (Vwindow_scroll_functions)) 3820 if (! NILP (Vwindow_scroll_functions))
3829 run_hook_with_args_2 (Qwindow_scroll_functions, new, 3821 run_hook_with_args_2 (Qwindow_scroll_functions, new,
3830 Fmarker_position (WVAR (n, start))); 3822 Fmarker_position (WGET (n, start)));
3831 /* Return NEW. */ 3823 /* Return NEW. */
3832 return new; 3824 return new;
3833} 3825}
@@ -3847,22 +3839,22 @@ Signal an error when WINDOW is the only window on its frame. */)
3847 3839
3848 w = decode_any_window (window); 3840 w = decode_any_window (window);
3849 XSETWINDOW (window, w); 3841 XSETWINDOW (window, w);
3850 if (NILP (WVAR (w, buffer)) 3842 if (NILP (WGET (w, buffer))
3851 && NILP (WVAR (w, hchild)) && NILP (WVAR (w, vchild))) 3843 && NILP (WGET (w, hchild)) && NILP (WGET (w, vchild)))
3852 /* It's a no-op to delete an already deleted window. */ 3844 /* It's a no-op to delete an already deleted window. */
3853 return Qnil; 3845 return Qnil;
3854 3846
3855 parent = WVAR (w, parent); 3847 parent = WGET (w, parent);
3856 if (NILP (parent)) 3848 if (NILP (parent))
3857 /* Never delete a minibuffer or frame root window. */ 3849 /* Never delete a minibuffer or frame root window. */
3858 error ("Attempt to delete minibuffer or sole ordinary window"); 3850 error ("Attempt to delete minibuffer or sole ordinary window");
3859 else if (NILP (WVAR (w, prev)) && NILP (WVAR (w, next))) 3851 else if (NILP (WGET (w, prev)) && NILP (WGET (w, next)))
3860 /* Rather bow out here, this case should be handled on the Elisp 3852 /* Rather bow out here, this case should be handled on the Elisp
3861 level. */ 3853 level. */
3862 error ("Attempt to delete sole window of parent"); 3854 error ("Attempt to delete sole window of parent");
3863 3855
3864 p = XWINDOW (parent); 3856 p = XWINDOW (parent);
3865 horflag = NILP (WVAR (p, vchild)); 3857 horflag = NILP (WGET (p, vchild));
3866 3858
3867 frame = WINDOW_FRAME (w); 3859 frame = WINDOW_FRAME (w);
3868 f = XFRAME (frame); 3860 f = XFRAME (frame);
@@ -3871,33 +3863,33 @@ Signal an error when WINDOW is the only window on its frame. */)
3871 r = XWINDOW (root); 3863 r = XWINDOW (root);
3872 3864
3873 /* Unlink WINDOW from window tree. */ 3865 /* Unlink WINDOW from window tree. */
3874 if (NILP (WVAR (w, prev))) 3866 if (NILP (WGET (w, prev)))
3875 /* Get SIBLING below (on the right of) WINDOW. */ 3867 /* Get SIBLING below (on the right of) WINDOW. */
3876 { 3868 {
3877 /* before_sibling 1 means WINDOW is the first child of its 3869 /* before_sibling 1 means WINDOW is the first child of its
3878 parent and thus before the sibling. */ 3870 parent and thus before the sibling. */
3879 before_sibling = 1; 3871 before_sibling = 1;
3880 sibling = WVAR (w, next); 3872 sibling = WGET (w, next);
3881 s = XWINDOW (sibling); 3873 s = XWINDOW (sibling);
3882 WVAR (s, prev) = Qnil; 3874 WSET (s, prev, Qnil);
3883 if (horflag) 3875 if (horflag)
3884 WVAR (p, hchild) = sibling; 3876 WSET (p, hchild, sibling);
3885 else 3877 else
3886 WVAR (p, vchild) = sibling; 3878 WSET (p, vchild, sibling);
3887 } 3879 }
3888 else 3880 else
3889 /* Get SIBLING above (on the left of) WINDOW. */ 3881 /* Get SIBLING above (on the left of) WINDOW. */
3890 { 3882 {
3891 sibling = WVAR (w, prev); 3883 sibling = WGET (w, prev);
3892 s = XWINDOW (sibling); 3884 s = XWINDOW (sibling);
3893 WVAR (s, next) = WVAR (w, next); 3885 WSET (s, next, WGET (w, next));
3894 if (!NILP (WVAR (s, next))) 3886 if (!NILP (WGET (s, next)))
3895 WVAR (XWINDOW (WVAR (s, next)), prev) = sibling; 3887 WSET (XWINDOW (WGET (s, next)), prev, sibling);
3896 } 3888 }
3897 3889
3898 if (window_resize_check (r, horflag) 3890 if (window_resize_check (r, horflag)
3899 && EQ (WVAR (r, new_total), 3891 && EQ (WGET (r, new_total),
3900 (horflag ? WVAR (r, total_cols) : WVAR (r, total_lines)))) 3892 (horflag ? WGET (r, total_cols) : WGET (r, total_lines))))
3901 /* We can delete WINDOW now. */ 3893 /* We can delete WINDOW now. */
3902 { 3894 {
3903 3895
@@ -3919,28 +3911,28 @@ Signal an error when WINDOW is the only window on its frame. */)
3919 Vwindow_list = Qnil; 3911 Vwindow_list = Qnil;
3920 FRAME_WINDOW_SIZES_CHANGED (f) = 1; 3912 FRAME_WINDOW_SIZES_CHANGED (f) = 1;
3921 3913
3922 WVAR (w, next) = Qnil; /* Don't delete w->next too. */ 3914 WSET (w, next, Qnil); /* Don't delete w->next too. */
3923 free_window_matrices (w); 3915 free_window_matrices (w);
3924 3916
3925 if (!NILP (WVAR (w, vchild))) 3917 if (!NILP (WGET (w, vchild)))
3926 { 3918 {
3927 delete_all_child_windows (WVAR (w, vchild)); 3919 delete_all_child_windows (WGET (w, vchild));
3928 WVAR (w, vchild) = Qnil; 3920 WSET (w, vchild, Qnil);
3929 } 3921 }
3930 else if (!NILP (WVAR (w, hchild))) 3922 else if (!NILP (WGET (w, hchild)))
3931 { 3923 {
3932 delete_all_child_windows (WVAR (w, hchild)); 3924 delete_all_child_windows (WGET (w, hchild));
3933 WVAR (w, hchild) = Qnil; 3925 WSET (w, hchild, Qnil);
3934 } 3926 }
3935 else if (!NILP (WVAR (w, buffer))) 3927 else if (!NILP (WGET (w, buffer)))
3936 { 3928 {
3937 unshow_buffer (w); 3929 unshow_buffer (w);
3938 unchain_marker (XMARKER (WVAR (w, pointm))); 3930 unchain_marker (XMARKER (WGET (w, pointm)));
3939 unchain_marker (XMARKER (WVAR (w, start))); 3931 unchain_marker (XMARKER (WGET (w, start)));
3940 WVAR (w, buffer) = Qnil; 3932 WSET (w, buffer, Qnil);
3941 } 3933 }
3942 3934
3943 if (NILP (WVAR (s, prev)) && NILP (WVAR (s, next))) 3935 if (NILP (WGET (s, prev)) && NILP (WGET (s, next)))
3944 /* A matrjoshka where SIBLING has become the only child of 3936 /* A matrjoshka where SIBLING has become the only child of
3945 PARENT. */ 3937 PARENT. */
3946 { 3938 {
@@ -3948,10 +3940,11 @@ Signal an error when WINDOW is the only window on its frame. */)
3948 replace_window (parent, sibling, 0); 3940 replace_window (parent, sibling, 0);
3949 /* Have SIBLING inherit the following three slot values from 3941 /* Have SIBLING inherit the following three slot values from
3950 PARENT (the combination_limit slot is not inherited). */ 3942 PARENT (the combination_limit slot is not inherited). */
3951 WVAR (s, normal_cols) = WVAR (p, normal_cols); 3943 WSET (s, normal_cols, WGET (p, normal_cols));
3952 WVAR (s, normal_lines) = WVAR (p, normal_lines); 3944 WSET (s, normal_lines, WGET (p, normal_lines));
3953 /* Mark PARENT as deleted. */ 3945 /* Mark PARENT as deleted. */
3954 WVAR (p, vchild) = WVAR (p, hchild) = Qnil; 3946 WSET (p, vchild, Qnil);
3947 WSET (p, hchild, Qnil);
3955 /* Try to merge SIBLING into its new parent. */ 3948 /* Try to merge SIBLING into its new parent. */
3956 recombine_windows (sibling); 3949 recombine_windows (sibling);
3957 } 3950 }
@@ -3978,7 +3971,7 @@ Signal an error when WINDOW is the only window on its frame. */)
3978 /* Now look whether `get-mru-window' gets us something. */ 3971 /* Now look whether `get-mru-window' gets us something. */
3979 mru_window = call1 (Qget_mru_window, frame); 3972 mru_window = call1 (Qget_mru_window, frame);
3980 if (WINDOW_LIVE_P (mru_window) 3973 if (WINDOW_LIVE_P (mru_window)
3981 && EQ (WVAR (XWINDOW (mru_window), frame), frame)) 3974 && EQ (WGET (XWINDOW (mru_window), frame), frame))
3982 new_selected_window = mru_window; 3975 new_selected_window = mru_window;
3983 3976
3984 /* If all ended up well, we now promote the mru window. */ 3977 /* If all ended up well, we now promote the mru window. */
@@ -3998,17 +3991,17 @@ Signal an error when WINDOW is the only window on its frame. */)
3998 { 3991 {
3999 if (before_sibling) 3992 if (before_sibling)
4000 { 3993 {
4001 WVAR (s, prev) = window; 3994 WSET (s, prev, window);
4002 if (horflag) 3995 if (horflag)
4003 WVAR (p, hchild) = window; 3996 WSET (p, hchild, window);
4004 else 3997 else
4005 WVAR (p, vchild) = window; 3998 WSET (p, vchild, window);
4006 } 3999 }
4007 else 4000 else
4008 { 4001 {
4009 WVAR (s, next) = window; 4002 WSET (s, next, window);
4010 if (!NILP (WVAR (w, next))) 4003 if (!NILP (WGET (w, next)))
4011 WVAR (XWINDOW (WVAR (w, next)), prev) = window; 4004 WSET (XWINDOW (WGET (w, next)), prev, window);
4012 } 4005 }
4013 error ("Deletion failed"); 4006 error ("Deletion failed");
4014 } 4007 }
@@ -4025,7 +4018,7 @@ Signal an error when WINDOW is the only window on its frame. */)
4025void 4018void
4026grow_mini_window (struct window *w, int delta) 4019grow_mini_window (struct window *w, int delta)
4027{ 4020{
4028 struct frame *f = XFRAME (WVAR (w, frame)); 4021 struct frame *f = XFRAME (WGET (w, frame));
4029 struct window *r; 4022 struct window *r;
4030 Lisp_Object root, value; 4023 Lisp_Object root, value;
4031 4024
@@ -4042,9 +4035,10 @@ grow_mini_window (struct window *w, int delta)
4042 window_resize_apply (r, 0); 4035 window_resize_apply (r, 0);
4043 4036
4044 /* Grow the mini-window. */ 4037 /* Grow the mini-window. */
4045 XSETFASTINT (WVAR (w, top_line), 4038 WSET (w, top_line,
4046 XFASTINT (WVAR (r, top_line)) + XFASTINT (WVAR (r, total_lines))); 4039 make_number (XFASTINT (WGET (r, top_line)) + XFASTINT (WGET (r, total_lines))));
4047 XSETFASTINT (WVAR (w, total_lines), XFASTINT (WVAR (w, total_lines)) - XINT (value)); 4040 WSET (w, total_lines,
4041 make_number (XFASTINT (WGET (w, total_lines)) - XINT (value)));
4048 w->last_modified = 0; 4042 w->last_modified = 0;
4049 w->last_overlay_modified = 0; 4043 w->last_overlay_modified = 0;
4050 4044
@@ -4058,14 +4052,14 @@ grow_mini_window (struct window *w, int delta)
4058void 4052void
4059shrink_mini_window (struct window *w) 4053shrink_mini_window (struct window *w)
4060{ 4054{
4061 struct frame *f = XFRAME (WVAR (w, frame)); 4055 struct frame *f = XFRAME (WGET (w, frame));
4062 struct window *r; 4056 struct window *r;
4063 Lisp_Object root, value; 4057 Lisp_Object root, value;
4064 EMACS_INT size; 4058 EMACS_INT size;
4065 4059
4066 eassert (MINI_WINDOW_P (w)); 4060 eassert (MINI_WINDOW_P (w));
4067 4061
4068 size = XINT (WVAR (w, total_lines)); 4062 size = XINT (WGET (w, total_lines));
4069 if (size > 1) 4063 if (size > 1)
4070 { 4064 {
4071 root = FRAME_ROOT_WINDOW (f); 4065 root = FRAME_ROOT_WINDOW (f);
@@ -4078,9 +4072,9 @@ shrink_mini_window (struct window *w)
4078 window_resize_apply (r, 0); 4072 window_resize_apply (r, 0);
4079 4073
4080 /* Shrink the mini-window. */ 4074 /* Shrink the mini-window. */
4081 XSETFASTINT (WVAR (w, top_line), XFASTINT (WVAR (r, top_line)) 4075 WSET (w, top_line,
4082 + XFASTINT (WVAR (r, total_lines))); 4076 make_number (XFASTINT (WGET (r, top_line)) + XFASTINT (WGET (r, total_lines))));
4083 XSETFASTINT (WVAR (w, total_lines), 1); 4077 WSET (w, total_lines, make_number (1));
4084 4078
4085 w->last_modified = 0; 4079 w->last_modified = 0;
4086 w->last_overlay_modified = 0; 4080 w->last_overlay_modified = 0;
@@ -4105,25 +4099,25 @@ DEFUN ("resize-mini-window-internal", Fresize_mini_window_internal, Sresize_mini
4105 int height; 4099 int height;
4106 4100
4107 CHECK_WINDOW (window); 4101 CHECK_WINDOW (window);
4108 f = XFRAME (WVAR (w, frame)); 4102 f = XFRAME (WGET (w, frame));
4109 4103
4110 if (!EQ (FRAME_MINIBUF_WINDOW (XFRAME (WVAR (w, frame))), window)) 4104 if (!EQ (FRAME_MINIBUF_WINDOW (XFRAME (WGET (w, frame))), window))
4111 error ("Not a valid minibuffer window"); 4105 error ("Not a valid minibuffer window");
4112 else if (FRAME_MINIBUF_ONLY_P (f)) 4106 else if (FRAME_MINIBUF_ONLY_P (f))
4113 error ("Cannot resize a minibuffer-only frame"); 4107 error ("Cannot resize a minibuffer-only frame");
4114 4108
4115 r = XWINDOW (FRAME_ROOT_WINDOW (f)); 4109 r = XWINDOW (FRAME_ROOT_WINDOW (f));
4116 height = XINT (WVAR (r, total_lines)) + XINT (WVAR (w, total_lines)); 4110 height = XINT (WGET (r, total_lines)) + XINT (WGET (w, total_lines));
4117 if (window_resize_check (r, 0) 4111 if (window_resize_check (r, 0)
4118 && XINT (WVAR (w, new_total)) > 0 4112 && XINT (WGET (w, new_total)) > 0
4119 && height == XINT (WVAR (r, new_total)) + XINT (WVAR (w, new_total))) 4113 && height == XINT (WGET (r, new_total)) + XINT (WGET (w, new_total)))
4120 { 4114 {
4121 BLOCK_INPUT; 4115 BLOCK_INPUT;
4122 window_resize_apply (r, 0); 4116 window_resize_apply (r, 0);
4123 4117
4124 WVAR (w, total_lines) = WVAR (w, new_total); 4118 WSET (w, total_lines, WGET (w, new_total));
4125 XSETFASTINT (WVAR (w, top_line), 4119 WSET (w, top_line,
4126 XINT (WVAR (r, top_line)) + XINT (WVAR (r, total_lines))); 4120 make_number (XINT (WGET (r, top_line)) + XINT (WGET (r, total_lines))));
4127 4121
4128 windows_or_buffers_changed++; 4122 windows_or_buffers_changed++;
4129 FRAME_WINDOW_SIZES_CHANGED (f) = 1; 4123 FRAME_WINDOW_SIZES_CHANGED (f) = 1;
@@ -4146,14 +4140,14 @@ mark_window_cursors_off (struct window *w)
4146{ 4140{
4147 while (w) 4141 while (w)
4148 { 4142 {
4149 if (!NILP (WVAR (w, hchild))) 4143 if (!NILP (WGET (w, hchild)))
4150 mark_window_cursors_off (XWINDOW (WVAR (w, hchild))); 4144 mark_window_cursors_off (XWINDOW (WGET (w, hchild)));
4151 else if (!NILP (WVAR (w, vchild))) 4145 else if (!NILP (WGET (w, vchild)))
4152 mark_window_cursors_off (XWINDOW (WVAR (w, vchild))); 4146 mark_window_cursors_off (XWINDOW (WGET (w, vchild)));
4153 else 4147 else
4154 w->phys_cursor_on_p = 0; 4148 w->phys_cursor_on_p = 0;
4155 4149
4156 w = NILP (WVAR (w, next)) ? 0 : XWINDOW (WVAR (w, next)); 4150 w = NILP (WGET (w, next)) ? 0 : XWINDOW (WGET (w, next));
4157 } 4151 }
4158} 4152}
4159 4153
@@ -4163,15 +4157,15 @@ mark_window_cursors_off (struct window *w)
4163int 4157int
4164window_internal_height (struct window *w) 4158window_internal_height (struct window *w)
4165{ 4159{
4166 int ht = XFASTINT (WVAR (w, total_lines)); 4160 int ht = XFASTINT (WGET (w, total_lines));
4167 4161
4168 if (!MINI_WINDOW_P (w)) 4162 if (!MINI_WINDOW_P (w))
4169 { 4163 {
4170 if (!NILP (WVAR (w, parent)) 4164 if (!NILP (WGET (w, parent))
4171 || !NILP (WVAR (w, vchild)) 4165 || !NILP (WGET (w, vchild))
4172 || !NILP (WVAR (w, hchild)) 4166 || !NILP (WGET (w, hchild))
4173 || !NILP (WVAR (w, next)) 4167 || !NILP (WGET (w, next))
4174 || !NILP (WVAR (w, prev)) 4168 || !NILP (WGET (w, prev))
4175 || WINDOW_WANTS_MODELINE_P (w)) 4169 || WINDOW_WANTS_MODELINE_P (w))
4176 --ht; 4170 --ht;
4177 4171
@@ -4201,7 +4195,7 @@ window_scroll (Lisp_Object window, EMACS_INT n, int whole, int noerror)
4201 4195
4202 /* If we must, use the pixel-based version which is much slower than 4196 /* If we must, use the pixel-based version which is much slower than
4203 the line-based one but can handle varying line heights. */ 4197 the line-based one but can handle varying line heights. */
4204 if (FRAME_WINDOW_P (XFRAME (WVAR (XWINDOW (window), frame)))) 4198 if (FRAME_WINDOW_P (XFRAME (WGET (XWINDOW (window), frame))))
4205 window_scroll_pixel_based (window, n, whole, noerror); 4199 window_scroll_pixel_based (window, n, whole, noerror);
4206 else 4200 else
4207 window_scroll_line_based (window, n, whole, noerror); 4201 window_scroll_line_based (window, n, whole, noerror);
@@ -4226,7 +4220,7 @@ window_scroll_pixel_based (Lisp_Object window, int n, int whole, int noerror)
4226 int x, y, rtop, rbot, rowh, vpos; 4220 int x, y, rtop, rbot, rowh, vpos;
4227 void *itdata = NULL; 4221 void *itdata = NULL;
4228 4222
4229 SET_TEXT_POS_FROM_MARKER (start, WVAR (w, start)); 4223 SET_TEXT_POS_FROM_MARKER (start, WGET (w, start));
4230 /* Scrolling a minibuffer window via scroll bar when the echo area 4224 /* Scrolling a minibuffer window via scroll bar when the echo area
4231 shows long text sometimes resets the minibuffer contents behind 4225 shows long text sometimes resets the minibuffer contents behind
4232 our backs. */ 4226 our backs. */
@@ -4307,8 +4301,8 @@ window_scroll_pixel_based (Lisp_Object window, int n, int whole, int noerror)
4307 spos = XINT (Fline_beginning_position (Qnil)); 4301 spos = XINT (Fline_beginning_position (Qnil));
4308 else 4302 else
4309 spos = min (XINT (Fline_end_position (Qnil)) + 1, ZV); 4303 spos = min (XINT (Fline_end_position (Qnil)) + 1, ZV);
4310 set_marker_restricted (WVAR (w, start), make_number (spos), 4304 set_marker_restricted (WGET (w, start), make_number (spos),
4311 WVAR (w, buffer)); 4305 WGET (w, buffer));
4312 w->start_at_line_beg = 1; 4306 w->start_at_line_beg = 1;
4313 w->update_mode_line = 1; 4307 w->update_mode_line = 1;
4314 w->last_modified = 0; 4308 w->last_modified = 0;
@@ -4432,7 +4426,7 @@ window_scroll_pixel_based (Lisp_Object window, int n, int whole, int noerror)
4432 4426
4433 /* If control gets here, then we vscrolled. */ 4427 /* If control gets here, then we vscrolled. */
4434 4428
4435 XBUFFER (WVAR (w, buffer))->prevent_redisplay_optimizations_p = 1; 4429 XBUFFER (WGET (w, buffer))->prevent_redisplay_optimizations_p = 1;
4436 4430
4437 /* Don't try to change the window start below. */ 4431 /* Don't try to change the window start below. */
4438 vscrolled = 1; 4432 vscrolled = 1;
@@ -4452,9 +4446,9 @@ window_scroll_pixel_based (Lisp_Object window, int n, int whole, int noerror)
4452 } 4446 }
4453 4447
4454 /* Set the window start, and set up the window for redisplay. */ 4448 /* Set the window start, and set up the window for redisplay. */
4455 set_marker_restricted (WVAR (w, start), make_number (pos), 4449 set_marker_restricted (WGET (w, start), make_number (pos),
4456 WVAR (w, buffer)); 4450 WGET (w, buffer));
4457 bytepos = XMARKER (WVAR (w, start))->bytepos; 4451 bytepos = XMARKER (WGET (w, start))->bytepos;
4458 w->start_at_line_beg = (pos == BEGV || FETCH_BYTE (bytepos - 1) == '\n'); 4452 w->start_at_line_beg = (pos == BEGV || FETCH_BYTE (bytepos - 1) == '\n');
4459 w->update_mode_line = 1; 4453 w->update_mode_line = 1;
4460 w->last_modified = 0; 4454 w->last_modified = 0;
@@ -4473,7 +4467,7 @@ window_scroll_pixel_based (Lisp_Object window, int n, int whole, int noerror)
4473 even if there is a header line. */ 4467 even if there is a header line. */
4474 this_scroll_margin = max (0, scroll_margin); 4468 this_scroll_margin = max (0, scroll_margin);
4475 this_scroll_margin 4469 this_scroll_margin
4476 = min (this_scroll_margin, XFASTINT (WVAR (w, total_lines)) / 4); 4470 = min (this_scroll_margin, XFASTINT (WGET (w, total_lines)) / 4);
4477 this_scroll_margin *= FRAME_LINE_HEIGHT (it.f); 4471 this_scroll_margin *= FRAME_LINE_HEIGHT (it.f);
4478 4472
4479 if (n > 0) 4473 if (n > 0)
@@ -4547,7 +4541,7 @@ window_scroll_pixel_based (Lisp_Object window, int n, int whole, int noerror)
4547 ; 4541 ;
4548 else if (window_scroll_pixel_based_preserve_y >= 0) 4542 else if (window_scroll_pixel_based_preserve_y >= 0)
4549 { 4543 {
4550 SET_TEXT_POS_FROM_MARKER (start, WVAR (w, start)); 4544 SET_TEXT_POS_FROM_MARKER (start, WGET (w, start));
4551 start_display (&it, w, start); 4545 start_display (&it, w, start);
4552 /* It would be wrong to subtract CURRENT_HEADER_LINE_HEIGHT 4546 /* It would be wrong to subtract CURRENT_HEADER_LINE_HEIGHT
4553 here because we called start_display again and did not 4547 here because we called start_display again and did not
@@ -4601,7 +4595,7 @@ window_scroll_line_based (Lisp_Object window, int n, int whole, int noerror)
4601 if (whole) 4595 if (whole)
4602 n *= max (1, ht - next_screen_context_lines); 4596 n *= max (1, ht - next_screen_context_lines);
4603 4597
4604 startpos = marker_position (WVAR (w, start)); 4598 startpos = marker_position (WGET (w, start));
4605 4599
4606 if (!NILP (Vscroll_preserve_screen_position)) 4600 if (!NILP (Vscroll_preserve_screen_position))
4607 { 4601 {
@@ -4652,9 +4646,9 @@ window_scroll_line_based (Lisp_Object window, int n, int whole, int noerror)
4652 { 4646 {
4653 /* Don't use a scroll margin that is negative or too large. */ 4647 /* Don't use a scroll margin that is negative or too large. */
4654 int this_scroll_margin = 4648 int this_scroll_margin =
4655 max (0, min (scroll_margin, XINT (WVAR (w, total_lines)) / 4)); 4649 max (0, min (scroll_margin, XINT (WGET (w, total_lines)) / 4));
4656 4650
4657 set_marker_restricted_both (WVAR (w, start), WVAR (w, buffer), pos, pos_byte); 4651 set_marker_restricted_both (WGET (w, start), WGET (w, buffer), pos, pos_byte);
4658 w->start_at_line_beg = !NILP (bolp); 4652 w->start_at_line_beg = !NILP (bolp);
4659 w->update_mode_line = 1; 4653 w->update_mode_line = 1;
4660 w->last_modified = 0; 4654 w->last_modified = 0;
@@ -4748,10 +4742,10 @@ scroll_command (Lisp_Object n, int direction)
4748 4742
4749 /* If selected window's buffer isn't current, make it current for 4743 /* If selected window's buffer isn't current, make it current for
4750 the moment. But don't screw up if window_scroll gets an error. */ 4744 the moment. But don't screw up if window_scroll gets an error. */
4751 if (XBUFFER (WVAR (XWINDOW (selected_window), buffer)) != current_buffer) 4745 if (XBUFFER (WGET (XWINDOW (selected_window), buffer)) != current_buffer)
4752 { 4746 {
4753 record_unwind_protect (save_excursion_restore, save_excursion_save ()); 4747 record_unwind_protect (save_excursion_restore, save_excursion_save ());
4754 Fset_buffer (WVAR (XWINDOW (selected_window), buffer)); 4748 Fset_buffer (WGET (XWINDOW (selected_window), buffer));
4755 4749
4756 /* Make redisplay consider other windows than just selected_window. */ 4750 /* Make redisplay consider other windows than just selected_window. */
4757 ++windows_or_buffers_changed; 4751 ++windows_or_buffers_changed;
@@ -4866,8 +4860,8 @@ specifies the window to scroll. This takes precedence over
4866 record_unwind_protect (save_excursion_restore, save_excursion_save ()); 4860 record_unwind_protect (save_excursion_restore, save_excursion_save ());
4867 ++windows_or_buffers_changed; 4861 ++windows_or_buffers_changed;
4868 4862
4869 Fset_buffer (WVAR (w, buffer)); 4863 Fset_buffer (WGET (w, buffer));
4870 SET_PT (marker_position (WVAR (w, pointm))); 4864 SET_PT (marker_position (WGET (w, pointm)));
4871 4865
4872 if (NILP (arg)) 4866 if (NILP (arg))
4873 window_scroll (window, 1, 1, 1); 4867 window_scroll (window, 1, 1, 1);
@@ -4881,7 +4875,7 @@ specifies the window to scroll. This takes precedence over
4881 window_scroll (window, XINT (arg), 0, 1); 4875 window_scroll (window, XINT (arg), 0, 1);
4882 } 4876 }
4883 4877
4884 set_marker_both (WVAR (w, pointm), Qnil, PT, PT_BYTE); 4878 set_marker_both (WGET (w, pointm), Qnil, PT, PT_BYTE);
4885 unbind_to (count, Qnil); 4879 unbind_to (count, Qnil);
4886 4880
4887 return Qnil; 4881 return Qnil;
@@ -4959,10 +4953,10 @@ displayed_window_lines (struct window *w)
4959 int bottom_y; 4953 int bottom_y;
4960 void *itdata = NULL; 4954 void *itdata = NULL;
4961 4955
4962 if (XBUFFER (WVAR (w, buffer)) != current_buffer) 4956 if (XBUFFER (WGET (w, buffer)) != current_buffer)
4963 { 4957 {
4964 old_buffer = current_buffer; 4958 old_buffer = current_buffer;
4965 set_buffer_internal (XBUFFER (WVAR (w, buffer))); 4959 set_buffer_internal (XBUFFER (WGET (w, buffer)));
4966 } 4960 }
4967 else 4961 else
4968 old_buffer = NULL; 4962 old_buffer = NULL;
@@ -4970,12 +4964,12 @@ displayed_window_lines (struct window *w)
4970 /* In case W->start is out of the accessible range, do something 4964 /* In case W->start is out of the accessible range, do something
4971 reasonable. This happens in Info mode when Info-scroll-down 4965 reasonable. This happens in Info mode when Info-scroll-down
4972 calls (recenter -1) while W->start is 1. */ 4966 calls (recenter -1) while W->start is 1. */
4973 if (XMARKER (WVAR (w, start))->charpos < BEGV) 4967 if (XMARKER (WGET (w, start))->charpos < BEGV)
4974 SET_TEXT_POS (start, BEGV, BEGV_BYTE); 4968 SET_TEXT_POS (start, BEGV, BEGV_BYTE);
4975 else if (XMARKER (WVAR (w, start))->charpos > ZV) 4969 else if (XMARKER (WGET (w, start))->charpos > ZV)
4976 SET_TEXT_POS (start, ZV, ZV_BYTE); 4970 SET_TEXT_POS (start, ZV, ZV_BYTE);
4977 else 4971 else
4978 SET_TEXT_POS_FROM_MARKER (start, WVAR (w, start)); 4972 SET_TEXT_POS_FROM_MARKER (start, WGET (w, start));
4979 4973
4980 itdata = bidi_shelve_cache (); 4974 itdata = bidi_shelve_cache ();
4981 start_display (&it, w, start); 4975 start_display (&it, w, start);
@@ -4989,7 +4983,7 @@ displayed_window_lines (struct window *w)
4989 This kludge fixes a bug whereby (move-to-window-line -1) 4983 This kludge fixes a bug whereby (move-to-window-line -1)
4990 when ZV is on the last screen line 4984 when ZV is on the last screen line
4991 moves to the previous screen line instead of the last one. */ 4985 moves to the previous screen line instead of the last one. */
4992 if (! FRAME_WINDOW_P (XFRAME (WVAR (w, frame)))) 4986 if (! FRAME_WINDOW_P (XFRAME (WGET (w, frame))))
4993 height++; 4987 height++;
4994 4988
4995 /* Add in empty lines at the bottom of the window. */ 4989 /* Add in empty lines at the bottom of the window. */
@@ -5024,7 +5018,7 @@ and redisplay normally--don't erase and redraw the frame. */)
5024 (register Lisp_Object arg) 5018 (register Lisp_Object arg)
5025{ 5019{
5026 struct window *w = XWINDOW (selected_window); 5020 struct window *w = XWINDOW (selected_window);
5027 struct buffer *buf = XBUFFER (WVAR (w, buffer)); 5021 struct buffer *buf = XBUFFER (WGET (w, buffer));
5028 struct buffer *obuf = current_buffer; 5022 struct buffer *obuf = current_buffer;
5029 int center_p = 0; 5023 int center_p = 0;
5030 ptrdiff_t charpos, bytepos; 5024 ptrdiff_t charpos, bytepos;
@@ -5068,12 +5062,12 @@ and redisplay normally--don't erase and redraw the frame. */)
5068 /* Do this after making BUF current 5062 /* Do this after making BUF current
5069 in case scroll_margin is buffer-local. */ 5063 in case scroll_margin is buffer-local. */
5070 this_scroll_margin = 5064 this_scroll_margin =
5071 max (0, min (scroll_margin, XFASTINT (WVAR (w, total_lines)) / 4)); 5065 max (0, min (scroll_margin, XFASTINT (WGET (w, total_lines)) / 4));
5072 5066
5073 /* Handle centering on a graphical frame specially. Such frames can 5067 /* Handle centering on a graphical frame specially. Such frames can
5074 have variable-height lines and centering point on the basis of 5068 have variable-height lines and centering point on the basis of
5075 line counts would lead to strange effects. */ 5069 line counts would lead to strange effects. */
5076 if (FRAME_WINDOW_P (XFRAME (WVAR (w, frame)))) 5070 if (FRAME_WINDOW_P (XFRAME (WGET (w, frame))))
5077 { 5071 {
5078 if (center_p) 5072 if (center_p)
5079 { 5073 {
@@ -5190,8 +5184,8 @@ and redisplay normally--don't erase and redraw the frame. */)
5190 } 5184 }
5191 5185
5192 /* Set the new window start. */ 5186 /* Set the new window start. */
5193 set_marker_both (WVAR (w, start), WVAR (w, buffer), charpos, bytepos); 5187 set_marker_both (WGET (w, start), WGET (w, buffer), charpos, bytepos);
5194 WVAR (w, window_end_valid) = Qnil; 5188 WSET (w, window_end_valid, Qnil);
5195 5189
5196 w->optional_new_start = 1; 5190 w->optional_new_start = 1;
5197 5191
@@ -5213,7 +5207,7 @@ nor any partial-height lines at the bottom of the text area. */)
5213{ 5207{
5214 struct window *w = decode_window (window); 5208 struct window *w = decode_window (window);
5215 int pixel_height = window_box_height (w); 5209 int pixel_height = window_box_height (w);
5216 int line_height = pixel_height / FRAME_LINE_HEIGHT (XFRAME (WVAR (w, frame))); 5210 int line_height = pixel_height / FRAME_LINE_HEIGHT (XFRAME (WGET (w, frame)));
5217 return make_number (line_height); 5211 return make_number (line_height);
5218} 5212}
5219 5213
@@ -5234,24 +5228,24 @@ zero means top of window, negative means relative to bottom of window. */)
5234 int this_scroll_margin; 5228 int this_scroll_margin;
5235#endif 5229#endif
5236 5230
5237 if (!(BUFFERP (WVAR (w, buffer)) 5231 if (!(BUFFERP (WGET (w, buffer))
5238 && XBUFFER (WVAR (w, buffer)) == current_buffer)) 5232 && XBUFFER (WGET (w, buffer)) == current_buffer))
5239 /* This test is needed to make sure PT/PT_BYTE make sense in w->buffer 5233 /* This test is needed to make sure PT/PT_BYTE make sense in w->buffer
5240 when passed below to set_marker_both. */ 5234 when passed below to set_marker_both. */
5241 error ("move-to-window-line called from unrelated buffer"); 5235 error ("move-to-window-line called from unrelated buffer");
5242 5236
5243 window = selected_window; 5237 window = selected_window;
5244 start = marker_position (WVAR (w, start)); 5238 start = marker_position (WGET (w, start));
5245 if (start < BEGV || start > ZV) 5239 if (start < BEGV || start > ZV)
5246 { 5240 {
5247 int height = window_internal_height (w); 5241 int height = window_internal_height (w);
5248 Fvertical_motion (make_number (- (height / 2)), window); 5242 Fvertical_motion (make_number (- (height / 2)), window);
5249 set_marker_both (WVAR (w, start), WVAR (w, buffer), PT, PT_BYTE); 5243 set_marker_both (WGET (w, start), WGET (w, buffer), PT, PT_BYTE);
5250 w->start_at_line_beg = !NILP (Fbolp ()); 5244 w->start_at_line_beg = !NILP (Fbolp ());
5251 w->force_start = 1; 5245 w->force_start = 1;
5252 } 5246 }
5253 else 5247 else
5254 Fgoto_char (WVAR (w, start)); 5248 Fgoto_char (WGET (w, start));
5255 5249
5256 lines = displayed_window_lines (w); 5250 lines = displayed_window_lines (w);
5257 5251
@@ -5355,7 +5349,7 @@ DEFUN ("window-configuration-frame", Fwindow_configuration_frame, Swindow_config
5355 5349
5356 data = (struct save_window_data *) XVECTOR (config); 5350 data = (struct save_window_data *) XVECTOR (config);
5357 saved_windows = XVECTOR (data->saved_windows); 5351 saved_windows = XVECTOR (data->saved_windows);
5358 return WVAR (XWINDOW (SAVED_WINDOW_N (saved_windows, 0)->window), frame); 5352 return WGET (XWINDOW (SAVED_WINDOW_N (saved_windows, 0)->window), frame);
5359} 5353}
5360 5354
5361DEFUN ("set-window-configuration", Fset_window_configuration, 5355DEFUN ("set-window-configuration", Fset_window_configuration,
@@ -5397,11 +5391,11 @@ the return value is nil. Otherwise the value is t. */)
5397 window-point of the final-selected-window to the window-point of 5391 window-point of the final-selected-window to the window-point of
5398 the current-selected-window. So we have to be careful which 5392 the current-selected-window. So we have to be careful which
5399 point of the current-buffer we copy into old_point. */ 5393 point of the current-buffer we copy into old_point. */
5400 if (EQ (WVAR (XWINDOW (data->current_window), buffer), new_current_buffer) 5394 if (EQ (WGET (XWINDOW (data->current_window), buffer), new_current_buffer)
5401 && WINDOWP (selected_window) 5395 && WINDOWP (selected_window)
5402 && EQ (WVAR (XWINDOW (selected_window), buffer), new_current_buffer) 5396 && EQ (WGET (XWINDOW (selected_window), buffer), new_current_buffer)
5403 && !EQ (selected_window, data->current_window)) 5397 && !EQ (selected_window, data->current_window))
5404 old_point = XMARKER (WVAR (XWINDOW (data->current_window), pointm))->charpos; 5398 old_point = XMARKER (WGET (XWINDOW (data->current_window), pointm))->charpos;
5405 else 5399 else
5406 old_point = PT; 5400 old_point = PT;
5407 else 5401 else
@@ -5413,15 +5407,15 @@ the return value is nil. Otherwise the value is t. */)
5413 So if possible we want this arbitrary choice of "which point" to 5407 So if possible we want this arbitrary choice of "which point" to
5414 be the one from the to-be-selected-window so as to prevent this 5408 be the one from the to-be-selected-window so as to prevent this
5415 window's cursor from being copied from another window. */ 5409 window's cursor from being copied from another window. */
5416 if (EQ (WVAR (XWINDOW (data->current_window), buffer), new_current_buffer) 5410 if (EQ (WGET (XWINDOW (data->current_window), buffer), new_current_buffer)
5417 /* If current_window = selected_window, its point is in BUF_PT. */ 5411 /* If current_window = selected_window, its point is in BUF_PT. */
5418 && !EQ (selected_window, data->current_window)) 5412 && !EQ (selected_window, data->current_window))
5419 old_point = XMARKER (WVAR (XWINDOW (data->current_window), pointm))->charpos; 5413 old_point = XMARKER (WGET (XWINDOW (data->current_window), pointm))->charpos;
5420 else 5414 else
5421 old_point = BUF_PT (XBUFFER (new_current_buffer)); 5415 old_point = BUF_PT (XBUFFER (new_current_buffer));
5422 } 5416 }
5423 5417
5424 frame = WVAR (XWINDOW (SAVED_WINDOW_N (saved_windows, 0)->window), frame); 5418 frame = WGET (XWINDOW (SAVED_WINDOW_N (saved_windows, 0)->window), frame);
5425 f = XFRAME (frame); 5419 f = XFRAME (frame);
5426 5420
5427 /* If f is a dead frame, don't bother rebuilding its window tree. 5421 /* If f is a dead frame, don't bother rebuilding its window tree.
@@ -5474,13 +5468,13 @@ the return value is nil. Otherwise the value is t. */)
5474 window holds garbage.) We do this now, before 5468 window holds garbage.) We do this now, before
5475 restoring the window contents, and prevent it from 5469 restoring the window contents, and prevent it from
5476 being done later on when we select a new window. */ 5470 being done later on when we select a new window. */
5477 if (! NILP (WVAR (XWINDOW (selected_window), buffer))) 5471 if (! NILP (WGET (XWINDOW (selected_window), buffer)))
5478 { 5472 {
5479 w = XWINDOW (selected_window); 5473 w = XWINDOW (selected_window);
5480 set_marker_both (WVAR (w, pointm), 5474 set_marker_both (WGET (w, pointm),
5481 WVAR (w, buffer), 5475 WGET (w, buffer),
5482 BUF_PT (XBUFFER (WVAR (w, buffer))), 5476 BUF_PT (XBUFFER (WGET (w, buffer))),
5483 BUF_PT_BYTE (XBUFFER (WVAR (w, buffer)))); 5477 BUF_PT_BYTE (XBUFFER (WGET (w, buffer))));
5484 } 5478 }
5485 5479
5486 windows_or_buffers_changed++; 5480 windows_or_buffers_changed++;
@@ -5509,60 +5503,60 @@ the return value is nil. Otherwise the value is t. */)
5509 p = SAVED_WINDOW_N (saved_windows, k); 5503 p = SAVED_WINDOW_N (saved_windows, k);
5510 window = p->window; 5504 window = p->window;
5511 w = XWINDOW (window); 5505 w = XWINDOW (window);
5512 WVAR (w, next) = Qnil; 5506 WSET (w, next, Qnil);
5513 5507
5514 if (!NILP (p->parent)) 5508 if (!NILP (p->parent))
5515 WVAR (w, parent) = SAVED_WINDOW_N (saved_windows, 5509 WSET (w, parent, SAVED_WINDOW_N (saved_windows,
5516 XFASTINT (p->parent))->window; 5510 XFASTINT (p->parent))->window);
5517 else 5511 else
5518 WVAR (w, parent) = Qnil; 5512 WSET (w, parent, Qnil);
5519 5513
5520 if (!NILP (p->prev)) 5514 if (!NILP (p->prev))
5521 { 5515 {
5522 WVAR (w, prev) = SAVED_WINDOW_N (saved_windows, 5516 WSET (w, prev, SAVED_WINDOW_N (saved_windows,
5523 XFASTINT (p->prev))->window; 5517 XFASTINT (p->prev))->window);
5524 WVAR (XWINDOW (WVAR (w, prev)), next) = p->window; 5518 WSET (XWINDOW (WGET (w, prev)), next, p->window);
5525 } 5519 }
5526 else 5520 else
5527 { 5521 {
5528 WVAR (w, prev) = Qnil; 5522 WSET (w, prev, Qnil);
5529 if (!NILP (WVAR (w, parent))) 5523 if (!NILP (WGET (w, parent)))
5530 { 5524 {
5531 if (EQ (p->total_cols, WVAR (XWINDOW (WVAR (w, parent)), total_cols))) 5525 if (EQ (p->total_cols, WGET (XWINDOW (WGET (w, parent)), total_cols)))
5532 { 5526 {
5533 WVAR (XWINDOW (WVAR (w, parent)), vchild) = p->window; 5527 WSET (XWINDOW (WGET (w, parent)), vchild, p->window);
5534 WVAR (XWINDOW (WVAR (w, parent)), hchild) = Qnil; 5528 WSET (XWINDOW (WGET (w, parent)), hchild, Qnil);
5535 } 5529 }
5536 else 5530 else
5537 { 5531 {
5538 WVAR (XWINDOW (WVAR (w, parent)), hchild) = p->window; 5532 WSET (XWINDOW (WGET (w, parent)), hchild, p->window);
5539 WVAR (XWINDOW (WVAR (w, parent)), vchild) = Qnil; 5533 WSET (XWINDOW (WGET (w, parent)), vchild, Qnil);
5540 } 5534 }
5541 } 5535 }
5542 } 5536 }
5543 5537
5544 /* If we squirreled away the buffer in the window's height, 5538 /* If we squirreled away the buffer in the window's height,
5545 restore it now. */ 5539 restore it now. */
5546 if (BUFFERP (WVAR (w, total_lines))) 5540 if (BUFFERP (WGET (w, total_lines)))
5547 WVAR (w, buffer) = WVAR (w, total_lines); 5541 WSET (w, buffer, WGET (w, total_lines));
5548 WVAR (w, left_col) = p->left_col; 5542 WSET (w, left_col, p->left_col);
5549 WVAR (w, top_line) = p->top_line; 5543 WSET (w, top_line, p->top_line);
5550 WVAR (w, total_cols) = p->total_cols; 5544 WSET (w, total_cols, p->total_cols);
5551 WVAR (w, total_lines) = p->total_lines; 5545 WSET (w, total_lines, p->total_lines);
5552 WVAR (w, normal_cols) = p->normal_cols; 5546 WSET (w, normal_cols, p->normal_cols);
5553 WVAR (w, normal_lines) = p->normal_lines; 5547 WSET (w, normal_lines, p->normal_lines);
5554 w->hscroll = XFASTINT (p->hscroll); 5548 w->hscroll = XFASTINT (p->hscroll);
5555 w->min_hscroll = XFASTINT (p->min_hscroll); 5549 w->min_hscroll = XFASTINT (p->min_hscroll);
5556 WVAR (w, display_table) = p->display_table; 5550 WSET (w, display_table, p->display_table);
5557 WVAR (w, left_margin_cols) = p->left_margin_cols; 5551 WSET (w, left_margin_cols, p->left_margin_cols);
5558 WVAR (w, right_margin_cols) = p->right_margin_cols; 5552 WSET (w, right_margin_cols, p->right_margin_cols);
5559 WVAR (w, left_fringe_width) = p->left_fringe_width; 5553 WSET (w, left_fringe_width, p->left_fringe_width);
5560 WVAR (w, right_fringe_width) = p->right_fringe_width; 5554 WSET (w, right_fringe_width, p->right_fringe_width);
5561 w->fringes_outside_margins = !NILP (p->fringes_outside_margins); 5555 w->fringes_outside_margins = !NILP (p->fringes_outside_margins);
5562 WVAR (w, scroll_bar_width) = p->scroll_bar_width; 5556 WSET (w, scroll_bar_width, p->scroll_bar_width);
5563 WVAR (w, vertical_scroll_bar_type) = p->vertical_scroll_bar_type; 5557 WSET (w, vertical_scroll_bar_type, p->vertical_scroll_bar_type);
5564 WVAR (w, dedicated) = p->dedicated; 5558 WSET (w, dedicated, p->dedicated);
5565 WVAR (w, combination_limit) = p->combination_limit; 5559 WSET (w, combination_limit, p->combination_limit);
5566 /* Restore any window parameters that have been saved. 5560 /* Restore any window parameters that have been saved.
5567 Parameters that have not been saved are left alone. */ 5561 Parameters that have not been saved are left alone. */
5568 for (tem = p->window_parameters; CONSP (tem); tem = XCDR (tem)) 5562 for (tem = p->window_parameters; CONSP (tem); tem = XCDR (tem))
@@ -5572,7 +5566,7 @@ the return value is nil. Otherwise the value is t. */)
5572 { 5566 {
5573 if (NILP (XCDR (pers))) 5567 if (NILP (XCDR (pers)))
5574 { 5568 {
5575 par = Fassq (XCAR (pers), WVAR (w, window_parameters)); 5569 par = Fassq (XCAR (pers), WGET (w, window_parameters));
5576 if (CONSP (par) && !NILP (XCDR (par))) 5570 if (CONSP (par) && !NILP (XCDR (par)))
5577 /* Reset a parameter to nil if and only if it 5571 /* Reset a parameter to nil if and only if it
5578 has a non-nil association. Don't make new 5572 has a non-nil association. Don't make new
@@ -5591,50 +5585,50 @@ the return value is nil. Otherwise the value is t. */)
5591 /* Reinstall the saved buffer and pointers into it. */ 5585 /* Reinstall the saved buffer and pointers into it. */
5592 if (NILP (p->buffer)) 5586 if (NILP (p->buffer))
5593 /* An internal window. */ 5587 /* An internal window. */
5594 WVAR (w, buffer) = p->buffer; 5588 WSET (w, buffer, p->buffer);
5595 else if (!NILP (BVAR (XBUFFER (p->buffer), name))) 5589 else if (!NILP (BVAR (XBUFFER (p->buffer), name)))
5596 /* If saved buffer is alive, install it. */ 5590 /* If saved buffer is alive, install it. */
5597 { 5591 {
5598 WVAR (w, buffer) = p->buffer; 5592 WSET (w, buffer, p->buffer);
5599 w->start_at_line_beg = !NILP (p->start_at_line_beg); 5593 w->start_at_line_beg = !NILP (p->start_at_line_beg);
5600 set_marker_restricted (WVAR (w, start), p->start, WVAR (w, buffer)); 5594 set_marker_restricted (WGET (w, start), p->start, WGET (w, buffer));
5601 set_marker_restricted (WVAR (w, pointm), p->pointm, 5595 set_marker_restricted (WGET (w, pointm), p->pointm,
5602 WVAR (w, buffer)); 5596 WGET (w, buffer));
5603 Fset_marker (BVAR (XBUFFER (WVAR (w, buffer)), mark), 5597 Fset_marker (BVAR (XBUFFER (WGET (w, buffer)), mark),
5604 p->mark, WVAR (w, buffer)); 5598 p->mark, WGET (w, buffer));
5605 5599
5606 /* As documented in Fcurrent_window_configuration, don't 5600 /* As documented in Fcurrent_window_configuration, don't
5607 restore the location of point in the buffer which was 5601 restore the location of point in the buffer which was
5608 current when the window configuration was recorded. */ 5602 current when the window configuration was recorded. */
5609 if (!EQ (p->buffer, new_current_buffer) 5603 if (!EQ (p->buffer, new_current_buffer)
5610 && XBUFFER (p->buffer) == current_buffer) 5604 && XBUFFER (p->buffer) == current_buffer)
5611 Fgoto_char (WVAR (w, pointm)); 5605 Fgoto_char (WGET (w, pointm));
5612 } 5606 }
5613 else if (!NILP (WVAR (w, buffer)) 5607 else if (!NILP (WGET (w, buffer))
5614 && !NILP (BVAR (XBUFFER (WVAR (w, buffer)), name))) 5608 && !NILP (BVAR (XBUFFER (WGET (w, buffer)), name)))
5615 /* Keep window's old buffer; make sure the markers are 5609 /* Keep window's old buffer; make sure the markers are
5616 real. */ 5610 real. */
5617 { 5611 {
5618 /* Set window markers at start of visible range. */ 5612 /* Set window markers at start of visible range. */
5619 if (XMARKER (WVAR (w, start))->buffer == 0) 5613 if (XMARKER (WGET (w, start))->buffer == 0)
5620 set_marker_restricted (WVAR (w, start), make_number (0), 5614 set_marker_restricted (WGET (w, start), make_number (0),
5621 WVAR (w, buffer)); 5615 WGET (w, buffer));
5622 if (XMARKER (WVAR (w, pointm))->buffer == 0) 5616 if (XMARKER (WGET (w, pointm))->buffer == 0)
5623 set_marker_restricted_both 5617 set_marker_restricted_both
5624 (WVAR (w, pointm), WVAR (w, buffer), 5618 (WGET (w, pointm), WGET (w, buffer),
5625 BUF_PT (XBUFFER (WVAR (w, buffer))), 5619 BUF_PT (XBUFFER (WGET (w, buffer))),
5626 BUF_PT_BYTE (XBUFFER (WVAR (w, buffer)))); 5620 BUF_PT_BYTE (XBUFFER (WGET (w, buffer))));
5627 w->start_at_line_beg = 1; 5621 w->start_at_line_beg = 1;
5628 } 5622 }
5629 else if (STRINGP (auto_buffer_name = 5623 else if (STRINGP (auto_buffer_name =
5630 Fwindow_parameter (window, Qauto_buffer_name)) 5624 Fwindow_parameter (window, Qauto_buffer_name))
5631 && SCHARS (auto_buffer_name) != 0 5625 && SCHARS (auto_buffer_name) != 0
5632 && !NILP (WVAR (w, buffer) = Fget_buffer_create (auto_buffer_name))) 5626 && !NILP (WSET (w, buffer, Fget_buffer_create (auto_buffer_name))))
5633 { 5627 {
5634 set_marker_restricted (WVAR (w, start), 5628 set_marker_restricted (WGET (w, start),
5635 make_number (0), WVAR (w, buffer)); 5629 make_number (0), WGET (w, buffer));
5636 set_marker_restricted (WVAR (w, pointm), 5630 set_marker_restricted (WGET (w, pointm),
5637 make_number (0), WVAR (w, buffer)); 5631 make_number (0), WGET (w, buffer));
5638 w->start_at_line_beg = 1; 5632 w->start_at_line_beg = 1;
5639 } 5633 }
5640 else 5634 else
@@ -5644,36 +5638,36 @@ the return value is nil. Otherwise the value is t. */)
5644 avoid showing an unimportant buffer and, if necessary, to 5638 avoid showing an unimportant buffer and, if necessary, to
5645 recreate *scratch* in the course (part of Juanma's bs-show 5639 recreate *scratch* in the course (part of Juanma's bs-show
5646 scenario from March 2011). */ 5640 scenario from March 2011). */
5647 WVAR (w, buffer) = other_buffer_safely (Fcurrent_buffer ()); 5641 WSET (w, buffer, other_buffer_safely (Fcurrent_buffer ()));
5648 /* This will set the markers to beginning of visible 5642 /* This will set the markers to beginning of visible
5649 range. */ 5643 range. */
5650 set_marker_restricted (WVAR (w, start), 5644 set_marker_restricted (WGET (w, start),
5651 make_number (0), WVAR (w, buffer)); 5645 make_number (0), WGET (w, buffer));
5652 set_marker_restricted (WVAR (w, pointm), 5646 set_marker_restricted (WGET (w, pointm),
5653 make_number (0), WVAR (w, buffer)); 5647 make_number (0), WGET (w, buffer));
5654 w->start_at_line_beg = 1; 5648 w->start_at_line_beg = 1;
5655 if (!NILP (WVAR (w, dedicated))) 5649 if (!NILP (WGET (w, dedicated)))
5656 /* Record this window as dead. */ 5650 /* Record this window as dead. */
5657 dead_windows = Fcons (window, dead_windows); 5651 dead_windows = Fcons (window, dead_windows);
5658 /* Make sure window is no more dedicated. */ 5652 /* Make sure window is no more dedicated. */
5659 WVAR (w, dedicated) = Qnil; 5653 WSET (w, dedicated, Qnil);
5660 } 5654 }
5661 } 5655 }
5662 5656
5663 FSET (f, root_window, data->root_window); 5657 FSET (f, root_window, data->root_window);
5664 /* Arrange *not* to restore point in the buffer that was 5658 /* Arrange *not* to restore point in the buffer that was
5665 current when the window configuration was saved. */ 5659 current when the window configuration was saved. */
5666 if (EQ (WVAR (XWINDOW (data->current_window), buffer), new_current_buffer)) 5660 if (EQ (WGET (XWINDOW (data->current_window), buffer), new_current_buffer))
5667 set_marker_restricted (WVAR (XWINDOW (data->current_window), pointm), 5661 set_marker_restricted (WGET (XWINDOW (data->current_window), pointm),
5668 make_number (old_point), 5662 make_number (old_point),
5669 WVAR (XWINDOW (data->current_window), buffer)); 5663 WGET (XWINDOW (data->current_window), buffer));
5670 5664
5671 /* In the following call to `select-window', prevent "swapping out 5665 /* In the following call to `select-window', prevent "swapping out
5672 point" in the old selected window using the buffer that has 5666 point" in the old selected window using the buffer that has
5673 been restored into it. We already swapped out that point from 5667 been restored into it. We already swapped out that point from
5674 that window's old buffer. */ 5668 that window's old buffer. */
5675 select_window (data->current_window, Qnil, 1); 5669 select_window (data->current_window, Qnil, 1);
5676 BVAR (XBUFFER (WVAR (XWINDOW (selected_window), buffer)), last_selected_window) 5670 BVAR (XBUFFER (WGET (XWINDOW (selected_window), buffer)), last_selected_window)
5677 = selected_window; 5671 = selected_window;
5678 5672
5679 if (NILP (data->focus_frame) 5673 if (NILP (data->focus_frame)
@@ -5700,14 +5694,14 @@ the return value is nil. Otherwise the value is t. */)
5700 /* Now, free glyph matrices in windows that were not reused. */ 5694 /* Now, free glyph matrices in windows that were not reused. */
5701 for (i = n = 0; i < n_leaf_windows; ++i) 5695 for (i = n = 0; i < n_leaf_windows; ++i)
5702 { 5696 {
5703 if (NILP (WVAR (leaf_windows[i], buffer))) 5697 if (NILP (WGET (leaf_windows[i], buffer)))
5704 { 5698 {
5705 /* Assert it's not reused as a combination. */ 5699 /* Assert it's not reused as a combination. */
5706 eassert (NILP (WVAR (leaf_windows[i], hchild)) 5700 eassert (NILP (WGET (leaf_windows[i], hchild))
5707 && NILP (WVAR (leaf_windows[i], vchild))); 5701 && NILP (WGET (leaf_windows[i], vchild)));
5708 free_window_matrices (leaf_windows[i]); 5702 free_window_matrices (leaf_windows[i]);
5709 } 5703 }
5710 else if (EQ (WVAR (leaf_windows[i], buffer), new_current_buffer)) 5704 else if (EQ (WGET (leaf_windows[i], buffer), new_current_buffer))
5711 ++n; 5705 ++n;
5712 } 5706 }
5713 5707
@@ -5752,28 +5746,28 @@ delete_all_child_windows (Lisp_Object window)
5752 5746
5753 w = XWINDOW (window); 5747 w = XWINDOW (window);
5754 5748
5755 if (!NILP (WVAR (w, next))) 5749 if (!NILP (WGET (w, next)))
5756 /* Delete WINDOW's siblings (we traverse postorderly). */ 5750 /* Delete WINDOW's siblings (we traverse postorderly). */
5757 delete_all_child_windows (WVAR (w, next)); 5751 delete_all_child_windows (WGET (w, next));
5758 5752
5759 WVAR (w, total_lines) = WVAR (w, buffer); /* See Fset_window_configuration for excuse. */ 5753 WSET (w, total_lines, WGET (w, buffer)); /* See Fset_window_configuration for excuse. */
5760 5754
5761 if (!NILP (WVAR (w, vchild))) 5755 if (!NILP (WGET (w, vchild)))
5762 { 5756 {
5763 delete_all_child_windows (WVAR (w, vchild)); 5757 delete_all_child_windows (WGET (w, vchild));
5764 WVAR (w, vchild) = Qnil; 5758 WSET (w, vchild, Qnil);
5765 } 5759 }
5766 else if (!NILP (WVAR (w, hchild))) 5760 else if (!NILP (WGET (w, hchild)))
5767 { 5761 {
5768 delete_all_child_windows (WVAR (w, hchild)); 5762 delete_all_child_windows (WGET (w, hchild));
5769 WVAR (w, hchild) = Qnil; 5763 WSET (w, hchild, Qnil);
5770 } 5764 }
5771 else if (!NILP (WVAR (w, buffer))) 5765 else if (!NILP (WGET (w, buffer)))
5772 { 5766 {
5773 unshow_buffer (w); 5767 unshow_buffer (w);
5774 unchain_marker (XMARKER (WVAR (w, pointm))); 5768 unchain_marker (XMARKER (WGET (w, pointm)));
5775 unchain_marker (XMARKER (WVAR (w, start))); 5769 unchain_marker (XMARKER (WGET (w, start)));
5776 WVAR (w, buffer) = Qnil; 5770 WSET (w, buffer, Qnil);
5777 } 5771 }
5778 5772
5779 Vwindow_list = Qnil; 5773 Vwindow_list = Qnil;
@@ -5783,12 +5777,12 @@ static int
5783count_windows (register struct window *window) 5777count_windows (register struct window *window)
5784{ 5778{
5785 register int count = 1; 5779 register int count = 1;
5786 if (!NILP (WVAR (window, next))) 5780 if (!NILP (WGET (window, next)))
5787 count += count_windows (XWINDOW (WVAR (window, next))); 5781 count += count_windows (XWINDOW (WGET (window, next)));
5788 if (!NILP (WVAR (window, vchild))) 5782 if (!NILP (WGET (window, vchild)))
5789 count += count_windows (XWINDOW (WVAR (window, vchild))); 5783 count += count_windows (XWINDOW (WGET (window, vchild)));
5790 if (!NILP (WVAR (window, hchild))) 5784 if (!NILP (WGET (window, hchild)))
5791 count += count_windows (XWINDOW (WVAR (window, hchild))); 5785 count += count_windows (XWINDOW (WGET (window, hchild)));
5792 return count; 5786 return count;
5793} 5787}
5794 5788
@@ -5800,14 +5794,14 @@ get_leaf_windows (struct window *w, struct window **flat, int i)
5800{ 5794{
5801 while (w) 5795 while (w)
5802 { 5796 {
5803 if (!NILP (WVAR (w, hchild))) 5797 if (!NILP (WGET (w, hchild)))
5804 i = get_leaf_windows (XWINDOW (WVAR (w, hchild)), flat, i); 5798 i = get_leaf_windows (XWINDOW (WGET (w, hchild)), flat, i);
5805 else if (!NILP (WVAR (w, vchild))) 5799 else if (!NILP (WGET (w, vchild)))
5806 i = get_leaf_windows (XWINDOW (WVAR (w, vchild)), flat, i); 5800 i = get_leaf_windows (XWINDOW (WGET (w, vchild)), flat, i);
5807 else 5801 else
5808 flat[i++] = w; 5802 flat[i++] = w;
5809 5803
5810 w = NILP (WVAR (w, next)) ? 0 : XWINDOW (WVAR (w, next)); 5804 w = NILP (WGET (w, next)) ? 0 : XWINDOW (WGET (w, next));
5811 } 5805 }
5812 5806
5813 return i; 5807 return i;
@@ -5860,32 +5854,32 @@ save_window_save (Lisp_Object window, struct Lisp_Vector *vector, int i)
5860 register struct window *w; 5854 register struct window *w;
5861 register Lisp_Object tem, pers, par; 5855 register Lisp_Object tem, pers, par;
5862 5856
5863 for (;!NILP (window); window = WVAR (w, next)) 5857 for (;!NILP (window); window = WGET (w, next))
5864 { 5858 {
5865 p = SAVED_WINDOW_N (vector, i); 5859 p = SAVED_WINDOW_N (vector, i);
5866 w = XWINDOW (window); 5860 w = XWINDOW (window);
5867 5861
5868 XSETFASTINT (WVAR (w, temslot), i); i++; 5862 WSET (w, temslot, make_number (i)); i++;
5869 p->window = window; 5863 p->window = window;
5870 p->buffer = WVAR (w, buffer); 5864 p->buffer = WGET (w, buffer);
5871 p->left_col = WVAR (w, left_col); 5865 p->left_col = WGET (w, left_col);
5872 p->top_line = WVAR (w, top_line); 5866 p->top_line = WGET (w, top_line);
5873 p->total_cols = WVAR (w, total_cols); 5867 p->total_cols = WGET (w, total_cols);
5874 p->total_lines = WVAR (w, total_lines); 5868 p->total_lines = WGET (w, total_lines);
5875 p->normal_cols = WVAR (w, normal_cols); 5869 p->normal_cols = WGET (w, normal_cols);
5876 p->normal_lines = WVAR (w, normal_lines); 5870 p->normal_lines = WGET (w, normal_lines);
5877 XSETFASTINT (p->hscroll, w->hscroll); 5871 XSETFASTINT (p->hscroll, w->hscroll);
5878 XSETFASTINT (p->min_hscroll, w->min_hscroll); 5872 XSETFASTINT (p->min_hscroll, w->min_hscroll);
5879 p->display_table = WVAR (w, display_table); 5873 p->display_table = WGET (w, display_table);
5880 p->left_margin_cols = WVAR (w, left_margin_cols); 5874 p->left_margin_cols = WGET (w, left_margin_cols);
5881 p->right_margin_cols = WVAR (w, right_margin_cols); 5875 p->right_margin_cols = WGET (w, right_margin_cols);
5882 p->left_fringe_width = WVAR (w, left_fringe_width); 5876 p->left_fringe_width = WGET (w, left_fringe_width);
5883 p->right_fringe_width = WVAR (w, right_fringe_width); 5877 p->right_fringe_width = WGET (w, right_fringe_width);
5884 p->fringes_outside_margins = w->fringes_outside_margins ? Qt : Qnil; 5878 p->fringes_outside_margins = w->fringes_outside_margins ? Qt : Qnil;
5885 p->scroll_bar_width = WVAR (w, scroll_bar_width); 5879 p->scroll_bar_width = WGET (w, scroll_bar_width);
5886 p->vertical_scroll_bar_type = WVAR (w, vertical_scroll_bar_type); 5880 p->vertical_scroll_bar_type = WGET (w, vertical_scroll_bar_type);
5887 p->dedicated = WVAR (w, dedicated); 5881 p->dedicated = WGET (w, dedicated);
5888 p->combination_limit = WVAR (w, combination_limit); 5882 p->combination_limit = WGET (w, combination_limit);
5889 p->window_parameters = Qnil; 5883 p->window_parameters = Qnil;
5890 5884
5891 if (!NILP (Vwindow_persistent_parameters)) 5885 if (!NILP (Vwindow_persistent_parameters))
@@ -5918,7 +5912,7 @@ save_window_save (Lisp_Object window, struct Lisp_Vector *vector, int i)
5918 /* Save values for persistent window parameters. */ 5912 /* Save values for persistent window parameters. */
5919 if (CONSP (pers) && !NILP (XCDR (pers))) 5913 if (CONSP (pers) && !NILP (XCDR (pers)))
5920 { 5914 {
5921 par = Fassq (XCAR (pers), WVAR (w, window_parameters)); 5915 par = Fassq (XCAR (pers), WGET (w, window_parameters));
5922 if (NILP (par)) 5916 if (NILP (par))
5923 /* If the window has no value for the parameter, 5917 /* If the window has no value for the parameter,
5924 make one. */ 5918 make one. */
@@ -5934,24 +5928,24 @@ save_window_save (Lisp_Object window, struct Lisp_Vector *vector, int i)
5934 } 5928 }
5935 } 5929 }
5936 5930
5937 if (!NILP (WVAR (w, buffer))) 5931 if (!NILP (WGET (w, buffer)))
5938 { 5932 {
5939 /* Save w's value of point in the window configuration. If w 5933 /* Save w's value of point in the window configuration. If w
5940 is the selected window, then get the value of point from 5934 is the selected window, then get the value of point from
5941 the buffer; pointm is garbage in the selected window. */ 5935 the buffer; pointm is garbage in the selected window. */
5942 if (EQ (window, selected_window)) 5936 if (EQ (window, selected_window))
5943 p->pointm = build_marker (XBUFFER (WVAR (w, buffer)), 5937 p->pointm = build_marker (XBUFFER (WGET (w, buffer)),
5944 BUF_PT (XBUFFER (WVAR (w, buffer))), 5938 BUF_PT (XBUFFER (WGET (w, buffer))),
5945 BUF_PT_BYTE (XBUFFER (WVAR (w, buffer)))); 5939 BUF_PT_BYTE (XBUFFER (WGET (w, buffer))));
5946 else 5940 else
5947 p->pointm = Fcopy_marker (WVAR (w, pointm), Qnil); 5941 p->pointm = Fcopy_marker (WGET (w, pointm), Qnil);
5948 XMARKER (p->pointm)->insertion_type 5942 XMARKER (p->pointm)->insertion_type
5949 = !NILP (Vwindow_point_insertion_type); 5943 = !NILP (Vwindow_point_insertion_type);
5950 5944
5951 p->start = Fcopy_marker (WVAR (w, start), Qnil); 5945 p->start = Fcopy_marker (WGET (w, start), Qnil);
5952 p->start_at_line_beg = w->start_at_line_beg ? Qt : Qnil; 5946 p->start_at_line_beg = w->start_at_line_beg ? Qt : Qnil;
5953 5947
5954 tem = BVAR (XBUFFER (WVAR (w, buffer)), mark); 5948 tem = BVAR (XBUFFER (WGET (w, buffer)), mark);
5955 p->mark = Fcopy_marker (tem, Qnil); 5949 p->mark = Fcopy_marker (tem, Qnil);
5956 } 5950 }
5957 else 5951 else
@@ -5962,20 +5956,20 @@ save_window_save (Lisp_Object window, struct Lisp_Vector *vector, int i)
5962 p->start_at_line_beg = Qnil; 5956 p->start_at_line_beg = Qnil;
5963 } 5957 }
5964 5958
5965 if (NILP (WVAR (w, parent))) 5959 if (NILP (WGET (w, parent)))
5966 p->parent = Qnil; 5960 p->parent = Qnil;
5967 else 5961 else
5968 p->parent = WVAR (XWINDOW (WVAR (w, parent)), temslot); 5962 p->parent = WGET (XWINDOW (WGET (w, parent)), temslot);
5969 5963
5970 if (NILP (WVAR (w, prev))) 5964 if (NILP (WGET (w, prev)))
5971 p->prev = Qnil; 5965 p->prev = Qnil;
5972 else 5966 else
5973 p->prev = WVAR (XWINDOW (WVAR (w, prev)), temslot); 5967 p->prev = WGET (XWINDOW (WGET (w, prev)), temslot);
5974 5968
5975 if (!NILP (WVAR (w, vchild))) 5969 if (!NILP (WGET (w, vchild)))
5976 i = save_window_save (WVAR (w, vchild), vector, i); 5970 i = save_window_save (WGET (w, vchild), vector, i);
5977 if (!NILP (WVAR (w, hchild))) 5971 if (!NILP (WGET (w, hchild)))
5978 i = save_window_save (WVAR (w, hchild), vector, i); 5972 i = save_window_save (WGET (w, hchild), vector, i);
5979 } 5973 }
5980 5974
5981 return i; 5975 return i;
@@ -6064,11 +6058,11 @@ means no margin. */)
6064 right_width = Qnil; 6058 right_width = Qnil;
6065 } 6059 }
6066 6060
6067 if (!EQ (WVAR (w, left_margin_cols), left_width) 6061 if (!EQ (WGET (w, left_margin_cols), left_width)
6068 || !EQ (WVAR (w, right_margin_cols), right_width)) 6062 || !EQ (WGET (w, right_margin_cols), right_width))
6069 { 6063 {
6070 WVAR (w, left_margin_cols) = left_width; 6064 WSET (w, left_margin_cols, left_width);
6071 WVAR (w, right_margin_cols) = right_width; 6065 WSET (w, right_margin_cols, right_width);
6072 6066
6073 adjust_window_margins (w); 6067 adjust_window_margins (w);
6074 6068
@@ -6090,7 +6084,7 @@ as nil. */)
6090 (Lisp_Object window) 6084 (Lisp_Object window)
6091{ 6085{
6092 struct window *w = decode_window (window); 6086 struct window *w = decode_window (window);
6093 return Fcons (WVAR (w, left_margin_cols), WVAR (w, right_margin_cols)); 6087 return Fcons (WGET (w, left_margin_cols), WGET (w, right_margin_cols));
6094} 6088}
6095 6089
6096 6090
@@ -6124,18 +6118,18 @@ display marginal areas and the text area. */)
6124 6118
6125 /* Do nothing on a tty. */ 6119 /* Do nothing on a tty. */
6126 if (FRAME_WINDOW_P (WINDOW_XFRAME (w)) 6120 if (FRAME_WINDOW_P (WINDOW_XFRAME (w))
6127 && (!EQ (WVAR (w, left_fringe_width), left_width) 6121 && (!EQ (WGET (w, left_fringe_width), left_width)
6128 || !EQ (WVAR (w, right_fringe_width), right_width) 6122 || !EQ (WGET (w, right_fringe_width), right_width)
6129 || w->fringes_outside_margins != outside)) 6123 || w->fringes_outside_margins != outside))
6130 { 6124 {
6131 WVAR (w, left_fringe_width) = left_width; 6125 WSET (w, left_fringe_width, left_width);
6132 WVAR (w, right_fringe_width) = right_width; 6126 WSET (w, right_fringe_width, right_width);
6133 w->fringes_outside_margins = outside; 6127 w->fringes_outside_margins = outside;
6134 6128
6135 adjust_window_margins (w); 6129 adjust_window_margins (w);
6136 6130
6137 clear_glyph_matrix (w->current_matrix); 6131 clear_glyph_matrix (w->current_matrix);
6138 WVAR (w, window_end_valid) = Qnil; 6132 WSET (w, window_end_valid, Qnil);
6139 6133
6140 ++windows_or_buffers_changed; 6134 ++windows_or_buffers_changed;
6141 adjust_glyphs (XFRAME (WINDOW_FRAME (w))); 6135 adjust_glyphs (XFRAME (WINDOW_FRAME (w)));
@@ -6195,16 +6189,16 @@ Fourth parameter HORIZONTAL-TYPE is currently unused. */)
6195 || EQ (vertical_type, Qt))) 6189 || EQ (vertical_type, Qt)))
6196 error ("Invalid type of vertical scroll bar"); 6190 error ("Invalid type of vertical scroll bar");
6197 6191
6198 if (!EQ (WVAR (w, scroll_bar_width), width) 6192 if (!EQ (WGET (w, scroll_bar_width), width)
6199 || !EQ (WVAR (w, vertical_scroll_bar_type), vertical_type)) 6193 || !EQ (WGET (w, vertical_scroll_bar_type), vertical_type))
6200 { 6194 {
6201 WVAR (w, scroll_bar_width) = width; 6195 WSET (w, scroll_bar_width, width);
6202 WVAR (w, vertical_scroll_bar_type) = vertical_type; 6196 WSET (w, vertical_scroll_bar_type, vertical_type);
6203 6197
6204 adjust_window_margins (w); 6198 adjust_window_margins (w);
6205 6199
6206 clear_glyph_matrix (w->current_matrix); 6200 clear_glyph_matrix (w->current_matrix);
6207 WVAR (w, window_end_valid) = Qnil; 6201 WSET (w, window_end_valid, Qnil);
6208 6202
6209 ++windows_or_buffers_changed; 6203 ++windows_or_buffers_changed;
6210 adjust_glyphs (XFRAME (WINDOW_FRAME (w))); 6204 adjust_glyphs (XFRAME (WINDOW_FRAME (w)));
@@ -6228,7 +6222,7 @@ value. */)
6228 ? WINDOW_CONFIG_SCROLL_BAR_WIDTH (w) 6222 ? WINDOW_CONFIG_SCROLL_BAR_WIDTH (w)
6229 : WINDOW_SCROLL_BAR_AREA_WIDTH (w))), 6223 : WINDOW_SCROLL_BAR_AREA_WIDTH (w))),
6230 Fcons (make_number (WINDOW_SCROLL_BAR_COLS (w)), 6224 Fcons (make_number (WINDOW_SCROLL_BAR_COLS (w)),
6231 Fcons (WVAR (w, vertical_scroll_bar_type), 6225 Fcons (WGET (w, vertical_scroll_bar_type),
6232 Fcons (Qnil, Qnil)))); 6226 Fcons (Qnil, Qnil))));
6233} 6227}
6234 6228
@@ -6254,7 +6248,7 @@ optional second arg PIXELS-P means value is measured in pixels. */)
6254 else 6248 else
6255 CHECK_WINDOW (window); 6249 CHECK_WINDOW (window);
6256 w = XWINDOW (window); 6250 w = XWINDOW (window);
6257 f = XFRAME (WVAR (w, frame)); 6251 f = XFRAME (WGET (w, frame));
6258 6252
6259 if (FRAME_WINDOW_P (f)) 6253 if (FRAME_WINDOW_P (f))
6260 result = (NILP (pixels_p) 6254 result = (NILP (pixels_p)
@@ -6288,7 +6282,7 @@ If PIXELS-P is non-nil, the return value is VSCROLL. */)
6288 CHECK_NUMBER_OR_FLOAT (vscroll); 6282 CHECK_NUMBER_OR_FLOAT (vscroll);
6289 6283
6290 w = XWINDOW (window); 6284 w = XWINDOW (window);
6291 f = XFRAME (WVAR (w, frame)); 6285 f = XFRAME (WGET (w, frame));
6292 6286
6293 if (FRAME_WINDOW_P (f)) 6287 if (FRAME_WINDOW_P (f))
6294 { 6288 {
@@ -6307,7 +6301,7 @@ If PIXELS-P is non-nil, the return value is VSCROLL. */)
6307 adjust_glyphs (f); 6301 adjust_glyphs (f);
6308 6302
6309 /* Prevent redisplay shortcuts. */ 6303 /* Prevent redisplay shortcuts. */
6310 XBUFFER (WVAR (w, buffer))->prevent_redisplay_optimizations_p = 1; 6304 XBUFFER (WGET (w, buffer))->prevent_redisplay_optimizations_p = 1;
6311 } 6305 }
6312 } 6306 }
6313 6307
@@ -6341,14 +6335,14 @@ foreach_window_1 (struct window *w, int (*fn) (struct window *, void *), void *u
6341 6335
6342 for (cont = 1; w && cont;) 6336 for (cont = 1; w && cont;)
6343 { 6337 {
6344 if (!NILP (WVAR (w, hchild))) 6338 if (!NILP (WGET (w, hchild)))
6345 cont = foreach_window_1 (XWINDOW (WVAR (w, hchild)), fn, user_data); 6339 cont = foreach_window_1 (XWINDOW (WGET (w, hchild)), fn, user_data);
6346 else if (!NILP (WVAR (w, vchild))) 6340 else if (!NILP (WGET (w, vchild)))
6347 cont = foreach_window_1 (XWINDOW (WVAR (w, vchild)), fn, user_data); 6341 cont = foreach_window_1 (XWINDOW (WGET (w, vchild)), fn, user_data);
6348 else 6342 else
6349 cont = fn (w, user_data); 6343 cont = fn (w, user_data);
6350 6344
6351 w = NILP (WVAR (w, next)) ? 0 : XWINDOW (WVAR (w, next)); 6345 w = NILP (WGET (w, next)) ? 0 : XWINDOW (WGET (w, next));
6352 } 6346 }
6353 6347
6354 return cont; 6348 return cont;
diff --git a/src/window.h b/src/window.h
index da42250befa..b6a37e2df9e 100644
--- a/src/window.h
+++ b/src/window.h
@@ -86,9 +86,15 @@ struct cursor_pos
86 int hpos, vpos; 86 int hpos, vpos;
87}; 87};
88 88
89/* Most code should use this macro to access Lisp fields in struct window. */ 89/* Most code should use these macros to access Lisp fields
90 in struct window. WGET should not be used as lvalue. */
90 91
91#define WVAR(w, field) ((w)->INTERNAL_FIELD (field)) 92#define WGET(f, field) \
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))
92 98
93struct window 99struct window
94 { 100 {
@@ -396,13 +402,13 @@ struct window
396 This includes scroll bars and fringes. */ 402 This includes scroll bars and fringes. */
397 403
398#define WINDOW_TOTAL_COLS(W) \ 404#define WINDOW_TOTAL_COLS(W) \
399 (XFASTINT (WVAR (W, total_cols))) 405 (XFASTINT (WGET (W, total_cols)))
400 406
401/* Return the height of window W in canonical line units. 407/* Return the height of window W in canonical line units.
402 This includes header and mode lines, if any. */ 408 This includes header and mode lines, if any. */
403 409
404#define WINDOW_TOTAL_LINES(W) \ 410#define WINDOW_TOTAL_LINES(W) \
405 (XFASTINT (WVAR (W, total_lines))) 411 (XFASTINT (WGET (W, total_lines)))
406 412
407/* Return the total pixel width of window W. */ 413/* Return the total pixel width of window W. */
408 414
@@ -430,7 +436,7 @@ struct window
430 This includes a left-hand scroll bar, if any. */ 436 This includes a left-hand scroll bar, if any. */
431 437
432#define WINDOW_LEFT_EDGE_COL(W) \ 438#define WINDOW_LEFT_EDGE_COL(W) \
433 (XFASTINT (WVAR (W, left_col))) 439 (XFASTINT (WGET (W, left_col)))
434 440
435/* Return the canonical frame column before which window W ends. 441/* Return the canonical frame column before which window W ends.
436 This includes a right-hand scroll bar, if any. */ 442 This includes a right-hand scroll bar, if any. */
@@ -442,7 +448,7 @@ struct window
442 This includes a header line, if any. */ 448 This includes a header line, if any. */
443 449
444#define WINDOW_TOP_EDGE_LINE(W) \ 450#define WINDOW_TOP_EDGE_LINE(W) \
445 (XFASTINT (WVAR (W, top_line))) 451 (XFASTINT (WGET (W, top_line)))
446 452
447/* Return the canonical frame line before which window W ends. 453/* Return the canonical frame line before which window W ends.
448 This includes a mode line, if any. */ 454 This includes a mode line, if any. */
@@ -547,31 +553,31 @@ struct window
547/* Width of left margin area in columns. */ 553/* Width of left margin area in columns. */
548 554
549#define WINDOW_LEFT_MARGIN_COLS(W) \ 555#define WINDOW_LEFT_MARGIN_COLS(W) \
550 (NILP (WVAR (W, left_margin_cols)) \ 556 (NILP (WGET (W, left_margin_cols)) \
551 ? 0 \ 557 ? 0 \
552 : XINT (WVAR (W, left_margin_cols))) 558 : XINT (WGET (W, left_margin_cols)))
553 559
554/* Width of right marginal area in columns. */ 560/* Width of right marginal area in columns. */
555 561
556#define WINDOW_RIGHT_MARGIN_COLS(W) \ 562#define WINDOW_RIGHT_MARGIN_COLS(W) \
557 (NILP (WVAR (W, right_margin_cols)) \ 563 (NILP (WGET (W, right_margin_cols)) \
558 ? 0 \ 564 ? 0 \
559 : XINT (WVAR (W, right_margin_cols))) 565 : XINT (WGET (W, right_margin_cols)))
560 566
561/* Width of left margin area in pixels. */ 567/* Width of left margin area in pixels. */
562 568
563#define WINDOW_LEFT_MARGIN_WIDTH(W) \ 569#define WINDOW_LEFT_MARGIN_WIDTH(W) \
564 (NILP (WVAR (W, left_margin_cols)) \ 570 (NILP (WGET (W, left_margin_cols)) \
565 ? 0 \ 571 ? 0 \
566 : (XINT (WVAR (W, left_margin_cols)) \ 572 : (XINT (WGET (W, left_margin_cols)) \
567 * WINDOW_FRAME_COLUMN_WIDTH (W))) 573 * WINDOW_FRAME_COLUMN_WIDTH (W)))
568 574
569/* Width of right marginal area in pixels. */ 575/* Width of right marginal area in pixels. */
570 576
571#define WINDOW_RIGHT_MARGIN_WIDTH(W) \ 577#define WINDOW_RIGHT_MARGIN_WIDTH(W) \
572 (NILP (WVAR (W, right_margin_cols)) \ 578 (NILP (WGET (W, right_margin_cols)) \
573 ? 0 \ 579 ? 0 \
574 : (XINT (WVAR (W, right_margin_cols)) \ 580 : (XINT (WGET (W, right_margin_cols)) \
575 * WINDOW_FRAME_COLUMN_WIDTH (W))) 581 * WINDOW_FRAME_COLUMN_WIDTH (W)))
576 582
577/* Total width of fringes reserved for drawing truncation bitmaps, 583/* Total width of fringes reserved for drawing truncation bitmaps,
@@ -581,8 +587,8 @@ struct window
581 able to split windows horizontally nicely. */ 587 able to split windows horizontally nicely. */
582 588
583#define WINDOW_FRINGE_COLS(W) \ 589#define WINDOW_FRINGE_COLS(W) \
584 ((INTEGERP (WVAR (W, left_fringe_width)) \ 590 ((INTEGERP (WGET (W, left_fringe_width)) \
585 || INTEGERP (WVAR (W, right_fringe_width))) \ 591 || INTEGERP (WGET (W, right_fringe_width))) \
586 ? ((WINDOW_LEFT_FRINGE_WIDTH (W) \ 592 ? ((WINDOW_LEFT_FRINGE_WIDTH (W) \
587 + WINDOW_RIGHT_FRINGE_WIDTH (W) \ 593 + WINDOW_RIGHT_FRINGE_WIDTH (W) \
588 + WINDOW_FRAME_COLUMN_WIDTH (W) - 1) \ 594 + WINDOW_FRAME_COLUMN_WIDTH (W) - 1) \
@@ -604,13 +610,13 @@ struct window
604/* Pixel-width of the left and right fringe. */ 610/* Pixel-width of the left and right fringe. */
605 611
606#define WINDOW_LEFT_FRINGE_WIDTH(W) \ 612#define WINDOW_LEFT_FRINGE_WIDTH(W) \
607 (INTEGERP (WVAR (W, left_fringe_width)) \ 613 (INTEGERP (WGET (W, left_fringe_width)) \
608 ? XFASTINT (WVAR (W, left_fringe_width)) \ 614 ? XFASTINT (WGET (W, left_fringe_width)) \
609 : FRAME_LEFT_FRINGE_WIDTH (WINDOW_XFRAME (W))) 615 : FRAME_LEFT_FRINGE_WIDTH (WINDOW_XFRAME (W)))
610 616
611#define WINDOW_RIGHT_FRINGE_WIDTH(W) \ 617#define WINDOW_RIGHT_FRINGE_WIDTH(W) \
612 (INTEGERP (WVAR (W, right_fringe_width)) \ 618 (INTEGERP (WGET (W, right_fringe_width)) \
613 ? XFASTINT (WVAR (W, right_fringe_width)) \ 619 ? XFASTINT (WGET (W, right_fringe_width)) \
614 : FRAME_RIGHT_FRINGE_WIDTH (WINDOW_XFRAME (W))) 620 : FRAME_RIGHT_FRINGE_WIDTH (WINDOW_XFRAME (W)))
615 621
616/* Total width of fringes in pixels. */ 622/* Total width of fringes in pixels. */
@@ -627,36 +633,36 @@ struct window
627 and which side they are on. */ 633 and which side they are on. */
628 634
629#define WINDOW_VERTICAL_SCROLL_BAR_TYPE(w) \ 635#define WINDOW_VERTICAL_SCROLL_BAR_TYPE(w) \
630 (EQ (WVAR (w, vertical_scroll_bar_type), Qt) \ 636 (EQ (WGET (w, vertical_scroll_bar_type), Qt) \
631 ? FRAME_VERTICAL_SCROLL_BAR_TYPE (WINDOW_XFRAME (w)) \ 637 ? FRAME_VERTICAL_SCROLL_BAR_TYPE (WINDOW_XFRAME (w)) \
632 : EQ (WVAR (w, vertical_scroll_bar_type), Qleft) \ 638 : EQ (WGET (w, vertical_scroll_bar_type), Qleft) \
633 ? vertical_scroll_bar_left \ 639 ? vertical_scroll_bar_left \
634 : EQ (WVAR (w, vertical_scroll_bar_type), Qright) \ 640 : EQ (WGET (w, vertical_scroll_bar_type), Qright) \
635 ? vertical_scroll_bar_right \ 641 ? vertical_scroll_bar_right \
636 : vertical_scroll_bar_none) \ 642 : vertical_scroll_bar_none) \
637 643
638#define WINDOW_HAS_VERTICAL_SCROLL_BAR(w) \ 644#define WINDOW_HAS_VERTICAL_SCROLL_BAR(w) \
639 (EQ (WVAR (w, vertical_scroll_bar_type), Qt) \ 645 (EQ (WGET (w, vertical_scroll_bar_type), Qt) \
640 ? FRAME_HAS_VERTICAL_SCROLL_BARS (WINDOW_XFRAME (w)) \ 646 ? FRAME_HAS_VERTICAL_SCROLL_BARS (WINDOW_XFRAME (w)) \
641 : !NILP (WVAR (w, vertical_scroll_bar_type))) 647 : !NILP (WGET (w, vertical_scroll_bar_type)))
642 648
643#define WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT(w) \ 649#define WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT(w) \
644 (EQ (WVAR (w, vertical_scroll_bar_type), Qt) \ 650 (EQ (WGET (w, vertical_scroll_bar_type), Qt) \
645 ? FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT (WINDOW_XFRAME (w)) \ 651 ? FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT (WINDOW_XFRAME (w)) \
646 : EQ (WVAR (w, vertical_scroll_bar_type), Qleft)) 652 : EQ (WGET (w, vertical_scroll_bar_type), Qleft))
647 653
648#define WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_RIGHT(w) \ 654#define WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_RIGHT(w) \
649 (EQ (WVAR (w, vertical_scroll_bar_type), Qt) \ 655 (EQ (WGET (w, vertical_scroll_bar_type), Qt) \
650 ? FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT (WINDOW_XFRAME (w))\ 656 ? FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT (WINDOW_XFRAME (w))\
651 : EQ (WVAR (w, vertical_scroll_bar_type), Qright)) 657 : EQ (WGET (w, vertical_scroll_bar_type), Qright))
652 658
653/* Width that a scroll bar in window W should have, if there is one. 659/* Width that a scroll bar in window W should have, if there is one.
654 Measured in pixels. If scroll bars are turned off, this is still 660 Measured in pixels. If scroll bars are turned off, this is still
655 nonzero. */ 661 nonzero. */
656 662
657#define WINDOW_CONFIG_SCROLL_BAR_WIDTH(w) \ 663#define WINDOW_CONFIG_SCROLL_BAR_WIDTH(w) \
658 (INTEGERP (WVAR (w, scroll_bar_width)) \ 664 (INTEGERP (WGET (w, scroll_bar_width)) \
659 ? XFASTINT (WVAR (w, scroll_bar_width)) \ 665 ? XFASTINT (WGET (w, scroll_bar_width)) \
660 : FRAME_CONFIG_SCROLL_BAR_WIDTH (WINDOW_XFRAME (w))) 666 : FRAME_CONFIG_SCROLL_BAR_WIDTH (WINDOW_XFRAME (w)))
661 667
662/* Width that a scroll bar in window W should have, if there is one. 668/* Width that a scroll bar in window W should have, if there is one.
@@ -664,8 +670,8 @@ struct window
664 this is still nonzero. */ 670 this is still nonzero. */
665 671
666#define WINDOW_CONFIG_SCROLL_BAR_COLS(w) \ 672#define WINDOW_CONFIG_SCROLL_BAR_COLS(w) \
667 (INTEGERP (WVAR (w, scroll_bar_width)) \ 673 (INTEGERP (WGET (w, scroll_bar_width)) \
668 ? ((XFASTINT (WVAR (w, scroll_bar_width)) \ 674 ? ((XFASTINT (WGET (w, scroll_bar_width)) \
669 + WINDOW_FRAME_COLUMN_WIDTH (w) - 1) \ 675 + WINDOW_FRAME_COLUMN_WIDTH (w) - 1) \
670 / WINDOW_FRAME_COLUMN_WIDTH (w)) \ 676 / WINDOW_FRAME_COLUMN_WIDTH (w)) \
671 : FRAME_CONFIG_SCROLL_BAR_COLS (WINDOW_XFRAME (w))) 677 : FRAME_CONFIG_SCROLL_BAR_COLS (WINDOW_XFRAME (w)))
@@ -887,9 +893,8 @@ struct glyph *get_phys_cursor_glyph (struct window *w);
887 893
888/* Value is non-zero if WINDOW is a live window. */ 894/* Value is non-zero if WINDOW is a live window. */
889 895
890#define WINDOW_LIVE_P(WINDOW) \ 896#define WINDOW_LIVE_P(WINDOW) \
891 (WINDOWP ((WINDOW)) && !NILP (WVAR (XWINDOW ((WINDOW)), buffer))) 897 (WINDOWP (WINDOW) && !NILP (WGET (XWINDOW (WINDOW), buffer)))
892
893 898
894/* These used to be in lisp.h. */ 899/* These used to be in lisp.h. */
895 900
diff --git a/src/xdisp.c b/src/xdisp.c
index 314fb44e230..9906a70a227 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 (WVAR (w, total_cols)); 987 int cols = XFASTINT (WGET (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 (WVAR (w, left_margin_cols))) 996 if (INTEGERP (WGET (w, left_margin_cols)))
997 cols -= XFASTINT (WVAR (w, left_margin_cols)); 997 cols -= XFASTINT (WGET (w, left_margin_cols));
998 if (INTEGERP (WVAR (w, right_margin_cols))) 998 if (INTEGERP (WGET (w, right_margin_cols)))
999 cols -= XFASTINT (WVAR (w, right_margin_cols)); 999 cols -= XFASTINT (WGET (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 (WVAR (w, left_margin_cols)) 1004 cols = (INTEGERP (WGET (w, left_margin_cols))
1005 ? XFASTINT (WVAR (w, left_margin_cols)) : 0); 1005 ? XFASTINT (WGET (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 (WVAR (w, right_margin_cols)) 1010 cols = (INTEGERP (WGET (w, right_margin_cols))
1011 ? XFASTINT (WVAR (w, right_margin_cols)) : 0); 1011 ? XFASTINT (WGET (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 (WVAR (w, frame)); 1026 struct frame *f = XFRAME (WGET (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 (WVAR (w, frame)); 1115 struct frame *f = XFRAME (WGET (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 (WVAR (w, buffer)) != current_buffer) 1291 if (XBUFFER (WGET (w, buffer)) != current_buffer)
1292 { 1292 {
1293 old_buffer = current_buffer; 1293 old_buffer = current_buffer;
1294 set_buffer_internal_1 (XBUFFER (WVAR (w, buffer))); 1294 set_buffer_internal_1 (XBUFFER (WGET (w, buffer)));
1295 } 1295 }
1296 1296
1297 SET_TEXT_POS_FROM_MARKER (top, WVAR (w, start)); 1297 SET_TEXT_POS_FROM_MARKER (top, WGET (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 (WVAR (w, frame)); 1916 struct frame *f = XFRAME (WGET (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 (WVAR (w, window_end_valid))) 2525 && !NILP (WGET (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 (WVAR (w, window_end_vpos))), 2529 XFASTINT (WGET (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 (WVAR (w, frame)), base_face_id); 2595 = lookup_basic_face (XFRAME (WGET (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 (WVAR (w, frame)); 2623 it->f = XFRAME (WGET (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 (WVAR (w, redisplay_end_trigger)) 2707 if (MARKERP (WGET (w, redisplay_end_trigger))
2708 && XMARKER (WVAR (w, redisplay_end_trigger))->buffer != 0) 2708 && XMARKER (WGET (w, redisplay_end_trigger))->buffer != 0)
2709 it->redisplay_end_trigger_charpos 2709 it->redisplay_end_trigger_charpos
2710 = marker_position (WVAR (w, redisplay_end_trigger)); 2710 = marker_position (WGET (w, redisplay_end_trigger));
2711 else if (INTEGERP (WVAR (w, redisplay_end_trigger))) 2711 else if (INTEGERP (WGET (w, redisplay_end_trigger)))
2712 it->redisplay_end_trigger_charpos = 2712 it->redisplay_end_trigger_charpos =
2713 clip_to_bounds (PTRDIFF_MIN, XINT (WVAR (w, redisplay_end_trigger)), PTRDIFF_MAX); 2713 clip_to_bounds (PTRDIFF_MIN, XINT (WGET (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 = WVAR (it->w, buffer); 4411 object = WGET (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) ? WVAR (it->w, buffer) : object; 4819 it->object = NILP (object) ? WGET (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) ? WVAR (it->w, buffer) : object; 4965 it->object = NILP (object) ? WGET (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 = WVAR (it->w, buffer); 5788 it->object = WGET (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 = WVAR (it->w, buffer); 5801 it->object = WGET (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 = WVAR (it->w, buffer); 6239 it->object = WGET (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 = WVAR (it->w, buffer); 7088 it->object = WGET (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 = WVAR (it->w, buffer); 7663 it->object = WGET (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 = WVAR (it->w, buffer); 7927 it->object = WGET (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
@@ -7981,7 +7981,7 @@ run_redisplay_end_trigger_hook (struct it *it)
7981 7981
7982 /* Since we are *trying* to run these functions, don't try to run 7982 /* Since we are *trying* to run these functions, don't try to run
7983 them again, even if they get an error. */ 7983 them again, even if they get an error. */
7984 WVAR (it->w, redisplay_end_trigger) = Qnil; 7984 WSET (it->w, redisplay_end_trigger, Qnil);
7985 Frun_hook_with_args (3, args); 7985 Frun_hook_with_args (3, args);
7986 7986
7987 /* Notice if it changed the face of the character we are on. */ 7987 /* Notice if it changed the face of the character we are on. */
@@ -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 = WVAR (it->w, buffer); 8033 it->object = WGET (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 (WVAR (it->w, window_end_vpos))) 8894 && it->vpos < XFASTINT (WGET (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 = WVAR (XWINDOW (mini_window), frame); 9646 frame = WGET (XWINDOW (mini_window), frame);
9647 f = XFRAME (frame); 9647 f = XFRAME (frame);
9648 9648
9649 FRAME_SAMPLE_VISIBILITY (f); 9649 FRAME_SAMPLE_VISIBILITY (f);
@@ -9969,8 +9969,8 @@ with_echo_area_buffer (struct window *w, int which,
9969 set_buffer_internal_1 (XBUFFER (buffer)); 9969 set_buffer_internal_1 (XBUFFER (buffer));
9970 if (w) 9970 if (w)
9971 { 9971 {
9972 WVAR (w, buffer) = buffer; 9972 WSET (w, buffer, buffer);
9973 set_marker_both (WVAR (w, pointm), buffer, BEG, BEG_BYTE); 9973 set_marker_both (WGET (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, WVAR (w, buffer)); ++i; 10021 ASET (vector, i, WGET (w, buffer)); ++i;
10022 ASET (vector, i, make_number (XMARKER (WVAR (w, pointm))->charpos)); ++i; 10022 ASET (vector, i, make_number (XMARKER (WGET (w, pointm))->charpos)); ++i;
10023 ASET (vector, i, make_number (XMARKER (WVAR (w, pointm))->bytepos)); ++i; 10023 ASET (vector, i, make_number (XMARKER (WGET (w, pointm))->bytepos)); ++i;
10024 } 10024 }
10025 else 10025 else
10026 { 10026 {
@@ -10054,8 +10054,8 @@ unwind_with_echo_area_buffer (Lisp_Object vector)
10054 charpos = AREF (vector, 5); 10054 charpos = AREF (vector, 5);
10055 bytepos = AREF (vector, 6); 10055 bytepos = AREF (vector, 6);
10056 10056
10057 WVAR (w, buffer) = buffer; 10057 WSET (w, buffer, buffer);
10058 set_marker_both (WVAR (w, pointm), buffer, 10058 set_marker_both (WGET (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, WVAR (w, start)); 10197 SET_TEXT_POS_FROM_MARKER (start, WGET (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 (WVAR (w, frame)); 10268 struct frame *f = XFRAME (WGET (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 (WVAR (w, start), WVAR (w, buffer), 10274 set_marker_both (WGET (w, start), WGET (w, buffer),
10275 BUF_BEGV (XBUFFER (WVAR (w, buffer))), 10275 BUF_BEGV (XBUFFER (WGET (w, buffer))),
10276 BUF_BEGV_BYTE (XBUFFER (WVAR (w, buffer)))); 10276 BUF_BEGV_BYTE (XBUFFER (WGET (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 (WVAR (w, buffer))) 10303 if (current_buffer != XBUFFER (WGET (w, buffer)))
10304 { 10304 {
10305 old_current_buffer = current_buffer; 10305 old_current_buffer = current_buffer;
10306 set_buffer_internal (XBUFFER (WVAR (w, buffer))); 10306 set_buffer_internal (XBUFFER (WGET (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 (WVAR (w, start), start); 10348 SET_MARKER_FROM_TEXT_POS (WGET (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 (FGET (f, selected_window), Qt); 11054 Fselect_window (FGET (f, selected_window), Qt);
11055 set_buffer_internal_1 11055 set_buffer_internal_1
11056 (XBUFFER (WVAR (XWINDOW (FGET (f, selected_window)), buffer))); 11056 (XBUFFER (WGET (XWINDOW (FGET (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;
@@ -11173,7 +11173,7 @@ prepare_menu_bars (void)
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
11176 (WVAR (XWINDOW (FGET (f, selected_window)), buffer))); 11176 (WGET (XWINDOW (FGET (f, selected_window)), buffer)));
11177#endif 11177#endif
11178 UNGCPRO; 11178 UNGCPRO;
11179 } 11179 }
@@ -11238,19 +11238,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 11238 /* This used to test w->update_mode_line, but we believe
11239 there is no need to recompute the menu in that case. */ 11239 there is no need to recompute the menu in that case. */
11240 || update_mode_lines 11240 || update_mode_lines
11241 || ((BUF_SAVE_MODIFF (XBUFFER (WVAR (w, buffer))) 11241 || ((BUF_SAVE_MODIFF (XBUFFER (WGET (w, buffer)))
11242 < BUF_MODIFF (XBUFFER (WVAR (w, buffer)))) 11242 < BUF_MODIFF (XBUFFER (WGET (w, buffer))))
11243 != w->last_had_star) 11243 != w->last_had_star)
11244 || ((!NILP (Vtransient_mark_mode) 11244 || ((!NILP (Vtransient_mark_mode)
11245 && !NILP (BVAR (XBUFFER (WVAR (w, buffer)), mark_active))) 11245 && !NILP (BVAR (XBUFFER (WGET (w, buffer)), mark_active)))
11246 != !NILP (WVAR (w, region_showing)))) 11246 != !NILP (WGET (w, region_showing))))
11247 { 11247 {
11248 struct buffer *prev = current_buffer; 11248 struct buffer *prev = current_buffer;
11249 ptrdiff_t count = SPECPDL_INDEX (); 11249 ptrdiff_t count = SPECPDL_INDEX ();
11250 11250
11251 specbind (Qinhibit_menubar_update, Qt); 11251 specbind (Qinhibit_menubar_update, Qt);
11252 11252
11253 set_buffer_internal_1 (XBUFFER (WVAR (w, buffer))); 11253 set_buffer_internal_1 (XBUFFER (WGET (w, buffer)));
11254 if (save_match_data) 11254 if (save_match_data)
11255 record_unwind_save_match_data (); 11255 record_unwind_save_match_data ();
11256 if (NILP (Voverriding_local_map_menu_flag)) 11256 if (NILP (Voverriding_local_map_menu_flag))
@@ -11436,12 +11436,12 @@ update_tool_bar (struct frame *f, int save_match_data)
11436 if (windows_or_buffers_changed 11436 if (windows_or_buffers_changed
11437 || w->update_mode_line 11437 || w->update_mode_line
11438 || update_mode_lines 11438 || update_mode_lines
11439 || ((BUF_SAVE_MODIFF (XBUFFER (WVAR (w, buffer))) 11439 || ((BUF_SAVE_MODIFF (XBUFFER (WGET (w, buffer)))
11440 < BUF_MODIFF (XBUFFER (WVAR (w, buffer)))) 11440 < BUF_MODIFF (XBUFFER (WGET (w, buffer))))
11441 != w->last_had_star) 11441 != w->last_had_star)
11442 || ((!NILP (Vtransient_mark_mode) 11442 || ((!NILP (Vtransient_mark_mode)
11443 && !NILP (BVAR (XBUFFER (WVAR (w, buffer)), mark_active))) 11443 && !NILP (BVAR (XBUFFER (WGET (w, buffer)), mark_active)))
11444 != !NILP (WVAR (w, region_showing)))) 11444 != !NILP (WGET (w, region_showing))))
11445 { 11445 {
11446 struct buffer *prev = current_buffer; 11446 struct buffer *prev = current_buffer;
11447 ptrdiff_t count = SPECPDL_INDEX (); 11447 ptrdiff_t count = SPECPDL_INDEX ();
@@ -11452,7 +11452,7 @@ update_tool_bar (struct frame *f, int save_match_data)
11452 /* Set current_buffer to the buffer of the selected 11452 /* Set current_buffer to the buffer of the selected
11453 window of the frame, so that we get the right local 11453 window of the frame, so that we get the right local
11454 keymaps. */ 11454 keymaps. */
11455 set_buffer_internal_1 (XBUFFER (WVAR (w, buffer))); 11455 set_buffer_internal_1 (XBUFFER (WGET (w, buffer)));
11456 11456
11457 /* Save match data, if we must. */ 11457 /* Save match data, if we must. */
11458 if (save_match_data) 11458 if (save_match_data)
@@ -12323,10 +12323,10 @@ hscroll_window_tree (Lisp_Object window)
12323 { 12323 {
12324 struct window *w = XWINDOW (window); 12324 struct window *w = XWINDOW (window);
12325 12325
12326 if (WINDOWP (WVAR (w, hchild))) 12326 if (WINDOWP (WGET (w, hchild)))
12327 hscrolled_p |= hscroll_window_tree (WVAR (w, hchild)); 12327 hscrolled_p |= hscroll_window_tree (WGET (w, hchild));
12328 else if (WINDOWP (WVAR (w, vchild))) 12328 else if (WINDOWP (WGET (w, vchild)))
12329 hscrolled_p |= hscroll_window_tree (WVAR (w, vchild)); 12329 hscrolled_p |= hscroll_window_tree (WGET (w, vchild));
12330 else if (w->cursor.vpos >= 0) 12330 else if (w->cursor.vpos >= 0)
12331 { 12331 {
12332 int h_margin; 12332 int h_margin;
@@ -12346,7 +12346,7 @@ hscroll_window_tree (Lisp_Object window)
12346 /* Scroll when cursor is inside this scroll margin. */ 12346 /* Scroll when cursor is inside this scroll margin. */
12347 h_margin = hscroll_margin * WINDOW_FRAME_COLUMN_WIDTH (w); 12347 h_margin = hscroll_margin * WINDOW_FRAME_COLUMN_WIDTH (w);
12348 12348
12349 if (!NILP (Fbuffer_local_value (Qauto_hscroll_mode, WVAR (w, buffer))) 12349 if (!NILP (Fbuffer_local_value (Qauto_hscroll_mode, WGET (w, buffer)))
12350 /* For left-to-right rows, hscroll when cursor is either 12350 /* For left-to-right rows, hscroll when cursor is either
12351 (i) inside the right hscroll margin, or (ii) if it is 12351 (i) inside the right hscroll margin, or (ii) if it is
12352 inside the left margin and the window is already 12352 inside the left margin and the window is already
@@ -12381,13 +12381,13 @@ hscroll_window_tree (Lisp_Object window)
12381 12381
12382 /* Find point in a display of infinite width. */ 12382 /* Find point in a display of infinite width. */
12383 saved_current_buffer = current_buffer; 12383 saved_current_buffer = current_buffer;
12384 current_buffer = XBUFFER (WVAR (w, buffer)); 12384 current_buffer = XBUFFER (WGET (w, buffer));
12385 12385
12386 if (w == XWINDOW (selected_window)) 12386 if (w == XWINDOW (selected_window))
12387 pt = PT; 12387 pt = PT;
12388 else 12388 else
12389 { 12389 {
12390 pt = marker_position (WVAR (w, pointm)); 12390 pt = marker_position (WGET (w, pointm));
12391 pt = max (BEGV, pt); 12391 pt = max (BEGV, pt);
12392 pt = min (ZV, pt); 12392 pt = min (ZV, pt);
12393 } 12393 }
@@ -12438,14 +12438,14 @@ hscroll_window_tree (Lisp_Object window)
12438 redisplay. */ 12438 redisplay. */
12439 if (w->hscroll != hscroll) 12439 if (w->hscroll != hscroll)
12440 { 12440 {
12441 XBUFFER (WVAR (w, buffer))->prevent_redisplay_optimizations_p = 1; 12441 XBUFFER (WGET (w, buffer))->prevent_redisplay_optimizations_p = 1;
12442 w->hscroll = hscroll; 12442 w->hscroll = hscroll;
12443 hscrolled_p = 1; 12443 hscrolled_p = 1;
12444 } 12444 }
12445 } 12445 }
12446 } 12446 }
12447 12447
12448 window = WVAR (w, next); 12448 window = WGET (w, next);
12449 } 12449 }
12450 12450
12451 /* Value is non-zero if hscroll of any leaf window has been changed. */ 12451 /* Value is non-zero if hscroll of any leaf window has been changed. */
@@ -12527,9 +12527,9 @@ debug_method_add (struct window *w, char const *fmt, ...)
12527 if (trace_redisplay_p) 12527 if (trace_redisplay_p)
12528 fprintf (stderr, "%p (%s): %s\n", 12528 fprintf (stderr, "%p (%s): %s\n",
12529 w, 12529 w,
12530 ((BUFFERP (WVAR (w, buffer)) 12530 ((BUFFERP (WGET (w, buffer))
12531 && STRINGP (BVAR (XBUFFER (WVAR (w, buffer)), name))) 12531 && STRINGP (BVAR (XBUFFER (WGET (w, buffer)), name)))
12532 ? SSDATA (BVAR (XBUFFER (WVAR (w, buffer)), name)) 12532 ? SSDATA (BVAR (XBUFFER (WGET (w, buffer)), name))
12533 : "no buffer"), 12533 : "no buffer"),
12534 method + len); 12534 method + len);
12535} 12535}
@@ -12594,8 +12594,8 @@ text_outside_line_unchanged_p (struct window *w,
12594 require to redisplay the whole paragraph. It might be worthwhile 12594 require to redisplay the whole paragraph. It might be worthwhile
12595 to find the paragraph limits and widen the range of redisplayed 12595 to find the paragraph limits and widen the range of redisplayed
12596 lines to that, but for now just give up this optimization. */ 12596 lines to that, but for now just give up this optimization. */
12597 if (!NILP (BVAR (XBUFFER (WVAR (w, buffer)), bidi_display_reordering)) 12597 if (!NILP (BVAR (XBUFFER (WGET (w, buffer)), bidi_display_reordering))
12598 && NILP (BVAR (XBUFFER (WVAR (w, buffer)), bidi_paragraph_direction))) 12598 && NILP (BVAR (XBUFFER (WGET (w, buffer)), bidi_paragraph_direction)))
12599 unchanged_p = 0; 12599 unchanged_p = 0;
12600 } 12600 }
12601 12601
@@ -12807,7 +12807,7 @@ static inline void
12807reconsider_clip_changes (struct window *w, struct buffer *b) 12807reconsider_clip_changes (struct window *w, struct buffer *b)
12808{ 12808{
12809 if (b->clip_changed 12809 if (b->clip_changed
12810 && !NILP (WVAR (w, window_end_valid)) 12810 && !NILP (WGET (w, window_end_valid))
12811 && w->current_matrix->buffer == b 12811 && w->current_matrix->buffer == b
12812 && w->current_matrix->zv == BUF_ZV (b) 12812 && w->current_matrix->zv == BUF_ZV (b)
12813 && w->current_matrix->begv == BUF_BEGV (b)) 12813 && w->current_matrix->begv == BUF_BEGV (b))
@@ -12819,20 +12819,20 @@ reconsider_clip_changes (struct window *w, struct buffer *b)
12819 b->clip_changed has already been set to 1, we can skip this 12819 b->clip_changed has already been set to 1, we can skip this
12820 check. */ 12820 check. */
12821 if (!b->clip_changed 12821 if (!b->clip_changed
12822 && BUFFERP (WVAR (w, buffer)) && !NILP (WVAR (w, window_end_valid))) 12822 && BUFFERP (WGET (w, buffer)) && !NILP (WGET (w, window_end_valid)))
12823 { 12823 {
12824 ptrdiff_t pt; 12824 ptrdiff_t pt;
12825 12825
12826 if (w == XWINDOW (selected_window)) 12826 if (w == XWINDOW (selected_window))
12827 pt = PT; 12827 pt = PT;
12828 else 12828 else
12829 pt = marker_position (WVAR (w, pointm)); 12829 pt = marker_position (WGET (w, pointm));
12830 12830
12831 if ((w->current_matrix->buffer != XBUFFER (WVAR (w, buffer)) 12831 if ((w->current_matrix->buffer != XBUFFER (WGET (w, buffer))
12832 || pt != w->last_point) 12832 || pt != w->last_point)
12833 && check_point_in_composition (w->current_matrix->buffer, 12833 && check_point_in_composition (w->current_matrix->buffer,
12834 w->last_point, 12834 w->last_point,
12835 XBUFFER (WVAR (w, buffer)), pt)) 12835 XBUFFER (WGET (w, buffer)), pt))
12836 b->clip_changed = 1; 12836 b->clip_changed = 1;
12837 } 12837 }
12838} 12838}
@@ -12915,7 +12915,7 @@ redisplay_internal (void)
12915 /* Don't examine these until after testing Vinhibit_redisplay. 12915 /* Don't examine these until after testing Vinhibit_redisplay.
12916 When Emacs is shutting down, perhaps because its connection to 12916 When Emacs is shutting down, perhaps because its connection to
12917 X has dropped, we should not look at them at all. */ 12917 X has dropped, we should not look at them at all. */
12918 fr = XFRAME (WVAR (w, frame)); 12918 fr = XFRAME (WGET (w, frame));
12919 sf = SELECTED_FRAME (); 12919 sf = SELECTED_FRAME ();
12920 12920
12921 if (!fr->glyphs_initialized_p) 12921 if (!fr->glyphs_initialized_p)
@@ -13051,18 +13051,18 @@ redisplay_internal (void)
13051 specbind (Qinhibit_point_motion_hooks, Qt); 13051 specbind (Qinhibit_point_motion_hooks, Qt);
13052 13052
13053 /* If %c is in the mode line, update it if needed. */ 13053 /* If %c is in the mode line, update it if needed. */
13054 if (!NILP (WVAR (w, column_number_displayed)) 13054 if (!NILP (WGET (w, column_number_displayed))
13055 /* This alternative quickly identifies a common case 13055 /* This alternative quickly identifies a common case
13056 where no change is needed. */ 13056 where no change is needed. */
13057 && !(PT == w->last_point 13057 && !(PT == w->last_point
13058 && w->last_modified >= MODIFF 13058 && w->last_modified >= MODIFF
13059 && w->last_overlay_modified >= OVERLAY_MODIFF) 13059 && w->last_overlay_modified >= OVERLAY_MODIFF)
13060 && (XFASTINT (WVAR (w, column_number_displayed)) != current_column ())) 13060 && (XFASTINT (WGET (w, column_number_displayed)) != current_column ()))
13061 w->update_mode_line = 1; 13061 w->update_mode_line = 1;
13062 13062
13063 unbind_to (count1, Qnil); 13063 unbind_to (count1, Qnil);
13064 13064
13065 FRAME_SCROLL_BOTTOM_VPOS (XFRAME (WVAR (w, frame))) = -1; 13065 FRAME_SCROLL_BOTTOM_VPOS (XFRAME (WGET (w, frame))) = -1;
13066 13066
13067 /* The variable buffer_shared is set in redisplay_window and 13067 /* The variable buffer_shared is set in redisplay_window and
13068 indicates that we redisplay a buffer in different windows. See 13068 indicates that we redisplay a buffer in different windows. See
@@ -13146,11 +13146,11 @@ redisplay_internal (void)
13146 the whole window. The assignment to this_line_start_pos prevents 13146 the whole window. The assignment to this_line_start_pos prevents
13147 the optimization directly below this if-statement. */ 13147 the optimization directly below this if-statement. */
13148 if (((!NILP (Vtransient_mark_mode) 13148 if (((!NILP (Vtransient_mark_mode)
13149 && !NILP (BVAR (XBUFFER (WVAR (w, buffer)), mark_active))) 13149 && !NILP (BVAR (XBUFFER (WGET (w, buffer)), mark_active)))
13150 != !NILP (WVAR (w, region_showing))) 13150 != !NILP (WGET (w, region_showing)))
13151 || (!NILP (WVAR (w, region_showing)) 13151 || (!NILP (WGET (w, region_showing))
13152 && !EQ (WVAR (w, region_showing), 13152 && !EQ (WGET (w, region_showing),
13153 Fmarker_position (BVAR (XBUFFER (WVAR (w, buffer)), mark))))) 13153 Fmarker_position (BVAR (XBUFFER (WGET (w, buffer)), mark)))))
13154 CHARPOS (this_line_start_pos) = 0; 13154 CHARPOS (this_line_start_pos) = 0;
13155 13155
13156 /* Optimize the case that only the line containing the cursor in the 13156 /* Optimize the case that only the line containing the cursor in the
@@ -13164,11 +13164,11 @@ redisplay_internal (void)
13164 && !w->update_mode_line 13164 && !w->update_mode_line
13165 && !current_buffer->clip_changed 13165 && !current_buffer->clip_changed
13166 && !current_buffer->prevent_redisplay_optimizations_p 13166 && !current_buffer->prevent_redisplay_optimizations_p
13167 && FRAME_VISIBLE_P (XFRAME (WVAR (w, frame))) 13167 && FRAME_VISIBLE_P (XFRAME (WGET (w, frame)))
13168 && !FRAME_OBSCURED_P (XFRAME (WVAR (w, frame))) 13168 && !FRAME_OBSCURED_P (XFRAME (WGET (w, frame)))
13169 /* Make sure recorded data applies to current buffer, etc. */ 13169 /* Make sure recorded data applies to current buffer, etc. */
13170 && this_line_buffer == current_buffer 13170 && this_line_buffer == current_buffer
13171 && current_buffer == XBUFFER (WVAR (w, buffer)) 13171 && current_buffer == XBUFFER (WGET (w, buffer))
13172 && !w->force_start 13172 && !w->force_start
13173 && !w->optional_new_start 13173 && !w->optional_new_start
13174 /* Point must be on the line that we have info recorded about. */ 13174 /* Point must be on the line that we have info recorded about. */
@@ -13266,13 +13266,13 @@ redisplay_internal (void)
13266 adjusted. */ 13266 adjusted. */
13267 if ((it.glyph_row - 1)->displays_text_p) 13267 if ((it.glyph_row - 1)->displays_text_p)
13268 { 13268 {
13269 if (XFASTINT (WVAR (w, window_end_vpos)) < this_line_vpos) 13269 if (XFASTINT (WGET (w, window_end_vpos)) < this_line_vpos)
13270 XSETINT (WVAR (w, window_end_vpos), this_line_vpos); 13270 WSET (w, window_end_vpos, make_number (this_line_vpos));
13271 } 13271 }
13272 else if (XFASTINT (WVAR (w, window_end_vpos)) == this_line_vpos 13272 else if (XFASTINT (WGET (w, window_end_vpos)) == this_line_vpos
13273 && this_line_vpos > 0) 13273 && this_line_vpos > 0)
13274 XSETINT (WVAR (w, window_end_vpos), this_line_vpos - 1); 13274 WSET (w, window_end_vpos, make_number (this_line_vpos - 1));
13275 WVAR (w, window_end_valid) = Qnil; 13275 WSET (w, window_end_valid, Qnil);
13276 13276
13277 /* Update hint: No need to try to scroll in update_window. */ 13277 /* Update hint: No need to try to scroll in update_window. */
13278 w->desired_matrix->no_scrolling_p = 1; 13278 w->desired_matrix->no_scrolling_p = 1;
@@ -13318,7 +13318,7 @@ redisplay_internal (void)
13318 && (EQ (selected_window, 13318 && (EQ (selected_window,
13319 BVAR (current_buffer, last_selected_window)) 13319 BVAR (current_buffer, last_selected_window))
13320 || highlight_nonselected_windows) 13320 || highlight_nonselected_windows)
13321 && NILP (WVAR (w, region_showing)) 13321 && NILP (WGET (w, region_showing))
13322 && NILP (Vshow_trailing_whitespace) 13322 && NILP (Vshow_trailing_whitespace)
13323 && !cursor_in_echo_area) 13323 && !cursor_in_echo_area)
13324 { 13324 {
@@ -13479,7 +13479,7 @@ redisplay_internal (void)
13479 Lisp_Object mini_window = FRAME_MINIBUF_WINDOW (sf); 13479 Lisp_Object mini_window = FRAME_MINIBUF_WINDOW (sf);
13480 struct frame *mini_frame; 13480 struct frame *mini_frame;
13481 13481
13482 displayed_buffer = XBUFFER (WVAR (XWINDOW (selected_window), buffer)); 13482 displayed_buffer = XBUFFER (WGET (XWINDOW (selected_window), buffer));
13483 /* Use list_of_error, not Qerror, so that 13483 /* Use list_of_error, not Qerror, so that
13484 we catch only errors and don't run the debugger. */ 13484 we catch only errors and don't run the debugger. */
13485 internal_condition_case_1 (redisplay_window_1, selected_window, 13485 internal_condition_case_1 (redisplay_window_1, selected_window,
@@ -13545,7 +13545,7 @@ redisplay_internal (void)
13545 /* If we pause after scrolling, some rows in the current 13545 /* If we pause after scrolling, some rows in the current
13546 matrices of some windows are not valid. */ 13546 matrices of some windows are not valid. */
13547 if (!WINDOW_FULL_WIDTH_P (w) 13547 if (!WINDOW_FULL_WIDTH_P (w)
13548 && !FRAME_WINDOW_P (XFRAME (WVAR (w, frame)))) 13548 && !FRAME_WINDOW_P (XFRAME (WGET (w, frame))))
13549 update_mode_lines = 1; 13549 update_mode_lines = 1;
13550 } 13550 }
13551 else 13551 else
@@ -13703,9 +13703,9 @@ unwind_redisplay (Lisp_Object val)
13703static void 13703static void
13704mark_window_display_accurate_1 (struct window *w, int accurate_p) 13704mark_window_display_accurate_1 (struct window *w, int accurate_p)
13705{ 13705{
13706 if (BUFFERP (WVAR (w, buffer))) 13706 if (BUFFERP (WGET (w, buffer)))
13707 { 13707 {
13708 struct buffer *b = XBUFFER (WVAR (w, buffer)); 13708 struct buffer *b = XBUFFER (WGET (w, buffer));
13709 13709
13710 w->last_modified = accurate_p ? BUF_MODIFF(b) : 0; 13710 w->last_modified = accurate_p ? BUF_MODIFF(b) : 0;
13711 w->last_overlay_modified = accurate_p ? BUF_OVERLAY_MODIFF(b) : 0; 13711 w->last_overlay_modified = accurate_p ? BUF_OVERLAY_MODIFF(b) : 0;
@@ -13732,13 +13732,13 @@ mark_window_display_accurate_1 (struct window *w, int accurate_p)
13732 if (w == XWINDOW (selected_window)) 13732 if (w == XWINDOW (selected_window))
13733 w->last_point = BUF_PT (b); 13733 w->last_point = BUF_PT (b);
13734 else 13734 else
13735 w->last_point = XMARKER (WVAR (w, pointm))->charpos; 13735 w->last_point = XMARKER (WGET (w, pointm))->charpos;
13736 } 13736 }
13737 } 13737 }
13738 13738
13739 if (accurate_p) 13739 if (accurate_p)
13740 { 13740 {
13741 WVAR (w, window_end_valid) = WVAR (w, buffer); 13741 WSET (w, window_end_valid, WGET (w, buffer));
13742 w->update_mode_line = 0; 13742 w->update_mode_line = 0;
13743 } 13743 }
13744} 13744}
@@ -13754,15 +13754,15 @@ mark_window_display_accurate (Lisp_Object window, int accurate_p)
13754{ 13754{
13755 struct window *w; 13755 struct window *w;
13756 13756
13757 for (; !NILP (window); window = WVAR (w, next)) 13757 for (; !NILP (window); window = WGET (w, next))
13758 { 13758 {
13759 w = XWINDOW (window); 13759 w = XWINDOW (window);
13760 mark_window_display_accurate_1 (w, accurate_p); 13760 mark_window_display_accurate_1 (w, accurate_p);
13761 13761
13762 if (!NILP (WVAR (w, vchild))) 13762 if (!NILP (WGET (w, vchild)))
13763 mark_window_display_accurate (WVAR (w, vchild), accurate_p); 13763 mark_window_display_accurate (WGET (w, vchild), accurate_p);
13764 if (!NILP (WVAR (w, hchild))) 13764 if (!NILP (WGET (w, hchild)))
13765 mark_window_display_accurate (WVAR (w, hchild), accurate_p); 13765 mark_window_display_accurate (WGET (w, hchild), accurate_p);
13766 } 13766 }
13767 13767
13768 if (accurate_p) 13768 if (accurate_p)
@@ -13822,13 +13822,13 @@ redisplay_windows (Lisp_Object window)
13822 { 13822 {
13823 struct window *w = XWINDOW (window); 13823 struct window *w = XWINDOW (window);
13824 13824
13825 if (!NILP (WVAR (w, hchild))) 13825 if (!NILP (WGET (w, hchild)))
13826 redisplay_windows (WVAR (w, hchild)); 13826 redisplay_windows (WGET (w, hchild));
13827 else if (!NILP (WVAR (w, vchild))) 13827 else if (!NILP (WGET (w, vchild)))
13828 redisplay_windows (WVAR (w, vchild)); 13828 redisplay_windows (WGET (w, vchild));
13829 else if (!NILP (WVAR (w, buffer))) 13829 else if (!NILP (WGET (w, buffer)))
13830 { 13830 {
13831 displayed_buffer = XBUFFER (WVAR (w, buffer)); 13831 displayed_buffer = XBUFFER (WGET (w, buffer));
13832 /* Use list_of_error, not Qerror, so that 13832 /* Use list_of_error, not Qerror, so that
13833 we catch only errors and don't run the debugger. */ 13833 we catch only errors and don't run the debugger. */
13834 internal_condition_case_1 (redisplay_window_0, window, 13834 internal_condition_case_1 (redisplay_window_0, window,
@@ -13836,7 +13836,7 @@ redisplay_windows (Lisp_Object window)
13836 redisplay_window_error); 13836 redisplay_window_error);
13837 } 13837 }
13838 13838
13839 window = WVAR (w, next); 13839 window = WGET (w, next);
13840 } 13840 }
13841} 13841}
13842 13842
@@ -14470,7 +14470,7 @@ set_cursor_from_row (struct window *w, struct glyph_row *row,
14470 && !MATRIX_ROW_CONTINUATION_LINE_P (row) 14470 && !MATRIX_ROW_CONTINUATION_LINE_P (row)
14471 && row->x == 0) 14471 && row->x == 0)
14472 { 14472 {
14473 this_line_buffer = XBUFFER (WVAR (w, buffer)); 14473 this_line_buffer = XBUFFER (WGET (w, buffer));
14474 14474
14475 CHARPOS (this_line_start_pos) 14475 CHARPOS (this_line_start_pos)
14476 = MATRIX_ROW_START_CHARPOS (row) + delta; 14476 = MATRIX_ROW_START_CHARPOS (row) + delta;
@@ -14504,19 +14504,19 @@ static inline struct text_pos
14504run_window_scroll_functions (Lisp_Object window, struct text_pos startp) 14504run_window_scroll_functions (Lisp_Object window, struct text_pos startp)
14505{ 14505{
14506 struct window *w = XWINDOW (window); 14506 struct window *w = XWINDOW (window);
14507 SET_MARKER_FROM_TEXT_POS (WVAR (w, start), startp); 14507 SET_MARKER_FROM_TEXT_POS (WGET (w, start), startp);
14508 14508
14509 if (current_buffer != XBUFFER (WVAR (w, buffer))) 14509 if (current_buffer != XBUFFER (WGET (w, buffer)))
14510 abort (); 14510 abort ();
14511 14511
14512 if (!NILP (Vwindow_scroll_functions)) 14512 if (!NILP (Vwindow_scroll_functions))
14513 { 14513 {
14514 run_hook_with_args_2 (Qwindow_scroll_functions, window, 14514 run_hook_with_args_2 (Qwindow_scroll_functions, window,
14515 make_number (CHARPOS (startp))); 14515 make_number (CHARPOS (startp)));
14516 SET_TEXT_POS_FROM_MARKER (startp, WVAR (w, start)); 14516 SET_TEXT_POS_FROM_MARKER (startp, WGET (w, start));
14517 /* In case the hook functions switch buffers. */ 14517 /* In case the hook functions switch buffers. */
14518 if (current_buffer != XBUFFER (WVAR (w, buffer))) 14518 if (current_buffer != XBUFFER (WGET (w, buffer)))
14519 set_buffer_internal_1 (XBUFFER (WVAR (w, buffer))); 14519 set_buffer_internal_1 (XBUFFER (WGET (w, buffer)));
14520 } 14520 }
14521 14521
14522 return startp; 14522 return startp;
@@ -14606,7 +14606,7 @@ try_scrolling (Lisp_Object window, int just_this_one_p,
14606 int temp_scroll_step, int last_line_misfit) 14606 int temp_scroll_step, int last_line_misfit)
14607{ 14607{
14608 struct window *w = XWINDOW (window); 14608 struct window *w = XWINDOW (window);
14609 struct frame *f = XFRAME (WVAR (w, frame)); 14609 struct frame *f = XFRAME (WGET (w, frame));
14610 struct text_pos pos, startp; 14610 struct text_pos pos, startp;
14611 struct it it; 14611 struct it it;
14612 int this_scroll_margin, scroll_max, rc, height; 14612 int this_scroll_margin, scroll_max, rc, height;
@@ -14620,7 +14620,7 @@ try_scrolling (Lisp_Object window, int just_this_one_p,
14620 debug_method_add (w, "try_scrolling"); 14620 debug_method_add (w, "try_scrolling");
14621#endif 14621#endif
14622 14622
14623 SET_TEXT_POS_FROM_MARKER (startp, WVAR (w, start)); 14623 SET_TEXT_POS_FROM_MARKER (startp, WGET (w, start));
14624 14624
14625 /* Compute scroll margin height in pixels. We scroll when point is 14625 /* Compute scroll margin height in pixels. We scroll when point is
14626 within this distance from the top or bottom of the window. */ 14626 within this distance from the top or bottom of the window. */
@@ -14846,7 +14846,7 @@ try_scrolling (Lisp_Object window, int just_this_one_p,
14846 if (!just_this_one_p 14846 if (!just_this_one_p
14847 || current_buffer->clip_changed 14847 || current_buffer->clip_changed
14848 || BEG_UNCHANGED < CHARPOS (startp)) 14848 || BEG_UNCHANGED < CHARPOS (startp))
14849 WVAR (w, base_line_number) = Qnil; 14849 WSET (w, base_line_number, Qnil);
14850 14850
14851 /* If cursor ends up on a partially visible line, 14851 /* If cursor ends up on a partially visible line,
14852 treat that as being off the bottom of the screen. */ 14852 treat that as being off the bottom of the screen. */
@@ -14881,7 +14881,7 @@ compute_window_start_on_continuation_line (struct window *w)
14881 struct text_pos pos, start_pos; 14881 struct text_pos pos, start_pos;
14882 int window_start_changed_p = 0; 14882 int window_start_changed_p = 0;
14883 14883
14884 SET_TEXT_POS_FROM_MARKER (start_pos, WVAR (w, start)); 14884 SET_TEXT_POS_FROM_MARKER (start_pos, WGET (w, start));
14885 14885
14886 /* If window start is on a continuation line... Window start may be 14886 /* 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 14887 < BEGV in case there's invisible text at the start of the
@@ -14929,7 +14929,7 @@ compute_window_start_on_continuation_line (struct window *w)
14929 } 14929 }
14930 14930
14931 /* Set the window start there. */ 14931 /* Set the window start there. */
14932 SET_MARKER_FROM_TEXT_POS (WVAR (w, start), pos); 14932 SET_MARKER_FROM_TEXT_POS (WGET (w, start), pos);
14933 window_start_changed_p = 1; 14933 window_start_changed_p = 1;
14934 } 14934 }
14935 } 14935 }
@@ -14965,7 +14965,7 @@ static int
14965try_cursor_movement (Lisp_Object window, struct text_pos startp, int *scroll_step) 14965try_cursor_movement (Lisp_Object window, struct text_pos startp, int *scroll_step)
14966{ 14966{
14967 struct window *w = XWINDOW (window); 14967 struct window *w = XWINDOW (window);
14968 struct frame *f = XFRAME (WVAR (w, frame)); 14968 struct frame *f = XFRAME (WGET (w, frame));
14969 int rc = CURSOR_MOVEMENT_CANNOT_BE_USED; 14969 int rc = CURSOR_MOVEMENT_CANNOT_BE_USED;
14970 14970
14971#ifdef GLYPH_DEBUG 14971#ifdef GLYPH_DEBUG
@@ -14996,7 +14996,7 @@ try_cursor_movement (Lisp_Object window, struct text_pos startp, int *scroll_ste
14996 set the cursor. */ 14996 set the cursor. */
14997 && !(!NILP (Vtransient_mark_mode) 14997 && !(!NILP (Vtransient_mark_mode)
14998 && !NILP (BVAR (current_buffer, mark_active))) 14998 && !NILP (BVAR (current_buffer, mark_active)))
14999 && NILP (WVAR (w, region_showing)) 14999 && NILP (WGET (w, region_showing))
15000 && NILP (Vshow_trailing_whitespace) 15000 && NILP (Vshow_trailing_whitespace)
15001 /* This code is not used for mini-buffer for the sake of the case 15001 /* 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 15002 of redisplaying to replace an echo area message; since in
@@ -15010,8 +15010,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 15010 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 15011 window.c. I don't have this on my list, now, so we do
15012 approximately the same as the old redisplay code. --gerd. */ 15012 approximately the same as the old redisplay code. --gerd. */
15013 && INTEGERP (WVAR (w, window_end_vpos)) 15013 && INTEGERP (WGET (w, window_end_vpos))
15014 && XFASTINT (WVAR (w, window_end_vpos)) < w->current_matrix->nrows 15014 && XFASTINT (WGET (w, window_end_vpos)) < w->current_matrix->nrows
15015 && (FRAME_WINDOW_P (f) 15015 && (FRAME_WINDOW_P (f)
15016 || !overlay_arrow_in_current_buffer_p ())) 15016 || !overlay_arrow_in_current_buffer_p ()))
15017 { 15017 {
@@ -15148,7 +15148,7 @@ try_cursor_movement (Lisp_Object window, struct text_pos startp, int *scroll_ste
15148 must_scroll = 1; 15148 must_scroll = 1;
15149 } 15149 }
15150 else if (rc != CURSOR_MOVEMENT_SUCCESS 15150 else if (rc != CURSOR_MOVEMENT_SUCCESS
15151 && !NILP (BVAR (XBUFFER (WVAR (w, buffer)), bidi_display_reordering))) 15151 && !NILP (BVAR (XBUFFER (WGET (w, buffer)), bidi_display_reordering)))
15152 { 15152 {
15153 struct glyph_row *row1; 15153 struct glyph_row *row1;
15154 15154
@@ -15211,7 +15211,7 @@ try_cursor_movement (Lisp_Object window, struct text_pos startp, int *scroll_ste
15211 else if (scroll_p) 15211 else if (scroll_p)
15212 rc = CURSOR_MOVEMENT_MUST_SCROLL; 15212 rc = CURSOR_MOVEMENT_MUST_SCROLL;
15213 else if (rc != CURSOR_MOVEMENT_SUCCESS 15213 else if (rc != CURSOR_MOVEMENT_SUCCESS
15214 && !NILP (BVAR (XBUFFER (WVAR (w, buffer)), bidi_display_reordering))) 15214 && !NILP (BVAR (XBUFFER (WGET (w, buffer)), bidi_display_reordering)))
15215 { 15215 {
15216 /* With bidi-reordered rows, there could be more than 15216 /* With bidi-reordered rows, there could be more than
15217 one candidate row whose start and end positions 15217 one candidate row whose start and end positions
@@ -15318,12 +15318,12 @@ set_vertical_scroll_bar (struct window *w)
15318 || (w == XWINDOW (minibuf_window) 15318 || (w == XWINDOW (minibuf_window)
15319 && NILP (echo_area_buffer[0]))) 15319 && NILP (echo_area_buffer[0])))
15320 { 15320 {
15321 struct buffer *buf = XBUFFER (WVAR (w, buffer)); 15321 struct buffer *buf = XBUFFER (WGET (w, buffer));
15322 whole = BUF_ZV (buf) - BUF_BEGV (buf); 15322 whole = BUF_ZV (buf) - BUF_BEGV (buf);
15323 start = marker_position (WVAR (w, start)) - BUF_BEGV (buf); 15323 start = marker_position (WGET (w, start)) - BUF_BEGV (buf);
15324 /* I don't think this is guaranteed to be right. For the 15324 /* I don't think this is guaranteed to be right. For the
15325 moment, we'll pretend it is. */ 15325 moment, we'll pretend it is. */
15326 end = BUF_Z (buf) - XFASTINT (WVAR (w, window_end_pos)) - BUF_BEGV (buf); 15326 end = BUF_Z (buf) - XFASTINT (WGET (w, window_end_pos)) - BUF_BEGV (buf);
15327 15327
15328 if (end < start) 15328 if (end < start)
15329 end = start; 15329 end = start;
@@ -15334,8 +15334,8 @@ set_vertical_scroll_bar (struct window *w)
15334 start = end = whole = 0; 15334 start = end = whole = 0;
15335 15335
15336 /* Indicate what this scroll bar ought to be displaying now. */ 15336 /* Indicate what this scroll bar ought to be displaying now. */
15337 if (FRAME_TERMINAL (XFRAME (WVAR (w, frame)))->set_vertical_scroll_bar_hook) 15337 if (FRAME_TERMINAL (XFRAME (WGET (w, frame)))->set_vertical_scroll_bar_hook)
15338 (*FRAME_TERMINAL (XFRAME (WVAR (w, frame)))->set_vertical_scroll_bar_hook) 15338 (*FRAME_TERMINAL (XFRAME (WGET (w, frame)))->set_vertical_scroll_bar_hook)
15339 (w, end - start, whole, start); 15339 (w, end - start, whole, start);
15340} 15340}
15341 15341
@@ -15351,8 +15351,8 @@ static void
15351redisplay_window (Lisp_Object window, int just_this_one_p) 15351redisplay_window (Lisp_Object window, int just_this_one_p)
15352{ 15352{
15353 struct window *w = XWINDOW (window); 15353 struct window *w = XWINDOW (window);
15354 struct frame *f = XFRAME (WVAR (w, frame)); 15354 struct frame *f = XFRAME (WGET (w, frame));
15355 struct buffer *buffer = XBUFFER (WVAR (w, buffer)); 15355 struct buffer *buffer = XBUFFER (WGET (w, buffer));
15356 struct buffer *old = current_buffer; 15356 struct buffer *old = current_buffer;
15357 struct text_pos lpoint, opoint, startp; 15357 struct text_pos lpoint, opoint, startp;
15358 int update_mode_line; 15358 int update_mode_line;
@@ -15375,7 +15375,7 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
15375 opoint = lpoint; 15375 opoint = lpoint;
15376 15376
15377 /* W must be a leaf window here. */ 15377 /* W must be a leaf window here. */
15378 eassert (!NILP (WVAR (w, buffer))); 15378 eassert (!NILP (WGET (w, buffer)));
15379#ifdef GLYPH_DEBUG 15379#ifdef GLYPH_DEBUG
15380 *w->desired_matrix->method = 0; 15380 *w->desired_matrix->method = 0;
15381#endif 15381#endif
@@ -15405,10 +15405,10 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
15405 else if ((w != XWINDOW (minibuf_window) 15405 else if ((w != XWINDOW (minibuf_window)
15406 || minibuf_level == 0) 15406 || minibuf_level == 0)
15407 /* When buffer is nonempty, redisplay window normally. */ 15407 /* When buffer is nonempty, redisplay window normally. */
15408 && BUF_Z (XBUFFER (WVAR (w, buffer))) == BUF_BEG (XBUFFER (WVAR (w, buffer))) 15408 && BUF_Z (XBUFFER (WGET (w, buffer))) == BUF_BEG (XBUFFER (WGET (w, buffer)))
15409 /* Quail displays non-mini buffers in minibuffer window. 15409 /* Quail displays non-mini buffers in minibuffer window.
15410 In that case, redisplay the window normally. */ 15410 In that case, redisplay the window normally. */
15411 && !NILP (Fmemq (WVAR (w, buffer), Vminibuffer_list))) 15411 && !NILP (Fmemq (WGET (w, buffer), Vminibuffer_list)))
15412 { 15412 {
15413 /* W is a mini-buffer window, but it's not active, so clear 15413 /* W is a mini-buffer window, but it's not active, so clear
15414 it. */ 15414 it. */
@@ -15430,10 +15430,10 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
15430 value. */ 15430 value. */
15431 /* Really select the buffer, for the sake of buffer-local 15431 /* Really select the buffer, for the sake of buffer-local
15432 variables. */ 15432 variables. */
15433 set_buffer_internal_1 (XBUFFER (WVAR (w, buffer))); 15433 set_buffer_internal_1 (XBUFFER (WGET (w, buffer)));
15434 15434
15435 current_matrix_up_to_date_p 15435 current_matrix_up_to_date_p
15436 = (!NILP (WVAR (w, window_end_valid)) 15436 = (!NILP (WGET (w, window_end_valid))
15437 && !current_buffer->clip_changed 15437 && !current_buffer->clip_changed
15438 && !current_buffer->prevent_redisplay_optimizations_p 15438 && !current_buffer->prevent_redisplay_optimizations_p
15439 && w->last_modified >= MODIFF 15439 && w->last_modified >= MODIFF
@@ -15457,7 +15457,7 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
15457 specbind (Qinhibit_point_motion_hooks, Qt); 15457 specbind (Qinhibit_point_motion_hooks, Qt);
15458 15458
15459 buffer_unchanged_p 15459 buffer_unchanged_p
15460 = (!NILP (WVAR (w, window_end_valid)) 15460 = (!NILP (WGET (w, window_end_valid))
15461 && !current_buffer->clip_changed 15461 && !current_buffer->clip_changed
15462 && w->last_modified >= MODIFF 15462 && w->last_modified >= MODIFF
15463 && w->last_overlay_modified >= OVERLAY_MODIFF); 15463 && w->last_overlay_modified >= OVERLAY_MODIFF);
@@ -15468,10 +15468,10 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
15468 { 15468 {
15469 /* If window starts on a continuation line, maybe adjust the 15469 /* If window starts on a continuation line, maybe adjust the
15470 window start in case the window's width changed. */ 15470 window start in case the window's width changed. */
15471 if (XMARKER (WVAR (w, start))->buffer == current_buffer) 15471 if (XMARKER (WGET (w, start))->buffer == current_buffer)
15472 compute_window_start_on_continuation_line (w); 15472 compute_window_start_on_continuation_line (w);
15473 15473
15474 WVAR (w, window_end_valid) = Qnil; 15474 WSET (w, window_end_valid, Qnil);
15475 } 15475 }
15476 15476
15477 /* Some sanity checks. */ 15477 /* Some sanity checks. */
@@ -15482,13 +15482,13 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
15482 abort (); 15482 abort ();
15483 15483
15484 /* If %c is in mode line, update it if needed. */ 15484 /* If %c is in mode line, update it if needed. */
15485 if (!NILP (WVAR (w, column_number_displayed)) 15485 if (!NILP (WGET (w, column_number_displayed))
15486 /* This alternative quickly identifies a common case 15486 /* This alternative quickly identifies a common case
15487 where no change is needed. */ 15487 where no change is needed. */
15488 && !(PT == w->last_point 15488 && !(PT == w->last_point
15489 && w->last_modified >= MODIFF 15489 && w->last_modified >= MODIFF
15490 && w->last_overlay_modified >= OVERLAY_MODIFF) 15490 && w->last_overlay_modified >= OVERLAY_MODIFF)
15491 && (XFASTINT (WVAR (w, column_number_displayed)) != current_column ())) 15491 && (XFASTINT (WGET (w, column_number_displayed)) != current_column ()))
15492 update_mode_line = 1; 15492 update_mode_line = 1;
15493 15493
15494 /* Count number of windows showing the selected buffer. An indirect 15494 /* Count number of windows showing the selected buffer. An indirect
@@ -15497,7 +15497,7 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
15497 { 15497 {
15498 struct buffer *current_base, *window_base; 15498 struct buffer *current_base, *window_base;
15499 current_base = current_buffer; 15499 current_base = current_buffer;
15500 window_base = XBUFFER (WVAR (XWINDOW (selected_window), buffer)); 15500 window_base = XBUFFER (WGET (XWINDOW (selected_window), buffer));
15501 if (current_base->base_buffer) 15501 if (current_base->base_buffer)
15502 current_base = current_base->base_buffer; 15502 current_base = current_base->base_buffer;
15503 if (window_base->base_buffer) 15503 if (window_base->base_buffer)
@@ -15510,19 +15510,19 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
15510 window, set up appropriate value. */ 15510 window, set up appropriate value. */
15511 if (!EQ (window, selected_window)) 15511 if (!EQ (window, selected_window))
15512 { 15512 {
15513 ptrdiff_t new_pt = XMARKER (WVAR (w, pointm))->charpos; 15513 ptrdiff_t new_pt = XMARKER (WGET (w, pointm))->charpos;
15514 ptrdiff_t new_pt_byte = marker_byte_position (WVAR (w, pointm)); 15514 ptrdiff_t new_pt_byte = marker_byte_position (WGET (w, pointm));
15515 if (new_pt < BEGV) 15515 if (new_pt < BEGV)
15516 { 15516 {
15517 new_pt = BEGV; 15517 new_pt = BEGV;
15518 new_pt_byte = BEGV_BYTE; 15518 new_pt_byte = BEGV_BYTE;
15519 set_marker_both (WVAR (w, pointm), Qnil, BEGV, BEGV_BYTE); 15519 set_marker_both (WGET (w, pointm), Qnil, BEGV, BEGV_BYTE);
15520 } 15520 }
15521 else if (new_pt > (ZV - 1)) 15521 else if (new_pt > (ZV - 1))
15522 { 15522 {
15523 new_pt = ZV; 15523 new_pt = ZV;
15524 new_pt_byte = ZV_BYTE; 15524 new_pt_byte = ZV_BYTE;
15525 set_marker_both (WVAR (w, pointm), Qnil, ZV, ZV_BYTE); 15525 set_marker_both (WGET (w, pointm), Qnil, ZV, ZV_BYTE);
15526 } 15526 }
15527 15527
15528 /* We don't use SET_PT so that the point-motion hooks don't run. */ 15528 /* We don't use SET_PT so that the point-motion hooks don't run. */
@@ -15549,10 +15549,10 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
15549 } 15549 }
15550 15550
15551 /* If window-start is screwed up, choose a new one. */ 15551 /* If window-start is screwed up, choose a new one. */
15552 if (XMARKER (WVAR (w, start))->buffer != current_buffer) 15552 if (XMARKER (WGET (w, start))->buffer != current_buffer)
15553 goto recenter; 15553 goto recenter;
15554 15554
15555 SET_TEXT_POS_FROM_MARKER (startp, WVAR (w, start)); 15555 SET_TEXT_POS_FROM_MARKER (startp, WGET (w, start));
15556 15556
15557 /* If someone specified a new starting point but did not insist, 15557 /* If someone specified a new starting point but did not insist,
15558 check whether it can be used. */ 15558 check whether it can be used. */
@@ -15582,11 +15582,11 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
15582 15582
15583 w->force_start = 0; 15583 w->force_start = 0;
15584 w->vscroll = 0; 15584 w->vscroll = 0;
15585 WVAR (w, window_end_valid) = Qnil; 15585 WSET (w, window_end_valid, Qnil);
15586 15586
15587 /* Forget any recorded base line for line number display. */ 15587 /* Forget any recorded base line for line number display. */
15588 if (!buffer_unchanged_p) 15588 if (!buffer_unchanged_p)
15589 WVAR (w, base_line_number) = Qnil; 15589 WSET (w, base_line_number, Qnil);
15590 15590
15591 /* Redisplay the mode line. Select the buffer properly for that. 15591 /* Redisplay the mode line. Select the buffer properly for that.
15592 Also, run the hook window-scroll-functions 15592 Also, run the hook window-scroll-functions
@@ -15651,7 +15651,7 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
15651 MATRIX_ROW_START_BYTEPOS (row)); 15651 MATRIX_ROW_START_BYTEPOS (row));
15652 15652
15653 if (w != XWINDOW (selected_window)) 15653 if (w != XWINDOW (selected_window))
15654 set_marker_both (WVAR (w, pointm), Qnil, PT, PT_BYTE); 15654 set_marker_both (WGET (w, pointm), Qnil, PT, PT_BYTE);
15655 else if (current_buffer == old) 15655 else if (current_buffer == old)
15656 SET_TEXT_POS (lpoint, PT, PT_BYTE); 15656 SET_TEXT_POS (lpoint, PT, PT_BYTE);
15657 15657
@@ -15753,7 +15753,7 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
15753 sets it. So, we need to check the return value of 15753 sets it. So, we need to check the return value of
15754 compute_window_start_on_continuation_line. (See also 15754 compute_window_start_on_continuation_line. (See also
15755 bug#197). */ 15755 bug#197). */
15756 && XMARKER (WVAR (w, start))->buffer == current_buffer 15756 && XMARKER (WGET (w, start))->buffer == current_buffer
15757 && compute_window_start_on_continuation_line (w) 15757 && compute_window_start_on_continuation_line (w)
15758 /* It doesn't make sense to force the window start like we 15758 /* 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 15759 do at label force_start if it is already known that point
@@ -15764,7 +15764,7 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
15764 && pos_visible_p (w, PT, &d1, &d2, &d3, &d4, &d5, &d6)) 15764 && pos_visible_p (w, PT, &d1, &d2, &d3, &d4, &d5, &d6))
15765 { 15765 {
15766 w->force_start = 1; 15766 w->force_start = 1;
15767 SET_TEXT_POS_FROM_MARKER (startp, WVAR (w, start)); 15767 SET_TEXT_POS_FROM_MARKER (startp, WGET (w, start));
15768 goto force_start; 15768 goto force_start;
15769 } 15769 }
15770 15770
@@ -15800,7 +15800,7 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
15800 || current_buffer->clip_changed 15800 || current_buffer->clip_changed
15801 || BEG_UNCHANGED < CHARPOS (startp)) 15801 || BEG_UNCHANGED < CHARPOS (startp))
15802 /* Forget any recorded base line for line number display. */ 15802 /* Forget any recorded base line for line number display. */
15803 WVAR (w, base_line_number) = Qnil; 15803 WSET (w, base_line_number, Qnil);
15804 15804
15805 if (!cursor_row_fully_visible_p (w, 1, 0)) 15805 if (!cursor_row_fully_visible_p (w, 1, 0))
15806 { 15806 {
@@ -15871,7 +15871,7 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
15871 15871
15872 /* Forget any previously recorded base line for line number display. */ 15872 /* Forget any previously recorded base line for line number display. */
15873 if (!buffer_unchanged_p) 15873 if (!buffer_unchanged_p)
15874 WVAR (w, base_line_number) = Qnil; 15874 WSET (w, base_line_number, Qnil);
15875 15875
15876 /* Determine the window start relative to point. */ 15876 /* Determine the window start relative to point. */
15877 init_iterator (&it, w, PT, PT_BYTE, NULL, DEFAULT_FACE_ID); 15877 init_iterator (&it, w, PT, PT_BYTE, NULL, DEFAULT_FACE_ID);
@@ -15974,7 +15974,7 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
15974 /* Set the window start position here explicitly, to avoid an 15974 /* Set the window start position here explicitly, to avoid an
15975 infinite loop in case the functions in window-scroll-functions 15975 infinite loop in case the functions in window-scroll-functions
15976 get errors. */ 15976 get errors. */
15977 set_marker_both (WVAR (w, start), Qnil, IT_CHARPOS (it), IT_BYTEPOS (it)); 15977 set_marker_both (WGET (w, start), Qnil, IT_CHARPOS (it), IT_BYTEPOS (it));
15978 15978
15979 /* Run scroll hooks. */ 15979 /* Run scroll hooks. */
15980 startp = run_window_scroll_functions (window, it.current.pos); 15980 startp = run_window_scroll_functions (window, it.current.pos);
@@ -16005,8 +16005,8 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
16005 line.) */ 16005 line.) */
16006 if (w->cursor.vpos < 0) 16006 if (w->cursor.vpos < 0)
16007 { 16007 {
16008 if (!NILP (WVAR (w, window_end_valid)) 16008 if (!NILP (WGET (w, window_end_valid))
16009 && PT >= Z - XFASTINT (WVAR (w, window_end_pos))) 16009 && PT >= Z - XFASTINT (WGET (w, window_end_pos)))
16010 { 16010 {
16011 clear_glyph_matrix (w->desired_matrix); 16011 clear_glyph_matrix (w->desired_matrix);
16012 move_it_by_lines (&it, 1); 16012 move_it_by_lines (&it, 1);
@@ -16078,7 +16078,7 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
16078 16078
16079 done: 16079 done:
16080 16080
16081 SET_TEXT_POS_FROM_MARKER (startp, WVAR (w, start)); 16081 SET_TEXT_POS_FROM_MARKER (startp, WGET (w, start));
16082 w->start_at_line_beg = (CHARPOS (startp) == BEGV 16082 w->start_at_line_beg = (CHARPOS (startp) == BEGV
16083 || FETCH_BYTE (BYTEPOS (startp) - 1) == '\n'); 16083 || FETCH_BYTE (BYTEPOS (startp) - 1) == '\n');
16084 16084
@@ -16092,10 +16092,10 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
16092 && !FRAME_WINDOW_P (f) 16092 && !FRAME_WINDOW_P (f)
16093 && !WINDOW_FULL_WIDTH_P (w)) 16093 && !WINDOW_FULL_WIDTH_P (w))
16094 /* Line number to display. */ 16094 /* Line number to display. */
16095 || INTEGERP (WVAR (w, base_line_pos)) 16095 || INTEGERP (WGET (w, base_line_pos))
16096 /* Column number is displayed and different from the one displayed. */ 16096 /* Column number is displayed and different from the one displayed. */
16097 || (!NILP (WVAR (w, column_number_displayed)) 16097 || (!NILP (WGET (w, column_number_displayed))
16098 && (XFASTINT (WVAR (w, column_number_displayed)) != current_column ()))) 16098 && (XFASTINT (WGET (w, column_number_displayed)) != current_column ())))
16099 /* This means that the window has a mode line. */ 16099 /* This means that the window has a mode line. */
16100 && (WINDOW_WANTS_MODELINE_P (w) 16100 && (WINDOW_WANTS_MODELINE_P (w)
16101 || WINDOW_WANTS_HEADER_LINE_P (w))) 16101 || WINDOW_WANTS_HEADER_LINE_P (w)))
@@ -16127,10 +16127,10 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
16127 } 16127 }
16128 16128
16129 if (!line_number_displayed 16129 if (!line_number_displayed
16130 && !BUFFERP (WVAR (w, base_line_pos))) 16130 && !BUFFERP (WGET (w, base_line_pos)))
16131 { 16131 {
16132 WVAR (w, base_line_pos) = Qnil; 16132 WSET (w, base_line_pos, Qnil);
16133 WVAR (w, base_line_number) = Qnil; 16133 WSET (w, base_line_number, Qnil);
16134 } 16134 }
16135 16135
16136 finish_menu_bars: 16136 finish_menu_bars:
@@ -16243,10 +16243,10 @@ try_window (Lisp_Object window, struct text_pos pos, int flags)
16243 struct window *w = XWINDOW (window); 16243 struct window *w = XWINDOW (window);
16244 struct it it; 16244 struct it it;
16245 struct glyph_row *last_text_row = NULL; 16245 struct glyph_row *last_text_row = NULL;
16246 struct frame *f = XFRAME (WVAR (w, frame)); 16246 struct frame *f = XFRAME (WGET (w, frame));
16247 16247
16248 /* Make POS the new window start. */ 16248 /* Make POS the new window start. */
16249 set_marker_both (WVAR (w, start), Qnil, CHARPOS (pos), BYTEPOS (pos)); 16249 set_marker_both (WGET (w, start), Qnil, CHARPOS (pos), BYTEPOS (pos));
16250 16250
16251 /* Mark cursor position as unknown. No overlay arrow seen. */ 16251 /* Mark cursor position as unknown. No overlay arrow seen. */
16252 w->cursor.vpos = -1; 16252 w->cursor.vpos = -1;
@@ -16295,7 +16295,7 @@ try_window (Lisp_Object window, struct text_pos pos, int flags)
16295 } 16295 }
16296 16296
16297 /* If bottom moved off end of frame, change mode line percentage. */ 16297 /* If bottom moved off end of frame, change mode line percentage. */
16298 if (XFASTINT (WVAR (w, window_end_pos)) <= 0 16298 if (XFASTINT (WGET (w, window_end_pos)) <= 0
16299 && Z != IT_CHARPOS (it)) 16299 && Z != IT_CHARPOS (it))
16300 w->update_mode_line = 1; 16300 w->update_mode_line = 1;
16301 16301
@@ -16307,23 +16307,23 @@ try_window (Lisp_Object window, struct text_pos pos, int flags)
16307 eassert (MATRIX_ROW_DISPLAYS_TEXT_P (last_text_row)); 16307 eassert (MATRIX_ROW_DISPLAYS_TEXT_P (last_text_row));
16308 w->window_end_bytepos 16308 w->window_end_bytepos
16309 = Z_BYTE - MATRIX_ROW_END_BYTEPOS (last_text_row); 16309 = Z_BYTE - MATRIX_ROW_END_BYTEPOS (last_text_row);
16310 WVAR (w, window_end_pos) 16310 WSET (w, window_end_pos,
16311 = make_number (Z - MATRIX_ROW_END_CHARPOS (last_text_row)); 16311 make_number (Z - MATRIX_ROW_END_CHARPOS (last_text_row)));
16312 WVAR (w, window_end_vpos) 16312 WSET (w, window_end_vpos,
16313 = make_number (MATRIX_ROW_VPOS (last_text_row, w->desired_matrix)); 16313 make_number (MATRIX_ROW_VPOS (last_text_row, w->desired_matrix)));
16314 eassert 16314 eassert
16315 (MATRIX_ROW (w->desired_matrix, 16315 (MATRIX_ROW (w->desired_matrix,
16316 XFASTINT (WVAR (w, window_end_vpos)))->displays_text_p); 16316 XFASTINT (WGET (w, window_end_vpos)))->displays_text_p);
16317 } 16317 }
16318 else 16318 else
16319 { 16319 {
16320 w->window_end_bytepos = Z_BYTE - ZV_BYTE; 16320 w->window_end_bytepos = Z_BYTE - ZV_BYTE;
16321 WVAR (w, window_end_pos) = make_number (Z - ZV); 16321 WSET (w, window_end_pos, make_number (Z - ZV));
16322 WVAR (w, window_end_vpos) = make_number (0); 16322 WSET (w, window_end_vpos, make_number (0));
16323 } 16323 }
16324 16324
16325 /* But that is not valid info until redisplay finishes. */ 16325 /* But that is not valid info until redisplay finishes. */
16326 WVAR (w, window_end_valid) = Qnil; 16326 WSET (w, window_end_valid, Qnil);
16327 return 1; 16327 return 1;
16328} 16328}
16329 16329
@@ -16341,7 +16341,7 @@ try_window (Lisp_Object window, struct text_pos pos, int flags)
16341static int 16341static int
16342try_window_reusing_current_matrix (struct window *w) 16342try_window_reusing_current_matrix (struct window *w)
16343{ 16343{
16344 struct frame *f = XFRAME (WVAR (w, frame)); 16344 struct frame *f = XFRAME (WGET (w, frame));
16345 struct glyph_row *bottom_row; 16345 struct glyph_row *bottom_row;
16346 struct it it; 16346 struct it it;
16347 struct run run; 16347 struct run run;
@@ -16368,7 +16368,7 @@ try_window_reusing_current_matrix (struct window *w)
16368 /* Can't do this if region may have changed. */ 16368 /* Can't do this if region may have changed. */
16369 if ((!NILP (Vtransient_mark_mode) 16369 if ((!NILP (Vtransient_mark_mode)
16370 && !NILP (BVAR (current_buffer, mark_active))) 16370 && !NILP (BVAR (current_buffer, mark_active)))
16371 || !NILP (WVAR (w, region_showing)) 16371 || !NILP (WGET (w, region_showing))
16372 || !NILP (Vshow_trailing_whitespace)) 16372 || !NILP (Vshow_trailing_whitespace))
16373 return 0; 16373 return 0;
16374 16374
@@ -16385,7 +16385,7 @@ try_window_reusing_current_matrix (struct window *w)
16385 16385
16386 /* The variable new_start now holds the new window start. The old 16386 /* The variable new_start now holds the new window start. The old
16387 start `start' can be determined from the current matrix. */ 16387 start `start' can be determined from the current matrix. */
16388 SET_TEXT_POS_FROM_MARKER (new_start, WVAR (w, start)); 16388 SET_TEXT_POS_FROM_MARKER (new_start, WGET (w, start));
16389 start = start_row->minpos; 16389 start = start_row->minpos;
16390 start_vpos = MATRIX_ROW_VPOS (start_row, w->current_matrix); 16390 start_vpos = MATRIX_ROW_VPOS (start_row, w->current_matrix);
16391 16391
@@ -16547,29 +16547,28 @@ try_window_reusing_current_matrix (struct window *w)
16547 { 16547 {
16548 w->window_end_bytepos 16548 w->window_end_bytepos
16549 = Z_BYTE - MATRIX_ROW_END_BYTEPOS (last_reused_text_row); 16549 = Z_BYTE - MATRIX_ROW_END_BYTEPOS (last_reused_text_row);
16550 WVAR (w, window_end_pos) 16550 WSET (w, window_end_pos,
16551 = make_number (Z - MATRIX_ROW_END_CHARPOS (last_reused_text_row)); 16551 make_number (Z - MATRIX_ROW_END_CHARPOS (last_reused_text_row)));
16552 WVAR (w, window_end_vpos) 16552 WSET (w, window_end_vpos,
16553 = make_number (MATRIX_ROW_VPOS (last_reused_text_row, 16553 make_number (MATRIX_ROW_VPOS (last_reused_text_row, w->current_matrix)));
16554 w->current_matrix));
16555 } 16554 }
16556 else if (last_text_row) 16555 else if (last_text_row)
16557 { 16556 {
16558 w->window_end_bytepos 16557 w->window_end_bytepos
16559 = Z_BYTE - MATRIX_ROW_END_BYTEPOS (last_text_row); 16558 = Z_BYTE - MATRIX_ROW_END_BYTEPOS (last_text_row);
16560 WVAR (w, window_end_pos) 16559 WSET (w, window_end_pos,
16561 = make_number (Z - MATRIX_ROW_END_CHARPOS (last_text_row)); 16560 make_number (Z - MATRIX_ROW_END_CHARPOS (last_text_row)));
16562 WVAR (w, window_end_vpos) 16561 WSET (w, window_end_vpos,
16563 = make_number (MATRIX_ROW_VPOS (last_text_row, w->desired_matrix)); 16562 make_number (MATRIX_ROW_VPOS (last_text_row, w->desired_matrix)));
16564 } 16563 }
16565 else 16564 else
16566 { 16565 {
16567 /* This window must be completely empty. */ 16566 /* This window must be completely empty. */
16568 w->window_end_bytepos = Z_BYTE - ZV_BYTE; 16567 w->window_end_bytepos = Z_BYTE - ZV_BYTE;
16569 WVAR (w, window_end_pos) = make_number (Z - ZV); 16568 WSET (w, window_end_pos, make_number (Z - ZV));
16570 WVAR (w, window_end_vpos) = make_number (0); 16569 WSET (w, window_end_vpos, make_number (0));
16571 } 16570 }
16572 WVAR (w, window_end_valid) = Qnil; 16571 WSET (w, window_end_valid, Qnil);
16573 16572
16574 /* Update hint: don't try scrolling again in update_window. */ 16573 /* Update hint: don't try scrolling again in update_window. */
16575 w->desired_matrix->no_scrolling_p = 1; 16574 w->desired_matrix->no_scrolling_p = 1;
@@ -16723,7 +16722,7 @@ try_window_reusing_current_matrix (struct window *w)
16723 16722
16724 /* Can't use this optimization with bidi-reordered glyph 16723 /* Can't use this optimization with bidi-reordered glyph
16725 rows, unless cursor is already at point. */ 16724 rows, unless cursor is already at point. */
16726 if (!NILP (BVAR (XBUFFER (WVAR (w, buffer)), bidi_display_reordering))) 16725 if (!NILP (BVAR (XBUFFER (WGET (w, buffer)), bidi_display_reordering)))
16727 { 16726 {
16728 if (!(w->cursor.hpos >= 0 16727 if (!(w->cursor.hpos >= 0
16729 && w->cursor.hpos < row->used[TEXT_AREA] 16728 && w->cursor.hpos < row->used[TEXT_AREA]
@@ -16750,18 +16749,18 @@ try_window_reusing_current_matrix (struct window *w)
16750 { 16749 {
16751 w->window_end_bytepos 16750 w->window_end_bytepos
16752 = Z_BYTE - MATRIX_ROW_END_BYTEPOS (last_text_row); 16751 = Z_BYTE - MATRIX_ROW_END_BYTEPOS (last_text_row);
16753 WVAR (w, window_end_pos) 16752 WSET (w, window_end_pos,
16754 = make_number (Z - MATRIX_ROW_END_CHARPOS (last_text_row)); 16753 make_number (Z - MATRIX_ROW_END_CHARPOS (last_text_row)));
16755 WVAR (w, window_end_vpos) 16754 WSET (w, window_end_vpos,
16756 = make_number (MATRIX_ROW_VPOS (last_text_row, w->desired_matrix)); 16755 make_number (MATRIX_ROW_VPOS (last_text_row, w->desired_matrix)));
16757 } 16756 }
16758 else 16757 else
16759 { 16758 {
16760 WVAR (w, window_end_vpos) 16759 WSET (w, window_end_vpos,
16761 = make_number (XFASTINT (WVAR (w, window_end_vpos)) - nrows_scrolled); 16760 make_number (XFASTINT (WGET (w, window_end_vpos)) - nrows_scrolled));
16762 } 16761 }
16763 16762
16764 WVAR (w, window_end_valid) = Qnil; 16763 WSET (w, window_end_valid, Qnil);
16765 w->desired_matrix->no_scrolling_p = 1; 16764 w->desired_matrix->no_scrolling_p = 1;
16766 16765
16767#ifdef GLYPH_DEBUG 16766#ifdef GLYPH_DEBUG
@@ -16894,16 +16893,16 @@ find_first_unchanged_at_end_row (struct window *w,
16894 16893
16895 /* Display must not have been paused, otherwise the current matrix 16894 /* Display must not have been paused, otherwise the current matrix
16896 is not up to date. */ 16895 is not up to date. */
16897 eassert (!NILP (WVAR (w, window_end_valid))); 16896 eassert (!NILP (WGET (w, window_end_valid)));
16898 16897
16899 /* A value of window_end_pos >= END_UNCHANGED means that the window 16898 /* A value of window_end_pos >= END_UNCHANGED means that the window
16900 end is in the range of changed text. If so, there is no 16899 end is in the range of changed text. If so, there is no
16901 unchanged row at the end of W's current matrix. */ 16900 unchanged row at the end of W's current matrix. */
16902 if (XFASTINT (WVAR (w, window_end_pos)) >= END_UNCHANGED) 16901 if (XFASTINT (WGET (w, window_end_pos)) >= END_UNCHANGED)
16903 return NULL; 16902 return NULL;
16904 16903
16905 /* Set row to the last row in W's current matrix displaying text. */ 16904 /* Set row to the last row in W's current matrix displaying text. */
16906 row = MATRIX_ROW (w->current_matrix, XFASTINT (WVAR (w, window_end_vpos))); 16905 row = MATRIX_ROW (w->current_matrix, XFASTINT (WGET (w, window_end_vpos)));
16907 16906
16908 /* If matrix is entirely empty, no unchanged row exists. */ 16907 /* If matrix is entirely empty, no unchanged row exists. */
16909 if (MATRIX_ROW_DISPLAYS_TEXT_P (row)) 16908 if (MATRIX_ROW_DISPLAYS_TEXT_P (row))
@@ -16914,7 +16913,7 @@ find_first_unchanged_at_end_row (struct window *w,
16914 buffer positions in the current matrix to current buffer 16913 buffer positions in the current matrix to current buffer
16915 positions for characters not in changed text. */ 16914 positions for characters not in changed text. */
16916 ptrdiff_t Z_old = 16915 ptrdiff_t Z_old =
16917 MATRIX_ROW_END_CHARPOS (row) + XFASTINT (WVAR (w, window_end_pos)); 16916 MATRIX_ROW_END_CHARPOS (row) + XFASTINT (WGET (w, window_end_pos));
16918 ptrdiff_t Z_BYTE_old = 16917 ptrdiff_t Z_BYTE_old =
16919 MATRIX_ROW_END_BYTEPOS (row) + w->window_end_bytepos; 16918 MATRIX_ROW_END_BYTEPOS (row) + w->window_end_bytepos;
16920 ptrdiff_t last_unchanged_pos, last_unchanged_pos_old; 16919 ptrdiff_t last_unchanged_pos, last_unchanged_pos_old;
@@ -16962,12 +16961,12 @@ find_first_unchanged_at_end_row (struct window *w,
16962static void 16961static void
16963sync_frame_with_window_matrix_rows (struct window *w) 16962sync_frame_with_window_matrix_rows (struct window *w)
16964{ 16963{
16965 struct frame *f = XFRAME (WVAR (w, frame)); 16964 struct frame *f = XFRAME (WGET (w, frame));
16966 struct glyph_row *window_row, *window_row_end, *frame_row; 16965 struct glyph_row *window_row, *window_row_end, *frame_row;
16967 16966
16968 /* Preconditions: W must be a leaf window and full-width. Its frame 16967 /* Preconditions: W must be a leaf window and full-width. Its frame
16969 must have a frame matrix. */ 16968 must have a frame matrix. */
16970 eassert (NILP (WVAR (w, hchild)) && NILP (WVAR (w, vchild))); 16969 eassert (NILP (WGET (w, hchild)) && NILP (WGET (w, vchild)));
16971 eassert (WINDOW_FULL_WIDTH_P (w)); 16970 eassert (WINDOW_FULL_WIDTH_P (w));
16972 eassert (!FRAME_WINDOW_P (f)); 16971 eassert (!FRAME_WINDOW_P (f));
16973 16972
@@ -17009,7 +17008,7 @@ row_containing_pos (struct window *w, ptrdiff_t charpos,
17009{ 17008{
17010 struct glyph_row *row = start; 17009 struct glyph_row *row = start;
17011 struct glyph_row *best_row = NULL; 17010 struct glyph_row *best_row = NULL;
17012 ptrdiff_t mindif = BUF_ZV (XBUFFER (WVAR (w, buffer))) + 1; 17011 ptrdiff_t mindif = BUF_ZV (XBUFFER (WGET (w, buffer))) + 1;
17013 int last_y; 17012 int last_y;
17014 17013
17015 /* If we happen to start on a header-line, skip that. */ 17014 /* If we happen to start on a header-line, skip that. */
@@ -17045,7 +17044,7 @@ row_containing_pos (struct window *w, ptrdiff_t charpos,
17045 { 17044 {
17046 struct glyph *g; 17045 struct glyph *g;
17047 17046
17048 if (NILP (BVAR (XBUFFER (WVAR (w, buffer)), bidi_display_reordering)) 17047 if (NILP (BVAR (XBUFFER (WGET (w, buffer)), bidi_display_reordering))
17049 || (!best_row && !row->continued_p)) 17048 || (!best_row && !row->continued_p))
17050 return row; 17049 return row;
17051 /* In bidi-reordered rows, there could be several rows 17050 /* In bidi-reordered rows, there could be several rows
@@ -17114,7 +17113,7 @@ row_containing_pos (struct window *w, ptrdiff_t charpos,
17114static int 17113static int
17115try_window_id (struct window *w) 17114try_window_id (struct window *w)
17116{ 17115{
17117 struct frame *f = XFRAME (WVAR (w, frame)); 17116 struct frame *f = XFRAME (WGET (w, frame));
17118 struct glyph_matrix *current_matrix = w->current_matrix; 17117 struct glyph_matrix *current_matrix = w->current_matrix;
17119 struct glyph_matrix *desired_matrix = w->desired_matrix; 17118 struct glyph_matrix *desired_matrix = w->desired_matrix;
17120 struct glyph_row *last_unchanged_at_beg_row; 17119 struct glyph_row *last_unchanged_at_beg_row;
@@ -17148,7 +17147,7 @@ try_window_id (struct window *w)
17148#define GIVE_UP(X) return 0 17147#define GIVE_UP(X) return 0
17149#endif 17148#endif
17150 17149
17151 SET_TEXT_POS_FROM_MARKER (start, WVAR (w, start)); 17150 SET_TEXT_POS_FROM_MARKER (start, WGET (w, start));
17152 17151
17153 /* Don't use this for mini-windows because these can show 17152 /* Don't use this for mini-windows because these can show
17154 messages and mini-buffers, and we don't handle that here. */ 17153 messages and mini-buffers, and we don't handle that here. */
@@ -17186,7 +17185,7 @@ try_window_id (struct window *w)
17186 GIVE_UP (7); 17185 GIVE_UP (7);
17187 17186
17188 /* Verify that display wasn't paused. */ 17187 /* Verify that display wasn't paused. */
17189 if (NILP (WVAR (w, window_end_valid))) 17188 if (NILP (WGET (w, window_end_valid)))
17190 GIVE_UP (8); 17189 GIVE_UP (8);
17191 17190
17192 /* Can't use this if highlighting a region because a cursor movement 17191 /* Can't use this if highlighting a region because a cursor movement
@@ -17200,7 +17199,7 @@ try_window_id (struct window *w)
17200 GIVE_UP (11); 17199 GIVE_UP (11);
17201 17200
17202 /* Likewise if showing a region. */ 17201 /* Likewise if showing a region. */
17203 if (!NILP (WVAR (w, region_showing))) 17202 if (!NILP (WGET (w, region_showing)))
17204 GIVE_UP (10); 17203 GIVE_UP (10);
17205 17204
17206 /* Can't use this if overlay arrow position and/or string have 17205 /* Can't use this if overlay arrow position and/or string have
@@ -17212,7 +17211,7 @@ try_window_id (struct window *w)
17212 wrapped line can change the wrap position, altering the line 17211 wrapped line can change the wrap position, altering the line
17213 above it. It might be worthwhile to handle this more 17212 above it. It might be worthwhile to handle this more
17214 intelligently, but for now just redisplay from scratch. */ 17213 intelligently, but for now just redisplay from scratch. */
17215 if (!NILP (BVAR (XBUFFER (WVAR (w, buffer)), word_wrap))) 17214 if (!NILP (BVAR (XBUFFER (WGET (w, buffer)), word_wrap)))
17216 GIVE_UP (21); 17215 GIVE_UP (21);
17217 17216
17218 /* Under bidi reordering, adding or deleting a character in the 17217 /* Under bidi reordering, adding or deleting a character in the
@@ -17223,8 +17222,8 @@ try_window_id (struct window *w)
17223 to find the paragraph limits and widen the range of redisplayed 17222 to find the paragraph limits and widen the range of redisplayed
17224 lines to that, but for now just give up this optimization and 17223 lines to that, but for now just give up this optimization and
17225 redisplay from scratch. */ 17224 redisplay from scratch. */
17226 if (!NILP (BVAR (XBUFFER (WVAR (w, buffer)), bidi_display_reordering)) 17225 if (!NILP (BVAR (XBUFFER (WGET (w, buffer)), bidi_display_reordering))
17227 && NILP (BVAR (XBUFFER (WVAR (w, buffer)), bidi_paragraph_direction))) 17226 && NILP (BVAR (XBUFFER (WGET (w, buffer)), bidi_paragraph_direction)))
17228 GIVE_UP (22); 17227 GIVE_UP (22);
17229 17228
17230 /* Make sure beg_unchanged and end_unchanged are up to date. Do it 17229 /* Make sure beg_unchanged and end_unchanged are up to date. Do it
@@ -17250,7 +17249,7 @@ try_window_id (struct window *w)
17250 This case happens with stealth-fontification. Note that although 17249 This case happens with stealth-fontification. Note that although
17251 the display is unchanged, glyph positions in the matrix have to 17250 the display is unchanged, glyph positions in the matrix have to
17252 be adjusted, of course. */ 17251 be adjusted, of course. */
17253 row = MATRIX_ROW (w->current_matrix, XFASTINT (WVAR (w, window_end_vpos))); 17252 row = MATRIX_ROW (w->current_matrix, XFASTINT (WGET (w, window_end_vpos)));
17254 if (MATRIX_ROW_DISPLAYS_TEXT_P (row) 17253 if (MATRIX_ROW_DISPLAYS_TEXT_P (row)
17255 && ((last_changed_charpos < CHARPOS (start) 17254 && ((last_changed_charpos < CHARPOS (start)
17256 && CHARPOS (start) == BEGV) 17255 && CHARPOS (start) == BEGV)
@@ -17262,7 +17261,7 @@ try_window_id (struct window *w)
17262 17261
17263 /* Compute how many chars/bytes have been added to or removed 17262 /* Compute how many chars/bytes have been added to or removed
17264 from the buffer. */ 17263 from the buffer. */
17265 Z_old = MATRIX_ROW_END_CHARPOS (row) + XFASTINT (WVAR (w, window_end_pos)); 17264 Z_old = MATRIX_ROW_END_CHARPOS (row) + XFASTINT (WGET (w, window_end_pos));
17266 Z_BYTE_old = MATRIX_ROW_END_BYTEPOS (row) + w->window_end_bytepos; 17265 Z_BYTE_old = MATRIX_ROW_END_BYTEPOS (row) + w->window_end_bytepos;
17267 Z_delta = Z - Z_old; 17266 Z_delta = Z - Z_old;
17268 Z_delta_bytes = Z_BYTE - Z_BYTE_old; 17267 Z_delta_bytes = Z_BYTE - Z_BYTE_old;
@@ -17333,8 +17332,8 @@ try_window_id (struct window *w)
17333 { 17332 {
17334 /* We have to compute the window end anew since text 17333 /* We have to compute the window end anew since text
17335 could have been added/removed after it. */ 17334 could have been added/removed after it. */
17336 WVAR (w, window_end_pos) 17335 WSET (w, window_end_pos,
17337 = make_number (Z - MATRIX_ROW_END_CHARPOS (row)); 17336 make_number (Z - MATRIX_ROW_END_CHARPOS (row)));
17338 w->window_end_bytepos 17337 w->window_end_bytepos
17339 = Z_BYTE - MATRIX_ROW_END_BYTEPOS (row); 17338 = Z_BYTE - MATRIX_ROW_END_BYTEPOS (row);
17340 17339
@@ -17369,7 +17368,7 @@ try_window_id (struct window *w)
17369 17368
17370 /* Give up if the window ends in strings. Overlay strings 17369 /* Give up if the window ends in strings. Overlay strings
17371 at the end are difficult to handle, so don't try. */ 17370 at the end are difficult to handle, so don't try. */
17372 row = MATRIX_ROW (current_matrix, XFASTINT (WVAR (w, window_end_vpos))); 17371 row = MATRIX_ROW (current_matrix, XFASTINT (WGET (w, window_end_vpos)));
17373 if (MATRIX_ROW_START_CHARPOS (row) == MATRIX_ROW_END_CHARPOS (row)) 17372 if (MATRIX_ROW_START_CHARPOS (row) == MATRIX_ROW_END_CHARPOS (row))
17374 GIVE_UP (20); 17373 GIVE_UP (20);
17375 17374
@@ -17712,7 +17711,7 @@ try_window_id (struct window *w)
17712 /* Set last_row to the glyph row in the current matrix where the 17711 /* Set last_row to the glyph row in the current matrix where the
17713 window end line is found. It has been moved up or down in 17712 window end line is found. It has been moved up or down in
17714 the matrix by dvpos. */ 17713 the matrix by dvpos. */
17715 int last_vpos = XFASTINT (WVAR (w, window_end_vpos)) + dvpos; 17714 int last_vpos = XFASTINT (WGET (w, window_end_vpos)) + dvpos;
17716 struct glyph_row *last_row = MATRIX_ROW (current_matrix, last_vpos); 17715 struct glyph_row *last_row = MATRIX_ROW (current_matrix, last_vpos);
17717 17716
17718 /* If last_row is the window end line, it should display text. */ 17717 /* If last_row is the window end line, it should display text. */
@@ -17768,21 +17767,21 @@ try_window_id (struct window *w)
17768 first_unchanged_at_end_row); 17767 first_unchanged_at_end_row);
17769 eassert (row && MATRIX_ROW_DISPLAYS_TEXT_P (row)); 17768 eassert (row && MATRIX_ROW_DISPLAYS_TEXT_P (row));
17770 17769
17771 WVAR (w, window_end_pos) = make_number (Z - MATRIX_ROW_END_CHARPOS (row)); 17770 WSET (w, window_end_pos, make_number (Z - MATRIX_ROW_END_CHARPOS (row)));
17772 w->window_end_bytepos = Z_BYTE - MATRIX_ROW_END_BYTEPOS (row); 17771 w->window_end_bytepos = Z_BYTE - MATRIX_ROW_END_BYTEPOS (row);
17773 WVAR (w, window_end_vpos) 17772 WSET (w, window_end_vpos,
17774 = make_number (MATRIX_ROW_VPOS (row, w->current_matrix)); 17773 make_number (MATRIX_ROW_VPOS (row, w->current_matrix)));
17775 eassert (w->window_end_bytepos >= 0); 17774 eassert (w->window_end_bytepos >= 0);
17776 IF_DEBUG (debug_method_add (w, "A")); 17775 IF_DEBUG (debug_method_add (w, "A"));
17777 } 17776 }
17778 else if (last_text_row_at_end) 17777 else if (last_text_row_at_end)
17779 { 17778 {
17780 WVAR (w, window_end_pos) 17779 WSET (w, window_end_pos,
17781 = make_number (Z - MATRIX_ROW_END_CHARPOS (last_text_row_at_end)); 17780 make_number (Z - MATRIX_ROW_END_CHARPOS (last_text_row_at_end)));
17782 w->window_end_bytepos 17781 w->window_end_bytepos
17783 = Z_BYTE - MATRIX_ROW_END_BYTEPOS (last_text_row_at_end); 17782 = Z_BYTE - MATRIX_ROW_END_BYTEPOS (last_text_row_at_end);
17784 WVAR (w, window_end_vpos) 17783 WSET (w, window_end_vpos,
17785 = make_number (MATRIX_ROW_VPOS (last_text_row_at_end, desired_matrix)); 17784 make_number (MATRIX_ROW_VPOS (last_text_row_at_end, desired_matrix)));
17786 eassert (w->window_end_bytepos >= 0); 17785 eassert (w->window_end_bytepos >= 0);
17787 IF_DEBUG (debug_method_add (w, "B")); 17786 IF_DEBUG (debug_method_add (w, "B"));
17788 } 17787 }
@@ -17791,12 +17790,12 @@ try_window_id (struct window *w)
17791 /* We have displayed either to the end of the window or at the 17790 /* We have displayed either to the end of the window or at the
17792 end of the window, i.e. the last row with text is to be found 17791 end of the window, i.e. the last row with text is to be found
17793 in the desired matrix. */ 17792 in the desired matrix. */
17794 WVAR (w, window_end_pos) 17793 WSET (w, window_end_pos,
17795 = make_number (Z - MATRIX_ROW_END_CHARPOS (last_text_row)); 17794 make_number (Z - MATRIX_ROW_END_CHARPOS (last_text_row)));
17796 w->window_end_bytepos 17795 w->window_end_bytepos
17797 = Z_BYTE - MATRIX_ROW_END_BYTEPOS (last_text_row); 17796 = Z_BYTE - MATRIX_ROW_END_BYTEPOS (last_text_row);
17798 WVAR (w, window_end_vpos) 17797 WSET (w, window_end_vpos,
17799 = make_number (MATRIX_ROW_VPOS (last_text_row, desired_matrix)); 17798 make_number (MATRIX_ROW_VPOS (last_text_row, desired_matrix)));
17800 eassert (w->window_end_bytepos >= 0); 17799 eassert (w->window_end_bytepos >= 0);
17801 } 17800 }
17802 else if (first_unchanged_at_end_row == NULL 17801 else if (first_unchanged_at_end_row == NULL
@@ -17806,7 +17805,7 @@ try_window_id (struct window *w)
17806 /* Displayed to end of window, but no line containing text was 17805 /* Displayed to end of window, but no line containing text was
17807 displayed. Lines were deleted at the end of the window. */ 17806 displayed. Lines were deleted at the end of the window. */
17808 int first_vpos = WINDOW_WANTS_HEADER_LINE_P (w) ? 1 : 0; 17807 int first_vpos = WINDOW_WANTS_HEADER_LINE_P (w) ? 1 : 0;
17809 int vpos = XFASTINT (WVAR (w, window_end_vpos)); 17808 int vpos = XFASTINT (WGET (w, window_end_vpos));
17810 struct glyph_row *current_row = current_matrix->rows + vpos; 17809 struct glyph_row *current_row = current_matrix->rows + vpos;
17811 struct glyph_row *desired_row = desired_matrix->rows + vpos; 17810 struct glyph_row *desired_row = desired_matrix->rows + vpos;
17812 17811
@@ -17824,8 +17823,8 @@ try_window_id (struct window *w)
17824 } 17823 }
17825 17824
17826 eassert (row != NULL); 17825 eassert (row != NULL);
17827 WVAR (w, window_end_vpos) = make_number (vpos + 1); 17826 WSET (w, window_end_vpos, make_number (vpos + 1));
17828 WVAR (w, window_end_pos) = make_number (Z - MATRIX_ROW_END_CHARPOS (row)); 17827 WSET (w, window_end_pos, make_number (Z - MATRIX_ROW_END_CHARPOS (row)));
17829 w->window_end_bytepos = Z_BYTE - MATRIX_ROW_END_BYTEPOS (row); 17828 w->window_end_bytepos = Z_BYTE - MATRIX_ROW_END_BYTEPOS (row);
17830 eassert (w->window_end_bytepos >= 0); 17829 eassert (w->window_end_bytepos >= 0);
17831 IF_DEBUG (debug_method_add (w, "C")); 17830 IF_DEBUG (debug_method_add (w, "C"));
@@ -17833,11 +17832,11 @@ try_window_id (struct window *w)
17833 else 17832 else
17834 abort (); 17833 abort ();
17835 17834
17836 IF_DEBUG (debug_end_pos = XFASTINT (WVAR (w, window_end_pos)); 17835 IF_DEBUG (debug_end_pos = XFASTINT (WGET (w, window_end_pos));
17837 debug_end_vpos = XFASTINT (WVAR (w, window_end_vpos))); 17836 debug_end_vpos = XFASTINT (WGET (w, window_end_vpos)));
17838 17837
17839 /* Record that display has not been completed. */ 17838 /* Record that display has not been completed. */
17840 WVAR (w, window_end_valid) = Qnil; 17839 WSET (w, window_end_valid, Qnil);
17841 w->desired_matrix->no_scrolling_p = 1; 17840 w->desired_matrix->no_scrolling_p = 1;
17842 return 3; 17841 return 3;
17843 17842
@@ -18067,7 +18066,7 @@ glyphs in short form, otherwise show glyphs in long form. */)
18067 (Lisp_Object glyphs) 18066 (Lisp_Object glyphs)
18068{ 18067{
18069 struct window *w = XWINDOW (selected_window); 18068 struct window *w = XWINDOW (selected_window);
18070 struct buffer *buffer = XBUFFER (WVAR (w, buffer)); 18069 struct buffer *buffer = XBUFFER (WGET (w, buffer));
18071 18070
18072 fprintf (stderr, "PT = %"pI"d, BEGV = %"pI"d. ZV = %"pI"d\n", 18071 fprintf (stderr, "PT = %"pI"d, BEGV = %"pI"d. ZV = %"pI"d\n",
18073 BUF_PT (buffer), BUF_BEGV (buffer), BUF_ZV (buffer)); 18072 BUF_PT (buffer), BUF_BEGV (buffer), BUF_ZV (buffer));
@@ -18173,7 +18172,7 @@ static struct glyph_row *
18173get_overlay_arrow_glyph_row (struct window *w, Lisp_Object overlay_arrow_string) 18172get_overlay_arrow_glyph_row (struct window *w, Lisp_Object overlay_arrow_string)
18174{ 18173{
18175 struct frame *f = XFRAME (WINDOW_FRAME (w)); 18174 struct frame *f = XFRAME (WINDOW_FRAME (w));
18176 struct buffer *buffer = XBUFFER (WVAR (w, buffer)); 18175 struct buffer *buffer = XBUFFER (WGET (w, buffer));
18177 struct buffer *old = current_buffer; 18176 struct buffer *old = current_buffer;
18178 const unsigned char *arrow_string = SDATA (overlay_arrow_string); 18177 const unsigned char *arrow_string = SDATA (overlay_arrow_string);
18179 int arrow_len = SCHARS (overlay_arrow_string); 18178 int arrow_len = SCHARS (overlay_arrow_string);
@@ -19250,7 +19249,7 @@ display_line (struct it *it)
19250 } 19249 }
19251 19250
19252 /* Is IT->w showing the region? */ 19251 /* Is IT->w showing the region? */
19253 WVAR (it->w, region_showing) = it->region_beg_charpos > 0 ? Qt : Qnil; 19252 WSET (it->w, region_showing, it->region_beg_charpos > 0 ? Qt : Qnil);
19254 19253
19255 /* Clear the result glyph row and enable it. */ 19254 /* Clear the result glyph row and enable it. */
19256 prepare_desired_row (row); 19255 prepare_desired_row (row);
@@ -19365,7 +19364,7 @@ display_line (struct it *it)
19365 row->glyphs[TEXT_AREA]->charpos = -1; 19364 row->glyphs[TEXT_AREA]->charpos = -1;
19366 row->displays_text_p = 0; 19365 row->displays_text_p = 0;
19367 19366
19368 if (!NILP (BVAR (XBUFFER (WVAR (it->w, buffer)), indicate_empty_lines)) 19367 if (!NILP (BVAR (XBUFFER (WGET (it->w, buffer)), indicate_empty_lines))
19369 && (!MINI_WINDOW_P (it->w) 19368 && (!MINI_WINDOW_P (it->w)
19370 || (minibuf_level && EQ (it->window, minibuf_window)))) 19369 || (minibuf_level && EQ (it->window, minibuf_window))))
19371 row->indicate_empty_line_p = 1; 19370 row->indicate_empty_line_p = 1;
@@ -20188,12 +20187,12 @@ redisplay_mode_lines (Lisp_Object window, int force)
20188 { 20187 {
20189 struct window *w = XWINDOW (window); 20188 struct window *w = XWINDOW (window);
20190 20189
20191 if (WINDOWP (WVAR (w, hchild))) 20190 if (WINDOWP (WGET (w, hchild)))
20192 nwindows += redisplay_mode_lines (WVAR (w, hchild), force); 20191 nwindows += redisplay_mode_lines (WGET (w, hchild), force);
20193 else if (WINDOWP (WVAR (w, vchild))) 20192 else if (WINDOWP (WGET (w, vchild)))
20194 nwindows += redisplay_mode_lines (WVAR (w, vchild), force); 20193 nwindows += redisplay_mode_lines (WGET (w, vchild), force);
20195 else if (force 20194 else if (force
20196 || FRAME_GARBAGED_P (XFRAME (WVAR (w, frame))) 20195 || FRAME_GARBAGED_P (XFRAME (WGET (w, frame)))
20197 || !MATRIX_MODE_LINE_ROW (w->current_matrix)->enabled_p) 20196 || !MATRIX_MODE_LINE_ROW (w->current_matrix)->enabled_p)
20198 { 20197 {
20199 struct text_pos lpoint; 20198 struct text_pos lpoint;
@@ -20201,7 +20200,7 @@ redisplay_mode_lines (Lisp_Object window, int force)
20201 20200
20202 /* Set the window's buffer for the mode line display. */ 20201 /* Set the window's buffer for the mode line display. */
20203 SET_TEXT_POS (lpoint, PT, PT_BYTE); 20202 SET_TEXT_POS (lpoint, PT, PT_BYTE);
20204 set_buffer_internal_1 (XBUFFER (WVAR (w, buffer))); 20203 set_buffer_internal_1 (XBUFFER (WGET (w, buffer)));
20205 20204
20206 /* Point refers normally to the selected window. For any 20205 /* Point refers normally to the selected window. For any
20207 other window, set up appropriate value. */ 20206 other window, set up appropriate value. */
@@ -20209,7 +20208,7 @@ redisplay_mode_lines (Lisp_Object window, int force)
20209 { 20208 {
20210 struct text_pos pt; 20209 struct text_pos pt;
20211 20210
20212 SET_TEXT_POS_FROM_MARKER (pt, WVAR (w, pointm)); 20211 SET_TEXT_POS_FROM_MARKER (pt, WGET (w, pointm));
20213 if (CHARPOS (pt) < BEGV) 20212 if (CHARPOS (pt) < BEGV)
20214 TEMP_SET_PT_BOTH (BEGV, BEGV_BYTE); 20213 TEMP_SET_PT_BOTH (BEGV, BEGV_BYTE);
20215 else if (CHARPOS (pt) > (ZV - 1)) 20214 else if (CHARPOS (pt) > (ZV - 1))
@@ -20231,7 +20230,7 @@ redisplay_mode_lines (Lisp_Object window, int force)
20231 TEMP_SET_PT_BOTH (CHARPOS (lpoint), BYTEPOS (lpoint)); 20230 TEMP_SET_PT_BOTH (CHARPOS (lpoint), BYTEPOS (lpoint));
20232 } 20231 }
20233 20232
20234 window = WVAR (w, next); 20233 window = WGET (w, next);
20235 } 20234 }
20236 20235
20237 return nwindows; 20236 return nwindows;
@@ -20248,13 +20247,13 @@ display_mode_lines (struct window *w)
20248 int n = 0; 20247 int n = 0;
20249 20248
20250 old_selected_frame = selected_frame; 20249 old_selected_frame = selected_frame;
20251 selected_frame = WVAR (w, frame); 20250 selected_frame = WGET (w, frame);
20252 old_selected_window = selected_window; 20251 old_selected_window = selected_window;
20253 XSETWINDOW (selected_window, w); 20252 XSETWINDOW (selected_window, w);
20254 20253
20255 /* These will be set while the mode line specs are processed. */ 20254 /* These will be set while the mode line specs are processed. */
20256 line_number_displayed = 0; 20255 line_number_displayed = 0;
20257 WVAR (w, column_number_displayed) = Qnil; 20256 WSET (w, column_number_displayed, Qnil);
20258 20257
20259 if (WINDOW_WANTS_MODELINE_P (w)) 20258 if (WINDOW_WANTS_MODELINE_P (w))
20260 { 20259 {
@@ -20984,7 +20983,7 @@ are the selected window and the WINDOW's buffer). */)
20984 w = XWINDOW (window); 20983 w = XWINDOW (window);
20985 20984
20986 if (NILP (buffer)) 20985 if (NILP (buffer))
20987 buffer = WVAR (w, buffer); 20986 buffer = WGET (w, buffer);
20988 CHECK_BUFFER (buffer); 20987 CHECK_BUFFER (buffer);
20989 20988
20990 /* Make formatting the modeline a non-op when noninteractive, otherwise 20989 /* Make formatting the modeline a non-op when noninteractive, otherwise
@@ -21390,7 +21389,7 @@ decode_mode_spec (struct window *w, register int c, int field_width,
21390 else 21389 else
21391 { 21390 {
21392 ptrdiff_t col = current_column (); 21391 ptrdiff_t col = current_column ();
21393 WVAR (w, column_number_displayed) = make_number (col); 21392 WSET (w, column_number_displayed, make_number (col));
21394 pint2str (decode_mode_spec_buf, field_width, col); 21393 pint2str (decode_mode_spec_buf, field_width, col);
21395 return decode_mode_spec_buf; 21394 return decode_mode_spec_buf;
21396 } 21395 }
@@ -21443,33 +21442,33 @@ decode_mode_spec (struct window *w, register int c, int field_width,
21443 if (mode_line_target == MODE_LINE_TITLE) 21442 if (mode_line_target == MODE_LINE_TITLE)
21444 return ""; 21443 return "";
21445 21444
21446 startpos = XMARKER (WVAR (w, start))->charpos; 21445 startpos = XMARKER (WGET (w, start))->charpos;
21447 startpos_byte = marker_byte_position (WVAR (w, start)); 21446 startpos_byte = marker_byte_position (WGET (w, start));
21448 height = WINDOW_TOTAL_LINES (w); 21447 height = WINDOW_TOTAL_LINES (w);
21449 21448
21450 /* If we decided that this buffer isn't suitable for line numbers, 21449 /* If we decided that this buffer isn't suitable for line numbers,
21451 don't forget that too fast. */ 21450 don't forget that too fast. */
21452 if (EQ (WVAR (w, base_line_pos), WVAR (w, buffer))) 21451 if (EQ (WGET (w, base_line_pos), WGET (w, buffer)))
21453 goto no_value; 21452 goto no_value;
21454 /* But do forget it, if the window shows a different buffer now. */ 21453 /* But do forget it, if the window shows a different buffer now. */
21455 else if (BUFFERP (WVAR (w, base_line_pos))) 21454 else if (BUFFERP (WGET (w, base_line_pos)))
21456 WVAR (w, base_line_pos) = Qnil; 21455 WSET (w, base_line_pos, Qnil);
21457 21456
21458 /* If the buffer is very big, don't waste time. */ 21457 /* If the buffer is very big, don't waste time. */
21459 if (INTEGERP (Vline_number_display_limit) 21458 if (INTEGERP (Vline_number_display_limit)
21460 && BUF_ZV (b) - BUF_BEGV (b) > XINT (Vline_number_display_limit)) 21459 && BUF_ZV (b) - BUF_BEGV (b) > XINT (Vline_number_display_limit))
21461 { 21460 {
21462 WVAR (w, base_line_pos) = Qnil; 21461 WSET (w, base_line_pos, Qnil);
21463 WVAR (w, base_line_number) = Qnil; 21462 WSET (w, base_line_number, Qnil);
21464 goto no_value; 21463 goto no_value;
21465 } 21464 }
21466 21465
21467 if (INTEGERP (WVAR (w, base_line_number)) 21466 if (INTEGERP (WGET (w, base_line_number))
21468 && INTEGERP (WVAR (w, base_line_pos)) 21467 && INTEGERP (WGET (w, base_line_pos))
21469 && XFASTINT (WVAR (w, base_line_pos)) <= startpos) 21468 && XFASTINT (WGET (w, base_line_pos)) <= startpos)
21470 { 21469 {
21471 line = XFASTINT (WVAR (w, base_line_number)); 21470 line = XFASTINT (WGET (w, base_line_number));
21472 linepos = XFASTINT (WVAR (w, base_line_pos)); 21471 linepos = XFASTINT (WGET (w, base_line_pos));
21473 linepos_byte = buf_charpos_to_bytepos (b, linepos); 21472 linepos_byte = buf_charpos_to_bytepos (b, linepos);
21474 } 21473 }
21475 else 21474 else
@@ -21492,8 +21491,8 @@ decode_mode_spec (struct window *w, register int c, int field_width,
21492 go back past it. */ 21491 go back past it. */
21493 if (startpos == BUF_BEGV (b)) 21492 if (startpos == BUF_BEGV (b))
21494 { 21493 {
21495 WVAR (w, base_line_number) = make_number (topline); 21494 WSET (w, base_line_number, make_number (topline));
21496 WVAR (w, base_line_pos) = make_number (BUF_BEGV (b)); 21495 WSET (w, base_line_pos, make_number (BUF_BEGV (b)));
21497 } 21496 }
21498 else if (nlines < height + 25 || nlines > height * 3 + 50 21497 else if (nlines < height + 25 || nlines > height * 3 + 50
21499 || linepos == BUF_BEGV (b)) 21498 || linepos == BUF_BEGV (b))
@@ -21519,13 +21518,13 @@ decode_mode_spec (struct window *w, register int c, int field_width,
21519 give up on line numbers for this window. */ 21518 give up on line numbers for this window. */
21520 if (position == limit_byte && limit == startpos - distance) 21519 if (position == limit_byte && limit == startpos - distance)
21521 { 21520 {
21522 WVAR (w, base_line_pos) = WVAR (w, buffer); 21521 WSET (w, base_line_pos, WGET (w, buffer));
21523 WVAR (w, base_line_number) = Qnil; 21522 WSET (w, base_line_number, Qnil);
21524 goto no_value; 21523 goto no_value;
21525 } 21524 }
21526 21525
21527 WVAR (w, base_line_number) = make_number (topline - nlines); 21526 WSET (w, base_line_number, make_number (topline - nlines));
21528 WVAR (w, base_line_pos) = make_number (BYTE_TO_CHAR (position)); 21527 WSET (w, base_line_pos, make_number (BYTE_TO_CHAR (position)));
21529 } 21528 }
21530 21529
21531 /* Now count lines from the start pos to point. */ 21530 /* Now count lines from the start pos to point. */
@@ -21563,10 +21562,10 @@ decode_mode_spec (struct window *w, register int c, int field_width,
21563 21562
21564 case 'p': 21563 case 'p':
21565 { 21564 {
21566 ptrdiff_t pos = marker_position (WVAR (w, start)); 21565 ptrdiff_t pos = marker_position (WGET (w, start));
21567 ptrdiff_t total = BUF_ZV (b) - BUF_BEGV (b); 21566 ptrdiff_t total = BUF_ZV (b) - BUF_BEGV (b);
21568 21567
21569 if (XFASTINT (WVAR (w, window_end_pos)) <= BUF_Z (b) - BUF_ZV (b)) 21568 if (XFASTINT (WGET (w, window_end_pos)) <= BUF_Z (b) - BUF_ZV (b))
21570 { 21569 {
21571 if (pos <= BUF_BEGV (b)) 21570 if (pos <= BUF_BEGV (b))
21572 return "All"; 21571 return "All";
@@ -21594,8 +21593,8 @@ decode_mode_spec (struct window *w, register int c, int field_width,
21594 /* Display percentage of size above the bottom of the screen. */ 21593 /* Display percentage of size above the bottom of the screen. */
21595 case 'P': 21594 case 'P':
21596 { 21595 {
21597 ptrdiff_t toppos = marker_position (WVAR (w, start)); 21596 ptrdiff_t toppos = marker_position (WGET (w, start));
21598 ptrdiff_t botpos = BUF_Z (b) - XFASTINT (WVAR (w, window_end_pos)); 21597 ptrdiff_t botpos = BUF_Z (b) - XFASTINT (WGET (w, window_end_pos));
21599 ptrdiff_t total = BUF_ZV (b) - BUF_BEGV (b); 21598 ptrdiff_t total = BUF_ZV (b) - BUF_BEGV (b);
21600 21599
21601 if (botpos >= BUF_ZV (b)) 21600 if (botpos >= BUF_ZV (b))
@@ -22302,7 +22301,7 @@ calc_pixel_width_or_height (double *res, struct it *it, Lisp_Object prop,
22302 return OK_PIXELS (WINDOW_SCROLL_BAR_AREA_WIDTH (it->w)); 22301 return OK_PIXELS (WINDOW_SCROLL_BAR_AREA_WIDTH (it->w));
22303 } 22302 }
22304 22303
22305 prop = buffer_local_value_1 (prop, WVAR (it->w, buffer)); 22304 prop = buffer_local_value_1 (prop, WGET (it->w, buffer));
22306 if (EQ (prop, Qunbound)) 22305 if (EQ (prop, Qunbound))
22307 prop = Qnil; 22306 prop = Qnil;
22308 } 22307 }
@@ -22354,7 +22353,7 @@ calc_pixel_width_or_height (double *res, struct it *it, Lisp_Object prop,
22354 return OK_PIXELS (pixels); 22353 return OK_PIXELS (pixels);
22355 } 22354 }
22356 22355
22357 car = buffer_local_value_1 (car, WVAR (it->w, buffer)); 22356 car = buffer_local_value_1 (car, WGET (it->w, buffer));
22358 if (EQ (car, Qunbound)) 22357 if (EQ (car, Qunbound))
22359 car = Qnil; 22358 car = Qnil;
22360 } 22359 }
@@ -22435,7 +22434,7 @@ init_glyph_string (struct glyph_string *s,
22435{ 22434{
22436 memset (s, 0, sizeof *s); 22435 memset (s, 0, sizeof *s);
22437 s->w = w; 22436 s->w = w;
22438 s->f = XFRAME (WVAR (w, frame)); 22437 s->f = XFRAME (WGET (w, frame));
22439#ifdef HAVE_NTGUI 22438#ifdef HAVE_NTGUI
22440 s->hdc = hdc; 22439 s->hdc = hdc;
22441#endif 22440#endif
@@ -22767,7 +22766,7 @@ fill_glyph_string (struct glyph_string *s, int face_id,
22767 int voffset; 22766 int voffset;
22768 int glyph_not_available_p; 22767 int glyph_not_available_p;
22769 22768
22770 eassert (s->f == XFRAME (WVAR (s->w, frame))); 22769 eassert (s->f == XFRAME (WGET (s->w, frame)));
22771 eassert (s->nchars == 0); 22770 eassert (s->nchars == 0);
22772 eassert (start >= 0 && end > start); 22771 eassert (start >= 0 && end > start);
22773 22772
@@ -24162,7 +24161,7 @@ produce_stretch_glyph (struct it *it)
24162 int n = width; 24161 int n = width;
24163 24162
24164 if (!STRINGP (object)) 24163 if (!STRINGP (object))
24165 object = WVAR (it->w, buffer); 24164 object = WGET (it->w, buffer);
24166#ifdef HAVE_WINDOW_SYSTEM 24165#ifdef HAVE_WINDOW_SYSTEM
24167 if (FRAME_WINDOW_P (it->f)) 24166 if (FRAME_WINDOW_P (it->f))
24168 append_stretch_glyph (it, object, width, height, ascent); 24167 append_stretch_glyph (it, object, width, height, ascent);
@@ -25389,7 +25388,7 @@ x_clear_end_of_line (int to_x)
25389 int from_x, from_y, to_y; 25388 int from_x, from_y, to_y;
25390 25389
25391 eassert (updated_window && updated_row); 25390 eassert (updated_window && updated_row);
25392 f = XFRAME (WVAR (w, frame)); 25391 f = XFRAME (WGET (w, frame));
25393 25392
25394 if (updated_row->full_width_p) 25393 if (updated_row->full_width_p)
25395 max_x = WINDOW_TOTAL_WIDTH (w); 25394 max_x = WINDOW_TOTAL_WIDTH (w);
@@ -25547,8 +25546,8 @@ static enum text_cursor_kinds
25547get_window_cursor_type (struct window *w, struct glyph *glyph, int *width, 25546get_window_cursor_type (struct window *w, struct glyph *glyph, int *width,
25548 int *active_cursor) 25547 int *active_cursor)
25549{ 25548{
25550 struct frame *f = XFRAME (WVAR (w, frame)); 25549 struct frame *f = XFRAME (WGET (w, frame));
25551 struct buffer *b = XBUFFER (WVAR (w, buffer)); 25550 struct buffer *b = XBUFFER (WGET (w, buffer));
25552 int cursor_type = DEFAULT_CURSOR; 25551 int cursor_type = DEFAULT_CURSOR;
25553 Lisp_Object alt_cursor; 25552 Lisp_Object alt_cursor;
25554 int non_selected = 0; 25553 int non_selected = 0;
@@ -25859,7 +25858,7 @@ draw_phys_cursor_glyph (struct window *w, struct glyph_row *row,
25859void 25858void
25860erase_phys_cursor (struct window *w) 25859erase_phys_cursor (struct window *w)
25861{ 25860{
25862 struct frame *f = XFRAME (WVAR (w, frame)); 25861 struct frame *f = XFRAME (WGET (w, frame));
25863 Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f); 25862 Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f);
25864 int hpos = w->phys_cursor.hpos; 25863 int hpos = w->phys_cursor.hpos;
25865 int vpos = w->phys_cursor.vpos; 25864 int vpos = w->phys_cursor.vpos;
@@ -25978,7 +25977,7 @@ void
25978display_and_set_cursor (struct window *w, int on, 25977display_and_set_cursor (struct window *w, int on,
25979 int hpos, int vpos, int x, int y) 25978 int hpos, int vpos, int x, int y)
25980{ 25979{
25981 struct frame *f = XFRAME (WVAR (w, frame)); 25980 struct frame *f = XFRAME (WGET (w, frame));
25982 int new_cursor_type; 25981 int new_cursor_type;
25983 int new_cursor_width; 25982 int new_cursor_width;
25984 int active_cursor; 25983 int active_cursor;
@@ -26099,14 +26098,14 @@ update_cursor_in_window_tree (struct window *w, int on_p)
26099{ 26098{
26100 while (w) 26099 while (w)
26101 { 26100 {
26102 if (!NILP (WVAR (w, hchild))) 26101 if (!NILP (WGET (w, hchild)))
26103 update_cursor_in_window_tree (XWINDOW (WVAR (w, hchild)), on_p); 26102 update_cursor_in_window_tree (XWINDOW (WGET (w, hchild)), on_p);
26104 else if (!NILP (WVAR (w, vchild))) 26103 else if (!NILP (WGET (w, vchild)))
26105 update_cursor_in_window_tree (XWINDOW (WVAR (w, vchild)), on_p); 26104 update_cursor_in_window_tree (XWINDOW (WGET (w, vchild)), on_p);
26106 else 26105 else
26107 update_window_cursor (w, on_p); 26106 update_window_cursor (w, on_p);
26108 26107
26109 w = NILP (WVAR (w, next)) ? 0 : XWINDOW (WVAR (w, next)); 26108 w = NILP (WGET (w, next)) ? 0 : XWINDOW (WGET (w, next));
26110 } 26109 }
26111} 26110}
26112 26111
@@ -26130,7 +26129,7 @@ x_update_cursor (struct frame *f, int on_p)
26130void 26129void
26131x_clear_cursor (struct window *w) 26130x_clear_cursor (struct window *w)
26132{ 26131{
26133 if (FRAME_VISIBLE_P (XFRAME (WVAR (w, frame))) && w->phys_cursor_on_p) 26132 if (FRAME_VISIBLE_P (XFRAME (WGET (w, frame))) && w->phys_cursor_on_p)
26134 update_window_cursor (w, 0); 26133 update_window_cursor (w, 0);
26135} 26134}
26136 26135
@@ -26144,7 +26143,7 @@ draw_row_with_mouse_face (struct window *w, int start_x, struct glyph_row *row,
26144 enum draw_glyphs_face draw) 26143 enum draw_glyphs_face draw)
26145{ 26144{
26146#ifdef HAVE_WINDOW_SYSTEM 26145#ifdef HAVE_WINDOW_SYSTEM
26147 if (FRAME_WINDOW_P (XFRAME (WVAR (w, frame)))) 26146 if (FRAME_WINDOW_P (XFRAME (WGET (w, frame))))
26148 { 26147 {
26149 draw_glyphs (w, start_x, row, TEXT_AREA, start_hpos, end_hpos, draw, 0); 26148 draw_glyphs (w, start_x, row, TEXT_AREA, start_hpos, end_hpos, draw, 0);
26150 return; 26149 return;
@@ -26315,7 +26314,7 @@ clear_mouse_face (Mouse_HLInfo *hlinfo)
26315static int 26314static int
26316coords_in_mouse_face_p (struct window *w, int hpos, int vpos) 26315coords_in_mouse_face_p (struct window *w, int hpos, int vpos)
26317{ 26316{
26318 Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (XFRAME (WVAR (w, frame))); 26317 Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (XFRAME (WGET (w, frame)));
26319 26318
26320 /* Quickly resolve the easy cases. */ 26319 /* Quickly resolve the easy cases. */
26321 if (!(WINDOWP (hlinfo->mouse_face_window) 26320 if (!(WINDOWP (hlinfo->mouse_face_window)
@@ -26567,7 +26566,7 @@ mouse_face_from_buffer_pos (Lisp_Object window,
26567 /* Find the rows corresponding to START_CHARPOS and END_CHARPOS. */ 26566 /* Find the rows corresponding to START_CHARPOS and END_CHARPOS. */
26568 rows_from_pos_range (w, start_charpos, end_charpos, disp_string, &r1, &r2); 26567 rows_from_pos_range (w, start_charpos, end_charpos, disp_string, &r1, &r2);
26569 if (r1 == NULL) 26568 if (r1 == NULL)
26570 r1 = MATRIX_ROW (w->current_matrix, XFASTINT (WVAR (w, window_end_vpos))); 26569 r1 = MATRIX_ROW (w->current_matrix, XFASTINT (WGET (w, window_end_vpos)));
26571 /* If the before-string or display-string contains newlines, 26570 /* If the before-string or display-string contains newlines,
26572 rows_from_pos_range skips to its last row. Move back. */ 26571 rows_from_pos_range skips to its last row. Move back. */
26573 if (!NILP (before_string) || !NILP (disp_string)) 26572 if (!NILP (before_string) || !NILP (disp_string))
@@ -26589,7 +26588,7 @@ mouse_face_from_buffer_pos (Lisp_Object window,
26589 } 26588 }
26590 if (r2 == NULL) 26589 if (r2 == NULL)
26591 { 26590 {
26592 r2 = MATRIX_ROW (w->current_matrix, XFASTINT (WVAR (w, window_end_vpos))); 26591 r2 = MATRIX_ROW (w->current_matrix, XFASTINT (WGET (w, window_end_vpos)));
26593 hlinfo->mouse_face_past_end = 1; 26592 hlinfo->mouse_face_past_end = 1;
26594 } 26593 }
26595 else if (!NILP (after_string)) 26594 else if (!NILP (after_string))
@@ -26597,7 +26596,7 @@ mouse_face_from_buffer_pos (Lisp_Object window,
26597 /* If the after-string has newlines, advance to its last row. */ 26596 /* If the after-string has newlines, advance to its last row. */
26598 struct glyph_row *next; 26597 struct glyph_row *next;
26599 struct glyph_row *last 26598 struct glyph_row *last
26600 = MATRIX_ROW (w->current_matrix, XFASTINT (WVAR (w, window_end_vpos))); 26599 = MATRIX_ROW (w->current_matrix, XFASTINT (WGET (w, window_end_vpos)));
26601 26600
26602 for (next = r2 + 1; 26601 for (next = r2 + 1;
26603 next <= last 26602 next <= last
@@ -27262,7 +27261,7 @@ note_mode_line_or_margin_highlight (Lisp_Object window, int x, int y,
27262 enum window_part area) 27261 enum window_part area)
27263{ 27262{
27264 struct window *w = XWINDOW (window); 27263 struct window *w = XWINDOW (window);
27265 struct frame *f = XFRAME (WVAR (w, frame)); 27264 struct frame *f = XFRAME (WGET (w, frame));
27266 Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f); 27265 Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f);
27267#ifdef HAVE_WINDOW_SYSTEM 27266#ifdef HAVE_WINDOW_SYSTEM
27268 Display_Info *dpyinfo; 27267 Display_Info *dpyinfo;
@@ -27346,7 +27345,7 @@ note_mode_line_or_margin_highlight (Lisp_Object window, int x, int y,
27346 { 27345 {
27347 help_echo_string = help; 27346 help_echo_string = help;
27348 XSETWINDOW (help_echo_window, w); 27347 XSETWINDOW (help_echo_window, w);
27349 help_echo_object = WVAR (w, buffer); 27348 help_echo_object = WGET (w, buffer);
27350 help_echo_pos = charpos; 27349 help_echo_pos = charpos;
27351 } 27350 }
27352 } 27351 }
@@ -27382,7 +27381,7 @@ note_mode_line_or_margin_highlight (Lisp_Object window, int x, int y,
27382 { 27381 {
27383 Lisp_Object default_help 27382 Lisp_Object default_help
27384 = buffer_local_value_1 (Qmode_line_default_help_echo, 27383 = buffer_local_value_1 (Qmode_line_default_help_echo,
27385 WVAR (w, buffer)); 27384 WGET (w, buffer));
27386 27385
27387 if (STRINGP (default_help)) 27386 if (STRINGP (default_help))
27388 { 27387 {
@@ -27663,9 +27662,9 @@ note_mouse_highlight (struct frame *f, int x, int y)
27663 27662
27664 /* Are we in a window whose display is up to date? 27663 /* Are we in a window whose display is up to date?
27665 And verify the buffer's text has not changed. */ 27664 And verify the buffer's text has not changed. */
27666 b = XBUFFER (WVAR (w, buffer)); 27665 b = XBUFFER (WGET (w, buffer));
27667 if (part == ON_TEXT 27666 if (part == ON_TEXT
27668 && EQ (WVAR (w, window_end_valid), WVAR (w, buffer)) 27667 && EQ (WGET (w, window_end_valid), WGET (w, buffer))
27669 && w->last_modified == BUF_MODIFF (b) 27668 && w->last_modified == BUF_MODIFF (b)
27670 && w->last_overlay_modified == BUF_OVERLAY_MODIFF (b)) 27669 && w->last_overlay_modified == BUF_OVERLAY_MODIFF (b))
27671 { 27670 {
@@ -27872,8 +27871,8 @@ note_mouse_highlight (struct frame *f, int x, int y)
27872 if (pos > 0) 27871 if (pos > 0)
27873 { 27872 {
27874 mouse_face = get_char_property_and_overlay 27873 mouse_face = get_char_property_and_overlay
27875 (make_number (pos), Qmouse_face, WVAR (w, buffer), &overlay); 27874 (make_number (pos), Qmouse_face, WGET (w, buffer), &overlay);
27876 buffer = WVAR (w, buffer); 27875 buffer = WGET (w, buffer);
27877 disp_string = object; 27876 disp_string = object;
27878 } 27877 }
27879 } 27878 }
@@ -27899,12 +27898,12 @@ note_mouse_highlight (struct frame *f, int x, int y)
27899 is the smallest. */ 27898 is the smallest. */
27900 Lisp_Object lim1 = 27899 Lisp_Object lim1 =
27901 NILP (BVAR (XBUFFER (buffer), bidi_display_reordering)) 27900 NILP (BVAR (XBUFFER (buffer), bidi_display_reordering))
27902 ? Fmarker_position (WVAR (w, start)) 27901 ? Fmarker_position (WGET (w, start))
27903 : Qnil; 27902 : Qnil;
27904 Lisp_Object lim2 = 27903 Lisp_Object lim2 =
27905 NILP (BVAR (XBUFFER (buffer), bidi_display_reordering)) 27904 NILP (BVAR (XBUFFER (buffer), bidi_display_reordering))
27906 ? make_number (BUF_Z (XBUFFER (buffer)) 27905 ? make_number (BUF_Z (XBUFFER (buffer))
27907 - XFASTINT (WVAR (w, window_end_pos))) 27906 - XFASTINT (WGET (w, window_end_pos)))
27908 : Qnil; 27907 : Qnil;
27909 27908
27910 if (NILP (overlay)) 27909 if (NILP (overlay))
@@ -27986,11 +27985,11 @@ note_mouse_highlight (struct frame *f, int x, int y)
27986 if (p > 0) 27985 if (p > 0)
27987 { 27986 {
27988 help = Fget_char_property (make_number (p), 27987 help = Fget_char_property (make_number (p),
27989 Qhelp_echo, WVAR (w, buffer)); 27988 Qhelp_echo, WGET (w, buffer));
27990 if (!NILP (help)) 27989 if (!NILP (help))
27991 { 27990 {
27992 charpos = p; 27991 charpos = p;
27993 obj = WVAR (w, buffer); 27992 obj = WGET (w, buffer);
27994 } 27993 }
27995 } 27994 }
27996 } 27995 }
@@ -28041,7 +28040,7 @@ note_mouse_highlight (struct frame *f, int x, int y)
28041 ptrdiff_t p = string_buffer_position (obj, start); 28040 ptrdiff_t p = string_buffer_position (obj, start);
28042 if (p > 0) 28041 if (p > 0)
28043 pointer = Fget_char_property (make_number (p), 28042 pointer = Fget_char_property (make_number (p),
28044 Qpointer, WVAR (w, buffer)); 28043 Qpointer, WGET (w, buffer));
28045 } 28044 }
28046 } 28045 }
28047 else if (BUFFERP (obj) 28046 else if (BUFFERP (obj)
@@ -28079,7 +28078,7 @@ note_mouse_highlight (struct frame *f, int x, int y)
28079void 28078void
28080x_clear_window_mouse_face (struct window *w) 28079x_clear_window_mouse_face (struct window *w)
28081{ 28080{
28082 Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (XFRAME (WVAR (w, frame))); 28081 Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (XFRAME (WGET (w, frame)));
28083 Lisp_Object window; 28082 Lisp_Object window;
28084 28083
28085 BLOCK_INPUT; 28084 BLOCK_INPUT;
@@ -28101,7 +28100,7 @@ cancel_mouse_face (struct frame *f)
28101 Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f); 28100 Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f);
28102 28101
28103 window = hlinfo->mouse_face_window; 28102 window = hlinfo->mouse_face_window;
28104 if (! NILP (window) && XFRAME (WVAR (XWINDOW (window), frame)) == f) 28103 if (! NILP (window) && XFRAME (WGET (XWINDOW (window), frame)) == f)
28105 { 28104 {
28106 hlinfo->mouse_face_beg_row = hlinfo->mouse_face_beg_col = -1; 28105 hlinfo->mouse_face_beg_row = hlinfo->mouse_face_beg_col = -1;
28107 hlinfo->mouse_face_end_row = hlinfo->mouse_face_end_col = -1; 28106 hlinfo->mouse_face_end_row = hlinfo->mouse_face_end_col = -1;
@@ -28295,7 +28294,7 @@ x_draw_vertical_border (struct window *w)
28295 do it for frames with vertical scroll bars because either the 28294 do it for frames with vertical scroll bars because either the
28296 right scroll bar of a window, or the left scroll bar of its 28295 right scroll bar of a window, or the left scroll bar of its
28297 neighbor will suffice as a border. */ 28296 neighbor will suffice as a border. */
28298 if (FRAME_HAS_VERTICAL_SCROLL_BARS (XFRAME (WVAR (w, frame)))) 28297 if (FRAME_HAS_VERTICAL_SCROLL_BARS (XFRAME (WGET (w, frame))))
28299 return; 28298 return;
28300 28299
28301 if (!WINDOW_RIGHTMOST_P (w) 28300 if (!WINDOW_RIGHTMOST_P (w)
@@ -28335,7 +28334,7 @@ x_draw_vertical_border (struct window *w)
28335static int 28334static int
28336expose_window (struct window *w, XRectangle *fr) 28335expose_window (struct window *w, XRectangle *fr)
28337{ 28336{
28338 struct frame *f = XFRAME (WVAR (w, frame)); 28337 struct frame *f = XFRAME (WGET (w, frame));
28339 XRectangle wr, r; 28338 XRectangle wr, r;
28340 int mouse_face_overwritten_p = 0; 28339 int mouse_face_overwritten_p = 0;
28341 28340
@@ -28476,21 +28475,21 @@ expose_window (struct window *w, XRectangle *fr)
28476static int 28475static int
28477expose_window_tree (struct window *w, XRectangle *r) 28476expose_window_tree (struct window *w, XRectangle *r)
28478{ 28477{
28479 struct frame *f = XFRAME (WVAR (w, frame)); 28478 struct frame *f = XFRAME (WGET (w, frame));
28480 int mouse_face_overwritten_p = 0; 28479 int mouse_face_overwritten_p = 0;
28481 28480
28482 while (w && !FRAME_GARBAGED_P (f)) 28481 while (w && !FRAME_GARBAGED_P (f))
28483 { 28482 {
28484 if (!NILP (WVAR (w, hchild))) 28483 if (!NILP (WGET (w, hchild)))
28485 mouse_face_overwritten_p 28484 mouse_face_overwritten_p
28486 |= expose_window_tree (XWINDOW (WVAR (w, hchild)), r); 28485 |= expose_window_tree (XWINDOW (WGET (w, hchild)), r);
28487 else if (!NILP (WVAR (w, vchild))) 28486 else if (!NILP (WGET (w, vchild)))
28488 mouse_face_overwritten_p 28487 mouse_face_overwritten_p
28489 |= expose_window_tree (XWINDOW (WVAR (w, vchild)), r); 28488 |= expose_window_tree (XWINDOW (WGET (w, vchild)), r);
28490 else 28489 else
28491 mouse_face_overwritten_p |= expose_window (w, r); 28490 mouse_face_overwritten_p |= expose_window (w, r);
28492 28491
28493 w = NILP (WVAR (w, next)) ? NULL : XWINDOW (WVAR (w, next)); 28492 w = NILP (WGET (w, next)) ? NULL : XWINDOW (WGET (w, next));
28494 } 28493 }
28495 28494
28496 return mouse_face_overwritten_p; 28495 return mouse_face_overwritten_p;
@@ -29282,7 +29281,7 @@ init_xdisp (void)
29282 if (!noninteractive) 29281 if (!noninteractive)
29283 { 29282 {
29284 struct window *m = XWINDOW (minibuf_window); 29283 struct window *m = XWINDOW (minibuf_window);
29285 Lisp_Object frame = WVAR (m, frame); 29284 Lisp_Object frame = WGET (m, frame);
29286 struct frame *f = XFRAME (frame); 29285 struct frame *f = XFRAME (frame);
29287 Lisp_Object root = FRAME_ROOT_WINDOW (f); 29286 Lisp_Object root = FRAME_ROOT_WINDOW (f);
29288 struct window *r = XWINDOW (root); 29287 struct window *r = XWINDOW (root);
@@ -29290,12 +29289,12 @@ init_xdisp (void)
29290 29289
29291 echo_area_window = minibuf_window; 29290 echo_area_window = minibuf_window;
29292 29291
29293 XSETFASTINT (WVAR (r, top_line), FRAME_TOP_MARGIN (f)); 29292 WSET (r, top_line, make_number (FRAME_TOP_MARGIN (f)));
29294 XSETFASTINT (WVAR (r, total_lines), FRAME_LINES (f) - 1 - FRAME_TOP_MARGIN (f)); 29293 WSET (r, total_lines, make_number (FRAME_LINES (f) - 1 - FRAME_TOP_MARGIN (f)));
29295 XSETFASTINT (WVAR (r, total_cols), FRAME_COLS (f)); 29294 WSET (r, total_cols, make_number (FRAME_COLS (f)));
29296 XSETFASTINT (WVAR (m, top_line), FRAME_LINES (f) - 1); 29295 WSET (m, top_line, make_number (FRAME_LINES (f) - 1));
29297 XSETFASTINT (WVAR (m, total_lines), 1); 29296 WSET (m, total_lines, make_number (1));
29298 XSETFASTINT (WVAR (m, total_cols), FRAME_COLS (f)); 29297 WSET (m, total_cols, make_number (FRAME_COLS (f)));
29299 29298
29300 scratch_glyph_row.glyphs[TEXT_AREA] = scratch_glyphs; 29299 scratch_glyph_row.glyphs[TEXT_AREA] = scratch_glyphs;
29301 scratch_glyph_row.glyphs[TEXT_AREA + 1] 29300 scratch_glyph_row.glyphs[TEXT_AREA + 1]
diff --git a/src/xfaces.c b/src/xfaces.c
index bdee8fdd4a1..ff9df493033 100644
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -6033,7 +6033,7 @@ face_at_buffer_position (struct window *w, ptrdiff_t pos,
6033 ptrdiff_t *endptr, ptrdiff_t limit, 6033 ptrdiff_t *endptr, ptrdiff_t limit,
6034 int mouse, int base_face_id) 6034 int mouse, int base_face_id)
6035{ 6035{
6036 struct frame *f = XFRAME (WVAR (w, frame)); 6036 struct frame *f = XFRAME (WGET (w, frame));
6037 Lisp_Object attrs[LFACE_VECTOR_SIZE]; 6037 Lisp_Object attrs[LFACE_VECTOR_SIZE];
6038 Lisp_Object prop, position; 6038 Lisp_Object prop, position;
6039 ptrdiff_t i, noverlays; 6039 ptrdiff_t i, noverlays;
@@ -6055,9 +6055,9 @@ face_at_buffer_position (struct window *w, ptrdiff_t pos,
6055 6055
6056 /* Get the `face' or `mouse_face' text property at POS, and 6056 /* Get the `face' or `mouse_face' text property at POS, and
6057 determine the next position at which the property changes. */ 6057 determine the next position at which the property changes. */
6058 prop = Fget_text_property (position, propname, WVAR (w, buffer)); 6058 prop = Fget_text_property (position, propname, WGET (w, buffer));
6059 XSETFASTINT (limit1, (limit < endpos ? limit : endpos)); 6059 XSETFASTINT (limit1, (limit < endpos ? limit : endpos));
6060 end = Fnext_single_property_change (position, propname, WVAR (w, buffer), limit1); 6060 end = Fnext_single_property_change (position, propname, WGET (w, buffer), limit1);
6061 if (INTEGERP (end)) 6061 if (INTEGERP (end))
6062 endpos = XINT (end); 6062 endpos = XINT (end);
6063 6063
@@ -6143,7 +6143,7 @@ face_for_overlay_string (struct window *w, ptrdiff_t pos,
6143 ptrdiff_t *endptr, ptrdiff_t limit, 6143 ptrdiff_t *endptr, ptrdiff_t limit,
6144 int mouse, Lisp_Object overlay) 6144 int mouse, Lisp_Object overlay)
6145{ 6145{
6146 struct frame *f = XFRAME (WVAR (w, frame)); 6146 struct frame *f = XFRAME (WGET (w, frame));
6147 Lisp_Object attrs[LFACE_VECTOR_SIZE]; 6147 Lisp_Object attrs[LFACE_VECTOR_SIZE];
6148 Lisp_Object prop, position; 6148 Lisp_Object prop, position;
6149 ptrdiff_t endpos; 6149 ptrdiff_t endpos;
@@ -6163,9 +6163,9 @@ face_for_overlay_string (struct window *w, ptrdiff_t pos,
6163 6163
6164 /* Get the `face' or `mouse_face' text property at POS, and 6164 /* Get the `face' or `mouse_face' text property at POS, and
6165 determine the next position at which the property changes. */ 6165 determine the next position at which the property changes. */
6166 prop = Fget_text_property (position, propname, WVAR (w, buffer)); 6166 prop = Fget_text_property (position, propname, WGET (w, buffer));
6167 XSETFASTINT (limit1, (limit < endpos ? limit : endpos)); 6167 XSETFASTINT (limit1, (limit < endpos ? limit : endpos));
6168 end = Fnext_single_property_change (position, propname, WVAR (w, buffer), limit1); 6168 end = Fnext_single_property_change (position, propname, WGET (w, buffer), limit1);
6169 if (INTEGERP (end)) 6169 if (INTEGERP (end))
6170 endpos = XINT (end); 6170 endpos = XINT (end);
6171 6171
diff --git a/src/xfns.c b/src/xfns.c
index e92b0e58f63..e1bfffeba1c 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 (WVAR (w, frame)); 2263 struct frame *f = XFRAME (WGET (w, frame));
2264 XVaNestedList attr; 2264 XVaNestedList attr;
2265 XPoint spot; 2265 XPoint spot;
2266 2266
@@ -5069,28 +5069,29 @@ Text larger than the specified size is clipped. */)
5069 5069
5070 /* Set up the frame's root window. */ 5070 /* Set up the frame's root window. */
5071 w = XWINDOW (FRAME_ROOT_WINDOW (f)); 5071 w = XWINDOW (FRAME_ROOT_WINDOW (f));
5072 WVAR (w, left_col) = WVAR (w, top_line) = make_number (0); 5072 WSET (w, left_col, make_number (0));
5073 WSET (w, top_line, make_number (0));
5073 5074
5074 if (CONSP (Vx_max_tooltip_size) 5075 if (CONSP (Vx_max_tooltip_size)
5075 && RANGED_INTEGERP (1, XCAR (Vx_max_tooltip_size), INT_MAX) 5076 && RANGED_INTEGERP (1, XCAR (Vx_max_tooltip_size), INT_MAX)
5076 && RANGED_INTEGERP (1, XCDR (Vx_max_tooltip_size), INT_MAX)) 5077 && RANGED_INTEGERP (1, XCDR (Vx_max_tooltip_size), INT_MAX))
5077 { 5078 {
5078 WVAR (w, total_cols) = XCAR (Vx_max_tooltip_size); 5079 WSET (w, total_cols, XCAR (Vx_max_tooltip_size));
5079 WVAR (w, total_lines) = XCDR (Vx_max_tooltip_size); 5080 WSET (w, total_lines, XCDR (Vx_max_tooltip_size));
5080 } 5081 }
5081 else 5082 else
5082 { 5083 {
5083 WVAR (w, total_cols) = make_number (80); 5084 WSET (w, total_cols, make_number (80));
5084 WVAR (w, total_lines) = make_number (40); 5085 WSET (w, total_lines, make_number (40));
5085 } 5086 }
5086 5087
5087 FRAME_TOTAL_COLS (f) = XINT (WVAR (w, total_cols)); 5088 FRAME_TOTAL_COLS (f) = XINT (WGET (w, total_cols));
5088 adjust_glyphs (f); 5089 adjust_glyphs (f);
5089 w->pseudo_window_p = 1; 5090 w->pseudo_window_p = 1;
5090 5091
5091 /* Display the tooltip text in a temporary buffer. */ 5092 /* Display the tooltip text in a temporary buffer. */
5092 old_buffer = current_buffer; 5093 old_buffer = current_buffer;
5093 set_buffer_internal_1 (XBUFFER (WVAR (XWINDOW (FRAME_ROOT_WINDOW (f)), buffer))); 5094 set_buffer_internal_1 (XBUFFER (WGET (XWINDOW (FRAME_ROOT_WINDOW (f)), buffer)));
5094 BVAR (current_buffer, truncate_lines) = Qnil; 5095 BVAR (current_buffer, truncate_lines) = Qnil;
5095 clear_glyph_matrix (w->desired_matrix); 5096 clear_glyph_matrix (w->desired_matrix);
5096 clear_glyph_matrix (w->current_matrix); 5097 clear_glyph_matrix (w->current_matrix);
@@ -5151,7 +5152,7 @@ Text larger than the specified size is clipped. */)
5151 /* w->total_cols and FRAME_TOTAL_COLS want the width in columns, 5152 /* w->total_cols and FRAME_TOTAL_COLS want the width in columns,
5152 not in pixels. */ 5153 not in pixels. */
5153 width /= WINDOW_FRAME_COLUMN_WIDTH (w); 5154 width /= WINDOW_FRAME_COLUMN_WIDTH (w);
5154 WVAR (w, total_cols) = make_number (width); 5155 WSET (w, total_cols, make_number (width));
5155 FRAME_TOTAL_COLS (f) = width; 5156 FRAME_TOTAL_COLS (f) = width;
5156 adjust_glyphs (f); 5157 adjust_glyphs (f);
5157 clear_glyph_matrix (w->desired_matrix); 5158 clear_glyph_matrix (w->desired_matrix);
diff --git a/src/xmenu.c b/src/xmenu.c
index 17d493b6343..23f96dcebdc 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 = WVAR (XWINDOW (FRAME_SELECTED_WINDOW (f)), buffer); 988 buffer = WGET (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. */
@@ -2575,7 +2575,7 @@ xmenu_show (FRAME_PTR f, int x, int y, int for_click, int keymaps,
2575/* Detect if a dialog or menu has been posted. MSDOS has its own 2575/* Detect if a dialog or menu has been posted. MSDOS has its own
2576 implementation on msdos.c. */ 2576 implementation on msdos.c. */
2577 2577
2578int 2578int ATTRIBUTE_CONST
2579popup_activated (void) 2579popup_activated (void)
2580{ 2580{
2581 return popup_activated_flag; 2581 return popup_activated_flag;
diff --git a/src/xterm.c b/src/xterm.c
index ea74c2c86b6..771b68e1be0 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 (WVAR (w, frame))); 631 Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (XFRAME (WGET (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 (WVAR (w, frame)), 731 && (f = XFRAME (WGET (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 (WVAR (w, frame)); 3298 struct frame *f = XFRAME (WGET (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 (WVAR (w, vertical_scroll_bar))->dragging)) 4247 if (!NILP (XSCROLL_BAR (WGET (w, vertical_scroll_bar))->dragging))
4248 { 4248 {
4249 XSCROLL_BAR (WVAR (w, vertical_scroll_bar))->dragging = Qnil; 4249 XSCROLL_BAR (WGET (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 (WVAR (w, frame)); 4280 struct frame *f = XFRAME (WGET (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 (WVAR (w, frame)))); 4356 XtLastTimestampProcessed (FRAME_X_DISPLAY (XFRAME (WGET (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 (WVAR (w, frame)); 4957 struct frame *f = XFRAME (WGET (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;
@@ -5182,7 +5182,7 @@ x_scroll_bar_remove (struct scroll_bar *bar)
5182#endif 5182#endif
5183 5183
5184 /* Dissociate this scroll bar from its window. */ 5184 /* Dissociate this scroll bar from its window. */
5185 WVAR (XWINDOW (bar->window), vertical_scroll_bar) = Qnil; 5185 WSET (XWINDOW (bar->window), vertical_scroll_bar, Qnil);
5186 5186
5187 UNBLOCK_INPUT; 5187 UNBLOCK_INPUT;
5188} 5188}
@@ -5196,7 +5196,8 @@ 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 (WVAR (w, frame)); 5199 struct frame *f = XFRAME (WGET (w, frame));
5200 Lisp_Object barobj;
5200 struct scroll_bar *bar; 5201 struct scroll_bar *bar;
5201 int top, height, left, sb_left, width, sb_width; 5202 int top, height, left, sb_left, width, sb_width;
5202 int window_y, window_height; 5203 int window_y, window_height;
@@ -5247,7 +5248,7 @@ XTset_vertical_scroll_bar (struct window *w, int portion, int whole, int positio
5247#endif 5248#endif
5248 5249
5249 /* Does the scroll bar exist yet? */ 5250 /* Does the scroll bar exist yet? */
5250 if (NILP (WVAR (w, vertical_scroll_bar))) 5251 if (NILP (WGET (w, vertical_scroll_bar)))
5251 { 5252 {
5252 if (width > 0 && height > 0) 5253 if (width > 0 && height > 0)
5253 { 5254 {
@@ -5270,7 +5271,7 @@ XTset_vertical_scroll_bar (struct window *w, int portion, int whole, int positio
5270 /* It may just need to be moved and resized. */ 5271 /* It may just need to be moved and resized. */
5271 unsigned int mask = 0; 5272 unsigned int mask = 0;
5272 5273
5273 bar = XSCROLL_BAR (WVAR (w, vertical_scroll_bar)); 5274 bar = XSCROLL_BAR (WGET (w, vertical_scroll_bar));
5274 5275
5275 BLOCK_INPUT; 5276 BLOCK_INPUT;
5276 5277
@@ -5394,7 +5395,8 @@ XTset_vertical_scroll_bar (struct window *w, int portion, int whole, int positio
5394 } 5395 }
5395#endif /* not USE_TOOLKIT_SCROLL_BARS */ 5396#endif /* not USE_TOOLKIT_SCROLL_BARS */
5396 5397
5397 XSETVECTOR (WVAR (w, vertical_scroll_bar), bar); 5398 XSETVECTOR (barobj, bar);
5399 WSET (w, vertical_scroll_bar, barobj);
5398} 5400}
5399 5401
5400 5402
@@ -5439,10 +5441,10 @@ XTredeem_scroll_bar (struct window *window)
5439 Lisp_Object barobj; 5441 Lisp_Object barobj;
5440 5442
5441 /* 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. */
5442 if (NILP (WVAR (window, vertical_scroll_bar))) 5444 if (NILP (WGET (window, vertical_scroll_bar)))
5443 abort (); 5445 abort ();
5444 5446
5445 bar = XSCROLL_BAR (WVAR (window, vertical_scroll_bar)); 5447 bar = XSCROLL_BAR (WGET (window, vertical_scroll_bar));
5446 5448
5447 /* Unlink it from the condemned list. */ 5449 /* Unlink it from the condemned list. */
5448 f = XFRAME (WINDOW_FRAME (window)); 5450 f = XFRAME (WINDOW_FRAME (window));
@@ -5450,11 +5452,11 @@ XTredeem_scroll_bar (struct window *window)
5450 { 5452 {
5451 /* 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
5452 the lists. */ 5454 the lists. */
5453 if (EQ (FRAME_SCROLL_BARS (f), WVAR (window, vertical_scroll_bar))) 5455 if (EQ (FRAME_SCROLL_BARS (f), WGET (window, vertical_scroll_bar)))
5454 /* It's not condemned. Everything's fine. */ 5456 /* It's not condemned. Everything's fine. */
5455 return; 5457 return;
5456 else if (EQ (FRAME_CONDEMNED_SCROLL_BARS (f), 5458 else if (EQ (FRAME_CONDEMNED_SCROLL_BARS (f),
5457 WVAR (window, vertical_scroll_bar))) 5459 WGET (window, vertical_scroll_bar)))
5458 FSET (f, condemned_scroll_bars, bar->next); 5460 FSET (f, condemned_scroll_bars, bar->next);
5459 else 5461 else
5460 /* 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
@@ -5614,7 +5616,7 @@ x_scroll_bar_handle_click (struct scroll_bar *bar, XEvent *event, struct input_e
5614static void 5616static void
5615x_scroll_bar_note_movement (struct scroll_bar *bar, XEvent *event) 5617x_scroll_bar_note_movement (struct scroll_bar *bar, XEvent *event)
5616{ 5618{
5617 FRAME_PTR f = XFRAME (WVAR (XWINDOW (bar->window), frame)); 5619 FRAME_PTR f = XFRAME (WGET (XWINDOW (bar->window), frame));
5618 5620
5619 last_mouse_movement_time = event->xmotion.time; 5621 last_mouse_movement_time = event->xmotion.time;
5620 5622
@@ -6788,8 +6790,8 @@ handle_one_xevent (struct x_display_info *dpyinfo, XEvent *eventptr,
6788 create event iff we don't leave the 6790 create event iff we don't leave the
6789 selected frame. */ 6791 selected frame. */
6790 && (focus_follows_mouse 6792 && (focus_follows_mouse
6791 || (EQ (WVAR (XWINDOW (window), frame), 6793 || (EQ (WGET (XWINDOW (window), frame),
6792 WVAR (XWINDOW (selected_window), frame))))) 6794 WGET (XWINDOW (selected_window), frame)))))
6793 { 6795 {
6794 inev.ie.kind = SELECT_WINDOW_EVENT; 6796 inev.ie.kind = SELECT_WINDOW_EVENT;
6795 inev.ie.frame_or_window = window; 6797 inev.ie.frame_or_window = window;
@@ -7338,7 +7340,7 @@ x_draw_hollow_cursor (struct window *w, struct glyph_row *row)
7338static void 7340static void
7339x_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)
7340{ 7342{
7341 struct frame *f = XFRAME (WVAR (w, frame)); 7343 struct frame *f = XFRAME (WGET (w, frame));
7342 struct glyph *cursor_glyph; 7344 struct glyph *cursor_glyph;
7343 7345
7344 /* 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