aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert2012-08-17 18:42:52 -0700
committerPaul Eggert2012-08-17 18:42:52 -0700
commite8c17b818670b73acc2499b501aef3aab2ae8e58 (patch)
treec337fcdcfe153432f7af6ceccae7e09dc80f0285 /src
parent3f22b86fc7d9b66ff3e332b9a56350e93ddbd0aa (diff)
downloademacs-e8c17b818670b73acc2499b501aef3aab2ae8e58.tar.gz
emacs-e8c17b818670b73acc2499b501aef3aab2ae8e58.zip
* window.h (WSET): Remove.
Replace all uses with calls to new setter functions. Use INLINE_HEADER_BEGIN, INLINE_HEADER_END. (WINDOW_INLINE): New macro. (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev) (wset_redisplay_end_trigger, wset_top_line, wset_total_cols) (wset_total_lines, wset_vertical_scroll_bar) (wset_window_end_pos, wset_window_end_valid) (wset_window_end_vpos): New setter functions. * window.c (WINDOW_INLINE): Define to EXTERN_INLINE, so that the corresponding functions are compiled into code. (wset_combination_limit, wset_dedicated, wset_display_table) (wset_hchild, wset_left_fringe_width, wset_left_margin_cols) (wset_new_normal, wset_new_total, wset_next_buffers) (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm) (wset_prev_buffers, wset_right_fringe_width) (wset_right_margin_cols, wset_scroll_bar_width, wset_start) (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type) (wset_window_parameters): * xdisp.c (wset_base_line_number, wset_base_line_pos) (wset_column_number_displayed, wset_region_showing): New setter functions. Fixes: debbugs:12215
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog24
-rw-r--r--src/dispnew.c38
-rw-r--r--src/frame.c34
-rw-r--r--src/indent.c4
-rw-r--r--src/nsterm.m6
-rw-r--r--src/w32fns.c14
-rw-r--r--src/w32term.c4
-rw-r--r--src/window.c587
-rw-r--r--src/window.h80
-rw-r--r--src/xdisp.c176
-rw-r--r--src/xfns.c14
-rw-r--r--src/xterm.c4
12 files changed, 616 insertions, 369 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 2175f48dabf..2fc2ee5c079 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,29 @@
12012-08-18 Paul Eggert <eggert@cs.ucla.edu> 12012-08-18 Paul Eggert <eggert@cs.ucla.edu>
2 2
3 * window.h (WSET): Remove (Bug#12215).
4 Replace all uses with calls to new setter functions.
5 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
6 (WINDOW_INLINE): New macro.
7 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
8 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
9 (wset_total_lines, wset_vertical_scroll_bar)
10 (wset_window_end_pos, wset_window_end_valid)
11 (wset_window_end_vpos): New setter functions.
12 * window.c (WINDOW_INLINE):
13 Define to EXTERN_INLINE, so that the corresponding functions
14 are compiled into code.
15 (wset_combination_limit, wset_dedicated, wset_display_table)
16 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
17 (wset_new_normal, wset_new_total, wset_next_buffers)
18 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
19 (wset_prev_buffers, wset_right_fringe_width)
20 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
21 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
22 (wset_window_parameters):
23 * xdisp.c (wset_base_line_number, wset_base_line_pos)
24 (wset_column_number_displayed, wset_region_showing):
25 New setter functions.
26
3 * termhooks.h (TSET): Remove (Bug#12215). 27 * termhooks.h (TSET): Remove (Bug#12215).
4 Replace all uses with calls to new setter functions. 28 Replace all uses with calls to new setter functions.
5 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END. 29 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
diff --git a/src/dispnew.c b/src/dispnew.c
index 88672934b24..8db4f93dc70 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -621,7 +621,7 @@ adjust_glyph_matrix (struct window *w, struct glyph_matrix *matrix, int x, int y
621 are invalidated below. */ 621 are invalidated below. */
622 if (INTEGERP (w->window_end_vpos) 622 if (INTEGERP (w->window_end_vpos)
623 && XFASTINT (w->window_end_vpos) >= i) 623 && XFASTINT (w->window_end_vpos) >= i)
624 WSET (w, window_end_valid, Qnil); 624 wset_window_end_valid (w, Qnil);
625 625
626 while (i < matrix->nrows) 626 while (i < matrix->nrows)
627 matrix->rows[i++].enabled_p = 0; 627 matrix->rows[i++].enabled_p = 0;
@@ -878,7 +878,7 @@ clear_window_matrices (struct window *w, int desired_p)
878 else 878 else
879 { 879 {
880 clear_glyph_matrix (w->current_matrix); 880 clear_glyph_matrix (w->current_matrix);
881 WSET (w, window_end_valid, Qnil); 881 wset_window_end_valid (w, Qnil);
882 } 882 }
883 } 883 }
884 884
@@ -1887,14 +1887,14 @@ adjust_frame_glyphs_initially (void)
1887 int top_margin = FRAME_TOP_MARGIN (sf); 1887 int top_margin = FRAME_TOP_MARGIN (sf);
1888 1888
1889 /* Do it for the root window. */ 1889 /* Do it for the root window. */
1890 WSET (root, top_line, make_number (top_margin)); 1890 wset_top_line (root, make_number (top_margin));
1891 WSET (root, total_lines, make_number (frame_lines - 1 - top_margin)); 1891 wset_total_lines (root, make_number (frame_lines - 1 - top_margin));
1892 WSET (root, total_cols, make_number (frame_cols)); 1892 wset_total_cols (root, make_number (frame_cols));
1893 1893
1894 /* Do it for the mini-buffer window. */ 1894 /* Do it for the mini-buffer window. */
1895 WSET (mini, top_line, make_number (frame_lines - 1)); 1895 wset_top_line (mini, make_number (frame_lines - 1));
1896 WSET (mini, total_lines, make_number (1)); 1896 wset_total_lines (mini, make_number (1));
1897 WSET (mini, total_cols, make_number (frame_cols)); 1897 wset_total_cols (mini, make_number (frame_cols));
1898 1898
1899 adjust_frame_glyphs (sf); 1899 adjust_frame_glyphs (sf);
1900 glyphs_initialized_initially_p = 1; 1900 glyphs_initialized_initially_p = 1;
@@ -2169,7 +2169,7 @@ adjust_frame_glyphs_for_window_redisplay (struct frame *f)
2169 fset_menu_bar_window (f, make_window ()); 2169 fset_menu_bar_window (f, make_window ());
2170 w = XWINDOW (f->menu_bar_window); 2170 w = XWINDOW (f->menu_bar_window);
2171 XSETFRAME (frame, f); 2171 XSETFRAME (frame, f);
2172 WSET (w, frame, frame); 2172 wset_frame (w, frame);
2173 w->pseudo_window_p = 1; 2173 w->pseudo_window_p = 1;
2174 } 2174 }
2175 else 2175 else
@@ -2177,10 +2177,10 @@ adjust_frame_glyphs_for_window_redisplay (struct frame *f)
2177 2177
2178 /* Set window dimensions to frame dimensions and allocate or 2178 /* Set window dimensions to frame dimensions and allocate or
2179 adjust glyph matrices of W. */ 2179 adjust glyph matrices of W. */
2180 WSET (w, top_line, make_number (0)); 2180 wset_top_line (w, make_number (0));
2181 WSET (w, left_col, make_number (0)); 2181 wset_left_col (w, make_number (0));
2182 WSET (w, total_lines, make_number (FRAME_MENU_BAR_LINES (f))); 2182 wset_total_lines (w, make_number (FRAME_MENU_BAR_LINES (f)));
2183 WSET (w, total_cols, make_number (FRAME_TOTAL_COLS (f))); 2183 wset_total_cols (w, make_number (FRAME_TOTAL_COLS (f)));
2184 allocate_matrices_for_window_redisplay (w); 2184 allocate_matrices_for_window_redisplay (w);
2185 } 2185 }
2186#endif /* not USE_X_TOOLKIT && not USE_GTK */ 2186#endif /* not USE_X_TOOLKIT && not USE_GTK */
@@ -2197,16 +2197,16 @@ adjust_frame_glyphs_for_window_redisplay (struct frame *f)
2197 fset_tool_bar_window (f, make_window ()); 2197 fset_tool_bar_window (f, make_window ());
2198 w = XWINDOW (f->tool_bar_window); 2198 w = XWINDOW (f->tool_bar_window);
2199 XSETFRAME (frame, f); 2199 XSETFRAME (frame, f);
2200 WSET (w, frame, frame); 2200 wset_frame (w, frame);
2201 w->pseudo_window_p = 1; 2201 w->pseudo_window_p = 1;
2202 } 2202 }
2203 else 2203 else
2204 w = XWINDOW (f->tool_bar_window); 2204 w = XWINDOW (f->tool_bar_window);
2205 2205
2206 WSET (w, top_line, make_number (FRAME_MENU_BAR_LINES (f))); 2206 wset_top_line (w, make_number (FRAME_MENU_BAR_LINES (f)));
2207 WSET (w, left_col, make_number (0)); 2207 wset_left_col (w, make_number (0));
2208 WSET (w, total_lines, make_number (FRAME_TOOL_BAR_LINES (f))); 2208 wset_total_lines (w, make_number (FRAME_TOOL_BAR_LINES (f)));
2209 WSET (w, total_cols, make_number (FRAME_TOTAL_COLS (f))); 2209 wset_total_cols (w, make_number (FRAME_TOTAL_COLS (f)));
2210 allocate_matrices_for_window_redisplay (w); 2210 allocate_matrices_for_window_redisplay (w);
2211 } 2211 }
2212#endif 2212#endif
@@ -5744,7 +5744,7 @@ change_frame_size_1 (register struct frame *f, int newheight, int newwidth, int
5744 FrameCols (FRAME_TTY (f)) = newwidth; 5744 FrameCols (FRAME_TTY (f)) = newwidth;
5745 5745
5746 if (WINDOWP (f->tool_bar_window)) 5746 if (WINDOWP (f->tool_bar_window))
5747 WSET (XWINDOW (f->tool_bar_window), total_cols, make_number (newwidth)); 5747 wset_total_cols (XWINDOW (f->tool_bar_window), make_number (newwidth));
5748 } 5748 }
5749 5749
5750 FRAME_LINES (f) = newheight; 5750 FRAME_LINES (f) = newheight;
diff --git a/src/frame.c b/src/frame.c
index 77326df156e..217c20b9d5e 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -148,8 +148,8 @@ set_menu_bar_lines_1 (Lisp_Object window, int n)
148 struct window *w = XWINDOW (window); 148 struct window *w = XWINDOW (window);
149 149
150 w->last_modified = 0; 150 w->last_modified = 0;
151 WSET (w, top_line, make_number (XFASTINT (w->top_line) + n)); 151 wset_top_line (w, make_number (XFASTINT (w->top_line) + n));
152 WSET (w, total_lines, make_number (XFASTINT (w->total_lines) - n)); 152 wset_total_lines (w, make_number (XFASTINT (w->total_lines) - n));
153 153
154 /* Handle just the top child in a vertical split. */ 154 /* Handle just the top child in a vertical split. */
155 if (!NILP (w->vchild)) 155 if (!NILP (w->vchild))
@@ -305,20 +305,20 @@ make_frame (int mini_p)
305 if (mini_p) 305 if (mini_p)
306 { 306 {
307 mini_window = make_window (); 307 mini_window = make_window ();
308 WSET (XWINDOW (root_window), next, mini_window); 308 wset_next (XWINDOW (root_window), mini_window);
309 WSET (XWINDOW (mini_window), prev, root_window); 309 wset_prev (XWINDOW (mini_window), root_window);
310 XWINDOW (mini_window)->mini = 1; 310 XWINDOW (mini_window)->mini = 1;
311 WSET (XWINDOW (mini_window), frame, frame); 311 wset_frame (XWINDOW (mini_window), frame);
312 fset_minibuffer_window (f, mini_window); 312 fset_minibuffer_window (f, mini_window);
313 } 313 }
314 else 314 else
315 { 315 {
316 mini_window = Qnil; 316 mini_window = Qnil;
317 WSET (XWINDOW (root_window), next, Qnil); 317 wset_next (XWINDOW (root_window), Qnil);
318 fset_minibuffer_window (f, Qnil); 318 fset_minibuffer_window (f, Qnil);
319 } 319 }
320 320
321 WSET (XWINDOW (root_window), frame, frame); 321 wset_frame (XWINDOW (root_window), frame);
322 322
323 /* 10 is arbitrary, 323 /* 10 is arbitrary,
324 just so that there is "something there." 324 just so that there is "something there."
@@ -327,21 +327,21 @@ make_frame (int mini_p)
327 SET_FRAME_COLS (f, 10); 327 SET_FRAME_COLS (f, 10);
328 FRAME_LINES (f) = 10; 328 FRAME_LINES (f) = 10;
329 329
330 WSET (XWINDOW (root_window), total_cols, make_number (10)); 330 wset_total_cols (XWINDOW (root_window), make_number (10));
331 WSET (XWINDOW (root_window), total_lines, make_number (mini_p ? 9 : 10)); 331 wset_total_lines (XWINDOW (root_window), make_number (mini_p ? 9 : 10));
332 332
333 if (mini_p) 333 if (mini_p)
334 { 334 {
335 WSET (XWINDOW (mini_window), total_cols, make_number (10)); 335 wset_total_cols (XWINDOW (mini_window), make_number (10));
336 WSET (XWINDOW (mini_window), top_line, make_number (9)); 336 wset_top_line (XWINDOW (mini_window), make_number (9));
337 WSET (XWINDOW (mini_window), total_lines, make_number (1)); 337 wset_total_lines (XWINDOW (mini_window), make_number (1));
338 } 338 }
339 339
340 /* Choose a buffer for the frame's root window. */ 340 /* Choose a buffer for the frame's root window. */
341 { 341 {
342 Lisp_Object buf; 342 Lisp_Object buf;
343 343
344 WSET (XWINDOW (root_window), buffer, Qt); 344 wset_buffer (XWINDOW (root_window), Qt);
345 buf = Fcurrent_buffer (); 345 buf = Fcurrent_buffer ();
346 /* If buf is a 'hidden' buffer (i.e. one whose name starts with 346 /* If buf is a 'hidden' buffer (i.e. one whose name starts with
347 a space), try to find another one. */ 347 a space), try to find another one. */
@@ -360,7 +360,7 @@ make_frame (int mini_p)
360 360
361 if (mini_p) 361 if (mini_p)
362 { 362 {
363 WSET (XWINDOW (mini_window), buffer, Qt); 363 wset_buffer (XWINDOW (mini_window), Qt);
364 set_window_buffer (mini_window, 364 set_window_buffer (mini_window,
365 (NILP (Vminibuffer_list) 365 (NILP (Vminibuffer_list)
366 ? get_minibuffer (0) 366 ? get_minibuffer (0)
@@ -458,9 +458,9 @@ make_minibuffer_frame (void)
458 mini_window = f->root_window; 458 mini_window = f->root_window;
459 fset_minibuffer_window (f, mini_window); 459 fset_minibuffer_window (f, mini_window);
460 XWINDOW (mini_window)->mini = 1; 460 XWINDOW (mini_window)->mini = 1;
461 WSET (XWINDOW (mini_window), next, Qnil); 461 wset_next (XWINDOW (mini_window), Qnil);
462 WSET (XWINDOW (mini_window), prev, Qnil); 462 wset_prev (XWINDOW (mini_window), Qnil);
463 WSET (XWINDOW (mini_window), frame, frame); 463 wset_frame (XWINDOW (mini_window), frame);
464 464
465 /* Put the proper buffer in that window. */ 465 /* Put the proper buffer in that window. */
466 466
diff --git a/src/indent.c b/src/indent.c
index d4b15e876f3..84cda7b47fa 100644
--- a/src/indent.c
+++ b/src/indent.c
@@ -2003,7 +2003,7 @@ whether or not it is currently displayed in some window. */)
2003 old_buffer = w->buffer; 2003 old_buffer = w->buffer;
2004 old_charpos = XMARKER (w->pointm)->charpos; 2004 old_charpos = XMARKER (w->pointm)->charpos;
2005 old_bytepos = XMARKER (w->pointm)->bytepos; 2005 old_bytepos = XMARKER (w->pointm)->bytepos;
2006 WSET (w, buffer, Fcurrent_buffer ()); 2006 wset_buffer (w, Fcurrent_buffer ());
2007 set_marker_both (w->pointm, w->buffer, 2007 set_marker_both (w->pointm, w->buffer,
2008 BUF_PT (current_buffer), BUF_PT_BYTE (current_buffer)); 2008 BUF_PT (current_buffer), BUF_PT_BYTE (current_buffer));
2009 } 2009 }
@@ -2146,7 +2146,7 @@ whether or not it is currently displayed in some window. */)
2146 2146
2147 if (BUFFERP (old_buffer)) 2147 if (BUFFERP (old_buffer))
2148 { 2148 {
2149 WSET (w, buffer, old_buffer); 2149 wset_buffer (w, old_buffer);
2150 set_marker_both (w->pointm, w->buffer, 2150 set_marker_both (w->pointm, w->buffer,
2151 old_charpos, old_bytepos); 2151 old_charpos, old_bytepos);
2152 } 2152 }
diff --git a/src/nsterm.m b/src/nsterm.m
index 75877b1ee91..3ab9358467a 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -3698,7 +3698,7 @@ ns_set_vertical_scroll_bar (struct window *window,
3698 { 3698 {
3699 bar = XNS_SCROLL_BAR (window->vertical_scroll_bar); 3699 bar = XNS_SCROLL_BAR (window->vertical_scroll_bar);
3700 [bar removeFromSuperview]; 3700 [bar removeFromSuperview];
3701 WSET (window, vertical_scroll_bar, Qnil); 3701 wset_vertical_scroll_bar (window, Qnil);
3702 } 3702 }
3703 ns_clear_frame_area (f, sb_left, top, width, height); 3703 ns_clear_frame_area (f, sb_left, top, width, height);
3704 UNBLOCK_INPUT; 3704 UNBLOCK_INPUT;
@@ -3709,7 +3709,7 @@ ns_set_vertical_scroll_bar (struct window *window,
3709 { 3709 {
3710 ns_clear_frame_area (f, sb_left, top, width, height); 3710 ns_clear_frame_area (f, sb_left, top, width, height);
3711 bar = [[EmacsScroller alloc] initFrame: r window: win]; 3711 bar = [[EmacsScroller alloc] initFrame: r window: win];
3712 WSET (window, vertical_scroll_bar, make_save_value (bar, 0)); 3712 wset_vertical_scroll_bar (window, make_save_value (bar, 0));
3713 } 3713 }
3714 else 3714 else
3715 { 3715 {
@@ -6388,7 +6388,7 @@ not_in_argv (NSString *arg)
6388{ 6388{
6389 NSTRACE (EmacsScroller_dealloc); 6389 NSTRACE (EmacsScroller_dealloc);
6390 if (!NILP (win)) 6390 if (!NILP (win))
6391 WSET (XWINDOW (win), vertical_scroll_bar, Qnil); 6391 wset_vertical_scroll_bar (XWINDOW (win), Qnil);
6392 [super dealloc]; 6392 [super dealloc];
6393} 6393}
6394 6394
diff --git a/src/w32fns.c b/src/w32fns.c
index 3b35147d3ca..0156027a656 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -5647,8 +5647,8 @@ Text larger than the specified size is clipped. */)
5647 5647
5648 /* Set up the frame's root window. */ 5648 /* Set up the frame's root window. */
5649 w = XWINDOW (FRAME_ROOT_WINDOW (f)); 5649 w = XWINDOW (FRAME_ROOT_WINDOW (f));
5650 WSET (w, left_col, make_number (0)); 5650 wset_left_col (w, make_number (0));
5651 WSET (w, top_line, make_number (0)); 5651 wset_top_line (w, make_number (0));
5652 5652
5653 if (CONSP (Vx_max_tooltip_size) 5653 if (CONSP (Vx_max_tooltip_size)
5654 && INTEGERP (XCAR (Vx_max_tooltip_size)) 5654 && INTEGERP (XCAR (Vx_max_tooltip_size))
@@ -5656,13 +5656,13 @@ Text larger than the specified size is clipped. */)
5656 && INTEGERP (XCDR (Vx_max_tooltip_size)) 5656 && INTEGERP (XCDR (Vx_max_tooltip_size))
5657 && XINT (XCDR (Vx_max_tooltip_size)) > 0) 5657 && XINT (XCDR (Vx_max_tooltip_size)) > 0)
5658 { 5658 {
5659 WSET (w, total_cols, XCAR (Vx_max_tooltip_size)); 5659 wset_total_cols (w, XCAR (Vx_max_tooltip_size));
5660 WSET (w, total_lines, XCDR (Vx_max_tooltip_size)); 5660 wset_total_lines (w, XCDR (Vx_max_tooltip_size));
5661 } 5661 }
5662 else 5662 else
5663 { 5663 {
5664 WSET (w, total_cols, make_number (80)); 5664 wset_total_cols (w, make_number (80));
5665 WSET (w, total_lines, make_number (40)); 5665 wset_total_lines (w, make_number (40));
5666 } 5666 }
5667 5667
5668 FRAME_TOTAL_COLS (f) = XINT (w->total_cols); 5668 FRAME_TOTAL_COLS (f) = XINT (w->total_cols);
@@ -5733,7 +5733,7 @@ Text larger than the specified size is clipped. */)
5733 /* w->total_cols and FRAME_TOTAL_COLS want the width in columns, 5733 /* w->total_cols and FRAME_TOTAL_COLS want the width in columns,
5734 not in pixels. */ 5734 not in pixels. */
5735 width /= WINDOW_FRAME_COLUMN_WIDTH (w); 5735 width /= WINDOW_FRAME_COLUMN_WIDTH (w);
5736 WSET (w, total_cols, make_number (width)); 5736 wset_total_cols (w, make_number (width));
5737 FRAME_TOTAL_COLS (f) = width; 5737 FRAME_TOTAL_COLS (f) = width;
5738 adjust_glyphs (f); 5738 adjust_glyphs (f);
5739 w->pseudo_window_p = 1; 5739 w->pseudo_window_p = 1;
diff --git a/src/w32term.c b/src/w32term.c
index 9b7dc896aaf..6948a98998e 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -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 WSET (XWINDOW (bar->window), vertical_scroll_bar, Qnil); 3673 wset_vertical_scroll_bar (XWINDOW (bar->window), Qnil);
3674 3674
3675 UNBLOCK_INPUT; 3675 UNBLOCK_INPUT;
3676} 3676}
@@ -3808,7 +3808,7 @@ w32_set_vertical_scroll_bar (struct window *w,
3808 3808
3809 w32_set_scroll_bar_thumb (bar, portion, position, whole); 3809 w32_set_scroll_bar_thumb (bar, portion, position, whole);
3810 XSETVECTOR (barobj, bar); 3810 XSETVECTOR (barobj, bar);
3811 WSET (w, vertical_scroll_bar, barobj); 3811 wset_vertical_scroll_bar (w, barobj);
3812} 3812}
3813 3813
3814 3814
diff --git a/src/window.c b/src/window.c
index 140b925ed6d..bb601db1d4c 100644
--- a/src/window.c
+++ b/src/window.c
@@ -19,6 +19,9 @@ You should have received a copy of the GNU General Public License
19along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ 19along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
20 20
21#include <config.h> 21#include <config.h>
22
23#define WINDOW_INLINE EXTERN_INLINE
24
22#include <stdio.h> 25#include <stdio.h>
23#include <setjmp.h> 26#include <setjmp.h>
24 27
@@ -130,6 +133,118 @@ static int window_scroll_pixel_based_preserve_y;
130static EMACS_INT window_scroll_preserve_hpos; 133static EMACS_INT window_scroll_preserve_hpos;
131static EMACS_INT window_scroll_preserve_vpos; 134static EMACS_INT window_scroll_preserve_vpos;
132 135
136/* These setters are used only in this file, so they can be private. */
137static inline void
138wset_combination_limit (struct window *w, Lisp_Object val)
139{
140 w->combination_limit = val;
141}
142static inline void
143wset_dedicated (struct window *w, Lisp_Object val)
144{
145 w->dedicated = val;
146}
147static inline void
148wset_display_table (struct window *w, Lisp_Object val)
149{
150 w->display_table = val;
151}
152static inline void
153wset_hchild (struct window *w, Lisp_Object val)
154{
155 w->hchild = val;
156}
157static inline void
158wset_left_fringe_width (struct window *w, Lisp_Object val)
159{
160 w->left_fringe_width = val;
161}
162static inline void
163wset_left_margin_cols (struct window *w, Lisp_Object val)
164{
165 w->left_margin_cols = val;
166}
167static inline void
168wset_new_normal (struct window *w, Lisp_Object val)
169{
170 w->new_normal = val;
171}
172static inline void
173wset_new_total (struct window *w, Lisp_Object val)
174{
175 w->new_total = val;
176}
177static inline void
178wset_next_buffers (struct window *w, Lisp_Object val)
179{
180 w->next_buffers = val;
181}
182static inline void
183wset_normal_cols (struct window *w, Lisp_Object val)
184{
185 w->normal_cols = val;
186}
187static inline void
188wset_normal_lines (struct window *w, Lisp_Object val)
189{
190 w->normal_lines = val;
191}
192static inline void
193wset_parent (struct window *w, Lisp_Object val)
194{
195 w->parent = val;
196}
197static inline void
198wset_pointm (struct window *w, Lisp_Object val)
199{
200 w->pointm = val;
201}
202static inline void
203wset_prev_buffers (struct window *w, Lisp_Object val)
204{
205 w->prev_buffers = val;
206}
207static inline void
208wset_right_fringe_width (struct window *w, Lisp_Object val)
209{
210 w->right_fringe_width = val;
211}
212static inline void
213wset_right_margin_cols (struct window *w, Lisp_Object val)
214{
215 w->right_margin_cols = val;
216}
217static inline void
218wset_scroll_bar_width (struct window *w, Lisp_Object val)
219{
220 w->scroll_bar_width = val;
221}
222static inline void
223wset_start (struct window *w, Lisp_Object val)
224{
225 w->start = val;
226}
227static inline void
228wset_temslot (struct window *w, Lisp_Object val)
229{
230 w->temslot = val;
231}
232static inline void
233wset_vchild (struct window *w, Lisp_Object val)
234{
235 w->vchild = val;
236}
237static inline void
238wset_vertical_scroll_bar_type (struct window *w, Lisp_Object val)
239{
240 w->vertical_scroll_bar_type = val;
241}
242static inline void
243wset_window_parameters (struct window *w, Lisp_Object val)
244{
245 w->window_parameters = val;
246}
247
133struct window * 248struct window *
134decode_live_window (register Lisp_Object window) 249decode_live_window (register Lisp_Object window)
135{ 250{
@@ -514,7 +629,8 @@ never \(re-)combined with WINDOW's siblings. Other values are reserved
514for future use. */) 629for future use. */)
515 (Lisp_Object window, Lisp_Object limit) 630 (Lisp_Object window, Lisp_Object limit)
516{ 631{
517 return WSET (decode_valid_window (window), combination_limit, limit); 632 wset_combination_limit (decode_valid_window (window), limit);
633 return limit;
518} 634}
519 635
520DEFUN ("window-use-time", Fwindow_use_time, Swindow_use_time, 0, 1, 0, 636DEFUN ("window-use-time", Fwindow_use_time, Swindow_use_time, 0, 1, 0,
@@ -753,7 +869,8 @@ with two arguments: WINDOW, and the end trigger value. Afterwards the
753end-trigger value is reset to nil. */) 869end-trigger value is reset to nil. */)
754 (register Lisp_Object window, Lisp_Object value) 870 (register Lisp_Object window, Lisp_Object value)
755{ 871{
756 return WSET (decode_live_window (window), redisplay_end_trigger, value); 872 wset_redisplay_end_trigger (decode_live_window (window), value);
873 return value;
757} 874}
758 875
759DEFUN ("window-edges", Fwindow_edges, Swindow_edges, 0, 1, 0, 876DEFUN ("window-edges", Fwindow_edges, Swindow_edges, 0, 1, 0,
@@ -1674,7 +1791,8 @@ buffer. If and when `set-window-buffer' displays another buffer in a
1674window, it also makes sure that the window is no more dedicated. */) 1791window, it also makes sure that the window is no more dedicated. */)
1675 (Lisp_Object window, Lisp_Object flag) 1792 (Lisp_Object window, Lisp_Object flag)
1676{ 1793{
1677 return WSET (decode_live_window (window), dedicated, flag); 1794 wset_dedicated (decode_live_window (window), flag);
1795 return flag;
1678} 1796}
1679 1797
1680DEFUN ("window-prev-buffers", Fwindow_prev_buffers, Swindow_prev_buffers, 1798DEFUN ("window-prev-buffers", Fwindow_prev_buffers, Swindow_prev_buffers,
@@ -1700,7 +1818,8 @@ where BUFFER is a buffer, WINDOW-START is the start position of the
1700window for that buffer, and POS is a window-specific point value. */) 1818window for that buffer, and POS is a window-specific point value. */)
1701 (Lisp_Object window, Lisp_Object prev_buffers) 1819 (Lisp_Object window, Lisp_Object prev_buffers)
1702{ 1820{
1703 return WSET (decode_live_window (window), prev_buffers, prev_buffers); 1821 wset_prev_buffers (decode_live_window (window), prev_buffers);
1822 return prev_buffers;
1704} 1823}
1705 1824
1706DEFUN ("window-next-buffers", Fwindow_next_buffers, Swindow_next_buffers, 1825DEFUN ("window-next-buffers", Fwindow_next_buffers, Swindow_next_buffers,
@@ -1719,7 +1838,8 @@ WINDOW must be a live window and defaults to the selected one.
1719NEXT-BUFFERS should be a list of buffers. */) 1838NEXT-BUFFERS should be a list of buffers. */)
1720 (Lisp_Object window, Lisp_Object next_buffers) 1839 (Lisp_Object window, Lisp_Object next_buffers)
1721{ 1840{
1722 return WSET (decode_live_window (window), next_buffers, next_buffers); 1841 wset_next_buffers (decode_live_window (window), next_buffers);
1842 return next_buffers;
1723} 1843}
1724 1844
1725DEFUN ("window-parameters", Fwindow_parameters, Swindow_parameters, 1845DEFUN ("window-parameters", Fwindow_parameters, Swindow_parameters,
@@ -1756,8 +1876,8 @@ Return VALUE. */)
1756 1876
1757 old_alist_elt = Fassq (parameter, w->window_parameters); 1877 old_alist_elt = Fassq (parameter, w->window_parameters);
1758 if (NILP (old_alist_elt)) 1878 if (NILP (old_alist_elt))
1759 WSET (w, window_parameters, 1879 wset_window_parameters
1760 Fcons (Fcons (parameter, value), w->window_parameters)); 1880 (w, Fcons (Fcons (parameter, value), w->window_parameters));
1761 else 1881 else
1762 Fsetcdr (old_alist_elt, value); 1882 Fsetcdr (old_alist_elt, value);
1763 return value; 1883 return value;
@@ -1802,7 +1922,8 @@ DEFUN ("set-window-display-table", Fset_window_display_table, Sset_window_displa
1802WINDOW must be a live window and defaults to the selected one. */) 1922WINDOW must be a live window and defaults to the selected one. */)
1803 (register Lisp_Object window, Lisp_Object table) 1923 (register Lisp_Object window, Lisp_Object table)
1804{ 1924{
1805 return WSET (decode_live_window (window), display_table, table); 1925 wset_display_table (decode_live_window (window), table);
1926 return table;
1806} 1927}
1807 1928
1808/* Record info on buffer window W is displaying 1929/* Record info on buffer window W is displaying
@@ -1870,14 +1991,14 @@ replace_window (Lisp_Object old, Lisp_Object new, int setflag)
1870 1991
1871 if (setflag) 1992 if (setflag)
1872 { 1993 {
1873 WSET (n, left_col, o->left_col); 1994 wset_left_col (n, o->left_col);
1874 WSET (n, top_line, o->top_line); 1995 wset_top_line (n, o->top_line);
1875 WSET (n, total_cols, o->total_cols); 1996 wset_total_cols (n, o->total_cols);
1876 WSET (n, total_lines, o->total_lines); 1997 wset_total_lines (n, o->total_lines);
1877 WSET (n, normal_cols, o->normal_cols); 1998 wset_normal_cols (n, o->normal_cols);
1878 WSET (o, normal_cols, make_float (1.0)); 1999 wset_normal_cols (o, make_float (1.0));
1879 WSET (n, normal_lines, o->normal_lines); 2000 wset_normal_lines (n, o->normal_lines);
1880 WSET (o, normal_lines, make_float (1.0)); 2001 wset_normal_lines (o, make_float (1.0));
1881 n->desired_matrix = n->current_matrix = 0; 2002 n->desired_matrix = n->current_matrix = 0;
1882 n->vscroll = 0; 2003 n->vscroll = 0;
1883 memset (&n->cursor, 0, sizeof (n->cursor)); 2004 memset (&n->cursor, 0, sizeof (n->cursor));
@@ -1887,30 +2008,30 @@ replace_window (Lisp_Object old, Lisp_Object new, int setflag)
1887 n->phys_cursor_width = -1; 2008 n->phys_cursor_width = -1;
1888 n->must_be_updated_p = 0; 2009 n->must_be_updated_p = 0;
1889 n->pseudo_window_p = 0; 2010 n->pseudo_window_p = 0;
1890 WSET (n, window_end_vpos, make_number (0)); 2011 wset_window_end_vpos (n, make_number (0));
1891 WSET (n, window_end_pos, make_number (0)); 2012 wset_window_end_pos (n, make_number (0));
1892 WSET (n, window_end_valid, Qnil); 2013 wset_window_end_valid (n, Qnil);
1893 n->frozen_window_start_p = 0; 2014 n->frozen_window_start_p = 0;
1894 } 2015 }
1895 2016
1896 tem = o->next; 2017 tem = o->next;
1897 WSET (n, next, tem); 2018 wset_next (n, tem);
1898 if (!NILP (tem)) 2019 if (!NILP (tem))
1899 WSET (XWINDOW (tem), prev, new); 2020 wset_prev (XWINDOW (tem), new);
1900 2021
1901 tem = o->prev; 2022 tem = o->prev;
1902 WSET (n, prev, tem); 2023 wset_prev (n, tem);
1903 if (!NILP (tem)) 2024 if (!NILP (tem))
1904 WSET (XWINDOW (tem), next, new); 2025 wset_next (XWINDOW (tem), new);
1905 2026
1906 tem = o->parent; 2027 tem = o->parent;
1907 WSET (n, parent, tem); 2028 wset_parent (n, tem);
1908 if (!NILP (tem)) 2029 if (!NILP (tem))
1909 { 2030 {
1910 if (EQ (XWINDOW (tem)->vchild, old)) 2031 if (EQ (XWINDOW (tem)->vchild, old))
1911 WSET (XWINDOW (tem), vchild, new); 2032 wset_vchild (XWINDOW (tem), new);
1912 if (EQ (XWINDOW (tem)->hchild, old)) 2033 if (EQ (XWINDOW (tem)->hchild, old))
1913 WSET (XWINDOW (tem), hchild, new); 2034 wset_hchild (XWINDOW (tem), new);
1914 } 2035 }
1915} 2036}
1916 2037
@@ -1943,34 +2064,34 @@ recombine_windows (Lisp_Object window)
1943 assign new normal sizes. */ 2064 assign new normal sizes. */
1944 if (NILP (w->prev)) 2065 if (NILP (w->prev))
1945 if (horflag) 2066 if (horflag)
1946 WSET (p, hchild, child); 2067 wset_hchild (p, child);
1947 else 2068 else
1948 WSET (p, vchild, child); 2069 wset_vchild (p, child);
1949 else 2070 else
1950 { 2071 {
1951 WSET (c, prev, w->prev); 2072 wset_prev (c, w->prev);
1952 WSET (XWINDOW (w->prev), next, child); 2073 wset_next (XWINDOW (w->prev), child);
1953 } 2074 }
1954 2075
1955 while (c) 2076 while (c)
1956 { 2077 {
1957 WSET (c, parent, parent); 2078 wset_parent (c, parent);
1958 2079
1959 if (horflag) 2080 if (horflag)
1960 WSET (c, normal_cols, 2081 wset_normal_cols (c,
1961 make_float (XFLOATINT (c->total_cols) 2082 make_float (XFLOATINT (c->total_cols)
1962 / XFLOATINT (p->total_cols))); 2083 / XFLOATINT (p->total_cols)));
1963 else 2084 else
1964 WSET (c, normal_lines, 2085 wset_normal_lines (c,
1965 make_float (XFLOATINT (c->total_lines) 2086 make_float (XFLOATINT (c->total_lines)
1966 / XFLOATINT (p->total_lines))); 2087 / XFLOATINT (p->total_lines)));
1967 2088
1968 if (NILP (c->next)) 2089 if (NILP (c->next))
1969 { 2090 {
1970 if (!NILP (w->next)) 2091 if (!NILP (w->next))
1971 { 2092 {
1972 WSET (c, next, w->next); 2093 wset_next (c, w->next);
1973 WSET (XWINDOW (c->next), prev, child); 2094 wset_prev (XWINDOW (c->next), child);
1974 } 2095 }
1975 2096
1976 c = 0; 2097 c = 0;
@@ -1983,8 +2104,8 @@ recombine_windows (Lisp_Object window)
1983 } 2104 }
1984 2105
1985 /* WINDOW can be deleted now. */ 2106 /* WINDOW can be deleted now. */
1986 WSET (w, vchild, Qnil); 2107 wset_vchild (w, Qnil);
1987 WSET (w, hchild, Qnil); 2108 wset_hchild (w, Qnil);
1988 } 2109 }
1989 } 2110 }
1990} 2111}
@@ -2505,7 +2626,7 @@ window_loop (enum window_loop type, Lisp_Object obj, int mini, Lisp_Object frame
2505 if (EQ (w->buffer, obj)) 2626 if (EQ (w->buffer, obj))
2506 { 2627 {
2507 /* Undedicate WINDOW. */ 2628 /* Undedicate WINDOW. */
2508 WSET (w, dedicated, Qnil); 2629 wset_dedicated (w, Qnil);
2509 /* Make WINDOW show the buffer returned by 2630 /* Make WINDOW show the buffer returned by
2510 other_buffer_safely, don't run any hooks. */ 2631 other_buffer_safely, don't run any hooks. */
2511 set_window_buffer 2632 set_window_buffer
@@ -2727,7 +2848,7 @@ window-start value is reasonable when this function is called. */)
2727 /* Resize child windows vertically. */ 2848 /* Resize child windows vertically. */
2728 XSETINT (delta, XINT (r->total_lines) 2849 XSETINT (delta, XINT (r->total_lines)
2729 - XINT (w->total_lines)); 2850 - XINT (w->total_lines));
2730 WSET (w, top_line, r->top_line); 2851 wset_top_line (w, r->top_line);
2731 resize_root_window (window, delta, Qnil, Qnil); 2852 resize_root_window (window, delta, Qnil, Qnil);
2732 if (window_resize_check (w, 0)) 2853 if (window_resize_check (w, 0))
2733 window_resize_apply (w, 0); 2854 window_resize_apply (w, 0);
@@ -2743,10 +2864,10 @@ window-start value is reasonable when this function is called. */)
2743 /* Resize child windows horizontally. */ 2864 /* Resize child windows horizontally. */
2744 if (!resize_failed) 2865 if (!resize_failed)
2745 { 2866 {
2746 WSET (w, left_col, r->left_col); 2867 wset_left_col (w, r->left_col);
2747 XSETINT (delta, 2868 XSETINT (delta,
2748 XINT (r->total_cols) - XINT (w->total_cols)); 2869 XINT (r->total_cols) - XINT (w->total_cols));
2749 WSET (w, left_col, r->left_col); 2870 wset_left_col (w, r->left_col);
2750 resize_root_window (window, delta, Qt, Qnil); 2871 resize_root_window (window, delta, Qt, Qnil);
2751 if (window_resize_check (w, 1)) 2872 if (window_resize_check (w, 1))
2752 window_resize_apply (w, 1); 2873 window_resize_apply (w, 1);
@@ -2774,32 +2895,32 @@ window-start value is reasonable when this function is called. */)
2774 { 2895 {
2775 sibling = w->prev; 2896 sibling = w->prev;
2776 s = XWINDOW (sibling); 2897 s = XWINDOW (sibling);
2777 WSET (s, next, w->next); 2898 wset_next (s, w->next);
2778 if (!NILP (s->next)) 2899 if (!NILP (s->next))
2779 WSET (XWINDOW (s->next), prev, sibling); 2900 wset_prev (XWINDOW (s->next), sibling);
2780 } 2901 }
2781 else 2902 else
2782 /* Get SIBLING below (on the right of) WINDOW. */ 2903 /* Get SIBLING below (on the right of) WINDOW. */
2783 { 2904 {
2784 sibling = w->next; 2905 sibling = w->next;
2785 s = XWINDOW (sibling); 2906 s = XWINDOW (sibling);
2786 WSET (s, prev, Qnil); 2907 wset_prev (s, Qnil);
2787 if (!NILP (XWINDOW (w->parent)->vchild)) 2908 if (!NILP (XWINDOW (w->parent)->vchild))
2788 WSET (XWINDOW (w->parent), vchild, sibling); 2909 wset_vchild (XWINDOW (w->parent), sibling);
2789 else 2910 else
2790 WSET (XWINDOW (w->parent), hchild, sibling); 2911 wset_hchild (XWINDOW (w->parent), sibling);
2791 } 2912 }
2792 2913
2793 /* Delete ROOT and all child windows of ROOT. */ 2914 /* Delete ROOT and all child windows of ROOT. */
2794 if (!NILP (r->vchild)) 2915 if (!NILP (r->vchild))
2795 { 2916 {
2796 delete_all_child_windows (r->vchild); 2917 delete_all_child_windows (r->vchild);
2797 WSET (r, vchild, Qnil); 2918 wset_vchild (r, Qnil);
2798 } 2919 }
2799 else if (!NILP (r->hchild)) 2920 else if (!NILP (r->hchild))
2800 { 2921 {
2801 delete_all_child_windows (r->hchild); 2922 delete_all_child_windows (r->hchild);
2802 WSET (r, hchild, Qnil); 2923 wset_hchild (r, Qnil);
2803 } 2924 }
2804 2925
2805 replace_window (root, window, 1); 2926 replace_window (root, window, 1);
@@ -2826,7 +2947,7 @@ window-start value is reasonable when this function is called. */)
2826 pos = *vmotion (startpos, -top, w); 2947 pos = *vmotion (startpos, -top, w);
2827 2948
2828 set_marker_both (w->start, w->buffer, pos.bufpos, pos.bytepos); 2949 set_marker_both (w->start, w->buffer, pos.bufpos, pos.bytepos);
2829 WSET (w, window_end_valid, Qnil); 2950 wset_window_end_valid (w, Qnil);
2830 w->start_at_line_beg = (pos.bytepos == BEGV_BYTE 2951 w->start_at_line_beg = (pos.bytepos == BEGV_BYTE
2831 || FETCH_BYTE (pos.bytepos - 1) == '\n'); 2952 || FETCH_BYTE (pos.bytepos - 1) == '\n');
2832 /* We need to do this, so that the window-scroll-functions 2953 /* We need to do this, so that the window-scroll-functions
@@ -2917,14 +3038,14 @@ adjust_window_margins (struct window *w)
2917 { 3038 {
2918 if (WINDOW_LEFT_MARGIN_COLS (w) > 0) 3039 if (WINDOW_LEFT_MARGIN_COLS (w) > 0)
2919 { 3040 {
2920 WSET (w, left_margin_cols, make_number (margin_cols / 2)); 3041 wset_left_margin_cols (w, make_number (margin_cols / 2));
2921 WSET (w, right_margin_cols, make_number (margin_cols / 2)); 3042 wset_right_margin_cols (w, make_number (margin_cols / 2));
2922 } 3043 }
2923 else 3044 else
2924 WSET (w, right_margin_cols, make_number (margin_cols)); 3045 wset_right_margin_cols (w, make_number (margin_cols));
2925 } 3046 }
2926 else 3047 else
2927 WSET (w, left_margin_cols, make_number (margin_cols)); 3048 wset_left_margin_cols (w, make_number (margin_cols));
2928 return 1; 3049 return 1;
2929} 3050}
2930 3051
@@ -3024,7 +3145,7 @@ set_window_buffer (Lisp_Object window, Lisp_Object buffer, int run_hooks_p, int
3024 ptrdiff_t count = SPECPDL_INDEX (); 3145 ptrdiff_t count = SPECPDL_INDEX ();
3025 int samebuf = EQ (buffer, w->buffer); 3146 int samebuf = EQ (buffer, w->buffer);
3026 3147
3027 WSET (w, buffer, buffer); 3148 wset_buffer (w, buffer);
3028 3149
3029 if (EQ (window, selected_window)) 3150 if (EQ (window, selected_window))
3030 BSET (b, last_selected_window, window); 3151 BSET (b, last_selected_window, window);
@@ -3037,10 +3158,10 @@ set_window_buffer (Lisp_Object window, Lisp_Object buffer, int run_hooks_p, int
3037 BSET (b, display_count, make_number (XINT (BVAR (b, display_count)) + 1)); 3158 BSET (b, display_count, make_number (XINT (BVAR (b, display_count)) + 1));
3038 BSET (b, display_time, Fcurrent_time ()); 3159 BSET (b, display_time, Fcurrent_time ());
3039 3160
3040 WSET (w, window_end_pos, make_number (0)); 3161 wset_window_end_pos (w, make_number (0));
3041 WSET (w, window_end_vpos, make_number (0)); 3162 wset_window_end_vpos (w, make_number (0));
3042 memset (&w->last_cursor, 0, sizeof w->last_cursor); 3163 memset (&w->last_cursor, 0, sizeof w->last_cursor);
3043 WSET (w, window_end_valid, Qnil); 3164 wset_window_end_valid (w, Qnil);
3044 if (!(keep_margins_p && samebuf)) 3165 if (!(keep_margins_p && samebuf))
3045 { /* If we're not actually changing the buffer, don't reset hscroll and 3166 { /* If we're not actually changing the buffer, don't reset hscroll and
3046 vscroll. This case happens for example when called from 3167 vscroll. This case happens for example when called from
@@ -3085,8 +3206,8 @@ set_window_buffer (Lisp_Object window, Lisp_Object buffer, int run_hooks_p, int
3085 Lisp_Object save_left = w->left_margin_cols; 3206 Lisp_Object save_left = w->left_margin_cols;
3086 Lisp_Object save_right = w->right_margin_cols; 3207 Lisp_Object save_right = w->right_margin_cols;
3087 3208
3088 WSET (w, left_margin_cols, Qnil); 3209 wset_left_margin_cols (w, Qnil);
3089 WSET (w, right_margin_cols, Qnil); 3210 wset_right_margin_cols (w, Qnil);
3090 3211
3091 Fset_window_fringes (window, 3212 Fset_window_fringes (window,
3092 BVAR (b, left_fringe_width), BVAR (b, right_fringe_width), 3213 BVAR (b, left_fringe_width), BVAR (b, right_fringe_width),
@@ -3096,8 +3217,8 @@ set_window_buffer (Lisp_Object window, Lisp_Object buffer, int run_hooks_p, int
3096 BVAR (b, scroll_bar_width), 3217 BVAR (b, scroll_bar_width),
3097 BVAR (b, vertical_scroll_bar_type), Qnil); 3218 BVAR (b, vertical_scroll_bar_type), Qnil);
3098 3219
3099 WSET (w, left_margin_cols, save_left); 3220 wset_left_margin_cols (w, save_left);
3100 WSET (w, right_margin_cols, save_right); 3221 wset_right_margin_cols (w, save_right);
3101 3222
3102 Fset_window_margins (window, 3223 Fset_window_margins (window,
3103 BVAR (b, left_margin_cols), BVAR (b, right_margin_cols)); 3224 BVAR (b, left_margin_cols), BVAR (b, right_margin_cols));
@@ -3156,7 +3277,7 @@ This function runs `window-scroll-functions' before running
3156 else 3277 else
3157 /* WINDOW is weakly dedicated to its buffer, reset 3278 /* WINDOW is weakly dedicated to its buffer, reset
3158 dedication. */ 3279 dedication. */
3159 WSET (w, dedicated, Qnil); 3280 wset_dedicated (w, Qnil);
3160 3281
3161 call1 (Qrecord_window_buffer, window); 3282 call1 (Qrecord_window_buffer, window);
3162 } 3283 }
@@ -3302,17 +3423,17 @@ make_parent_window (Lisp_Object window, int horflag)
3302 3423
3303 replace_window (window, parent, 1); 3424 replace_window (window, parent, 1);
3304 3425
3305 WSET (o, next, Qnil); 3426 wset_next (o, Qnil);
3306 WSET (o, prev, Qnil); 3427 wset_prev (o, Qnil);
3307 WSET (o, parent, parent); 3428 wset_parent (o, parent);
3308 3429
3309 WSET (p, hchild, horflag ? window : Qnil); 3430 wset_hchild (p, horflag ? window : Qnil);
3310 WSET (p, vchild, horflag ? Qnil : window); 3431 wset_vchild (p, horflag ? Qnil : window);
3311 WSET (p, start, Qnil); 3432 wset_start (p, Qnil);
3312 WSET (p, pointm, Qnil); 3433 wset_pointm (p, Qnil);
3313 WSET (p, buffer, Qnil); 3434 wset_buffer (p, Qnil);
3314 WSET (p, combination_limit, Qnil); 3435 wset_combination_limit (p, Qnil);
3315 WSET (p, window_parameters, Qnil); 3436 wset_window_parameters (p, Qnil);
3316} 3437}
3317 3438
3318/* Make new window from scratch. */ 3439/* Make new window from scratch. */
@@ -3325,19 +3446,19 @@ make_window (void)
3325 w = allocate_window (); 3446 w = allocate_window ();
3326 /* Initialize Lisp data. Note that allocate_window initializes all 3447 /* Initialize Lisp data. Note that allocate_window initializes all
3327 Lisp data to nil, so do it only for slots which should not be nil. */ 3448 Lisp data to nil, so do it only for slots which should not be nil. */
3328 WSET (w, left_col, make_number (0)); 3449 wset_left_col (w, make_number (0));
3329 WSET (w, top_line, make_number (0)); 3450 wset_top_line (w, make_number (0));
3330 WSET (w, total_lines, make_number (0)); 3451 wset_total_lines (w, make_number (0));
3331 WSET (w, total_cols, make_number (0)); 3452 wset_total_cols (w, make_number (0));
3332 WSET (w, normal_lines, make_float (1.0)); 3453 wset_normal_lines (w, make_float (1.0));
3333 WSET (w, normal_cols, make_float (1.0)); 3454 wset_normal_cols (w, make_float (1.0));
3334 WSET (w, new_total, make_number (0)); 3455 wset_new_total (w, make_number (0));
3335 WSET (w, new_normal, make_number (0)); 3456 wset_new_normal (w, make_number (0));
3336 WSET (w, start, Fmake_marker ()); 3457 wset_start (w, Fmake_marker ());
3337 WSET (w, pointm, Fmake_marker ()); 3458 wset_pointm (w, Fmake_marker ());
3338 WSET (w, vertical_scroll_bar_type, Qt); 3459 wset_vertical_scroll_bar_type (w, Qt);
3339 WSET (w, window_end_pos, make_number (0)); 3460 wset_window_end_pos (w, make_number (0));
3340 WSET (w, window_end_vpos, make_number (0)); 3461 wset_window_end_vpos (w, make_number (0));
3341 3462
3342 /* Initialize non-Lisp data. Note that allocate_window zeroes out all 3463 /* Initialize non-Lisp data. Note that allocate_window zeroes out all
3343 non-Lisp data, so do it only for slots which should not be zero. */ 3464 non-Lisp data, so do it only for slots which should not be zero. */
@@ -3368,9 +3489,9 @@ Note: This function does not operate on any child windows of WINDOW. */)
3368 3489
3369 CHECK_NUMBER (size); 3490 CHECK_NUMBER (size);
3370 if (NILP (add)) 3491 if (NILP (add))
3371 WSET (w, new_total, size); 3492 wset_new_total (w, size);
3372 else 3493 else
3373 WSET (w, new_total, make_number (XINT (w->new_total) + XINT (size))); 3494 wset_new_total (w, make_number (XINT (w->new_total) + XINT (size)));
3374 3495
3375 return w->new_total; 3496 return w->new_total;
3376} 3497}
@@ -3383,7 +3504,8 @@ Return SIZE.
3383Note: This function does not operate on any child windows of WINDOW. */) 3504Note: This function does not operate on any child windows of WINDOW. */)
3384 (Lisp_Object window, Lisp_Object size) 3505 (Lisp_Object window, Lisp_Object size)
3385{ 3506{
3386 return WSET (decode_valid_window (window), new_normal, size); 3507 wset_new_normal (decode_valid_window (window), size);
3508 return size;
3387} 3509}
3388 3510
3389/* Return 1 if setting w->total_lines (w->total_cols if HORFLAG is 3511/* Return 1 if setting w->total_lines (w->total_cols if HORFLAG is
@@ -3484,17 +3606,17 @@ window_resize_apply (struct window *w, int horflag)
3484 parent window has been set *before*. */ 3606 parent window has been set *before*. */
3485 if (horflag) 3607 if (horflag)
3486 { 3608 {
3487 WSET (w, total_cols, w->new_total); 3609 wset_total_cols (w, w->new_total);
3488 if (NUMBERP (w->new_normal)) 3610 if (NUMBERP (w->new_normal))
3489 WSET (w, normal_cols, w->new_normal); 3611 wset_normal_cols (w, w->new_normal);
3490 3612
3491 pos = XINT (w->left_col); 3613 pos = XINT (w->left_col);
3492 } 3614 }
3493 else 3615 else
3494 { 3616 {
3495 WSET (w, total_lines, w->new_total); 3617 wset_total_lines (w, w->new_total);
3496 if (NUMBERP (w->new_normal)) 3618 if (NUMBERP (w->new_normal))
3497 WSET (w, normal_lines, w->new_normal); 3619 wset_normal_lines (w, w->new_normal);
3498 3620
3499 pos = XINT (w->top_line); 3621 pos = XINT (w->top_line);
3500 } 3622 }
@@ -3506,9 +3628,9 @@ window_resize_apply (struct window *w, int horflag)
3506 while (c) 3628 while (c)
3507 { 3629 {
3508 if (horflag) 3630 if (horflag)
3509 WSET (c, left_col, make_number (pos)); 3631 wset_left_col (c, make_number (pos));
3510 else 3632 else
3511 WSET (c, top_line, make_number (pos)); 3633 wset_top_line (c, make_number (pos));
3512 window_resize_apply (c, horflag); 3634 window_resize_apply (c, horflag);
3513 if (!horflag) 3635 if (!horflag)
3514 pos = pos + XINT (c->total_lines); 3636 pos = pos + XINT (c->total_lines);
@@ -3522,9 +3644,9 @@ window_resize_apply (struct window *w, int horflag)
3522 while (c) 3644 while (c)
3523 { 3645 {
3524 if (horflag) 3646 if (horflag)
3525 WSET (c, left_col, make_number (pos)); 3647 wset_left_col (c, make_number (pos));
3526 else 3648 else
3527 WSET (c, top_line, make_number (pos)); 3649 wset_top_line (c, make_number (pos));
3528 window_resize_apply (c, horflag); 3650 window_resize_apply (c, horflag);
3529 if (horflag) 3651 if (horflag)
3530 pos = pos + XINT (c->total_cols); 3652 pos = pos + XINT (c->total_cols);
@@ -3605,13 +3727,13 @@ resize_frame_windows (struct frame *f, int size, int horflag)
3605 - ((FRAME_HAS_MINIBUF_P (f) && !FRAME_MINIBUF_ONLY_P (f)) 3727 - ((FRAME_HAS_MINIBUF_P (f) && !FRAME_MINIBUF_ONLY_P (f))
3606 ? 1 : 0))); 3728 ? 1 : 0)));
3607 3729
3608 WSET (r, top_line, make_number (FRAME_TOP_MARGIN (f))); 3730 wset_top_line (r, make_number (FRAME_TOP_MARGIN (f)));
3609 if (NILP (r->vchild) && NILP (r->hchild)) 3731 if (NILP (r->vchild) && NILP (r->hchild))
3610 /* For a leaf root window just set the size. */ 3732 /* For a leaf root window just set the size. */
3611 if (horflag) 3733 if (horflag)
3612 WSET (r, total_cols, make_number (new_size)); 3734 wset_total_cols (r, make_number (new_size));
3613 else 3735 else
3614 WSET (r, total_lines, make_number (new_size)); 3736 wset_total_lines (r, make_number (new_size));
3615 else 3737 else
3616 { 3738 {
3617 /* old_size is the old size of the frame's root window. */ 3739 /* old_size is the old size of the frame's root window. */
@@ -3646,9 +3768,9 @@ resize_frame_windows (struct frame *f, int size, int horflag)
3646 root = f->selected_window; 3768 root = f->selected_window;
3647 Fdelete_other_windows_internal (root, Qnil); 3769 Fdelete_other_windows_internal (root, Qnil);
3648 if (horflag) 3770 if (horflag)
3649 WSET (XWINDOW (root), total_cols, make_number (new_size)); 3771 wset_total_cols (XWINDOW (root), make_number (new_size));
3650 else 3772 else
3651 WSET (XWINDOW (root), total_lines, make_number (new_size)); 3773 wset_total_lines (XWINDOW (root), make_number (new_size));
3652 } 3774 }
3653 } 3775 }
3654 } 3776 }
@@ -3658,13 +3780,13 @@ resize_frame_windows (struct frame *f, int size, int horflag)
3658 { 3780 {
3659 m = XWINDOW (mini); 3781 m = XWINDOW (mini);
3660 if (horflag) 3782 if (horflag)
3661 WSET (m, total_cols, make_number (size)); 3783 wset_total_cols (m, make_number (size));
3662 else 3784 else
3663 { 3785 {
3664 /* Are we sure we always want 1 line here? */ 3786 /* Are we sure we always want 1 line here? */
3665 WSET (m, total_lines, make_number (1)); 3787 wset_total_lines (m, make_number (1));
3666 WSET (m, top_line, 3788 wset_top_line
3667 make_number (XINT (r->top_line) + XINT (r->total_lines))); 3789 (m, make_number (XINT (r->top_line) + XINT (r->total_lines)));
3668 } 3790 }
3669 } 3791 }
3670} 3792}
@@ -3745,15 +3867,14 @@ set correctly. See the code of `split-window' for how this is done. */)
3745 { 3867 {
3746 p = XWINDOW (o->parent); 3868 p = XWINDOW (o->parent);
3747 /* Temporarily pretend we split the parent window. */ 3869 /* Temporarily pretend we split the parent window. */
3748 WSET (p, new_total, 3870 wset_new_total
3749 make_number (XINT (horflag ? p->total_cols : p->total_lines) 3871 (p, make_number (XINT (horflag ? p->total_cols : p->total_lines)
3750 - XINT (total_size))); 3872 - XINT (total_size)));
3751 if (!window_resize_check (p, horflag)) 3873 if (!window_resize_check (p, horflag))
3752 error ("Window sizes don't fit"); 3874 error ("Window sizes don't fit");
3753 else 3875 else
3754 /* Undo the temporary pretension. */ 3876 /* Undo the temporary pretension. */
3755 WSET (p, new_total, 3877 wset_new_total (p, horflag ? p->total_cols : p->total_lines);
3756 horflag ? p->total_cols : p->total_lines);
3757 } 3878 }
3758 else 3879 else
3759 { 3880 {
@@ -3777,10 +3898,10 @@ set correctly. See the code of `split-window' for how this is done. */)
3777 p = XWINDOW (o->parent); 3898 p = XWINDOW (o->parent);
3778 /* Store value of `window-combination-limit' in new parent's 3899 /* Store value of `window-combination-limit' in new parent's
3779 combination_limit slot. */ 3900 combination_limit slot. */
3780 WSET (p, combination_limit, Vwindow_combination_limit); 3901 wset_combination_limit (p, Vwindow_combination_limit);
3781 /* These get applied below. */ 3902 /* These get applied below. */
3782 WSET (p, new_total, horflag ? o->total_cols : o->total_lines); 3903 wset_new_total (p, horflag ? o->total_cols : o->total_lines);
3783 WSET (p, new_normal, new_normal); 3904 wset_new_normal (p, new_normal);
3784 } 3905 }
3785 else 3906 else
3786 p = XWINDOW (o->parent); 3907 p = XWINDOW (o->parent);
@@ -3789,62 +3910,62 @@ set correctly. See the code of `split-window' for how this is done. */)
3789 FRAME_WINDOW_SIZES_CHANGED (f) = 1; 3910 FRAME_WINDOW_SIZES_CHANGED (f) = 1;
3790 new = make_window (); 3911 new = make_window ();
3791 n = XWINDOW (new); 3912 n = XWINDOW (new);
3792 WSET (n, frame, frame); 3913 wset_frame (n, frame);
3793 WSET (n, parent, o->parent); 3914 wset_parent (n, o->parent);
3794 WSET (n, vchild, Qnil); 3915 wset_vchild (n, Qnil);
3795 WSET (n, hchild, Qnil); 3916 wset_hchild (n, Qnil);
3796 3917
3797 if (EQ (side, Qabove) || EQ (side, Qleft)) 3918 if (EQ (side, Qabove) || EQ (side, Qleft))
3798 { 3919 {
3799 WSET (n, prev, o->prev); 3920 wset_prev (n, o->prev);
3800 if (NILP (n->prev)) 3921 if (NILP (n->prev))
3801 if (horflag) 3922 if (horflag)
3802 WSET (p, hchild, new); 3923 wset_hchild (p, new);
3803 else 3924 else
3804 WSET (p, vchild, new); 3925 wset_vchild (p, new);
3805 else 3926 else
3806 WSET (XWINDOW (n->prev), next, new); 3927 wset_next (XWINDOW (n->prev), new);
3807 WSET (n, next, old); 3928 wset_next (n, old);
3808 WSET (o, prev, new); 3929 wset_prev (o, new);
3809 } 3930 }
3810 else 3931 else
3811 { 3932 {
3812 WSET (n, next, o->next); 3933 wset_next (n, o->next);
3813 if (!NILP (n->next)) 3934 if (!NILP (n->next))
3814 WSET (XWINDOW (n->next), prev, new); 3935 wset_prev (XWINDOW (n->next), new);
3815 WSET (n, prev, old); 3936 wset_prev (n, old);
3816 WSET (o, next, new); 3937 wset_next (o, new);
3817 } 3938 }
3818 3939
3819 WSET (n, buffer, Qt); 3940 wset_buffer (n, Qt);
3820 WSET (n, window_end_valid, Qnil); 3941 wset_window_end_valid (n, Qnil);
3821 memset (&n->last_cursor, 0, sizeof n->last_cursor); 3942 memset (&n->last_cursor, 0, sizeof n->last_cursor);
3822 3943
3823 /* Get special geometry settings from reference window. */ 3944 /* Get special geometry settings from reference window. */
3824 WSET (n, left_margin_cols, r->left_margin_cols); 3945 wset_left_margin_cols (n, r->left_margin_cols);
3825 WSET (n, right_margin_cols, r->right_margin_cols); 3946 wset_right_margin_cols (n, r->right_margin_cols);
3826 WSET (n, left_fringe_width, r->left_fringe_width); 3947 wset_left_fringe_width (n, r->left_fringe_width);
3827 WSET (n, right_fringe_width, r->right_fringe_width); 3948 wset_right_fringe_width (n, r->right_fringe_width);
3828 n->fringes_outside_margins = r->fringes_outside_margins; 3949 n->fringes_outside_margins = r->fringes_outside_margins;
3829 WSET (n, scroll_bar_width, r->scroll_bar_width); 3950 wset_scroll_bar_width (n, r->scroll_bar_width);
3830 WSET (n, vertical_scroll_bar_type, r->vertical_scroll_bar_type); 3951 wset_vertical_scroll_bar_type (n, r->vertical_scroll_bar_type);
3831 3952
3832 /* Directly assign orthogonal coordinates and sizes. */ 3953 /* Directly assign orthogonal coordinates and sizes. */
3833 if (horflag) 3954 if (horflag)
3834 { 3955 {
3835 WSET (n, top_line, o->top_line); 3956 wset_top_line (n, o->top_line);
3836 WSET (n, total_lines, o->total_lines); 3957 wset_total_lines (n, o->total_lines);
3837 } 3958 }
3838 else 3959 else
3839 { 3960 {
3840 WSET (n, left_col, o->left_col); 3961 wset_left_col (n, o->left_col);
3841 WSET (n, total_cols, o->total_cols); 3962 wset_total_cols (n, o->total_cols);
3842 } 3963 }
3843 3964
3844 /* Iso-coordinates and sizes are assigned by window_resize_apply, 3965 /* Iso-coordinates and sizes are assigned by window_resize_apply,
3845 get them ready here. */ 3966 get them ready here. */
3846 WSET (n, new_total, total_size); 3967 wset_new_total (n, total_size);
3847 WSET (n, new_normal, normal_size); 3968 wset_new_normal (n, normal_size);
3848 3969
3849 BLOCK_INPUT; 3970 BLOCK_INPUT;
3850 window_resize_apply (p, horflag); 3971 window_resize_apply (p, horflag);
@@ -3910,20 +4031,20 @@ Signal an error when WINDOW is the only window on its frame. */)
3910 before_sibling = 1; 4031 before_sibling = 1;
3911 sibling = w->next; 4032 sibling = w->next;
3912 s = XWINDOW (sibling); 4033 s = XWINDOW (sibling);
3913 WSET (s, prev, Qnil); 4034 wset_prev (s, Qnil);
3914 if (horflag) 4035 if (horflag)
3915 WSET (p, hchild, sibling); 4036 wset_hchild (p, sibling);
3916 else 4037 else
3917 WSET (p, vchild, sibling); 4038 wset_vchild (p, sibling);
3918 } 4039 }
3919 else 4040 else
3920 /* Get SIBLING above (on the left of) WINDOW. */ 4041 /* Get SIBLING above (on the left of) WINDOW. */
3921 { 4042 {
3922 sibling = w->prev; 4043 sibling = w->prev;
3923 s = XWINDOW (sibling); 4044 s = XWINDOW (sibling);
3924 WSET (s, next, w->next); 4045 wset_next (s, w->next);
3925 if (!NILP (s->next)) 4046 if (!NILP (s->next))
3926 WSET (XWINDOW (s->next), prev, sibling); 4047 wset_prev (XWINDOW (s->next), sibling);
3927 } 4048 }
3928 4049
3929 if (window_resize_check (r, horflag) 4050 if (window_resize_check (r, horflag)
@@ -3950,25 +4071,25 @@ Signal an error when WINDOW is the only window on its frame. */)
3950 Vwindow_list = Qnil; 4071 Vwindow_list = Qnil;
3951 FRAME_WINDOW_SIZES_CHANGED (f) = 1; 4072 FRAME_WINDOW_SIZES_CHANGED (f) = 1;
3952 4073
3953 WSET (w, next, Qnil); /* Don't delete w->next too. */ 4074 wset_next (w, Qnil); /* Don't delete w->next too. */
3954 free_window_matrices (w); 4075 free_window_matrices (w);
3955 4076
3956 if (!NILP (w->vchild)) 4077 if (!NILP (w->vchild))
3957 { 4078 {
3958 delete_all_child_windows (w->vchild); 4079 delete_all_child_windows (w->vchild);
3959 WSET (w, vchild, Qnil); 4080 wset_vchild (w, Qnil);
3960 } 4081 }
3961 else if (!NILP (w->hchild)) 4082 else if (!NILP (w->hchild))
3962 { 4083 {
3963 delete_all_child_windows (w->hchild); 4084 delete_all_child_windows (w->hchild);
3964 WSET (w, hchild, Qnil); 4085 wset_hchild (w, Qnil);
3965 } 4086 }
3966 else if (!NILP (w->buffer)) 4087 else if (!NILP (w->buffer))
3967 { 4088 {
3968 unshow_buffer (w); 4089 unshow_buffer (w);
3969 unchain_marker (XMARKER (w->pointm)); 4090 unchain_marker (XMARKER (w->pointm));
3970 unchain_marker (XMARKER (w->start)); 4091 unchain_marker (XMARKER (w->start));
3971 WSET (w, buffer, Qnil); 4092 wset_buffer (w, Qnil);
3972 } 4093 }
3973 4094
3974 if (NILP (s->prev) && NILP (s->next)) 4095 if (NILP (s->prev) && NILP (s->next))
@@ -3979,11 +4100,11 @@ Signal an error when WINDOW is the only window on its frame. */)
3979 replace_window (parent, sibling, 0); 4100 replace_window (parent, sibling, 0);
3980 /* Have SIBLING inherit the following three slot values from 4101 /* Have SIBLING inherit the following three slot values from
3981 PARENT (the combination_limit slot is not inherited). */ 4102 PARENT (the combination_limit slot is not inherited). */
3982 WSET (s, normal_cols, p->normal_cols); 4103 wset_normal_cols (s, p->normal_cols);
3983 WSET (s, normal_lines, p->normal_lines); 4104 wset_normal_lines (s, p->normal_lines);
3984 /* Mark PARENT as deleted. */ 4105 /* Mark PARENT as deleted. */
3985 WSET (p, vchild, Qnil); 4106 wset_vchild (p, Qnil);
3986 WSET (p, hchild, Qnil); 4107 wset_hchild (p, Qnil);
3987 /* Try to merge SIBLING into its new parent. */ 4108 /* Try to merge SIBLING into its new parent. */
3988 recombine_windows (sibling); 4109 recombine_windows (sibling);
3989 } 4110 }
@@ -4030,17 +4151,17 @@ Signal an error when WINDOW is the only window on its frame. */)
4030 { 4151 {
4031 if (before_sibling) 4152 if (before_sibling)
4032 { 4153 {
4033 WSET (s, prev, window); 4154 wset_prev (s, window);
4034 if (horflag) 4155 if (horflag)
4035 WSET (p, hchild, window); 4156 wset_hchild (p, window);
4036 else 4157 else
4037 WSET (p, vchild, window); 4158 wset_vchild (p, window);
4038 } 4159 }
4039 else 4160 else
4040 { 4161 {
4041 WSET (s, next, window); 4162 wset_next (s, window);
4042 if (!NILP (w->next)) 4163 if (!NILP (w->next))
4043 WSET (XWINDOW (w->next), prev, window); 4164 wset_prev (XWINDOW (w->next), window);
4044 } 4165 }
4045 error ("Deletion failed"); 4166 error ("Deletion failed");
4046 } 4167 }
@@ -4074,10 +4195,10 @@ grow_mini_window (struct window *w, int delta)
4074 window_resize_apply (r, 0); 4195 window_resize_apply (r, 0);
4075 4196
4076 /* Grow the mini-window. */ 4197 /* Grow the mini-window. */
4077 WSET (w, top_line, 4198 wset_top_line
4078 make_number (XFASTINT (r->top_line) + XFASTINT (r->total_lines))); 4199 (w, make_number (XFASTINT (r->top_line) + XFASTINT (r->total_lines)));
4079 WSET (w, total_lines, 4200 wset_total_lines
4080 make_number (XFASTINT (w->total_lines) - XINT (value))); 4201 (w, make_number (XFASTINT (w->total_lines) - XINT (value)));
4081 w->last_modified = 0; 4202 w->last_modified = 0;
4082 w->last_overlay_modified = 0; 4203 w->last_overlay_modified = 0;
4083 4204
@@ -4111,9 +4232,9 @@ shrink_mini_window (struct window *w)
4111 window_resize_apply (r, 0); 4232 window_resize_apply (r, 0);
4112 4233
4113 /* Shrink the mini-window. */ 4234 /* Shrink the mini-window. */
4114 WSET (w, top_line, 4235 wset_top_line (w, make_number (XFASTINT (r->top_line)
4115 make_number (XFASTINT (r->top_line) + XFASTINT (r->total_lines))); 4236 + XFASTINT (r->total_lines)));
4116 WSET (w, total_lines, make_number (1)); 4237 wset_total_lines (w, make_number (1));
4117 4238
4118 w->last_modified = 0; 4239 w->last_modified = 0;
4119 w->last_overlay_modified = 0; 4240 w->last_overlay_modified = 0;
@@ -4154,9 +4275,9 @@ DEFUN ("resize-mini-window-internal", Fresize_mini_window_internal, Sresize_mini
4154 BLOCK_INPUT; 4275 BLOCK_INPUT;
4155 window_resize_apply (r, 0); 4276 window_resize_apply (r, 0);
4156 4277
4157 WSET (w, total_lines, w->new_total); 4278 wset_total_lines (w, w->new_total);
4158 WSET (w, top_line, 4279 wset_top_line (w, make_number (XINT (r->top_line)
4159 make_number (XINT (r->top_line) + XINT (r->total_lines))); 4280 + XINT (r->total_lines)));
4160 4281
4161 windows_or_buffers_changed++; 4282 windows_or_buffers_changed++;
4162 FRAME_WINDOW_SIZES_CHANGED (f) = 1; 4283 FRAME_WINDOW_SIZES_CHANGED (f) = 1;
@@ -5224,7 +5345,7 @@ and redisplay normally--don't erase and redraw the frame. */)
5224 5345
5225 /* Set the new window start. */ 5346 /* Set the new window start. */
5226 set_marker_both (w->start, w->buffer, charpos, bytepos); 5347 set_marker_both (w->start, w->buffer, charpos, bytepos);
5227 WSET (w, window_end_valid, Qnil); 5348 wset_window_end_valid (w, Qnil);
5228 5349
5229 w->optional_new_start = 1; 5350 w->optional_new_start = 1;
5230 5351
@@ -5542,34 +5663,34 @@ the return value is nil. Otherwise the value is t. */)
5542 p = SAVED_WINDOW_N (saved_windows, k); 5663 p = SAVED_WINDOW_N (saved_windows, k);
5543 window = p->window; 5664 window = p->window;
5544 w = XWINDOW (window); 5665 w = XWINDOW (window);
5545 WSET (w, next, Qnil); 5666 wset_next (w, Qnil);
5546 5667
5547 if (!NILP (p->parent)) 5668 if (!NILP (p->parent))
5548 WSET (w, parent, SAVED_WINDOW_N 5669 wset_parent
5549 (saved_windows, XFASTINT (p->parent))->window); 5670 (w, SAVED_WINDOW_N (saved_windows, XFASTINT (p->parent))->window);
5550 else 5671 else
5551 WSET (w, parent, Qnil); 5672 wset_parent (w, Qnil);
5552 5673
5553 if (!NILP (p->prev)) 5674 if (!NILP (p->prev))
5554 { 5675 {
5555 WSET (w, prev, SAVED_WINDOW_N 5676 wset_prev
5556 (saved_windows, XFASTINT (p->prev))->window); 5677 (w, SAVED_WINDOW_N (saved_windows, XFASTINT (p->prev))->window);
5557 WSET (XWINDOW (w->prev), next, p->window); 5678 wset_next (XWINDOW (w->prev), p->window);
5558 } 5679 }
5559 else 5680 else
5560 { 5681 {
5561 WSET (w, prev, Qnil); 5682 wset_prev (w, Qnil);
5562 if (!NILP (w->parent)) 5683 if (!NILP (w->parent))
5563 { 5684 {
5564 if (EQ (p->total_cols, XWINDOW (w->parent)->total_cols)) 5685 if (EQ (p->total_cols, XWINDOW (w->parent)->total_cols))
5565 { 5686 {
5566 WSET (XWINDOW (w->parent), vchild, p->window); 5687 wset_vchild (XWINDOW (w->parent), p->window);
5567 WSET (XWINDOW (w->parent), hchild, Qnil); 5688 wset_hchild (XWINDOW (w->parent), Qnil);
5568 } 5689 }
5569 else 5690 else
5570 { 5691 {
5571 WSET (XWINDOW (w->parent), hchild, p->window); 5692 wset_hchild (XWINDOW (w->parent), p->window);
5572 WSET (XWINDOW (w->parent), vchild, Qnil); 5693 wset_vchild (XWINDOW (w->parent), Qnil);
5573 } 5694 }
5574 } 5695 }
5575 } 5696 }
@@ -5577,25 +5698,25 @@ the return value is nil. Otherwise the value is t. */)
5577 /* If we squirreled away the buffer in the window's height, 5698 /* If we squirreled away the buffer in the window's height,
5578 restore it now. */ 5699 restore it now. */
5579 if (BUFFERP (w->total_lines)) 5700 if (BUFFERP (w->total_lines))
5580 WSET (w, buffer, w->total_lines); 5701 wset_buffer (w, w->total_lines);
5581 WSET (w, left_col, p->left_col); 5702 wset_left_col (w, p->left_col);
5582 WSET (w, top_line, p->top_line); 5703 wset_top_line (w, p->top_line);
5583 WSET (w, total_cols, p->total_cols); 5704 wset_total_cols (w, p->total_cols);
5584 WSET (w, total_lines, p->total_lines); 5705 wset_total_lines (w, p->total_lines);
5585 WSET (w, normal_cols, p->normal_cols); 5706 wset_normal_cols (w, p->normal_cols);
5586 WSET (w, normal_lines, p->normal_lines); 5707 wset_normal_lines (w, p->normal_lines);
5587 w->hscroll = XFASTINT (p->hscroll); 5708 w->hscroll = XFASTINT (p->hscroll);
5588 w->min_hscroll = XFASTINT (p->min_hscroll); 5709 w->min_hscroll = XFASTINT (p->min_hscroll);
5589 WSET (w, display_table, p->display_table); 5710 wset_display_table (w, p->display_table);
5590 WSET (w, left_margin_cols, p->left_margin_cols); 5711 wset_left_margin_cols (w, p->left_margin_cols);
5591 WSET (w, right_margin_cols, p->right_margin_cols); 5712 wset_right_margin_cols (w, p->right_margin_cols);
5592 WSET (w, left_fringe_width, p->left_fringe_width); 5713 wset_left_fringe_width (w, p->left_fringe_width);
5593 WSET (w, right_fringe_width, p->right_fringe_width); 5714 wset_right_fringe_width (w, p->right_fringe_width);
5594 w->fringes_outside_margins = !NILP (p->fringes_outside_margins); 5715 w->fringes_outside_margins = !NILP (p->fringes_outside_margins);
5595 WSET (w, scroll_bar_width, p->scroll_bar_width); 5716 wset_scroll_bar_width (w, p->scroll_bar_width);
5596 WSET (w, vertical_scroll_bar_type, p->vertical_scroll_bar_type); 5717 wset_vertical_scroll_bar_type (w, p->vertical_scroll_bar_type);
5597 WSET (w, dedicated, p->dedicated); 5718 wset_dedicated (w, p->dedicated);
5598 WSET (w, combination_limit, p->combination_limit); 5719 wset_combination_limit (w, p->combination_limit);
5599 /* Restore any window parameters that have been saved. 5720 /* Restore any window parameters that have been saved.
5600 Parameters that have not been saved are left alone. */ 5721 Parameters that have not been saved are left alone. */
5601 for (tem = p->window_parameters; CONSP (tem); tem = XCDR (tem)) 5722 for (tem = p->window_parameters; CONSP (tem); tem = XCDR (tem))
@@ -5624,24 +5745,24 @@ the return value is nil. Otherwise the value is t. */)
5624 /* Reinstall the saved buffer and pointers into it. */ 5745 /* Reinstall the saved buffer and pointers into it. */
5625 if (NILP (p->buffer)) 5746 if (NILP (p->buffer))
5626 /* An internal window. */ 5747 /* An internal window. */
5627 WSET (w, buffer, p->buffer); 5748 wset_buffer (w, p->buffer);
5628 else if (!NILP (BVAR (XBUFFER (p->buffer), name))) 5749 else if (!NILP (BVAR (XBUFFER (p->buffer), name)))
5629 /* If saved buffer is alive, install it. */ 5750 /* If saved buffer is alive, install it. */
5630 { 5751 {
5631 WSET (w, buffer, p->buffer); 5752 wset_buffer (w, p->buffer);
5632 w->start_at_line_beg = !NILP (p->start_at_line_beg); 5753 w->start_at_line_beg = !NILP (p->start_at_line_beg);
5633 set_marker_restricted (w->start, p->start, w->buffer); 5754 set_marker_restricted (w->start, p->start, w->buffer);
5634 set_marker_restricted (w->pointm, p->pointm, 5755 set_marker_restricted (w->pointm, p->pointm,
5635 w->buffer); 5756 w->buffer);
5636 Fset_marker (BVAR (XBUFFER (w->buffer), mark), 5757 Fset_marker (BVAR (XBUFFER (w->buffer), mark),
5637 p->mark, w->buffer); 5758 p->mark, w->buffer);
5638 5759
5639 /* As documented in Fcurrent_window_configuration, don't 5760 /* As documented in Fcurrent_window_configuration, don't
5640 restore the location of point in the buffer which was 5761 restore the location of point in the buffer which was
5641 current when the window configuration was recorded. */ 5762 current when the window configuration was recorded. */
5642 if (!EQ (p->buffer, new_current_buffer) 5763 if (!EQ (p->buffer, new_current_buffer)
5643 && XBUFFER (p->buffer) == current_buffer) 5764 && XBUFFER (p->buffer) == current_buffer)
5644 Fgoto_char (w->pointm); 5765 Fgoto_char (w->pointm);
5645 } 5766 }
5646 else if (!NILP (w->buffer) 5767 else if (!NILP (w->buffer)
5647 && !NILP (BVAR (XBUFFER (w->buffer), name))) 5768 && !NILP (BVAR (XBUFFER (w->buffer), name)))
@@ -5662,7 +5783,8 @@ the return value is nil. Otherwise the value is t. */)
5662 else if (STRINGP (auto_buffer_name = 5783 else if (STRINGP (auto_buffer_name =
5663 Fwindow_parameter (window, Qauto_buffer_name)) 5784 Fwindow_parameter (window, Qauto_buffer_name))
5664 && SCHARS (auto_buffer_name) != 0 5785 && SCHARS (auto_buffer_name) != 0
5665 && !NILP (WSET (w, buffer, Fget_buffer_create (auto_buffer_name)))) 5786 && (wset_buffer (w, Fget_buffer_create (auto_buffer_name)),
5787 !NILP (w->buffer)))
5666 { 5788 {
5667 set_marker_restricted (w->start, 5789 set_marker_restricted (w->start,
5668 make_number (0), w->buffer); 5790 make_number (0), w->buffer);
@@ -5677,7 +5799,7 @@ the return value is nil. Otherwise the value is t. */)
5677 avoid showing an unimportant buffer and, if necessary, to 5799 avoid showing an unimportant buffer and, if necessary, to
5678 recreate *scratch* in the course (part of Juanma's bs-show 5800 recreate *scratch* in the course (part of Juanma's bs-show
5679 scenario from March 2011). */ 5801 scenario from March 2011). */
5680 WSET (w, buffer, other_buffer_safely (Fcurrent_buffer ())); 5802 wset_buffer (w, other_buffer_safely (Fcurrent_buffer ()));
5681 /* This will set the markers to beginning of visible 5803 /* This will set the markers to beginning of visible
5682 range. */ 5804 range. */
5683 set_marker_restricted (w->start, 5805 set_marker_restricted (w->start,
@@ -5689,7 +5811,7 @@ the return value is nil. Otherwise the value is t. */)
5689 /* Record this window as dead. */ 5811 /* Record this window as dead. */
5690 dead_windows = Fcons (window, dead_windows); 5812 dead_windows = Fcons (window, dead_windows);
5691 /* Make sure window is no more dedicated. */ 5813 /* Make sure window is no more dedicated. */
5692 WSET (w, dedicated, Qnil); 5814 wset_dedicated (w, Qnil);
5693 } 5815 }
5694 } 5816 }
5695 5817
@@ -5789,24 +5911,25 @@ delete_all_child_windows (Lisp_Object window)
5789 /* Delete WINDOW's siblings (we traverse postorderly). */ 5911 /* Delete WINDOW's siblings (we traverse postorderly). */
5790 delete_all_child_windows (w->next); 5912 delete_all_child_windows (w->next);
5791 5913
5792 WSET (w, total_lines, w->buffer); /* See Fset_window_configuration for excuse. */ 5914 /* See Fset_window_configuration for excuse. */
5915 wset_total_lines (w, w->buffer);
5793 5916
5794 if (!NILP (w->vchild)) 5917 if (!NILP (w->vchild))
5795 { 5918 {
5796 delete_all_child_windows (w->vchild); 5919 delete_all_child_windows (w->vchild);
5797 WSET (w, vchild, Qnil); 5920 wset_vchild (w, Qnil);
5798 } 5921 }
5799 else if (!NILP (w->hchild)) 5922 else if (!NILP (w->hchild))
5800 { 5923 {
5801 delete_all_child_windows (w->hchild); 5924 delete_all_child_windows (w->hchild);
5802 WSET (w, hchild, Qnil); 5925 wset_hchild (w, Qnil);
5803 } 5926 }
5804 else if (!NILP (w->buffer)) 5927 else if (!NILP (w->buffer))
5805 { 5928 {
5806 unshow_buffer (w); 5929 unshow_buffer (w);
5807 unchain_marker (XMARKER (w->pointm)); 5930 unchain_marker (XMARKER (w->pointm));
5808 unchain_marker (XMARKER (w->start)); 5931 unchain_marker (XMARKER (w->start));
5809 WSET (w, buffer, Qnil); 5932 wset_buffer (w, Qnil);
5810 } 5933 }
5811 5934
5812 Vwindow_list = Qnil; 5935 Vwindow_list = Qnil;
@@ -5898,7 +6021,7 @@ save_window_save (Lisp_Object window, struct Lisp_Vector *vector, int i)
5898 p = SAVED_WINDOW_N (vector, i); 6021 p = SAVED_WINDOW_N (vector, i);
5899 w = XWINDOW (window); 6022 w = XWINDOW (window);
5900 6023
5901 WSET (w, temslot, make_number (i)); i++; 6024 wset_temslot (w, make_number (i)); i++;
5902 p->window = window; 6025 p->window = window;
5903 p->buffer = w->buffer; 6026 p->buffer = w->buffer;
5904 p->left_col = w->left_col; 6027 p->left_col = w->left_col;
@@ -6101,8 +6224,8 @@ means no margin. */)
6101 if (!EQ (w->left_margin_cols, left_width) 6224 if (!EQ (w->left_margin_cols, left_width)
6102 || !EQ (w->right_margin_cols, right_width)) 6225 || !EQ (w->right_margin_cols, right_width))
6103 { 6226 {
6104 WSET (w, left_margin_cols, left_width); 6227 wset_left_margin_cols (w, left_width);
6105 WSET (w, right_margin_cols, right_width); 6228 wset_right_margin_cols (w, right_width);
6106 6229
6107 adjust_window_margins (w); 6230 adjust_window_margins (w);
6108 6231
@@ -6163,14 +6286,14 @@ display marginal areas and the text area. */)
6163 || !EQ (w->right_fringe_width, right_width) 6286 || !EQ (w->right_fringe_width, right_width)
6164 || w->fringes_outside_margins != outside)) 6287 || w->fringes_outside_margins != outside))
6165 { 6288 {
6166 WSET (w, left_fringe_width, left_width); 6289 wset_left_fringe_width (w, left_width);
6167 WSET (w, right_fringe_width, right_width); 6290 wset_right_fringe_width (w, right_width);
6168 w->fringes_outside_margins = outside; 6291 w->fringes_outside_margins = outside;
6169 6292
6170 adjust_window_margins (w); 6293 adjust_window_margins (w);
6171 6294
6172 clear_glyph_matrix (w->current_matrix); 6295 clear_glyph_matrix (w->current_matrix);
6173 WSET (w, window_end_valid, Qnil); 6296 wset_window_end_valid (w, Qnil);
6174 6297
6175 ++windows_or_buffers_changed; 6298 ++windows_or_buffers_changed;
6176 adjust_glyphs (XFRAME (WINDOW_FRAME (w))); 6299 adjust_glyphs (XFRAME (WINDOW_FRAME (w)));
@@ -6235,13 +6358,13 @@ Fourth parameter HORIZONTAL-TYPE is currently unused. */)
6235 if (!EQ (w->scroll_bar_width, width) 6358 if (!EQ (w->scroll_bar_width, width)
6236 || !EQ (w->vertical_scroll_bar_type, vertical_type)) 6359 || !EQ (w->vertical_scroll_bar_type, vertical_type))
6237 { 6360 {
6238 WSET (w, scroll_bar_width, width); 6361 wset_scroll_bar_width (w, width);
6239 WSET (w, vertical_scroll_bar_type, vertical_type); 6362 wset_vertical_scroll_bar_type (w, vertical_type);
6240 6363
6241 adjust_window_margins (w); 6364 adjust_window_margins (w);
6242 6365
6243 clear_glyph_matrix (w->current_matrix); 6366 clear_glyph_matrix (w->current_matrix);
6244 WSET (w, window_end_valid, Qnil); 6367 wset_window_end_valid (w, Qnil);
6245 6368
6246 ++windows_or_buffers_changed; 6369 ++windows_or_buffers_changed;
6247 adjust_glyphs (XFRAME (WINDOW_FRAME (w))); 6370 adjust_glyphs (XFRAME (WINDOW_FRAME (w)));
diff --git a/src/window.h b/src/window.h
index 77b31dafd8b..28b9678b667 100644
--- a/src/window.h
+++ b/src/window.h
@@ -22,6 +22,11 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
22 22
23#include "dispextern.h" 23#include "dispextern.h"
24 24
25INLINE_HEADER_BEGIN
26#ifndef WINDOW_INLINE
27# define WINDOW_INLINE INLINE
28#endif
29
25extern Lisp_Object Qleft, Qright; 30extern Lisp_Object Qleft, Qright;
26 31
27/* Windows are allocated as if they were vectors, but then the 32/* Windows are allocated as if they were vectors, but then the
@@ -86,10 +91,6 @@ struct cursor_pos
86 int hpos, vpos; 91 int hpos, vpos;
87}; 92};
88 93
89/* Most code should use this macro to set Lisp fields in struct window. */
90
91#define WSET(w, field, value) ((w)->field = (value))
92
93struct window 94struct window
94 { 95 {
95 /* This is for Lisp; the terminal code does not refer to it. */ 96 /* This is for Lisp; the terminal code does not refer to it. */
@@ -348,6 +349,75 @@ struct window
348 ptrdiff_t window_end_bytepos; 349 ptrdiff_t window_end_bytepos;
349}; 350};
350 351
352/* Most code should use these functions to set Lisp fields in struct
353 window. */
354WINDOW_INLINE void
355wset_buffer (struct window *w, Lisp_Object val)
356{
357 w->buffer = val;
358}
359WINDOW_INLINE void
360wset_frame (struct window *w, Lisp_Object val)
361{
362 w->frame = val;
363}
364WINDOW_INLINE void
365wset_left_col (struct window *w, Lisp_Object val)
366{
367 w->left_col = val;
368}
369WINDOW_INLINE void
370wset_next (struct window *w, Lisp_Object val)
371{
372 w->next = val;
373}
374WINDOW_INLINE void
375wset_prev (struct window *w, Lisp_Object val)
376{
377 w->prev = val;
378}
379WINDOW_INLINE void
380wset_redisplay_end_trigger (struct window *w, Lisp_Object val)
381{
382 w->redisplay_end_trigger = val;
383}
384WINDOW_INLINE void
385wset_top_line (struct window *w, Lisp_Object val)
386{
387 w->top_line = val;
388}
389WINDOW_INLINE void
390wset_total_cols (struct window *w, Lisp_Object val)
391{
392 w->total_cols = val;
393}
394WINDOW_INLINE void
395wset_total_lines (struct window *w, Lisp_Object val)
396{
397 w->total_lines = val;
398}
399WINDOW_INLINE void
400wset_vertical_scroll_bar (struct window *w, Lisp_Object val)
401{
402 w->vertical_scroll_bar = val;
403}
404WINDOW_INLINE void
405wset_window_end_pos (struct window *w, Lisp_Object val)
406{
407 w->window_end_pos = val;
408}
409WINDOW_INLINE void
410wset_window_end_valid (struct window *w, Lisp_Object val)
411{
412 w->window_end_valid = val;
413}
414WINDOW_INLINE void
415wset_window_end_vpos (struct window *w, Lisp_Object val)
416{
417 w->window_end_vpos = val;
418}
419
420
351/* 1 if W is a minibuffer window. */ 421/* 1 if W is a minibuffer window. */
352 422
353#define MINI_WINDOW_P(W) ((W)->mini) 423#define MINI_WINDOW_P(W) ((W)->mini)
@@ -916,4 +986,6 @@ extern void init_window (void);
916extern void syms_of_window (void); 986extern void syms_of_window (void);
917extern void keys_of_window (void); 987extern void keys_of_window (void);
918 988
989INLINE_HEADER_END
990
919#endif /* not WINDOW_H_INCLUDED */ 991#endif /* not WINDOW_H_INCLUDED */
diff --git a/src/xdisp.c b/src/xdisp.c
index ab4375d2479..fce9952c518 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -365,6 +365,28 @@ Lisp_Object Qcenter;
365static Lisp_Object Qmargin, Qpointer; 365static Lisp_Object Qmargin, Qpointer;
366static Lisp_Object Qline_height; 366static Lisp_Object Qline_height;
367 367
368/* These setters are used only in this file, so they can be private. */
369static inline void
370wset_base_line_number (struct window *w, Lisp_Object val)
371{
372 w->base_line_number = val;
373}
374static inline void
375wset_base_line_pos (struct window *w, Lisp_Object val)
376{
377 w->base_line_pos = val;
378}
379static inline void
380wset_column_number_displayed (struct window *w, Lisp_Object val)
381{
382 w->column_number_displayed = val;
383}
384static inline void
385wset_region_showing (struct window *w, Lisp_Object val)
386{
387 w->region_showing = val;
388}
389
368#ifdef HAVE_WINDOW_SYSTEM 390#ifdef HAVE_WINDOW_SYSTEM
369 391
370/* Test if overflow newline into fringe. Called with iterator IT 392/* Test if overflow newline into fringe. Called with iterator IT
@@ -7981,7 +8003,7 @@ run_redisplay_end_trigger_hook (struct it *it)
7981 8003
7982 /* Since we are *trying* to run these functions, don't try to run 8004 /* Since we are *trying* to run these functions, don't try to run
7983 them again, even if they get an error. */ 8005 them again, even if they get an error. */
7984 WSET (it->w, redisplay_end_trigger, Qnil); 8006 wset_redisplay_end_trigger (it->w, Qnil);
7985 Frun_hook_with_args (3, args); 8007 Frun_hook_with_args (3, args);
7986 8008
7987 /* Notice if it changed the face of the character we are on. */ 8009 /* Notice if it changed the face of the character we are on. */
@@ -9969,7 +9991,7 @@ with_echo_area_buffer (struct window *w, int which,
9969 set_buffer_internal_1 (XBUFFER (buffer)); 9991 set_buffer_internal_1 (XBUFFER (buffer));
9970 if (w) 9992 if (w)
9971 { 9993 {
9972 WSET (w, buffer, buffer); 9994 wset_buffer (w, buffer);
9973 set_marker_both (w->pointm, buffer, BEG, BEG_BYTE); 9995 set_marker_both (w->pointm, buffer, BEG, BEG_BYTE);
9974 } 9996 }
9975 9997
@@ -10054,7 +10076,7 @@ unwind_with_echo_area_buffer (Lisp_Object vector)
10054 charpos = AREF (vector, 5); 10076 charpos = AREF (vector, 5);
10055 bytepos = AREF (vector, 6); 10077 bytepos = AREF (vector, 6);
10056 10078
10057 WSET (w, buffer, buffer); 10079 wset_buffer (w, buffer);
10058 set_marker_both (w->pointm, buffer, 10080 set_marker_both (w->pointm, buffer,
10059 XFASTINT (charpos), XFASTINT (bytepos)); 10081 XFASTINT (charpos), XFASTINT (bytepos));
10060 } 10082 }
@@ -13266,12 +13288,12 @@ redisplay_internal (void)
13266 if ((it.glyph_row - 1)->displays_text_p) 13288 if ((it.glyph_row - 1)->displays_text_p)
13267 { 13289 {
13268 if (XFASTINT (w->window_end_vpos) < this_line_vpos) 13290 if (XFASTINT (w->window_end_vpos) < this_line_vpos)
13269 WSET (w, window_end_vpos, make_number (this_line_vpos)); 13291 wset_window_end_vpos (w, make_number (this_line_vpos));
13270 } 13292 }
13271 else if (XFASTINT (w->window_end_vpos) == this_line_vpos 13293 else if (XFASTINT (w->window_end_vpos) == this_line_vpos
13272 && this_line_vpos > 0) 13294 && this_line_vpos > 0)
13273 WSET (w, window_end_vpos, make_number (this_line_vpos - 1)); 13295 wset_window_end_vpos (w, make_number (this_line_vpos - 1));
13274 WSET (w, window_end_valid, Qnil); 13296 wset_window_end_valid (w, Qnil);
13275 13297
13276 /* Update hint: No need to try to scroll in update_window. */ 13298 /* Update hint: No need to try to scroll in update_window. */
13277 w->desired_matrix->no_scrolling_p = 1; 13299 w->desired_matrix->no_scrolling_p = 1;
@@ -13737,7 +13759,7 @@ mark_window_display_accurate_1 (struct window *w, int accurate_p)
13737 13759
13738 if (accurate_p) 13760 if (accurate_p)
13739 { 13761 {
13740 WSET (w, window_end_valid, w->buffer); 13762 wset_window_end_valid (w, w->buffer);
13741 w->update_mode_line = 0; 13763 w->update_mode_line = 0;
13742 } 13764 }
13743} 13765}
@@ -14845,7 +14867,7 @@ try_scrolling (Lisp_Object window, int just_this_one_p,
14845 if (!just_this_one_p 14867 if (!just_this_one_p
14846 || current_buffer->clip_changed 14868 || current_buffer->clip_changed
14847 || BEG_UNCHANGED < CHARPOS (startp)) 14869 || BEG_UNCHANGED < CHARPOS (startp))
14848 WSET (w, base_line_number, Qnil); 14870 wset_base_line_number (w, Qnil);
14849 14871
14850 /* If cursor ends up on a partially visible line, 14872 /* If cursor ends up on a partially visible line,
14851 treat that as being off the bottom of the screen. */ 14873 treat that as being off the bottom of the screen. */
@@ -15470,7 +15492,7 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
15470 if (XMARKER (w->start)->buffer == current_buffer) 15492 if (XMARKER (w->start)->buffer == current_buffer)
15471 compute_window_start_on_continuation_line (w); 15493 compute_window_start_on_continuation_line (w);
15472 15494
15473 WSET (w, window_end_valid, Qnil); 15495 wset_window_end_valid (w, Qnil);
15474 } 15496 }
15475 15497
15476 /* Some sanity checks. */ 15498 /* Some sanity checks. */
@@ -15581,11 +15603,11 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
15581 15603
15582 w->force_start = 0; 15604 w->force_start = 0;
15583 w->vscroll = 0; 15605 w->vscroll = 0;
15584 WSET (w, window_end_valid, Qnil); 15606 wset_window_end_valid (w, Qnil);
15585 15607
15586 /* Forget any recorded base line for line number display. */ 15608 /* Forget any recorded base line for line number display. */
15587 if (!buffer_unchanged_p) 15609 if (!buffer_unchanged_p)
15588 WSET (w, base_line_number, Qnil); 15610 wset_base_line_number (w, Qnil);
15589 15611
15590 /* Redisplay the mode line. Select the buffer properly for that. 15612 /* Redisplay the mode line. Select the buffer properly for that.
15591 Also, run the hook window-scroll-functions 15613 Also, run the hook window-scroll-functions
@@ -15799,7 +15821,7 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
15799 || current_buffer->clip_changed 15821 || current_buffer->clip_changed
15800 || BEG_UNCHANGED < CHARPOS (startp)) 15822 || BEG_UNCHANGED < CHARPOS (startp))
15801 /* Forget any recorded base line for line number display. */ 15823 /* Forget any recorded base line for line number display. */
15802 WSET (w, base_line_number, Qnil); 15824 wset_base_line_number (w, Qnil);
15803 15825
15804 if (!cursor_row_fully_visible_p (w, 1, 0)) 15826 if (!cursor_row_fully_visible_p (w, 1, 0))
15805 { 15827 {
@@ -15870,7 +15892,7 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
15870 15892
15871 /* Forget any previously recorded base line for line number display. */ 15893 /* Forget any previously recorded base line for line number display. */
15872 if (!buffer_unchanged_p) 15894 if (!buffer_unchanged_p)
15873 WSET (w, base_line_number, Qnil); 15895 wset_base_line_number (w, Qnil);
15874 15896
15875 /* Determine the window start relative to point. */ 15897 /* Determine the window start relative to point. */
15876 init_iterator (&it, w, PT, PT_BYTE, NULL, DEFAULT_FACE_ID); 15898 init_iterator (&it, w, PT, PT_BYTE, NULL, DEFAULT_FACE_ID);
@@ -16128,8 +16150,8 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
16128 if (!line_number_displayed 16150 if (!line_number_displayed
16129 && !BUFFERP (w->base_line_pos)) 16151 && !BUFFERP (w->base_line_pos))
16130 { 16152 {
16131 WSET (w, base_line_pos, Qnil); 16153 wset_base_line_pos (w, Qnil);
16132 WSET (w, base_line_number, Qnil); 16154 wset_base_line_number (w, Qnil);
16133 } 16155 }
16134 16156
16135 finish_menu_bars: 16157 finish_menu_bars:
@@ -16306,10 +16328,10 @@ try_window (Lisp_Object window, struct text_pos pos, int flags)
16306 eassert (MATRIX_ROW_DISPLAYS_TEXT_P (last_text_row)); 16328 eassert (MATRIX_ROW_DISPLAYS_TEXT_P (last_text_row));
16307 w->window_end_bytepos 16329 w->window_end_bytepos
16308 = Z_BYTE - MATRIX_ROW_END_BYTEPOS (last_text_row); 16330 = Z_BYTE - MATRIX_ROW_END_BYTEPOS (last_text_row);
16309 WSET (w, window_end_pos, 16331 wset_window_end_pos
16310 make_number (Z - MATRIX_ROW_END_CHARPOS (last_text_row))); 16332 (w, make_number (Z - MATRIX_ROW_END_CHARPOS (last_text_row)));
16311 WSET (w, window_end_vpos, 16333 wset_window_end_vpos
16312 make_number (MATRIX_ROW_VPOS (last_text_row, w->desired_matrix))); 16334 (w, make_number (MATRIX_ROW_VPOS (last_text_row, w->desired_matrix)));
16313 eassert 16335 eassert
16314 (MATRIX_ROW (w->desired_matrix, 16336 (MATRIX_ROW (w->desired_matrix,
16315 XFASTINT (w->window_end_vpos))->displays_text_p); 16337 XFASTINT (w->window_end_vpos))->displays_text_p);
@@ -16317,12 +16339,12 @@ try_window (Lisp_Object window, struct text_pos pos, int flags)
16317 else 16339 else
16318 { 16340 {
16319 w->window_end_bytepos = Z_BYTE - ZV_BYTE; 16341 w->window_end_bytepos = Z_BYTE - ZV_BYTE;
16320 WSET (w, window_end_pos, make_number (Z - ZV)); 16342 wset_window_end_pos (w, make_number (Z - ZV));
16321 WSET (w, window_end_vpos, make_number (0)); 16343 wset_window_end_vpos (w, make_number (0));
16322 } 16344 }
16323 16345
16324 /* But that is not valid info until redisplay finishes. */ 16346 /* But that is not valid info until redisplay finishes. */
16325 WSET (w, window_end_valid, Qnil); 16347 wset_window_end_valid (w, Qnil);
16326 return 1; 16348 return 1;
16327} 16349}
16328 16350
@@ -16546,28 +16568,31 @@ try_window_reusing_current_matrix (struct window *w)
16546 { 16568 {
16547 w->window_end_bytepos 16569 w->window_end_bytepos
16548 = Z_BYTE - MATRIX_ROW_END_BYTEPOS (last_reused_text_row); 16570 = Z_BYTE - MATRIX_ROW_END_BYTEPOS (last_reused_text_row);
16549 WSET (w, window_end_pos, 16571 wset_window_end_pos
16550 make_number (Z - MATRIX_ROW_END_CHARPOS (last_reused_text_row))); 16572 (w, make_number (Z
16551 WSET (w, window_end_vpos, 16573 - MATRIX_ROW_END_CHARPOS (last_reused_text_row)));
16552 make_number (MATRIX_ROW_VPOS (last_reused_text_row, w->current_matrix))); 16574 wset_window_end_vpos
16575 (w, make_number (MATRIX_ROW_VPOS (last_reused_text_row,
16576 w->current_matrix)));
16553 } 16577 }
16554 else if (last_text_row) 16578 else if (last_text_row)
16555 { 16579 {
16556 w->window_end_bytepos 16580 w->window_end_bytepos
16557 = Z_BYTE - MATRIX_ROW_END_BYTEPOS (last_text_row); 16581 = Z_BYTE - MATRIX_ROW_END_BYTEPOS (last_text_row);
16558 WSET (w, window_end_pos, 16582 wset_window_end_pos
16559 make_number (Z - MATRIX_ROW_END_CHARPOS (last_text_row))); 16583 (w, make_number (Z - MATRIX_ROW_END_CHARPOS (last_text_row)));
16560 WSET (w, window_end_vpos, 16584 wset_window_end_vpos
16561 make_number (MATRIX_ROW_VPOS (last_text_row, w->desired_matrix))); 16585 (w, make_number (MATRIX_ROW_VPOS (last_text_row,
16586 w->desired_matrix)));
16562 } 16587 }
16563 else 16588 else
16564 { 16589 {
16565 /* This window must be completely empty. */ 16590 /* This window must be completely empty. */
16566 w->window_end_bytepos = Z_BYTE - ZV_BYTE; 16591 w->window_end_bytepos = Z_BYTE - ZV_BYTE;
16567 WSET (w, window_end_pos, make_number (Z - ZV)); 16592 wset_window_end_pos (w, make_number (Z - ZV));
16568 WSET (w, window_end_vpos, make_number (0)); 16593 wset_window_end_vpos (w, make_number (0));
16569 } 16594 }
16570 WSET (w, window_end_valid, Qnil); 16595 wset_window_end_valid (w, Qnil);
16571 16596
16572 /* Update hint: don't try scrolling again in update_window. */ 16597 /* Update hint: don't try scrolling again in update_window. */
16573 w->desired_matrix->no_scrolling_p = 1; 16598 w->desired_matrix->no_scrolling_p = 1;
@@ -16748,18 +16773,19 @@ try_window_reusing_current_matrix (struct window *w)
16748 { 16773 {
16749 w->window_end_bytepos 16774 w->window_end_bytepos
16750 = Z_BYTE - MATRIX_ROW_END_BYTEPOS (last_text_row); 16775 = Z_BYTE - MATRIX_ROW_END_BYTEPOS (last_text_row);
16751 WSET (w, window_end_pos, 16776 wset_window_end_pos
16752 make_number (Z - MATRIX_ROW_END_CHARPOS (last_text_row))); 16777 (w, make_number (Z - MATRIX_ROW_END_CHARPOS (last_text_row)));
16753 WSET (w, window_end_vpos, 16778 wset_window_end_vpos
16754 make_number (MATRIX_ROW_VPOS (last_text_row, w->desired_matrix))); 16779 (w, make_number (MATRIX_ROW_VPOS (last_text_row,
16780 w->desired_matrix)));
16755 } 16781 }
16756 else 16782 else
16757 { 16783 {
16758 WSET (w, window_end_vpos, 16784 wset_window_end_vpos
16759 make_number (XFASTINT (w->window_end_vpos) - nrows_scrolled)); 16785 (w, make_number (XFASTINT (w->window_end_vpos) - nrows_scrolled));
16760 } 16786 }
16761 16787
16762 WSET (w, window_end_valid, Qnil); 16788 wset_window_end_valid (w, Qnil);
16763 w->desired_matrix->no_scrolling_p = 1; 16789 w->desired_matrix->no_scrolling_p = 1;
16764 16790
16765#ifdef GLYPH_DEBUG 16791#ifdef GLYPH_DEBUG
@@ -17331,8 +17357,8 @@ try_window_id (struct window *w)
17331 { 17357 {
17332 /* We have to compute the window end anew since text 17358 /* We have to compute the window end anew since text
17333 could have been added/removed after it. */ 17359 could have been added/removed after it. */
17334 WSET (w, window_end_pos, 17360 wset_window_end_pos
17335 make_number (Z - MATRIX_ROW_END_CHARPOS (row))); 17361 (w, make_number (Z - MATRIX_ROW_END_CHARPOS (row)));
17336 w->window_end_bytepos 17362 w->window_end_bytepos
17337 = Z_BYTE - MATRIX_ROW_END_BYTEPOS (row); 17363 = Z_BYTE - MATRIX_ROW_END_BYTEPOS (row);
17338 17364
@@ -17766,21 +17792,22 @@ try_window_id (struct window *w)
17766 first_unchanged_at_end_row); 17792 first_unchanged_at_end_row);
17767 eassert (row && MATRIX_ROW_DISPLAYS_TEXT_P (row)); 17793 eassert (row && MATRIX_ROW_DISPLAYS_TEXT_P (row));
17768 17794
17769 WSET (w, window_end_pos, make_number (Z - MATRIX_ROW_END_CHARPOS (row))); 17795 wset_window_end_pos (w, make_number (Z - MATRIX_ROW_END_CHARPOS (row)));
17770 w->window_end_bytepos = Z_BYTE - MATRIX_ROW_END_BYTEPOS (row); 17796 w->window_end_bytepos = Z_BYTE - MATRIX_ROW_END_BYTEPOS (row);
17771 WSET (w, window_end_vpos, 17797 wset_window_end_vpos
17772 make_number (MATRIX_ROW_VPOS (row, w->current_matrix))); 17798 (w, make_number (MATRIX_ROW_VPOS (row, w->current_matrix)));
17773 eassert (w->window_end_bytepos >= 0); 17799 eassert (w->window_end_bytepos >= 0);
17774 IF_DEBUG (debug_method_add (w, "A")); 17800 IF_DEBUG (debug_method_add (w, "A"));
17775 } 17801 }
17776 else if (last_text_row_at_end) 17802 else if (last_text_row_at_end)
17777 { 17803 {
17778 WSET (w, window_end_pos, 17804 wset_window_end_pos
17779 make_number (Z - MATRIX_ROW_END_CHARPOS (last_text_row_at_end))); 17805 (w, make_number (Z - MATRIX_ROW_END_CHARPOS (last_text_row_at_end)));
17780 w->window_end_bytepos 17806 w->window_end_bytepos
17781 = Z_BYTE - MATRIX_ROW_END_BYTEPOS (last_text_row_at_end); 17807 = Z_BYTE - MATRIX_ROW_END_BYTEPOS (last_text_row_at_end);
17782 WSET (w, window_end_vpos, 17808 wset_window_end_vpos
17783 make_number (MATRIX_ROW_VPOS (last_text_row_at_end, desired_matrix))); 17809 (w, make_number (MATRIX_ROW_VPOS (last_text_row_at_end,
17810 desired_matrix)));
17784 eassert (w->window_end_bytepos >= 0); 17811 eassert (w->window_end_bytepos >= 0);
17785 IF_DEBUG (debug_method_add (w, "B")); 17812 IF_DEBUG (debug_method_add (w, "B"));
17786 } 17813 }
@@ -17789,12 +17816,12 @@ try_window_id (struct window *w)
17789 /* We have displayed either to the end of the window or at the 17816 /* We have displayed either to the end of the window or at the
17790 end of the window, i.e. the last row with text is to be found 17817 end of the window, i.e. the last row with text is to be found
17791 in the desired matrix. */ 17818 in the desired matrix. */
17792 WSET (w, window_end_pos, 17819 wset_window_end_pos
17793 make_number (Z - MATRIX_ROW_END_CHARPOS (last_text_row))); 17820 (w, make_number (Z - MATRIX_ROW_END_CHARPOS (last_text_row)));
17794 w->window_end_bytepos 17821 w->window_end_bytepos
17795 = Z_BYTE - MATRIX_ROW_END_BYTEPOS (last_text_row); 17822 = Z_BYTE - MATRIX_ROW_END_BYTEPOS (last_text_row);
17796 WSET (w, window_end_vpos, 17823 wset_window_end_vpos
17797 make_number (MATRIX_ROW_VPOS (last_text_row, desired_matrix))); 17824 (w, make_number (MATRIX_ROW_VPOS (last_text_row, desired_matrix)));
17798 eassert (w->window_end_bytepos >= 0); 17825 eassert (w->window_end_bytepos >= 0);
17799 } 17826 }
17800 else if (first_unchanged_at_end_row == NULL 17827 else if (first_unchanged_at_end_row == NULL
@@ -17822,8 +17849,8 @@ try_window_id (struct window *w)
17822 } 17849 }
17823 17850
17824 eassert (row != NULL); 17851 eassert (row != NULL);
17825 WSET (w, window_end_vpos, make_number (vpos + 1)); 17852 wset_window_end_vpos (w, make_number (vpos + 1));
17826 WSET (w, window_end_pos, make_number (Z - MATRIX_ROW_END_CHARPOS (row))); 17853 wset_window_end_pos (w, make_number (Z - MATRIX_ROW_END_CHARPOS (row)));
17827 w->window_end_bytepos = Z_BYTE - MATRIX_ROW_END_BYTEPOS (row); 17854 w->window_end_bytepos = Z_BYTE - MATRIX_ROW_END_BYTEPOS (row);
17828 eassert (w->window_end_bytepos >= 0); 17855 eassert (w->window_end_bytepos >= 0);
17829 IF_DEBUG (debug_method_add (w, "C")); 17856 IF_DEBUG (debug_method_add (w, "C"));
@@ -17835,7 +17862,7 @@ try_window_id (struct window *w)
17835 debug_end_vpos = XFASTINT (w->window_end_vpos)); 17862 debug_end_vpos = XFASTINT (w->window_end_vpos));
17836 17863
17837 /* Record that display has not been completed. */ 17864 /* Record that display has not been completed. */
17838 WSET (w, window_end_valid, Qnil); 17865 wset_window_end_valid (w, Qnil);
17839 w->desired_matrix->no_scrolling_p = 1; 17866 w->desired_matrix->no_scrolling_p = 1;
17840 return 3; 17867 return 3;
17841 17868
@@ -19248,7 +19275,7 @@ display_line (struct it *it)
19248 } 19275 }
19249 19276
19250 /* Is IT->w showing the region? */ 19277 /* Is IT->w showing the region? */
19251 WSET (it->w, region_showing, it->region_beg_charpos > 0 ? Qt : Qnil); 19278 wset_region_showing (it->w, it->region_beg_charpos > 0 ? Qt : Qnil);
19252 19279
19253 /* Clear the result glyph row and enable it. */ 19280 /* Clear the result glyph row and enable it. */
19254 prepare_desired_row (row); 19281 prepare_desired_row (row);
@@ -20252,7 +20279,7 @@ display_mode_lines (struct window *w)
20252 20279
20253 /* These will be set while the mode line specs are processed. */ 20280 /* These will be set while the mode line specs are processed. */
20254 line_number_displayed = 0; 20281 line_number_displayed = 0;
20255 WSET (w, column_number_displayed, Qnil); 20282 wset_column_number_displayed (w, Qnil);
20256 20283
20257 if (WINDOW_WANTS_MODELINE_P (w)) 20284 if (WINDOW_WANTS_MODELINE_P (w))
20258 { 20285 {
@@ -21388,7 +21415,7 @@ decode_mode_spec (struct window *w, register int c, int field_width,
21388 else 21415 else
21389 { 21416 {
21390 ptrdiff_t col = current_column (); 21417 ptrdiff_t col = current_column ();
21391 WSET (w, column_number_displayed, make_number (col)); 21418 wset_column_number_displayed (w, make_number (col));
21392 pint2str (decode_mode_spec_buf, field_width, col); 21419 pint2str (decode_mode_spec_buf, field_width, col);
21393 return decode_mode_spec_buf; 21420 return decode_mode_spec_buf;
21394 } 21421 }
@@ -21451,14 +21478,14 @@ decode_mode_spec (struct window *w, register int c, int field_width,
21451 goto no_value; 21478 goto no_value;
21452 /* But do forget it, if the window shows a different buffer now. */ 21479 /* But do forget it, if the window shows a different buffer now. */
21453 else if (BUFFERP (w->base_line_pos)) 21480 else if (BUFFERP (w->base_line_pos))
21454 WSET (w, base_line_pos, Qnil); 21481 wset_base_line_pos (w, Qnil);
21455 21482
21456 /* If the buffer is very big, don't waste time. */ 21483 /* If the buffer is very big, don't waste time. */
21457 if (INTEGERP (Vline_number_display_limit) 21484 if (INTEGERP (Vline_number_display_limit)
21458 && BUF_ZV (b) - BUF_BEGV (b) > XINT (Vline_number_display_limit)) 21485 && BUF_ZV (b) - BUF_BEGV (b) > XINT (Vline_number_display_limit))
21459 { 21486 {
21460 WSET (w, base_line_pos, Qnil); 21487 wset_base_line_pos (w, Qnil);
21461 WSET (w, base_line_number, Qnil); 21488 wset_base_line_number (w, Qnil);
21462 goto no_value; 21489 goto no_value;
21463 } 21490 }
21464 21491
@@ -21490,8 +21517,8 @@ decode_mode_spec (struct window *w, register int c, int field_width,
21490 go back past it. */ 21517 go back past it. */
21491 if (startpos == BUF_BEGV (b)) 21518 if (startpos == BUF_BEGV (b))
21492 { 21519 {
21493 WSET (w, base_line_number, make_number (topline)); 21520 wset_base_line_number (w, make_number (topline));
21494 WSET (w, base_line_pos, make_number (BUF_BEGV (b))); 21521 wset_base_line_pos (w, make_number (BUF_BEGV (b)));
21495 } 21522 }
21496 else if (nlines < height + 25 || nlines > height * 3 + 50 21523 else if (nlines < height + 25 || nlines > height * 3 + 50
21497 || linepos == BUF_BEGV (b)) 21524 || linepos == BUF_BEGV (b))
@@ -21517,13 +21544,13 @@ decode_mode_spec (struct window *w, register int c, int field_width,
21517 give up on line numbers for this window. */ 21544 give up on line numbers for this window. */
21518 if (position == limit_byte && limit == startpos - distance) 21545 if (position == limit_byte && limit == startpos - distance)
21519 { 21546 {
21520 WSET (w, base_line_pos, w->buffer); 21547 wset_base_line_pos (w, w->buffer);
21521 WSET (w, base_line_number, Qnil); 21548 wset_base_line_number (w, Qnil);
21522 goto no_value; 21549 goto no_value;
21523 } 21550 }
21524 21551
21525 WSET (w, base_line_number, make_number (topline - nlines)); 21552 wset_base_line_number (w, make_number (topline - nlines));
21526 WSET (w, base_line_pos, make_number (BYTE_TO_CHAR (position))); 21553 wset_base_line_pos (w, make_number (BYTE_TO_CHAR (position)));
21527 } 21554 }
21528 21555
21529 /* Now count lines from the start pos to point. */ 21556 /* Now count lines from the start pos to point. */
@@ -29288,12 +29315,13 @@ init_xdisp (void)
29288 29315
29289 echo_area_window = minibuf_window; 29316 echo_area_window = minibuf_window;
29290 29317
29291 WSET (r, top_line, make_number (FRAME_TOP_MARGIN (f))); 29318 wset_top_line (r, make_number (FRAME_TOP_MARGIN (f)));
29292 WSET (r, total_lines, make_number (FRAME_LINES (f) - 1 - FRAME_TOP_MARGIN (f))); 29319 wset_total_lines
29293 WSET (r, total_cols, make_number (FRAME_COLS (f))); 29320 (r, make_number (FRAME_LINES (f) - 1 - FRAME_TOP_MARGIN (f)));
29294 WSET (m, top_line, make_number (FRAME_LINES (f) - 1)); 29321 wset_total_cols (r, make_number (FRAME_COLS (f)));
29295 WSET (m, total_lines, make_number (1)); 29322 wset_top_line (m, make_number (FRAME_LINES (f) - 1));
29296 WSET (m, total_cols, make_number (FRAME_COLS (f))); 29323 wset_total_lines (m, make_number (1));
29324 wset_total_cols (m, make_number (FRAME_COLS (f)));
29297 29325
29298 scratch_glyph_row.glyphs[TEXT_AREA] = scratch_glyphs; 29326 scratch_glyph_row.glyphs[TEXT_AREA] = scratch_glyphs;
29299 scratch_glyph_row.glyphs[TEXT_AREA + 1] 29327 scratch_glyph_row.glyphs[TEXT_AREA + 1]
diff --git a/src/xfns.c b/src/xfns.c
index f4c7f4714a4..53891188727 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -5064,20 +5064,20 @@ Text larger than the specified size is clipped. */)
5064 5064
5065 /* Set up the frame's root window. */ 5065 /* Set up the frame's root window. */
5066 w = XWINDOW (FRAME_ROOT_WINDOW (f)); 5066 w = XWINDOW (FRAME_ROOT_WINDOW (f));
5067 WSET (w, left_col, make_number (0)); 5067 wset_left_col (w, make_number (0));
5068 WSET (w, top_line, make_number (0)); 5068 wset_top_line (w, make_number (0));
5069 5069
5070 if (CONSP (Vx_max_tooltip_size) 5070 if (CONSP (Vx_max_tooltip_size)
5071 && RANGED_INTEGERP (1, XCAR (Vx_max_tooltip_size), INT_MAX) 5071 && RANGED_INTEGERP (1, XCAR (Vx_max_tooltip_size), INT_MAX)
5072 && RANGED_INTEGERP (1, XCDR (Vx_max_tooltip_size), INT_MAX)) 5072 && RANGED_INTEGERP (1, XCDR (Vx_max_tooltip_size), INT_MAX))
5073 { 5073 {
5074 WSET (w, total_cols, XCAR (Vx_max_tooltip_size)); 5074 wset_total_cols (w, XCAR (Vx_max_tooltip_size));
5075 WSET (w, total_lines, XCDR (Vx_max_tooltip_size)); 5075 wset_total_lines (w, XCDR (Vx_max_tooltip_size));
5076 } 5076 }
5077 else 5077 else
5078 { 5078 {
5079 WSET (w, total_cols, make_number (80)); 5079 wset_total_cols (w, make_number (80));
5080 WSET (w, total_lines, make_number (40)); 5080 wset_total_lines (w, make_number (40));
5081 } 5081 }
5082 5082
5083 FRAME_TOTAL_COLS (f) = XINT (w->total_cols); 5083 FRAME_TOTAL_COLS (f) = XINT (w->total_cols);
@@ -5147,7 +5147,7 @@ Text larger than the specified size is clipped. */)
5147 /* w->total_cols and FRAME_TOTAL_COLS want the width in columns, 5147 /* w->total_cols and FRAME_TOTAL_COLS want the width in columns,
5148 not in pixels. */ 5148 not in pixels. */
5149 width /= WINDOW_FRAME_COLUMN_WIDTH (w); 5149 width /= WINDOW_FRAME_COLUMN_WIDTH (w);
5150 WSET (w, total_cols, make_number (width)); 5150 wset_total_cols (w, make_number (width));
5151 FRAME_TOTAL_COLS (f) = width; 5151 FRAME_TOTAL_COLS (f) = width;
5152 adjust_glyphs (f); 5152 adjust_glyphs (f);
5153 clear_glyph_matrix (w->desired_matrix); 5153 clear_glyph_matrix (w->desired_matrix);
diff --git a/src/xterm.c b/src/xterm.c
index 6a195543ed7..118c8767c23 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -5181,7 +5181,7 @@ x_scroll_bar_remove (struct scroll_bar *bar)
5181#endif 5181#endif
5182 5182
5183 /* Dissociate this scroll bar from its window. */ 5183 /* Dissociate this scroll bar from its window. */
5184 WSET (XWINDOW (bar->window), vertical_scroll_bar, Qnil); 5184 wset_vertical_scroll_bar (XWINDOW (bar->window), Qnil);
5185 5185
5186 UNBLOCK_INPUT; 5186 UNBLOCK_INPUT;
5187} 5187}
@@ -5395,7 +5395,7 @@ XTset_vertical_scroll_bar (struct window *w, int portion, int whole, int positio
5395#endif /* not USE_TOOLKIT_SCROLL_BARS */ 5395#endif /* not USE_TOOLKIT_SCROLL_BARS */
5396 5396
5397 XSETVECTOR (barobj, bar); 5397 XSETVECTOR (barobj, bar);
5398 WSET (w, vertical_scroll_bar, barobj); 5398 wset_vertical_scroll_bar (w, barobj);
5399} 5399}
5400 5400
5401 5401