aboutsummaryrefslogtreecommitdiffstats
path: root/src/window.c
diff options
context:
space:
mode:
authorKenichi Handa2012-08-22 18:05:50 +0900
committerKenichi Handa2012-08-22 18:05:50 +0900
commitfabc1281e9cde34ff9a19d843316d2ceca8647ad (patch)
treef38f13cab3ec6c32ab8ab49ea2e60f64969a0d22 /src/window.c
parent4ff819d728960bf5e52b72501c606f4bb3fde028 (diff)
parent842e3a93aa3a0826cb4148376e54cd1527d10901 (diff)
downloademacs-fabc1281e9cde34ff9a19d843316d2ceca8647ad.tar.gz
emacs-fabc1281e9cde34ff9a19d843316d2ceca8647ad.zip
merge trunk
Diffstat (limited to 'src/window.c')
-rw-r--r--src/window.c692
1 files changed, 414 insertions, 278 deletions
diff --git a/src/window.c b/src/window.c
index 7874105df1e..4d92566b243 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{
@@ -322,7 +437,10 @@ Return WINDOW. */)
322 if (EQ (frame, selected_frame)) 437 if (EQ (frame, selected_frame))
323 return Fselect_window (window, norecord); 438 return Fselect_window (window, norecord);
324 else 439 else
325 return FSET (XFRAME (frame), selected_window, window); 440 {
441 fset_selected_window (XFRAME (frame), window);
442 return window;
443 }
326} 444}
327 445
328DEFUN ("selected-window", Fselected_window, Sselected_window, 0, 0, 0, 446DEFUN ("selected-window", Fselected_window, Sselected_window, 0, 0, 0,
@@ -359,13 +477,16 @@ select_window (Lisp_Object window, Lisp_Object norecord, int inhibit_point_swap)
359 record_buffer (w->buffer); 477 record_buffer (w->buffer);
360 } 478 }
361 479
480 /* Make the selected window's buffer current. */
481 Fset_buffer (w->buffer);
482
362 if (EQ (window, selected_window) && !inhibit_point_swap) 483 if (EQ (window, selected_window) && !inhibit_point_swap)
363 return window; 484 return window;
364 485
365 sf = SELECTED_FRAME (); 486 sf = SELECTED_FRAME ();
366 if (XFRAME (WINDOW_FRAME (w)) != sf) 487 if (XFRAME (WINDOW_FRAME (w)) != sf)
367 { 488 {
368 FSET (XFRAME (WINDOW_FRAME (w)), selected_window, window); 489 fset_selected_window (XFRAME (WINDOW_FRAME (w)), window);
369 /* Use this rather than Fhandle_switch_frame 490 /* Use this rather than Fhandle_switch_frame
370 so that FRAME_FOCUS_FRAME is moved appropriately as we 491 so that FRAME_FOCUS_FRAME is moved appropriately as we
371 move around in the state where a minibuffer in a separate 492 move around in the state where a minibuffer in a separate
@@ -376,11 +497,11 @@ select_window (Lisp_Object window, Lisp_Object norecord, int inhibit_point_swap)
376 return window; 497 return window;
377 } 498 }
378 else 499 else
379 FSET (sf, selected_window, window); 500 fset_selected_window (sf, window);
380 501
381 /* Store the current buffer's actual point into the 502 /* Store the old selected window's buffer's point in pointm of the old
382 old selected window. It belongs to that window, 503 selected window. It belongs to that window, and when the window is
383 and when the window is not selected, must be in the window. */ 504 not selected, must be in the window. */
384 if (!inhibit_point_swap) 505 if (!inhibit_point_swap)
385 { 506 {
386 ow = XWINDOW (selected_window); 507 ow = XWINDOW (selected_window);
@@ -391,10 +512,7 @@ select_window (Lisp_Object window, Lisp_Object norecord, int inhibit_point_swap)
391 } 512 }
392 513
393 selected_window = window; 514 selected_window = window;
394 515 bset_last_selected_window (XBUFFER (w->buffer), window);
395 Fset_buffer (w->buffer);
396
397 BSET (XBUFFER (w->buffer), last_selected_window, window);
398 516
399 /* Go to the point recorded in the window. 517 /* Go to the point recorded in the window.
400 This is important when the buffer is in more 518 This is important when the buffer is in more
@@ -511,7 +629,8 @@ never \(re-)combined with WINDOW's siblings. Other values are reserved
511for future use. */) 629for future use. */)
512 (Lisp_Object window, Lisp_Object limit) 630 (Lisp_Object window, Lisp_Object limit)
513{ 631{
514 return WSET (decode_valid_window (window), combination_limit, limit); 632 wset_combination_limit (decode_valid_window (window), limit);
633 return limit;
515} 634}
516 635
517DEFUN ("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,
@@ -750,7 +869,8 @@ with two arguments: WINDOW, and the end trigger value. Afterwards the
750end-trigger value is reset to nil. */) 869end-trigger value is reset to nil. */)
751 (register Lisp_Object window, Lisp_Object value) 870 (register Lisp_Object window, Lisp_Object value)
752{ 871{
753 return WSET (decode_live_window (window), redisplay_end_trigger, value); 872 wset_redisplay_end_trigger (decode_live_window (window), value);
873 return value;
754} 874}
755 875
756DEFUN ("window-edges", Fwindow_edges, Swindow_edges, 0, 1, 0, 876DEFUN ("window-edges", Fwindow_edges, Swindow_edges, 0, 1, 0,
@@ -1287,22 +1407,21 @@ DEFUN ("window-point", Fwindow_point, Swindow_point, 0, 1, 0,
1287 doc: /* Return current value of point in WINDOW. 1407 doc: /* Return current value of point in WINDOW.
1288WINDOW must be a live window and defaults to the selected one. 1408WINDOW must be a live window and defaults to the selected one.
1289 1409
1290For a nonselected window, this is the value point would have 1410For a nonselected window, this is the value point would have if that
1291if that window were selected. 1411window were selected.
1292 1412
1293Note that, when WINDOW is the selected window and its buffer 1413Note that, when WINDOW is selected, the value returned is the same as
1294is also currently selected, the value returned is the same as (point). 1414that returned by `point' for WINDOW's buffer. It would be more strictly
1295It would be more strictly correct to return the `top-level' value 1415correct to return the `top-level' value of `point', outside of any
1296of point, outside of any save-excursion forms. 1416`save-excursion' forms. But that is hard to define. */)
1297But that is hard to define. */)
1298 (Lisp_Object window) 1417 (Lisp_Object window)
1299{ 1418{
1300 register struct window *w = decode_live_window (window); 1419 register struct window *w = decode_live_window (window);
1301 1420
1302 if (w == XWINDOW (selected_window) 1421 if (w == XWINDOW (selected_window))
1303 && current_buffer == XBUFFER (w->buffer)) 1422 return make_number (BUF_PT (XBUFFER (w->buffer)));
1304 return Fpoint (); 1423 else
1305 return Fmarker_position (w->pointm); 1424 return Fmarker_position (w->pointm);
1306} 1425}
1307 1426
1308DEFUN ("window-start", Fwindow_start, Swindow_start, 0, 1, 0, 1427DEFUN ("window-start", Fwindow_start, Swindow_start, 0, 1, 0,
@@ -1412,16 +1531,27 @@ Return POS. */)
1412 register struct window *w = decode_live_window (window); 1531 register struct window *w = decode_live_window (window);
1413 1532
1414 CHECK_NUMBER_COERCE_MARKER (pos); 1533 CHECK_NUMBER_COERCE_MARKER (pos);
1415 if (w == XWINDOW (selected_window)
1416 && XBUFFER (w->buffer) == current_buffer)
1417 Fgoto_char (pos);
1418 else
1419 set_marker_restricted (w->pointm, pos, w->buffer);
1420 1534
1421 /* We have to make sure that redisplay updates the window to show 1535 if (w == XWINDOW (selected_window))
1422 the new value of point. */ 1536 {
1423 if (!EQ (window, selected_window)) 1537 if (XBUFFER (w->buffer) == current_buffer)
1424 ++windows_or_buffers_changed; 1538 Fgoto_char (pos);
1539 else
1540 {
1541 struct buffer *old_buffer = current_buffer;
1542
1543 set_buffer_internal (XBUFFER (w->buffer));
1544 Fgoto_char (pos);
1545 set_buffer_internal (old_buffer);
1546 }
1547 }
1548 else
1549 {
1550 set_marker_restricted (w->pointm, pos, w->buffer);
1551 /* We have to make sure that redisplay updates the window to show
1552 the new value of point. */
1553 ++windows_or_buffers_changed;
1554 }
1425 1555
1426 return pos; 1556 return pos;
1427} 1557}
@@ -1671,7 +1801,8 @@ buffer. If and when `set-window-buffer' displays another buffer in a
1671window, it also makes sure that the window is no more dedicated. */) 1801window, it also makes sure that the window is no more dedicated. */)
1672 (Lisp_Object window, Lisp_Object flag) 1802 (Lisp_Object window, Lisp_Object flag)
1673{ 1803{
1674 return WSET (decode_live_window (window), dedicated, flag); 1804 wset_dedicated (decode_live_window (window), flag);
1805 return flag;
1675} 1806}
1676 1807
1677DEFUN ("window-prev-buffers", Fwindow_prev_buffers, Swindow_prev_buffers, 1808DEFUN ("window-prev-buffers", Fwindow_prev_buffers, Swindow_prev_buffers,
@@ -1697,7 +1828,8 @@ where BUFFER is a buffer, WINDOW-START is the start position of the
1697window for that buffer, and POS is a window-specific point value. */) 1828window for that buffer, and POS is a window-specific point value. */)
1698 (Lisp_Object window, Lisp_Object prev_buffers) 1829 (Lisp_Object window, Lisp_Object prev_buffers)
1699{ 1830{
1700 return WSET (decode_live_window (window), prev_buffers, prev_buffers); 1831 wset_prev_buffers (decode_live_window (window), prev_buffers);
1832 return prev_buffers;
1701} 1833}
1702 1834
1703DEFUN ("window-next-buffers", Fwindow_next_buffers, Swindow_next_buffers, 1835DEFUN ("window-next-buffers", Fwindow_next_buffers, Swindow_next_buffers,
@@ -1716,7 +1848,8 @@ WINDOW must be a live window and defaults to the selected one.
1716NEXT-BUFFERS should be a list of buffers. */) 1848NEXT-BUFFERS should be a list of buffers. */)
1717 (Lisp_Object window, Lisp_Object next_buffers) 1849 (Lisp_Object window, Lisp_Object next_buffers)
1718{ 1850{
1719 return WSET (decode_live_window (window), next_buffers, next_buffers); 1851 wset_next_buffers (decode_live_window (window), next_buffers);
1852 return next_buffers;
1720} 1853}
1721 1854
1722DEFUN ("window-parameters", Fwindow_parameters, Swindow_parameters, 1855DEFUN ("window-parameters", Fwindow_parameters, Swindow_parameters,
@@ -1753,8 +1886,8 @@ Return VALUE. */)
1753 1886
1754 old_alist_elt = Fassq (parameter, w->window_parameters); 1887 old_alist_elt = Fassq (parameter, w->window_parameters);
1755 if (NILP (old_alist_elt)) 1888 if (NILP (old_alist_elt))
1756 WSET (w, window_parameters, 1889 wset_window_parameters
1757 Fcons (Fcons (parameter, value), w->window_parameters)); 1890 (w, Fcons (Fcons (parameter, value), w->window_parameters));
1758 else 1891 else
1759 Fsetcdr (old_alist_elt, value); 1892 Fsetcdr (old_alist_elt, value);
1760 return value; 1893 return value;
@@ -1799,7 +1932,8 @@ DEFUN ("set-window-display-table", Fset_window_display_table, Sset_window_displa
1799WINDOW must be a live window and defaults to the selected one. */) 1932WINDOW must be a live window and defaults to the selected one. */)
1800 (register Lisp_Object window, Lisp_Object table) 1933 (register Lisp_Object window, Lisp_Object table)
1801{ 1934{
1802 return WSET (decode_live_window (window), display_table, table); 1935 wset_display_table (decode_live_window (window), table);
1936 return table;
1803} 1937}
1804 1938
1805/* Record info on buffer window W is displaying 1939/* Record info on buffer window W is displaying
@@ -1848,7 +1982,7 @@ unshow_buffer (register struct window *w)
1848 1982
1849 if (WINDOWP (BVAR (b, last_selected_window)) 1983 if (WINDOWP (BVAR (b, last_selected_window))
1850 && w == XWINDOW (BVAR (b, last_selected_window))) 1984 && w == XWINDOW (BVAR (b, last_selected_window)))
1851 BSET (b, last_selected_window, Qnil); 1985 bset_last_selected_window (b, Qnil);
1852} 1986}
1853 1987
1854/* Put NEW into the window structure in place of OLD. SETFLAG zero 1988/* Put NEW into the window structure in place of OLD. SETFLAG zero
@@ -1863,18 +1997,18 @@ replace_window (Lisp_Object old, Lisp_Object new, int setflag)
1863 /* If OLD is its frame's root window, then NEW is the new 1997 /* If OLD is its frame's root window, then NEW is the new
1864 root window for that frame. */ 1998 root window for that frame. */
1865 if (EQ (old, FRAME_ROOT_WINDOW (XFRAME (o->frame)))) 1999 if (EQ (old, FRAME_ROOT_WINDOW (XFRAME (o->frame))))
1866 FSET (XFRAME (o->frame), root_window, new); 2000 fset_root_window (XFRAME (o->frame), new);
1867 2001
1868 if (setflag) 2002 if (setflag)
1869 { 2003 {
1870 WSET (n, left_col, o->left_col); 2004 wset_left_col (n, o->left_col);
1871 WSET (n, top_line, o->top_line); 2005 wset_top_line (n, o->top_line);
1872 WSET (n, total_cols, o->total_cols); 2006 wset_total_cols (n, o->total_cols);
1873 WSET (n, total_lines, o->total_lines); 2007 wset_total_lines (n, o->total_lines);
1874 WSET (n, normal_cols, o->normal_cols); 2008 wset_normal_cols (n, o->normal_cols);
1875 WSET (o, normal_cols, make_float (1.0)); 2009 wset_normal_cols (o, make_float (1.0));
1876 WSET (n, normal_lines, o->normal_lines); 2010 wset_normal_lines (n, o->normal_lines);
1877 WSET (o, normal_lines, make_float (1.0)); 2011 wset_normal_lines (o, make_float (1.0));
1878 n->desired_matrix = n->current_matrix = 0; 2012 n->desired_matrix = n->current_matrix = 0;
1879 n->vscroll = 0; 2013 n->vscroll = 0;
1880 memset (&n->cursor, 0, sizeof (n->cursor)); 2014 memset (&n->cursor, 0, sizeof (n->cursor));
@@ -1884,30 +2018,30 @@ replace_window (Lisp_Object old, Lisp_Object new, int setflag)
1884 n->phys_cursor_width = -1; 2018 n->phys_cursor_width = -1;
1885 n->must_be_updated_p = 0; 2019 n->must_be_updated_p = 0;
1886 n->pseudo_window_p = 0; 2020 n->pseudo_window_p = 0;
1887 WSET (n, window_end_vpos, make_number (0)); 2021 wset_window_end_vpos (n, make_number (0));
1888 WSET (n, window_end_pos, make_number (0)); 2022 wset_window_end_pos (n, make_number (0));
1889 WSET (n, window_end_valid, Qnil); 2023 wset_window_end_valid (n, Qnil);
1890 n->frozen_window_start_p = 0; 2024 n->frozen_window_start_p = 0;
1891 } 2025 }
1892 2026
1893 tem = o->next; 2027 tem = o->next;
1894 WSET (n, next, tem); 2028 wset_next (n, tem);
1895 if (!NILP (tem)) 2029 if (!NILP (tem))
1896 WSET (XWINDOW (tem), prev, new); 2030 wset_prev (XWINDOW (tem), new);
1897 2031
1898 tem = o->prev; 2032 tem = o->prev;
1899 WSET (n, prev, tem); 2033 wset_prev (n, tem);
1900 if (!NILP (tem)) 2034 if (!NILP (tem))
1901 WSET (XWINDOW (tem), next, new); 2035 wset_next (XWINDOW (tem), new);
1902 2036
1903 tem = o->parent; 2037 tem = o->parent;
1904 WSET (n, parent, tem); 2038 wset_parent (n, tem);
1905 if (!NILP (tem)) 2039 if (!NILP (tem))
1906 { 2040 {
1907 if (EQ (XWINDOW (tem)->vchild, old)) 2041 if (EQ (XWINDOW (tem)->vchild, old))
1908 WSET (XWINDOW (tem), vchild, new); 2042 wset_vchild (XWINDOW (tem), new);
1909 if (EQ (XWINDOW (tem)->hchild, old)) 2043 if (EQ (XWINDOW (tem)->hchild, old))
1910 WSET (XWINDOW (tem), hchild, new); 2044 wset_hchild (XWINDOW (tem), new);
1911 } 2045 }
1912} 2046}
1913 2047
@@ -1940,34 +2074,34 @@ recombine_windows (Lisp_Object window)
1940 assign new normal sizes. */ 2074 assign new normal sizes. */
1941 if (NILP (w->prev)) 2075 if (NILP (w->prev))
1942 if (horflag) 2076 if (horflag)
1943 WSET (p, hchild, child); 2077 wset_hchild (p, child);
1944 else 2078 else
1945 WSET (p, vchild, child); 2079 wset_vchild (p, child);
1946 else 2080 else
1947 { 2081 {
1948 WSET (c, prev, w->prev); 2082 wset_prev (c, w->prev);
1949 WSET (XWINDOW (w->prev), next, child); 2083 wset_next (XWINDOW (w->prev), child);
1950 } 2084 }
1951 2085
1952 while (c) 2086 while (c)
1953 { 2087 {
1954 WSET (c, parent, parent); 2088 wset_parent (c, parent);
1955 2089
1956 if (horflag) 2090 if (horflag)
1957 WSET (c, normal_cols, 2091 wset_normal_cols (c,
1958 make_float (XFLOATINT (c->total_cols) 2092 make_float (XFLOATINT (c->total_cols)
1959 / XFLOATINT (p->total_cols))); 2093 / XFLOATINT (p->total_cols)));
1960 else 2094 else
1961 WSET (c, normal_lines, 2095 wset_normal_lines (c,
1962 make_float (XFLOATINT (c->total_lines) 2096 make_float (XFLOATINT (c->total_lines)
1963 / XFLOATINT (p->total_lines))); 2097 / XFLOATINT (p->total_lines)));
1964 2098
1965 if (NILP (c->next)) 2099 if (NILP (c->next))
1966 { 2100 {
1967 if (!NILP (w->next)) 2101 if (!NILP (w->next))
1968 { 2102 {
1969 WSET (c, next, w->next); 2103 wset_next (c, w->next);
1970 WSET (XWINDOW (c->next), prev, child); 2104 wset_prev (XWINDOW (c->next), child);
1971 } 2105 }
1972 2106
1973 c = 0; 2107 c = 0;
@@ -1980,8 +2114,8 @@ recombine_windows (Lisp_Object window)
1980 } 2114 }
1981 2115
1982 /* WINDOW can be deleted now. */ 2116 /* WINDOW can be deleted now. */
1983 WSET (w, vchild, Qnil); 2117 wset_vchild (w, Qnil);
1984 WSET (w, hchild, Qnil); 2118 wset_hchild (w, Qnil);
1985 } 2119 }
1986 } 2120 }
1987} 2121}
@@ -2146,7 +2280,7 @@ decode_next_window_args (Lisp_Object *window, Lisp_Object *minibuf, Lisp_Object
2146 2280
2147 /* ALL_FRAMES nil doesn't specify which frames to include. */ 2281 /* ALL_FRAMES nil doesn't specify which frames to include. */
2148 if (NILP (*all_frames)) 2282 if (NILP (*all_frames))
2149 *all_frames 2283 *all_frames
2150 = (!EQ (*minibuf, Qlambda) 2284 = (!EQ (*minibuf, Qlambda)
2151 ? FRAME_MINIBUF_WINDOW (XFRAME (XWINDOW (*window)->frame)) 2285 ? FRAME_MINIBUF_WINDOW (XFRAME (XWINDOW (*window)->frame))
2152 : Qnil); 2286 : Qnil);
@@ -2502,7 +2636,7 @@ window_loop (enum window_loop type, Lisp_Object obj, int mini, Lisp_Object frame
2502 if (EQ (w->buffer, obj)) 2636 if (EQ (w->buffer, obj))
2503 { 2637 {
2504 /* Undedicate WINDOW. */ 2638 /* Undedicate WINDOW. */
2505 WSET (w, dedicated, Qnil); 2639 wset_dedicated (w, Qnil);
2506 /* Make WINDOW show the buffer returned by 2640 /* Make WINDOW show the buffer returned by
2507 other_buffer_safely, don't run any hooks. */ 2641 other_buffer_safely, don't run any hooks. */
2508 set_window_buffer 2642 set_window_buffer
@@ -2659,7 +2793,7 @@ window-start value is reasonable when this function is called. */)
2659 if (EQ (selected_frame, w->frame)) 2793 if (EQ (selected_frame, w->frame))
2660 Fselect_window (window, Qnil); 2794 Fselect_window (window, Qnil);
2661 else 2795 else
2662 FSET (f, selected_window, window); 2796 fset_selected_window (f, window);
2663 } 2797 }
2664 } 2798 }
2665 else 2799 else
@@ -2689,7 +2823,7 @@ window-start value is reasonable when this function is called. */)
2689 if (EQ (selected_frame, w->frame)) 2823 if (EQ (selected_frame, w->frame))
2690 Fselect_window (swindow, Qnil); 2824 Fselect_window (swindow, Qnil);
2691 else 2825 else
2692 FSET (f, selected_window, swindow); 2826 fset_selected_window (f, swindow);
2693 } 2827 }
2694 } 2828 }
2695 2829
@@ -2724,7 +2858,7 @@ window-start value is reasonable when this function is called. */)
2724 /* Resize child windows vertically. */ 2858 /* Resize child windows vertically. */
2725 XSETINT (delta, XINT (r->total_lines) 2859 XSETINT (delta, XINT (r->total_lines)
2726 - XINT (w->total_lines)); 2860 - XINT (w->total_lines));
2727 WSET (w, top_line, r->top_line); 2861 wset_top_line (w, r->top_line);
2728 resize_root_window (window, delta, Qnil, Qnil); 2862 resize_root_window (window, delta, Qnil, Qnil);
2729 if (window_resize_check (w, 0)) 2863 if (window_resize_check (w, 0))
2730 window_resize_apply (w, 0); 2864 window_resize_apply (w, 0);
@@ -2740,10 +2874,10 @@ window-start value is reasonable when this function is called. */)
2740 /* Resize child windows horizontally. */ 2874 /* Resize child windows horizontally. */
2741 if (!resize_failed) 2875 if (!resize_failed)
2742 { 2876 {
2743 WSET (w, left_col, r->left_col); 2877 wset_left_col (w, r->left_col);
2744 XSETINT (delta, XINT (r->total_cols) 2878 XSETINT (delta,
2745 - XINT (w->total_cols)); 2879 XINT (r->total_cols) - XINT (w->total_cols));
2746 WSET (w, left_col, r->left_col); 2880 wset_left_col (w, r->left_col);
2747 resize_root_window (window, delta, Qt, Qnil); 2881 resize_root_window (window, delta, Qt, Qnil);
2748 if (window_resize_check (w, 1)) 2882 if (window_resize_check (w, 1))
2749 window_resize_apply (w, 1); 2883 window_resize_apply (w, 1);
@@ -2771,32 +2905,32 @@ window-start value is reasonable when this function is called. */)
2771 { 2905 {
2772 sibling = w->prev; 2906 sibling = w->prev;
2773 s = XWINDOW (sibling); 2907 s = XWINDOW (sibling);
2774 WSET (s, next, w->next); 2908 wset_next (s, w->next);
2775 if (!NILP (s->next)) 2909 if (!NILP (s->next))
2776 WSET (XWINDOW (s->next), prev, sibling); 2910 wset_prev (XWINDOW (s->next), sibling);
2777 } 2911 }
2778 else 2912 else
2779 /* Get SIBLING below (on the right of) WINDOW. */ 2913 /* Get SIBLING below (on the right of) WINDOW. */
2780 { 2914 {
2781 sibling = w->next; 2915 sibling = w->next;
2782 s = XWINDOW (sibling); 2916 s = XWINDOW (sibling);
2783 WSET (s, prev, Qnil); 2917 wset_prev (s, Qnil);
2784 if (!NILP (XWINDOW (w->parent)->vchild)) 2918 if (!NILP (XWINDOW (w->parent)->vchild))
2785 WSET (XWINDOW (w->parent), vchild, sibling); 2919 wset_vchild (XWINDOW (w->parent), sibling);
2786 else 2920 else
2787 WSET (XWINDOW (w->parent), hchild, sibling); 2921 wset_hchild (XWINDOW (w->parent), sibling);
2788 } 2922 }
2789 2923
2790 /* Delete ROOT and all child windows of ROOT. */ 2924 /* Delete ROOT and all child windows of ROOT. */
2791 if (!NILP (r->vchild)) 2925 if (!NILP (r->vchild))
2792 { 2926 {
2793 delete_all_child_windows (r->vchild); 2927 delete_all_child_windows (r->vchild);
2794 WSET (r, vchild, Qnil); 2928 wset_vchild (r, Qnil);
2795 } 2929 }
2796 else if (!NILP (r->hchild)) 2930 else if (!NILP (r->hchild))
2797 { 2931 {
2798 delete_all_child_windows (r->hchild); 2932 delete_all_child_windows (r->hchild);
2799 WSET (r, hchild, Qnil); 2933 wset_hchild (r, Qnil);
2800 } 2934 }
2801 2935
2802 replace_window (root, window, 1); 2936 replace_window (root, window, 1);
@@ -2823,7 +2957,7 @@ window-start value is reasonable when this function is called. */)
2823 pos = *vmotion (startpos, -top, w); 2957 pos = *vmotion (startpos, -top, w);
2824 2958
2825 set_marker_both (w->start, w->buffer, pos.bufpos, pos.bytepos); 2959 set_marker_both (w->start, w->buffer, pos.bufpos, pos.bytepos);
2826 WSET (w, window_end_valid, Qnil); 2960 wset_window_end_valid (w, Qnil);
2827 w->start_at_line_beg = (pos.bytepos == BEGV_BYTE 2961 w->start_at_line_beg = (pos.bytepos == BEGV_BYTE
2828 || FETCH_BYTE (pos.bytepos - 1) == '\n'); 2962 || FETCH_BYTE (pos.bytepos - 1) == '\n');
2829 /* We need to do this, so that the window-scroll-functions 2963 /* We need to do this, so that the window-scroll-functions
@@ -2914,14 +3048,14 @@ adjust_window_margins (struct window *w)
2914 { 3048 {
2915 if (WINDOW_LEFT_MARGIN_COLS (w) > 0) 3049 if (WINDOW_LEFT_MARGIN_COLS (w) > 0)
2916 { 3050 {
2917 WSET (w, left_margin_cols, make_number (margin_cols / 2)); 3051 wset_left_margin_cols (w, make_number (margin_cols / 2));
2918 WSET (w, right_margin_cols, make_number (margin_cols / 2)); 3052 wset_right_margin_cols (w, make_number (margin_cols / 2));
2919 } 3053 }
2920 else 3054 else
2921 WSET (w, right_margin_cols, make_number (margin_cols)); 3055 wset_right_margin_cols (w, make_number (margin_cols));
2922 } 3056 }
2923 else 3057 else
2924 WSET (w, left_margin_cols, make_number (margin_cols)); 3058 wset_left_margin_cols (w, make_number (margin_cols));
2925 return 1; 3059 return 1;
2926} 3060}
2927 3061
@@ -3021,23 +3155,23 @@ set_window_buffer (Lisp_Object window, Lisp_Object buffer, int run_hooks_p, int
3021 ptrdiff_t count = SPECPDL_INDEX (); 3155 ptrdiff_t count = SPECPDL_INDEX ();
3022 int samebuf = EQ (buffer, w->buffer); 3156 int samebuf = EQ (buffer, w->buffer);
3023 3157
3024 WSET (w, buffer, buffer); 3158 wset_buffer (w, buffer);
3025 3159
3026 if (EQ (window, selected_window)) 3160 if (EQ (window, selected_window))
3027 BSET (b, last_selected_window, window); 3161 bset_last_selected_window (b, window);
3028 3162
3029 /* Let redisplay errors through. */ 3163 /* Let redisplay errors through. */
3030 b->display_error_modiff = 0; 3164 b->display_error_modiff = 0;
3031 3165
3032 /* Update time stamps of buffer display. */ 3166 /* Update time stamps of buffer display. */
3033 if (INTEGERP (BVAR (b, display_count))) 3167 if (INTEGERP (BVAR (b, display_count)))
3034 BSET (b, display_count, make_number (XINT (BVAR (b, display_count)) + 1)); 3168 bset_display_count (b, make_number (XINT (BVAR (b, display_count)) + 1));
3035 BSET (b, display_time, Fcurrent_time ()); 3169 bset_display_time (b, Fcurrent_time ());
3036 3170
3037 WSET (w, window_end_pos, make_number (0)); 3171 wset_window_end_pos (w, make_number (0));
3038 WSET (w, window_end_vpos, make_number (0)); 3172 wset_window_end_vpos (w, make_number (0));
3039 memset (&w->last_cursor, 0, sizeof w->last_cursor); 3173 memset (&w->last_cursor, 0, sizeof w->last_cursor);
3040 WSET (w, window_end_valid, Qnil); 3174 wset_window_end_valid (w, Qnil);
3041 if (!(keep_margins_p && samebuf)) 3175 if (!(keep_margins_p && samebuf))
3042 { /* If we're not actually changing the buffer, don't reset hscroll and 3176 { /* If we're not actually changing the buffer, don't reset hscroll and
3043 vscroll. This case happens for example when called from 3177 vscroll. This case happens for example when called from
@@ -3082,8 +3216,8 @@ set_window_buffer (Lisp_Object window, Lisp_Object buffer, int run_hooks_p, int
3082 Lisp_Object save_left = w->left_margin_cols; 3216 Lisp_Object save_left = w->left_margin_cols;
3083 Lisp_Object save_right = w->right_margin_cols; 3217 Lisp_Object save_right = w->right_margin_cols;
3084 3218
3085 WSET (w, left_margin_cols, Qnil); 3219 wset_left_margin_cols (w, Qnil);
3086 WSET (w, right_margin_cols, Qnil); 3220 wset_right_margin_cols (w, Qnil);
3087 3221
3088 Fset_window_fringes (window, 3222 Fset_window_fringes (window,
3089 BVAR (b, left_fringe_width), BVAR (b, right_fringe_width), 3223 BVAR (b, left_fringe_width), BVAR (b, right_fringe_width),
@@ -3093,8 +3227,8 @@ set_window_buffer (Lisp_Object window, Lisp_Object buffer, int run_hooks_p, int
3093 BVAR (b, scroll_bar_width), 3227 BVAR (b, scroll_bar_width),
3094 BVAR (b, vertical_scroll_bar_type), Qnil); 3228 BVAR (b, vertical_scroll_bar_type), Qnil);
3095 3229
3096 WSET (w, left_margin_cols, save_left); 3230 wset_left_margin_cols (w, save_left);
3097 WSET (w, right_margin_cols, save_right); 3231 wset_right_margin_cols (w, save_right);
3098 3232
3099 Fset_window_margins (window, 3233 Fset_window_margins (window,
3100 BVAR (b, left_margin_cols), BVAR (b, right_margin_cols)); 3234 BVAR (b, left_margin_cols), BVAR (b, right_margin_cols));
@@ -3153,7 +3287,7 @@ This function runs `window-scroll-functions' before running
3153 else 3287 else
3154 /* WINDOW is weakly dedicated to its buffer, reset 3288 /* WINDOW is weakly dedicated to its buffer, reset
3155 dedication. */ 3289 dedication. */
3156 WSET (w, dedicated, Qnil); 3290 wset_dedicated (w, Qnil);
3157 3291
3158 call1 (Qrecord_window_buffer, window); 3292 call1 (Qrecord_window_buffer, window);
3159 } 3293 }
@@ -3223,7 +3357,7 @@ temp_output_buffer_show (register Lisp_Object buf)
3223 register Lisp_Object window; 3357 register Lisp_Object window;
3224 register struct window *w; 3358 register struct window *w;
3225 3359
3226 BSET (XBUFFER (buf), directory, BVAR (current_buffer, directory)); 3360 bset_directory (XBUFFER (buf), BVAR (current_buffer, directory));
3227 3361
3228 Fset_buffer (buf); 3362 Fset_buffer (buf);
3229 BUF_SAVE_MODIFF (XBUFFER (buf)) = MODIFF; 3363 BUF_SAVE_MODIFF (XBUFFER (buf)) = MODIFF;
@@ -3299,17 +3433,17 @@ make_parent_window (Lisp_Object window, int horflag)
3299 3433
3300 replace_window (window, parent, 1); 3434 replace_window (window, parent, 1);
3301 3435
3302 WSET (o, next, Qnil); 3436 wset_next (o, Qnil);
3303 WSET (o, prev, Qnil); 3437 wset_prev (o, Qnil);
3304 WSET (o, parent, parent); 3438 wset_parent (o, parent);
3305 3439
3306 WSET (p, hchild, horflag ? window : Qnil); 3440 wset_hchild (p, horflag ? window : Qnil);
3307 WSET (p, vchild, horflag ? Qnil : window); 3441 wset_vchild (p, horflag ? Qnil : window);
3308 WSET (p, start, Qnil); 3442 wset_start (p, Qnil);
3309 WSET (p, pointm, Qnil); 3443 wset_pointm (p, Qnil);
3310 WSET (p, buffer, Qnil); 3444 wset_buffer (p, Qnil);
3311 WSET (p, combination_limit, Qnil); 3445 wset_combination_limit (p, Qnil);
3312 WSET (p, window_parameters, Qnil); 3446 wset_window_parameters (p, Qnil);
3313} 3447}
3314 3448
3315/* Make new window from scratch. */ 3449/* Make new window from scratch. */
@@ -3322,19 +3456,19 @@ make_window (void)
3322 w = allocate_window (); 3456 w = allocate_window ();
3323 /* Initialize Lisp data. Note that allocate_window initializes all 3457 /* Initialize Lisp data. Note that allocate_window initializes all
3324 Lisp data to nil, so do it only for slots which should not be nil. */ 3458 Lisp data to nil, so do it only for slots which should not be nil. */
3325 WSET (w, left_col, make_number (0)); 3459 wset_left_col (w, make_number (0));
3326 WSET (w, top_line, make_number (0)); 3460 wset_top_line (w, make_number (0));
3327 WSET (w, total_lines, make_number (0)); 3461 wset_total_lines (w, make_number (0));
3328 WSET (w, total_cols, make_number (0)); 3462 wset_total_cols (w, make_number (0));
3329 WSET (w, normal_lines, make_float (1.0)); 3463 wset_normal_lines (w, make_float (1.0));
3330 WSET (w, normal_cols, make_float (1.0)); 3464 wset_normal_cols (w, make_float (1.0));
3331 WSET (w, new_total, make_number (0)); 3465 wset_new_total (w, make_number (0));
3332 WSET (w, new_normal, make_number (0)); 3466 wset_new_normal (w, make_number (0));
3333 WSET (w, start, Fmake_marker ()); 3467 wset_start (w, Fmake_marker ());
3334 WSET (w, pointm, Fmake_marker ()); 3468 wset_pointm (w, Fmake_marker ());
3335 WSET (w, vertical_scroll_bar_type, Qt); 3469 wset_vertical_scroll_bar_type (w, Qt);
3336 WSET (w, window_end_pos, make_number (0)); 3470 wset_window_end_pos (w, make_number (0));
3337 WSET (w, window_end_vpos, make_number (0)); 3471 wset_window_end_vpos (w, make_number (0));
3338 3472
3339 /* Initialize non-Lisp data. Note that allocate_window zeroes out all 3473 /* Initialize non-Lisp data. Note that allocate_window zeroes out all
3340 non-Lisp data, so do it only for slots which should not be zero. */ 3474 non-Lisp data, so do it only for slots which should not be zero. */
@@ -3365,9 +3499,9 @@ Note: This function does not operate on any child windows of WINDOW. */)
3365 3499
3366 CHECK_NUMBER (size); 3500 CHECK_NUMBER (size);
3367 if (NILP (add)) 3501 if (NILP (add))
3368 WSET (w, new_total, size); 3502 wset_new_total (w, size);
3369 else 3503 else
3370 WSET (w, new_total, make_number (XINT (w->new_total) + XINT (size))); 3504 wset_new_total (w, make_number (XINT (w->new_total) + XINT (size)));
3371 3505
3372 return w->new_total; 3506 return w->new_total;
3373} 3507}
@@ -3380,7 +3514,8 @@ Return SIZE.
3380Note: This function does not operate on any child windows of WINDOW. */) 3514Note: This function does not operate on any child windows of WINDOW. */)
3381 (Lisp_Object window, Lisp_Object size) 3515 (Lisp_Object window, Lisp_Object size)
3382{ 3516{
3383 return WSET (decode_valid_window (window), new_normal, size); 3517 wset_new_normal (decode_valid_window (window), size);
3518 return size;
3384} 3519}
3385 3520
3386/* Return 1 if setting w->total_lines (w->total_cols if HORFLAG is 3521/* Return 1 if setting w->total_lines (w->total_cols if HORFLAG is
@@ -3481,17 +3616,17 @@ window_resize_apply (struct window *w, int horflag)
3481 parent window has been set *before*. */ 3616 parent window has been set *before*. */
3482 if (horflag) 3617 if (horflag)
3483 { 3618 {
3484 WSET (w, total_cols, w->new_total); 3619 wset_total_cols (w, w->new_total);
3485 if (NUMBERP (w->new_normal)) 3620 if (NUMBERP (w->new_normal))
3486 WSET (w, normal_cols, w->new_normal); 3621 wset_normal_cols (w, w->new_normal);
3487 3622
3488 pos = XINT (w->left_col); 3623 pos = XINT (w->left_col);
3489 } 3624 }
3490 else 3625 else
3491 { 3626 {
3492 WSET (w, total_lines, w->new_total); 3627 wset_total_lines (w, w->new_total);
3493 if (NUMBERP (w->new_normal)) 3628 if (NUMBERP (w->new_normal))
3494 WSET (w, normal_lines, w->new_normal); 3629 wset_normal_lines (w, w->new_normal);
3495 3630
3496 pos = XINT (w->top_line); 3631 pos = XINT (w->top_line);
3497 } 3632 }
@@ -3503,9 +3638,9 @@ window_resize_apply (struct window *w, int horflag)
3503 while (c) 3638 while (c)
3504 { 3639 {
3505 if (horflag) 3640 if (horflag)
3506 WSET (c, left_col, make_number (pos)); 3641 wset_left_col (c, make_number (pos));
3507 else 3642 else
3508 WSET (c, top_line, make_number (pos)); 3643 wset_top_line (c, make_number (pos));
3509 window_resize_apply (c, horflag); 3644 window_resize_apply (c, horflag);
3510 if (!horflag) 3645 if (!horflag)
3511 pos = pos + XINT (c->total_lines); 3646 pos = pos + XINT (c->total_lines);
@@ -3519,9 +3654,9 @@ window_resize_apply (struct window *w, int horflag)
3519 while (c) 3654 while (c)
3520 { 3655 {
3521 if (horflag) 3656 if (horflag)
3522 WSET (c, left_col, make_number (pos)); 3657 wset_left_col (c, make_number (pos));
3523 else 3658 else
3524 WSET (c, top_line, make_number (pos)); 3659 wset_top_line (c, make_number (pos));
3525 window_resize_apply (c, horflag); 3660 window_resize_apply (c, horflag);
3526 if (horflag) 3661 if (horflag)
3527 pos = pos + XINT (c->total_cols); 3662 pos = pos + XINT (c->total_cols);
@@ -3602,17 +3737,17 @@ resize_frame_windows (struct frame *f, int size, int horflag)
3602 - ((FRAME_HAS_MINIBUF_P (f) && !FRAME_MINIBUF_ONLY_P (f)) 3737 - ((FRAME_HAS_MINIBUF_P (f) && !FRAME_MINIBUF_ONLY_P (f))
3603 ? 1 : 0))); 3738 ? 1 : 0)));
3604 3739
3605 WSET (r, top_line, make_number (FRAME_TOP_MARGIN (f))); 3740 wset_top_line (r, make_number (FRAME_TOP_MARGIN (f)));
3606 if (NILP (r->vchild) && NILP (r->hchild)) 3741 if (NILP (r->vchild) && NILP (r->hchild))
3607 /* For a leaf root window just set the size. */ 3742 /* For a leaf root window just set the size. */
3608 if (horflag) 3743 if (horflag)
3609 WSET (r, total_cols, make_number (new_size)); 3744 wset_total_cols (r, make_number (new_size));
3610 else 3745 else
3611 WSET (r, total_lines, make_number (new_size)); 3746 wset_total_lines (r, make_number (new_size));
3612 else 3747 else
3613 { 3748 {
3614 /* old_size is the old size of the frame's root window. */ 3749 /* old_size is the old size of the frame's root window. */
3615 int old_size = XFASTINT (horflag ? r->total_cols 3750 int old_size = XFASTINT (horflag ? r->total_cols
3616 : r->total_lines); 3751 : r->total_lines);
3617 Lisp_Object delta; 3752 Lisp_Object delta;
3618 3753
@@ -3643,9 +3778,9 @@ resize_frame_windows (struct frame *f, int size, int horflag)
3643 root = f->selected_window; 3778 root = f->selected_window;
3644 Fdelete_other_windows_internal (root, Qnil); 3779 Fdelete_other_windows_internal (root, Qnil);
3645 if (horflag) 3780 if (horflag)
3646 WSET (XWINDOW (root), total_cols, make_number (new_size)); 3781 wset_total_cols (XWINDOW (root), make_number (new_size));
3647 else 3782 else
3648 WSET (XWINDOW (root), total_lines, make_number (new_size)); 3783 wset_total_lines (XWINDOW (root), make_number (new_size));
3649 } 3784 }
3650 } 3785 }
3651 } 3786 }
@@ -3655,13 +3790,13 @@ resize_frame_windows (struct frame *f, int size, int horflag)
3655 { 3790 {
3656 m = XWINDOW (mini); 3791 m = XWINDOW (mini);
3657 if (horflag) 3792 if (horflag)
3658 WSET (m, total_cols, make_number (size)); 3793 wset_total_cols (m, make_number (size));
3659 else 3794 else
3660 { 3795 {
3661 /* Are we sure we always want 1 line here? */ 3796 /* Are we sure we always want 1 line here? */
3662 WSET (m, total_lines, make_number (1)); 3797 wset_total_lines (m, make_number (1));
3663 WSET (m, top_line, 3798 wset_top_line
3664 make_number (XINT (r->top_line) + XINT (r->total_lines))); 3799 (m, make_number (XINT (r->top_line) + XINT (r->total_lines)));
3665 } 3800 }
3666 } 3801 }
3667} 3802}
@@ -3742,15 +3877,14 @@ set correctly. See the code of `split-window' for how this is done. */)
3742 { 3877 {
3743 p = XWINDOW (o->parent); 3878 p = XWINDOW (o->parent);
3744 /* Temporarily pretend we split the parent window. */ 3879 /* Temporarily pretend we split the parent window. */
3745 WSET (p, new_total, 3880 wset_new_total
3746 make_number (XINT (horflag ? p->total_cols : p->total_lines) 3881 (p, make_number (XINT (horflag ? p->total_cols : p->total_lines)
3747 - XINT (total_size))); 3882 - XINT (total_size)));
3748 if (!window_resize_check (p, horflag)) 3883 if (!window_resize_check (p, horflag))
3749 error ("Window sizes don't fit"); 3884 error ("Window sizes don't fit");
3750 else 3885 else
3751 /* Undo the temporary pretension. */ 3886 /* Undo the temporary pretension. */
3752 WSET (p, new_total, 3887 wset_new_total (p, horflag ? p->total_cols : p->total_lines);
3753 horflag ? p->total_cols : p->total_lines);
3754 } 3888 }
3755 else 3889 else
3756 { 3890 {
@@ -3774,10 +3908,10 @@ set correctly. See the code of `split-window' for how this is done. */)
3774 p = XWINDOW (o->parent); 3908 p = XWINDOW (o->parent);
3775 /* Store value of `window-combination-limit' in new parent's 3909 /* Store value of `window-combination-limit' in new parent's
3776 combination_limit slot. */ 3910 combination_limit slot. */
3777 WSET (p, combination_limit, Vwindow_combination_limit); 3911 wset_combination_limit (p, Vwindow_combination_limit);
3778 /* These get applied below. */ 3912 /* These get applied below. */
3779 WSET (p, new_total, horflag ? o->total_cols : o->total_lines); 3913 wset_new_total (p, horflag ? o->total_cols : o->total_lines);
3780 WSET (p, new_normal, new_normal); 3914 wset_new_normal (p, new_normal);
3781 } 3915 }
3782 else 3916 else
3783 p = XWINDOW (o->parent); 3917 p = XWINDOW (o->parent);
@@ -3786,62 +3920,62 @@ set correctly. See the code of `split-window' for how this is done. */)
3786 FRAME_WINDOW_SIZES_CHANGED (f) = 1; 3920 FRAME_WINDOW_SIZES_CHANGED (f) = 1;
3787 new = make_window (); 3921 new = make_window ();
3788 n = XWINDOW (new); 3922 n = XWINDOW (new);
3789 WSET (n, frame, frame); 3923 wset_frame (n, frame);
3790 WSET (n, parent, o->parent); 3924 wset_parent (n, o->parent);
3791 WSET (n, vchild, Qnil); 3925 wset_vchild (n, Qnil);
3792 WSET (n, hchild, Qnil); 3926 wset_hchild (n, Qnil);
3793 3927
3794 if (EQ (side, Qabove) || EQ (side, Qleft)) 3928 if (EQ (side, Qabove) || EQ (side, Qleft))
3795 { 3929 {
3796 WSET (n, prev, o->prev); 3930 wset_prev (n, o->prev);
3797 if (NILP (n->prev)) 3931 if (NILP (n->prev))
3798 if (horflag) 3932 if (horflag)
3799 WSET (p, hchild, new); 3933 wset_hchild (p, new);
3800 else 3934 else
3801 WSET (p, vchild, new); 3935 wset_vchild (p, new);
3802 else 3936 else
3803 WSET (XWINDOW (n->prev), next, new); 3937 wset_next (XWINDOW (n->prev), new);
3804 WSET (n, next, old); 3938 wset_next (n, old);
3805 WSET (o, prev, new); 3939 wset_prev (o, new);
3806 } 3940 }
3807 else 3941 else
3808 { 3942 {
3809 WSET (n, next, o->next); 3943 wset_next (n, o->next);
3810 if (!NILP (n->next)) 3944 if (!NILP (n->next))
3811 WSET (XWINDOW (n->next), prev, new); 3945 wset_prev (XWINDOW (n->next), new);
3812 WSET (n, prev, old); 3946 wset_prev (n, old);
3813 WSET (o, next, new); 3947 wset_next (o, new);
3814 } 3948 }
3815 3949
3816 WSET (n, buffer, Qt); 3950 wset_buffer (n, Qt);
3817 WSET (n, window_end_valid, Qnil); 3951 wset_window_end_valid (n, Qnil);
3818 memset (&n->last_cursor, 0, sizeof n->last_cursor); 3952 memset (&n->last_cursor, 0, sizeof n->last_cursor);
3819 3953
3820 /* Get special geometry settings from reference window. */ 3954 /* Get special geometry settings from reference window. */
3821 WSET (n, left_margin_cols, r->left_margin_cols); 3955 wset_left_margin_cols (n, r->left_margin_cols);
3822 WSET (n, right_margin_cols, r->right_margin_cols); 3956 wset_right_margin_cols (n, r->right_margin_cols);
3823 WSET (n, left_fringe_width, r->left_fringe_width); 3957 wset_left_fringe_width (n, r->left_fringe_width);
3824 WSET (n, right_fringe_width, r->right_fringe_width); 3958 wset_right_fringe_width (n, r->right_fringe_width);
3825 n->fringes_outside_margins = r->fringes_outside_margins; 3959 n->fringes_outside_margins = r->fringes_outside_margins;
3826 WSET (n, scroll_bar_width, r->scroll_bar_width); 3960 wset_scroll_bar_width (n, r->scroll_bar_width);
3827 WSET (n, vertical_scroll_bar_type, r->vertical_scroll_bar_type); 3961 wset_vertical_scroll_bar_type (n, r->vertical_scroll_bar_type);
3828 3962
3829 /* Directly assign orthogonal coordinates and sizes. */ 3963 /* Directly assign orthogonal coordinates and sizes. */
3830 if (horflag) 3964 if (horflag)
3831 { 3965 {
3832 WSET (n, top_line, o->top_line); 3966 wset_top_line (n, o->top_line);
3833 WSET (n, total_lines, o->total_lines); 3967 wset_total_lines (n, o->total_lines);
3834 } 3968 }
3835 else 3969 else
3836 { 3970 {
3837 WSET (n, left_col, o->left_col); 3971 wset_left_col (n, o->left_col);
3838 WSET (n, total_cols, o->total_cols); 3972 wset_total_cols (n, o->total_cols);
3839 } 3973 }
3840 3974
3841 /* Iso-coordinates and sizes are assigned by window_resize_apply, 3975 /* Iso-coordinates and sizes are assigned by window_resize_apply,
3842 get them ready here. */ 3976 get them ready here. */
3843 WSET (n, new_total, total_size); 3977 wset_new_total (n, total_size);
3844 WSET (n, new_normal, normal_size); 3978 wset_new_normal (n, normal_size);
3845 3979
3846 BLOCK_INPUT; 3980 BLOCK_INPUT;
3847 window_resize_apply (p, horflag); 3981 window_resize_apply (p, horflag);
@@ -3907,20 +4041,20 @@ Signal an error when WINDOW is the only window on its frame. */)
3907 before_sibling = 1; 4041 before_sibling = 1;
3908 sibling = w->next; 4042 sibling = w->next;
3909 s = XWINDOW (sibling); 4043 s = XWINDOW (sibling);
3910 WSET (s, prev, Qnil); 4044 wset_prev (s, Qnil);
3911 if (horflag) 4045 if (horflag)
3912 WSET (p, hchild, sibling); 4046 wset_hchild (p, sibling);
3913 else 4047 else
3914 WSET (p, vchild, sibling); 4048 wset_vchild (p, sibling);
3915 } 4049 }
3916 else 4050 else
3917 /* Get SIBLING above (on the left of) WINDOW. */ 4051 /* Get SIBLING above (on the left of) WINDOW. */
3918 { 4052 {
3919 sibling = w->prev; 4053 sibling = w->prev;
3920 s = XWINDOW (sibling); 4054 s = XWINDOW (sibling);
3921 WSET (s, next, w->next); 4055 wset_next (s, w->next);
3922 if (!NILP (s->next)) 4056 if (!NILP (s->next))
3923 WSET (XWINDOW (s->next), prev, sibling); 4057 wset_prev (XWINDOW (s->next), sibling);
3924 } 4058 }
3925 4059
3926 if (window_resize_check (r, horflag) 4060 if (window_resize_check (r, horflag)
@@ -3947,25 +4081,25 @@ Signal an error when WINDOW is the only window on its frame. */)
3947 Vwindow_list = Qnil; 4081 Vwindow_list = Qnil;
3948 FRAME_WINDOW_SIZES_CHANGED (f) = 1; 4082 FRAME_WINDOW_SIZES_CHANGED (f) = 1;
3949 4083
3950 WSET (w, next, Qnil); /* Don't delete w->next too. */ 4084 wset_next (w, Qnil); /* Don't delete w->next too. */
3951 free_window_matrices (w); 4085 free_window_matrices (w);
3952 4086
3953 if (!NILP (w->vchild)) 4087 if (!NILP (w->vchild))
3954 { 4088 {
3955 delete_all_child_windows (w->vchild); 4089 delete_all_child_windows (w->vchild);
3956 WSET (w, vchild, Qnil); 4090 wset_vchild (w, Qnil);
3957 } 4091 }
3958 else if (!NILP (w->hchild)) 4092 else if (!NILP (w->hchild))
3959 { 4093 {
3960 delete_all_child_windows (w->hchild); 4094 delete_all_child_windows (w->hchild);
3961 WSET (w, hchild, Qnil); 4095 wset_hchild (w, Qnil);
3962 } 4096 }
3963 else if (!NILP (w->buffer)) 4097 else if (!NILP (w->buffer))
3964 { 4098 {
3965 unshow_buffer (w); 4099 unshow_buffer (w);
3966 unchain_marker (XMARKER (w->pointm)); 4100 unchain_marker (XMARKER (w->pointm));
3967 unchain_marker (XMARKER (w->start)); 4101 unchain_marker (XMARKER (w->start));
3968 WSET (w, buffer, Qnil); 4102 wset_buffer (w, Qnil);
3969 } 4103 }
3970 4104
3971 if (NILP (s->prev) && NILP (s->next)) 4105 if (NILP (s->prev) && NILP (s->next))
@@ -3976,11 +4110,11 @@ Signal an error when WINDOW is the only window on its frame. */)
3976 replace_window (parent, sibling, 0); 4110 replace_window (parent, sibling, 0);
3977 /* Have SIBLING inherit the following three slot values from 4111 /* Have SIBLING inherit the following three slot values from
3978 PARENT (the combination_limit slot is not inherited). */ 4112 PARENT (the combination_limit slot is not inherited). */
3979 WSET (s, normal_cols, p->normal_cols); 4113 wset_normal_cols (s, p->normal_cols);
3980 WSET (s, normal_lines, p->normal_lines); 4114 wset_normal_lines (s, p->normal_lines);
3981 /* Mark PARENT as deleted. */ 4115 /* Mark PARENT as deleted. */
3982 WSET (p, vchild, Qnil); 4116 wset_vchild (p, Qnil);
3983 WSET (p, hchild, Qnil); 4117 wset_hchild (p, Qnil);
3984 /* Try to merge SIBLING into its new parent. */ 4118 /* Try to merge SIBLING into its new parent. */
3985 recombine_windows (sibling); 4119 recombine_windows (sibling);
3986 } 4120 }
@@ -4000,7 +4134,7 @@ Signal an error when WINDOW is the only window on its frame. */)
4000 if (EQ (FRAME_SELECTED_WINDOW (f), selected_window)) 4134 if (EQ (FRAME_SELECTED_WINDOW (f), selected_window))
4001 Fselect_window (new_selected_window, Qt); 4135 Fselect_window (new_selected_window, Qt);
4002 else 4136 else
4003 FSET (f, selected_window, new_selected_window); 4137 fset_selected_window (f, new_selected_window);
4004 4138
4005 UNBLOCK_INPUT; 4139 UNBLOCK_INPUT;
4006 4140
@@ -4014,7 +4148,7 @@ Signal an error when WINDOW is the only window on its frame. */)
4014 if (EQ (FRAME_SELECTED_WINDOW (f), selected_window)) 4148 if (EQ (FRAME_SELECTED_WINDOW (f), selected_window))
4015 Fselect_window (new_selected_window, Qnil); 4149 Fselect_window (new_selected_window, Qnil);
4016 else 4150 else
4017 FSET (f, selected_window, new_selected_window); 4151 fset_selected_window (f, new_selected_window);
4018 } 4152 }
4019 else 4153 else
4020 UNBLOCK_INPUT; 4154 UNBLOCK_INPUT;
@@ -4027,17 +4161,17 @@ Signal an error when WINDOW is the only window on its frame. */)
4027 { 4161 {
4028 if (before_sibling) 4162 if (before_sibling)
4029 { 4163 {
4030 WSET (s, prev, window); 4164 wset_prev (s, window);
4031 if (horflag) 4165 if (horflag)
4032 WSET (p, hchild, window); 4166 wset_hchild (p, window);
4033 else 4167 else
4034 WSET (p, vchild, window); 4168 wset_vchild (p, window);
4035 } 4169 }
4036 else 4170 else
4037 { 4171 {
4038 WSET (s, next, window); 4172 wset_next (s, window);
4039 if (!NILP (w->next)) 4173 if (!NILP (w->next))
4040 WSET (XWINDOW (w->next), prev, window); 4174 wset_prev (XWINDOW (w->next), window);
4041 } 4175 }
4042 error ("Deletion failed"); 4176 error ("Deletion failed");
4043 } 4177 }
@@ -4071,10 +4205,10 @@ grow_mini_window (struct window *w, int delta)
4071 window_resize_apply (r, 0); 4205 window_resize_apply (r, 0);
4072 4206
4073 /* Grow the mini-window. */ 4207 /* Grow the mini-window. */
4074 WSET (w, top_line, 4208 wset_top_line
4075 make_number (XFASTINT (r->top_line) + XFASTINT (r->total_lines))); 4209 (w, make_number (XFASTINT (r->top_line) + XFASTINT (r->total_lines)));
4076 WSET (w, total_lines, 4210 wset_total_lines
4077 make_number (XFASTINT (w->total_lines) - XINT (value))); 4211 (w, make_number (XFASTINT (w->total_lines) - XINT (value)));
4078 w->last_modified = 0; 4212 w->last_modified = 0;
4079 w->last_overlay_modified = 0; 4213 w->last_overlay_modified = 0;
4080 4214
@@ -4108,9 +4242,9 @@ shrink_mini_window (struct window *w)
4108 window_resize_apply (r, 0); 4242 window_resize_apply (r, 0);
4109 4243
4110 /* Shrink the mini-window. */ 4244 /* Shrink the mini-window. */
4111 WSET (w, top_line, 4245 wset_top_line (w, make_number (XFASTINT (r->top_line)
4112 make_number (XFASTINT (r->top_line) + XFASTINT (r->total_lines))); 4246 + XFASTINT (r->total_lines)));
4113 WSET (w, total_lines, make_number (1)); 4247 wset_total_lines (w, make_number (1));
4114 4248
4115 w->last_modified = 0; 4249 w->last_modified = 0;
4116 w->last_overlay_modified = 0; 4250 w->last_overlay_modified = 0;
@@ -4151,9 +4285,9 @@ DEFUN ("resize-mini-window-internal", Fresize_mini_window_internal, Sresize_mini
4151 BLOCK_INPUT; 4285 BLOCK_INPUT;
4152 window_resize_apply (r, 0); 4286 window_resize_apply (r, 0);
4153 4287
4154 WSET (w, total_lines, w->new_total); 4288 wset_total_lines (w, w->new_total);
4155 WSET (w, top_line, 4289 wset_top_line (w, make_number (XINT (r->top_line)
4156 make_number (XINT (r->top_line) + XINT (r->total_lines))); 4290 + XINT (r->total_lines)));
4157 4291
4158 windows_or_buffers_changed++; 4292 windows_or_buffers_changed++;
4159 FRAME_WINDOW_SIZES_CHANGED (f) = 1; 4293 FRAME_WINDOW_SIZES_CHANGED (f) = 1;
@@ -5221,7 +5355,7 @@ and redisplay normally--don't erase and redraw the frame. */)
5221 5355
5222 /* Set the new window start. */ 5356 /* Set the new window start. */
5223 set_marker_both (w->start, w->buffer, charpos, bytepos); 5357 set_marker_both (w->start, w->buffer, charpos, bytepos);
5224 WSET (w, window_end_valid, Qnil); 5358 wset_window_end_valid (w, Qnil);
5225 5359
5226 w->optional_new_start = 1; 5360 w->optional_new_start = 1;
5227 5361
@@ -5539,34 +5673,34 @@ the return value is nil. Otherwise the value is t. */)
5539 p = SAVED_WINDOW_N (saved_windows, k); 5673 p = SAVED_WINDOW_N (saved_windows, k);
5540 window = p->window; 5674 window = p->window;
5541 w = XWINDOW (window); 5675 w = XWINDOW (window);
5542 WSET (w, next, Qnil); 5676 wset_next (w, Qnil);
5543 5677
5544 if (!NILP (p->parent)) 5678 if (!NILP (p->parent))
5545 WSET (w, parent, SAVED_WINDOW_N 5679 wset_parent
5546 (saved_windows, XFASTINT (p->parent))->window); 5680 (w, SAVED_WINDOW_N (saved_windows, XFASTINT (p->parent))->window);
5547 else 5681 else
5548 WSET (w, parent, Qnil); 5682 wset_parent (w, Qnil);
5549 5683
5550 if (!NILP (p->prev)) 5684 if (!NILP (p->prev))
5551 { 5685 {
5552 WSET (w, prev, SAVED_WINDOW_N 5686 wset_prev
5553 (saved_windows, XFASTINT (p->prev))->window); 5687 (w, SAVED_WINDOW_N (saved_windows, XFASTINT (p->prev))->window);
5554 WSET (XWINDOW (w->prev), next, p->window); 5688 wset_next (XWINDOW (w->prev), p->window);
5555 } 5689 }
5556 else 5690 else
5557 { 5691 {
5558 WSET (w, prev, Qnil); 5692 wset_prev (w, Qnil);
5559 if (!NILP (w->parent)) 5693 if (!NILP (w->parent))
5560 { 5694 {
5561 if (EQ (p->total_cols, XWINDOW (w->parent)->total_cols)) 5695 if (EQ (p->total_cols, XWINDOW (w->parent)->total_cols))
5562 { 5696 {
5563 WSET (XWINDOW (w->parent), vchild, p->window); 5697 wset_vchild (XWINDOW (w->parent), p->window);
5564 WSET (XWINDOW (w->parent), hchild, Qnil); 5698 wset_hchild (XWINDOW (w->parent), Qnil);
5565 } 5699 }
5566 else 5700 else
5567 { 5701 {
5568 WSET (XWINDOW (w->parent), hchild, p->window); 5702 wset_hchild (XWINDOW (w->parent), p->window);
5569 WSET (XWINDOW (w->parent), vchild, Qnil); 5703 wset_vchild (XWINDOW (w->parent), Qnil);
5570 } 5704 }
5571 } 5705 }
5572 } 5706 }
@@ -5574,25 +5708,25 @@ the return value is nil. Otherwise the value is t. */)
5574 /* If we squirreled away the buffer in the window's height, 5708 /* If we squirreled away the buffer in the window's height,
5575 restore it now. */ 5709 restore it now. */
5576 if (BUFFERP (w->total_lines)) 5710 if (BUFFERP (w->total_lines))
5577 WSET (w, buffer, w->total_lines); 5711 wset_buffer (w, w->total_lines);
5578 WSET (w, left_col, p->left_col); 5712 wset_left_col (w, p->left_col);
5579 WSET (w, top_line, p->top_line); 5713 wset_top_line (w, p->top_line);
5580 WSET (w, total_cols, p->total_cols); 5714 wset_total_cols (w, p->total_cols);
5581 WSET (w, total_lines, p->total_lines); 5715 wset_total_lines (w, p->total_lines);
5582 WSET (w, normal_cols, p->normal_cols); 5716 wset_normal_cols (w, p->normal_cols);
5583 WSET (w, normal_lines, p->normal_lines); 5717 wset_normal_lines (w, p->normal_lines);
5584 w->hscroll = XFASTINT (p->hscroll); 5718 w->hscroll = XFASTINT (p->hscroll);
5585 w->min_hscroll = XFASTINT (p->min_hscroll); 5719 w->min_hscroll = XFASTINT (p->min_hscroll);
5586 WSET (w, display_table, p->display_table); 5720 wset_display_table (w, p->display_table);
5587 WSET (w, left_margin_cols, p->left_margin_cols); 5721 wset_left_margin_cols (w, p->left_margin_cols);
5588 WSET (w, right_margin_cols, p->right_margin_cols); 5722 wset_right_margin_cols (w, p->right_margin_cols);
5589 WSET (w, left_fringe_width, p->left_fringe_width); 5723 wset_left_fringe_width (w, p->left_fringe_width);
5590 WSET (w, right_fringe_width, p->right_fringe_width); 5724 wset_right_fringe_width (w, p->right_fringe_width);
5591 w->fringes_outside_margins = !NILP (p->fringes_outside_margins); 5725 w->fringes_outside_margins = !NILP (p->fringes_outside_margins);
5592 WSET (w, scroll_bar_width, p->scroll_bar_width); 5726 wset_scroll_bar_width (w, p->scroll_bar_width);
5593 WSET (w, vertical_scroll_bar_type, p->vertical_scroll_bar_type); 5727 wset_vertical_scroll_bar_type (w, p->vertical_scroll_bar_type);
5594 WSET (w, dedicated, p->dedicated); 5728 wset_dedicated (w, p->dedicated);
5595 WSET (w, combination_limit, p->combination_limit); 5729 wset_combination_limit (w, p->combination_limit);
5596 /* Restore any window parameters that have been saved. 5730 /* Restore any window parameters that have been saved.
5597 Parameters that have not been saved are left alone. */ 5731 Parameters that have not been saved are left alone. */
5598 for (tem = p->window_parameters; CONSP (tem); tem = XCDR (tem)) 5732 for (tem = p->window_parameters; CONSP (tem); tem = XCDR (tem))
@@ -5621,24 +5755,24 @@ the return value is nil. Otherwise the value is t. */)
5621 /* Reinstall the saved buffer and pointers into it. */ 5755 /* Reinstall the saved buffer and pointers into it. */
5622 if (NILP (p->buffer)) 5756 if (NILP (p->buffer))
5623 /* An internal window. */ 5757 /* An internal window. */
5624 WSET (w, buffer, p->buffer); 5758 wset_buffer (w, p->buffer);
5625 else if (!NILP (BVAR (XBUFFER (p->buffer), name))) 5759 else if (!NILP (BVAR (XBUFFER (p->buffer), name)))
5626 /* If saved buffer is alive, install it. */ 5760 /* If saved buffer is alive, install it. */
5627 { 5761 {
5628 WSET (w, buffer, p->buffer); 5762 wset_buffer (w, p->buffer);
5629 w->start_at_line_beg = !NILP (p->start_at_line_beg); 5763 w->start_at_line_beg = !NILP (p->start_at_line_beg);
5630 set_marker_restricted (w->start, p->start, w->buffer); 5764 set_marker_restricted (w->start, p->start, w->buffer);
5631 set_marker_restricted (w->pointm, p->pointm, 5765 set_marker_restricted (w->pointm, p->pointm,
5632 w->buffer); 5766 w->buffer);
5633 Fset_marker (BVAR (XBUFFER (w->buffer), mark), 5767 Fset_marker (BVAR (XBUFFER (w->buffer), mark),
5634 p->mark, w->buffer); 5768 p->mark, w->buffer);
5635 5769
5636 /* As documented in Fcurrent_window_configuration, don't 5770 /* As documented in Fcurrent_window_configuration, don't
5637 restore the location of point in the buffer which was 5771 restore the location of point in the buffer which was
5638 current when the window configuration was recorded. */ 5772 current when the window configuration was recorded. */
5639 if (!EQ (p->buffer, new_current_buffer) 5773 if (!EQ (p->buffer, new_current_buffer)
5640 && XBUFFER (p->buffer) == current_buffer) 5774 && XBUFFER (p->buffer) == current_buffer)
5641 Fgoto_char (w->pointm); 5775 Fgoto_char (w->pointm);
5642 } 5776 }
5643 else if (!NILP (w->buffer) 5777 else if (!NILP (w->buffer)
5644 && !NILP (BVAR (XBUFFER (w->buffer), name))) 5778 && !NILP (BVAR (XBUFFER (w->buffer), name)))
@@ -5650,7 +5784,7 @@ the return value is nil. Otherwise the value is t. */)
5650 set_marker_restricted (w->start, make_number (0), 5784 set_marker_restricted (w->start, make_number (0),
5651 w->buffer); 5785 w->buffer);
5652 if (XMARKER (w->pointm)->buffer == 0) 5786 if (XMARKER (w->pointm)->buffer == 0)
5653 set_marker_restricted_both 5787 set_marker_restricted_both
5654 (w->pointm, w->buffer, 5788 (w->pointm, w->buffer,
5655 BUF_PT (XBUFFER (w->buffer)), 5789 BUF_PT (XBUFFER (w->buffer)),
5656 BUF_PT_BYTE (XBUFFER (w->buffer))); 5790 BUF_PT_BYTE (XBUFFER (w->buffer)));
@@ -5659,7 +5793,8 @@ the return value is nil. Otherwise the value is t. */)
5659 else if (STRINGP (auto_buffer_name = 5793 else if (STRINGP (auto_buffer_name =
5660 Fwindow_parameter (window, Qauto_buffer_name)) 5794 Fwindow_parameter (window, Qauto_buffer_name))
5661 && SCHARS (auto_buffer_name) != 0 5795 && SCHARS (auto_buffer_name) != 0
5662 && !NILP (WSET (w, buffer, Fget_buffer_create (auto_buffer_name)))) 5796 && (wset_buffer (w, Fget_buffer_create (auto_buffer_name)),
5797 !NILP (w->buffer)))
5663 { 5798 {
5664 set_marker_restricted (w->start, 5799 set_marker_restricted (w->start,
5665 make_number (0), w->buffer); 5800 make_number (0), w->buffer);
@@ -5674,7 +5809,7 @@ the return value is nil. Otherwise the value is t. */)
5674 avoid showing an unimportant buffer and, if necessary, to 5809 avoid showing an unimportant buffer and, if necessary, to
5675 recreate *scratch* in the course (part of Juanma's bs-show 5810 recreate *scratch* in the course (part of Juanma's bs-show
5676 scenario from March 2011). */ 5811 scenario from March 2011). */
5677 WSET (w, buffer, other_buffer_safely (Fcurrent_buffer ())); 5812 wset_buffer (w, other_buffer_safely (Fcurrent_buffer ()));
5678 /* This will set the markers to beginning of visible 5813 /* This will set the markers to beginning of visible
5679 range. */ 5814 range. */
5680 set_marker_restricted (w->start, 5815 set_marker_restricted (w->start,
@@ -5686,11 +5821,11 @@ the return value is nil. Otherwise the value is t. */)
5686 /* Record this window as dead. */ 5821 /* Record this window as dead. */
5687 dead_windows = Fcons (window, dead_windows); 5822 dead_windows = Fcons (window, dead_windows);
5688 /* Make sure window is no more dedicated. */ 5823 /* Make sure window is no more dedicated. */
5689 WSET (w, dedicated, Qnil); 5824 wset_dedicated (w, Qnil);
5690 } 5825 }
5691 } 5826 }
5692 5827
5693 FSET (f, root_window, data->root_window); 5828 fset_root_window (f, data->root_window);
5694 /* Arrange *not* to restore point in the buffer that was 5829 /* Arrange *not* to restore point in the buffer that was
5695 current when the window configuration was saved. */ 5830 current when the window configuration was saved. */
5696 if (EQ (XWINDOW (data->current_window)->buffer, new_current_buffer)) 5831 if (EQ (XWINDOW (data->current_window)->buffer, new_current_buffer))
@@ -5786,24 +5921,25 @@ delete_all_child_windows (Lisp_Object window)
5786 /* Delete WINDOW's siblings (we traverse postorderly). */ 5921 /* Delete WINDOW's siblings (we traverse postorderly). */
5787 delete_all_child_windows (w->next); 5922 delete_all_child_windows (w->next);
5788 5923
5789 WSET (w, total_lines, w->buffer); /* See Fset_window_configuration for excuse. */ 5924 /* See Fset_window_configuration for excuse. */
5925 wset_total_lines (w, w->buffer);
5790 5926
5791 if (!NILP (w->vchild)) 5927 if (!NILP (w->vchild))
5792 { 5928 {
5793 delete_all_child_windows (w->vchild); 5929 delete_all_child_windows (w->vchild);
5794 WSET (w, vchild, Qnil); 5930 wset_vchild (w, Qnil);
5795 } 5931 }
5796 else if (!NILP (w->hchild)) 5932 else if (!NILP (w->hchild))
5797 { 5933 {
5798 delete_all_child_windows (w->hchild); 5934 delete_all_child_windows (w->hchild);
5799 WSET (w, hchild, Qnil); 5935 wset_hchild (w, Qnil);
5800 } 5936 }
5801 else if (!NILP (w->buffer)) 5937 else if (!NILP (w->buffer))
5802 { 5938 {
5803 unshow_buffer (w); 5939 unshow_buffer (w);
5804 unchain_marker (XMARKER (w->pointm)); 5940 unchain_marker (XMARKER (w->pointm));
5805 unchain_marker (XMARKER (w->start)); 5941 unchain_marker (XMARKER (w->start));
5806 WSET (w, buffer, Qnil); 5942 wset_buffer (w, Qnil);
5807 } 5943 }
5808 5944
5809 Vwindow_list = Qnil; 5945 Vwindow_list = Qnil;
@@ -5895,7 +6031,7 @@ save_window_save (Lisp_Object window, struct Lisp_Vector *vector, int i)
5895 p = SAVED_WINDOW_N (vector, i); 6031 p = SAVED_WINDOW_N (vector, i);
5896 w = XWINDOW (window); 6032 w = XWINDOW (window);
5897 6033
5898 WSET (w, temslot, make_number (i)); i++; 6034 wset_temslot (w, make_number (i)); i++;
5899 p->window = window; 6035 p->window = window;
5900 p->buffer = w->buffer; 6036 p->buffer = w->buffer;
5901 p->left_col = w->left_col; 6037 p->left_col = w->left_col;
@@ -6098,8 +6234,8 @@ means no margin. */)
6098 if (!EQ (w->left_margin_cols, left_width) 6234 if (!EQ (w->left_margin_cols, left_width)
6099 || !EQ (w->right_margin_cols, right_width)) 6235 || !EQ (w->right_margin_cols, right_width))
6100 { 6236 {
6101 WSET (w, left_margin_cols, left_width); 6237 wset_left_margin_cols (w, left_width);
6102 WSET (w, right_margin_cols, right_width); 6238 wset_right_margin_cols (w, right_width);
6103 6239
6104 adjust_window_margins (w); 6240 adjust_window_margins (w);
6105 6241
@@ -6160,14 +6296,14 @@ display marginal areas and the text area. */)
6160 || !EQ (w->right_fringe_width, right_width) 6296 || !EQ (w->right_fringe_width, right_width)
6161 || w->fringes_outside_margins != outside)) 6297 || w->fringes_outside_margins != outside))
6162 { 6298 {
6163 WSET (w, left_fringe_width, left_width); 6299 wset_left_fringe_width (w, left_width);
6164 WSET (w, right_fringe_width, right_width); 6300 wset_right_fringe_width (w, right_width);
6165 w->fringes_outside_margins = outside; 6301 w->fringes_outside_margins = outside;
6166 6302
6167 adjust_window_margins (w); 6303 adjust_window_margins (w);
6168 6304
6169 clear_glyph_matrix (w->current_matrix); 6305 clear_glyph_matrix (w->current_matrix);
6170 WSET (w, window_end_valid, Qnil); 6306 wset_window_end_valid (w, Qnil);
6171 6307
6172 ++windows_or_buffers_changed; 6308 ++windows_or_buffers_changed;
6173 adjust_glyphs (XFRAME (WINDOW_FRAME (w))); 6309 adjust_glyphs (XFRAME (WINDOW_FRAME (w)));
@@ -6232,13 +6368,13 @@ Fourth parameter HORIZONTAL-TYPE is currently unused. */)
6232 if (!EQ (w->scroll_bar_width, width) 6368 if (!EQ (w->scroll_bar_width, width)
6233 || !EQ (w->vertical_scroll_bar_type, vertical_type)) 6369 || !EQ (w->vertical_scroll_bar_type, vertical_type))
6234 { 6370 {
6235 WSET (w, scroll_bar_width, width); 6371 wset_scroll_bar_width (w, width);
6236 WSET (w, vertical_scroll_bar_type, vertical_type); 6372 wset_vertical_scroll_bar_type (w, vertical_type);
6237 6373
6238 adjust_window_margins (w); 6374 adjust_window_margins (w);
6239 6375
6240 clear_glyph_matrix (w->current_matrix); 6376 clear_glyph_matrix (w->current_matrix);
6241 WSET (w, window_end_valid, Qnil); 6377 wset_window_end_valid (w, Qnil);
6242 6378
6243 ++windows_or_buffers_changed; 6379 ++windows_or_buffers_changed;
6244 adjust_glyphs (XFRAME (WINDOW_FRAME (w))); 6380 adjust_glyphs (XFRAME (WINDOW_FRAME (w)));