aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert2015-04-11 20:45:08 -0700
committerPaul Eggert2015-04-11 20:45:42 -0700
commit303797134fa05d2e0d156a5bd912f8baab418489 (patch)
tree8cd6627dc4e579080f7d6fc9822f45a9b50dd0c3 /src
parent3ba6b3a9c1e0565ee5f45f11a9c09702a24f8453 (diff)
downloademacs-303797134fa05d2e0d156a5bd912f8baab418489.tar.gz
emacs-303797134fa05d2e0d156a5bd912f8baab418489.zip
Use bool for boolean in window.c
* src/window.c: Omit unnecessary static function decls. (adjust_window_count, select_window, Fselect_window) (window_body_width, Fwindow_body_height, Fwindow_body_width) (set_window_hscroll, check_window_containing, Fwindow_at) (Fwindow_end, Fset_window_start, Fpos_visible_in_window_p) (unshow_buffer, replace_window, recombine_windows) (add_window_to_list, candidate_window_p, next_window) (Fnext_window, Fprevious_window, window_loop, check_all_windows) (Fget_buffer_window, Fdelete_other_windows_internal) (replace_buffer_in_windows_safely, set_window_buffer) (Fset_window_buffer, Fforce_window_update) (temp_output_buffer_show, make_parent_window) (window_resize_check, window_resize_apply, Fwindow_resize_apply) (resize_frame_windows, Fsplit_window_internal) (Fdelete_window_internal, grow_mini_window, shrink_mini_window) (Fresize_mini_window_internal, mark_window_cursors_off) (window_scroll, window_scroll_pixel_based) (window_scroll_line_based, scroll_command, Fscroll_other_window) (Fscroll_left, Fscroll_right, displayed_window_lines, Frecenter) (Fmove_to_window_line, Fset_window_configuration) (delete_all_child_windows, apply_window_adjustment) (set_window_fringes, set_window_scroll_bars) (Fset_window_vscroll, foreach_window, foreach_window_1) (compare_window_configurations, Fcompare_window_configurations): Prefer 'bool', 'true', and 'false' for booleans. * src/window.h (WINDOW_MODE_LINE_LINES) (WINDOW_HEADER_LINE_LINES): Omit unnecessary "!!" on bool value.
Diffstat (limited to 'src')
-rw-r--r--src/window.c510
-rw-r--r--src/window.h14
2 files changed, 258 insertions, 266 deletions
diff --git a/src/window.c b/src/window.c
index 55fcb8cf02f..eb68672e2e0 100644
--- a/src/window.c
+++ b/src/window.c
@@ -45,28 +45,18 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
45#include "msdos.h" 45#include "msdos.h"
46#endif 46#endif
47 47
48static int displayed_window_lines (struct window *);
49static int count_windows (struct window *); 48static int count_windows (struct window *);
50static int get_leaf_windows (struct window *, struct window **, int); 49static int get_leaf_windows (struct window *, struct window **, int);
51static void window_scroll (Lisp_Object, EMACS_INT, bool, int); 50static void window_scroll_pixel_based (Lisp_Object, int, bool, bool);
52static void window_scroll_pixel_based (Lisp_Object, int, bool, int); 51static void window_scroll_line_based (Lisp_Object, int, bool, bool);
53static void window_scroll_line_based (Lisp_Object, int, bool, int);
54static int add_window_to_list (struct window *, void *);
55static Lisp_Object next_window (Lisp_Object, Lisp_Object,
56 Lisp_Object, int);
57static void decode_next_window_args (Lisp_Object *, Lisp_Object *,
58 Lisp_Object *);
59static void foreach_window (struct frame *, 52static void foreach_window (struct frame *,
60 int (* fn) (struct window *, void *), 53 bool (* fn) (struct window *, void *),
61 void *); 54 void *);
62static int foreach_window_1 (struct window *, 55static bool foreach_window_1 (struct window *,
63 int (* fn) (struct window *, void *), 56 bool (* fn) (struct window *, void *),
64 void *); 57 void *);
65static Lisp_Object window_list_1 (Lisp_Object, Lisp_Object, Lisp_Object); 58static bool window_resize_check (struct window *, bool);
66static int window_resize_check (struct window *, bool);
67static void window_resize_apply (struct window *, bool); 59static void window_resize_apply (struct window *, bool);
68static void window_resize_apply_total (struct window *, bool);
69static Lisp_Object select_window (Lisp_Object, Lisp_Object, int);
70static void select_window_1 (Lisp_Object, bool); 60static void select_window_1 (Lisp_Object, bool);
71 61
72static struct window *set_window_fringes (struct window *, Lisp_Object, 62static struct window *set_window_fringes (struct window *, Lisp_Object,
@@ -74,7 +64,8 @@ static struct window *set_window_fringes (struct window *, Lisp_Object,
74static struct window *set_window_margins (struct window *, Lisp_Object, 64static struct window *set_window_margins (struct window *, Lisp_Object,
75 Lisp_Object); 65 Lisp_Object);
76static struct window *set_window_scroll_bars (struct window *, Lisp_Object, 66static struct window *set_window_scroll_bars (struct window *, Lisp_Object,
77 Lisp_Object, Lisp_Object, Lisp_Object); 67 Lisp_Object, Lisp_Object,
68 Lisp_Object);
78static void apply_window_adjustment (struct window *); 69static void apply_window_adjustment (struct window *);
79 70
80/* This is the window in which the terminal's cursor should 71/* This is the window in which the terminal's cursor should
@@ -216,7 +207,7 @@ wset_combination (struct window *w, bool horflag, Lisp_Object val)
216 w->horizontal = horflag; 207 w->horizontal = horflag;
217} 208}
218 209
219/* Nonzero if leaf window W doesn't reflect the actual state 210/* True if leaf window W doesn't reflect the actual state
220 of displayed buffer due to its text or overlays change. */ 211 of displayed buffer due to its text or overlays change. */
221 212
222bool 213bool
@@ -279,7 +270,7 @@ adjust_window_count (struct window *w, int arg)
279 b->window_count += arg; 270 b->window_count += arg;
280 eassert (b->window_count >= 0); 271 eassert (b->window_count >= 0);
281 /* These should be recalculated by redisplay code. */ 272 /* These should be recalculated by redisplay code. */
282 w->window_end_valid = 0; 273 w->window_end_valid = false;
283 w->base_line_pos = 0; 274 w->base_line_pos = 0;
284 } 275 }
285} 276}
@@ -462,15 +453,16 @@ selected windows appears and to which many commands apply. */)
462 453
463int window_select_count; 454int window_select_count;
464 455
465/* If select_window is called with inhibit_point_swap non-zero it will 456/* If select_window is called with inhibit_point_swap true it will
466 not store point of the old selected window's buffer back into that 457 not store point of the old selected window's buffer back into that
467 window's pointm slot. This is needed by Fset_window_configuration to 458 window's pointm slot. This is needed by Fset_window_configuration to
468 avoid that the display routine is called with selected_window set to 459 avoid that the display routine is called with selected_window set to
469 Qnil causing a subsequent crash. */ 460 Qnil causing a subsequent crash. */
470static Lisp_Object 461static Lisp_Object
471select_window (Lisp_Object window, Lisp_Object norecord, int inhibit_point_swap) 462select_window (Lisp_Object window, Lisp_Object norecord,
463 bool inhibit_point_swap)
472{ 464{
473 register struct window *w; 465 struct window *w;
474 struct frame *sf; 466 struct frame *sf;
475 467
476 CHECK_LIVE_WINDOW (window); 468 CHECK_LIVE_WINDOW (window);
@@ -577,9 +569,9 @@ time a window gets selected put it on `buffer-list-update-hook'.
577 569
578Also note that the main editor command loop sets the current buffer to 570Also note that the main editor command loop sets the current buffer to
579the buffer of the selected window before each command. */) 571the buffer of the selected window before each command. */)
580 (register Lisp_Object window, Lisp_Object norecord) 572 (Lisp_Object window, Lisp_Object norecord)
581{ 573{
582 return select_window (window, norecord, 0); 574 return select_window (window, norecord, false);
583} 575}
584 576
585DEFUN ("window-buffer", Fwindow_buffer, Swindow_buffer, 0, 1, 0, 577DEFUN ("window-buffer", Fwindow_buffer, Swindow_buffer, 0, 1, 0,
@@ -930,11 +922,10 @@ window_body_width (struct window *w, bool pixelwise)
930 - WINDOW_RIGHT_DIVIDER_WIDTH (w) 922 - WINDOW_RIGHT_DIVIDER_WIDTH (w)
931 - (WINDOW_HAS_VERTICAL_SCROLL_BAR (w) 923 - (WINDOW_HAS_VERTICAL_SCROLL_BAR (w)
932 ? WINDOW_SCROLL_BAR_AREA_WIDTH (w) 924 ? WINDOW_SCROLL_BAR_AREA_WIDTH (w)
933 : ((!FRAME_WINDOW_P (f) 925 : (/* A vertical bar is either 1 or 0. */
934 && !WINDOW_RIGHTMOST_P (w) 926 !FRAME_WINDOW_P (f)
935 && !WINDOW_RIGHT_DIVIDER_WIDTH (w)) 927 && !WINDOW_RIGHTMOST_P (w)
936 /* A vertical bar is either 1 or 0. */ 928 && !WINDOW_RIGHT_DIVIDER_WIDTH (w)))
937 ? 1 : 0))
938 - WINDOW_MARGINS_WIDTH (w) 929 - WINDOW_MARGINS_WIDTH (w)
939 - (FRAME_WINDOW_P (f) 930 - (FRAME_WINDOW_P (f)
940 ? WINDOW_FRINGES_WIDTH (w) 931 ? WINDOW_FRINGES_WIDTH (w)
@@ -961,7 +952,7 @@ visible, that line is not counted. */)
961 (Lisp_Object window, Lisp_Object pixelwise) 952 (Lisp_Object window, Lisp_Object pixelwise)
962{ 953{
963 return make_number (window_body_height (decode_live_window (window), 954 return make_number (window_body_height (decode_live_window (window),
964 NILP (pixelwise) ? 0 : 1)); 955 !NILP (pixelwise)));
965} 956}
966 957
967DEFUN ("window-body-width", Fwindow_body_width, Swindow_body_width, 0, 2, 0, 958DEFUN ("window-body-width", Fwindow_body_width, Swindow_body_width, 0, 2, 0,
@@ -981,7 +972,7 @@ continuation glyph. */)
981 (Lisp_Object window, Lisp_Object pixelwise) 972 (Lisp_Object window, Lisp_Object pixelwise)
982{ 973{
983 return make_number (window_body_width (decode_live_window (window), 974 return make_number (window_body_width (decode_live_window (window),
984 NILP (pixelwise) ? 0 : 1)); 975 !NILP (pixelwise)));
985} 976}
986 977
987DEFUN ("window-mode-line-height", Fwindow_mode_line_height, 978DEFUN ("window-mode-line-height", Fwindow_mode_line_height,
@@ -1062,10 +1053,10 @@ set_window_hscroll (struct window *w, EMACS_INT hscroll)
1062 1053
1063 /* Prevent redisplay shortcuts when changing the hscroll. */ 1054 /* Prevent redisplay shortcuts when changing the hscroll. */
1064 if (w->hscroll != new_hscroll) 1055 if (w->hscroll != new_hscroll)
1065 XBUFFER (w->contents)->prevent_redisplay_optimizations_p = 1; 1056 XBUFFER (w->contents)->prevent_redisplay_optimizations_p = true;
1066 1057
1067 w->hscroll = new_hscroll; 1058 w->hscroll = new_hscroll;
1068 w->suspend_auto_hscroll = 1; 1059 w->suspend_auto_hscroll = true;
1069 1060
1070 return make_number (new_hscroll); 1061 return make_number (new_hscroll);
1071} 1062}
@@ -1583,7 +1574,7 @@ If they are in the windows's left or right marginal areas, `left-margin'\n\
1583 Check if window W contains coordinates *CW->x and *CW->y. If it 1574 Check if window W contains coordinates *CW->x and *CW->y. If it
1584 does, return W in *CW->window, as Lisp_Object, and return in 1575 does, return W in *CW->window, as Lisp_Object, and return in
1585 *CW->part the part of the window under coordinates *X,*Y. Return 1576 *CW->part the part of the window under coordinates *X,*Y. Return
1586 zero from this function to stop iterating over windows. */ 1577 false from this function to stop iterating over windows. */
1587 1578
1588struct check_window_data 1579struct check_window_data
1589{ 1580{
@@ -1592,22 +1583,19 @@ struct check_window_data
1592 enum window_part *part; 1583 enum window_part *part;
1593}; 1584};
1594 1585
1595static int 1586static bool
1596check_window_containing (struct window *w, void *user_data) 1587check_window_containing (struct window *w, void *user_data)
1597{ 1588{
1598 struct check_window_data *cw = user_data; 1589 struct check_window_data *cw = user_data;
1599 enum window_part found; 1590 enum window_part found = coordinates_in_window (w, cw->x, cw->y);
1600 int continue_p = 1; 1591 if (found == ON_NOTHING)
1601 1592 return true;
1602 found = coordinates_in_window (w, cw->x, cw->y); 1593 else
1603 if (found != ON_NOTHING)
1604 { 1594 {
1605 *cw->part = found; 1595 *cw->part = found;
1606 XSETWINDOW (*cw->window, w); 1596 XSETWINDOW (*cw->window, w);
1607 continue_p = 0; 1597 return false;
1608 } 1598 }
1609
1610 return continue_p;
1611} 1599}
1612 1600
1613 1601
@@ -1618,7 +1606,7 @@ check_window_containing (struct window *w, void *user_data)
1618 set *PART to the id of that element. 1606 set *PART to the id of that element.
1619 1607
1620 If there is no window under X, Y return nil and leave *PART 1608 If there is no window under X, Y return nil and leave *PART
1621 unmodified. TOOL_BAR_P non-zero means detect tool-bar windows. 1609 unmodified. TOOL_BAR_P means detect tool-bar windows.
1622 1610
1623 This function was previously implemented with a loop cycling over 1611 This function was previously implemented with a loop cycling over
1624 windows with Fnext_window, and starting with the frame's selected 1612 windows with Fnext_window, and starting with the frame's selected
@@ -1680,7 +1668,7 @@ column 0. */)
1680 + FRAME_INTERNAL_BORDER_WIDTH (f)), 1668 + FRAME_INTERNAL_BORDER_WIDTH (f)),
1681 (FRAME_PIXEL_Y_FROM_CANON_Y (f, y) 1669 (FRAME_PIXEL_Y_FROM_CANON_Y (f, y)
1682 + FRAME_INTERNAL_BORDER_WIDTH (f)), 1670 + FRAME_INTERNAL_BORDER_WIDTH (f)),
1683 0, 0); 1671 0, false);
1684} 1672}
1685 1673
1686DEFUN ("window-point", Fwindow_point, Swindow_point, 0, 1, 0, 1674DEFUN ("window-point", Fwindow_point, Swindow_point, 0, 1, 0,
@@ -1787,7 +1775,7 @@ if it isn't already recorded. */)
1787 if (it.current_y < it.last_visible_y) 1775 if (it.current_y < it.last_visible_y)
1788 move_it_past_eol (&it); 1776 move_it_past_eol (&it);
1789 value = make_number (IT_CHARPOS (it)); 1777 value = make_number (IT_CHARPOS (it));
1790 bidi_unshelve_cache (itdata, 0); 1778 bidi_unshelve_cache (itdata, false);
1791 1779
1792 if (old_buffer) 1780 if (old_buffer)
1793 set_buffer_internal (old_buffer); 1781 set_buffer_internal (old_buffer);
@@ -1845,12 +1833,12 @@ overriding motion of point in order to display at this exact start. */)
1845 1833
1846 set_marker_restricted (w->start, pos, w->contents); 1834 set_marker_restricted (w->start, pos, w->contents);
1847 /* This is not right, but much easier than doing what is right. */ 1835 /* This is not right, but much easier than doing what is right. */
1848 w->start_at_line_beg = 0; 1836 w->start_at_line_beg = false;
1849 if (NILP (noforce)) 1837 if (NILP (noforce))
1850 w->force_start = 1; 1838 w->force_start = true;
1851 w->update_mode_line = 1; 1839 w->update_mode_line = true;
1852 /* Bug#15957. */ 1840 /* Bug#15957. */
1853 w->window_end_valid = 0; 1841 w->window_end_valid = false;
1854 wset_redisplay (w); 1842 wset_redisplay (w);
1855 1843
1856 return pos; 1844 return pos;
@@ -1878,12 +1866,13 @@ POS, ROWH is the visible height of that row, and VPOS is the row number
1878\(zero-based). */) 1866\(zero-based). */)
1879 (Lisp_Object pos, Lisp_Object window, Lisp_Object partially) 1867 (Lisp_Object pos, Lisp_Object window, Lisp_Object partially)
1880{ 1868{
1881 register struct window *w; 1869 struct window *w;
1882 register EMACS_INT posint; 1870 EMACS_INT posint;
1883 register struct buffer *buf; 1871 struct buffer *buf;
1884 struct text_pos top; 1872 struct text_pos top;
1885 Lisp_Object in_window = Qnil; 1873 Lisp_Object in_window = Qnil;
1886 int rtop, rbot, rowh, vpos, fully_p = 1; 1874 int rtop, rbot, rowh, vpos;
1875 bool fully_p = true;
1887 int x, y; 1876 int x, y;
1888 1877
1889 w = decode_live_window (window); 1878 w = decode_live_window (window);
@@ -1908,9 +1897,12 @@ POS, ROWH is the visible height of that row, and VPOS is the row number
1908 || (posint >= CHARPOS (top) && posint <= BUF_ZV (buf))) 1897 || (posint >= CHARPOS (top) && posint <= BUF_ZV (buf)))
1909 && CHARPOS (top) >= BUF_BEGV (buf) 1898 && CHARPOS (top) >= BUF_BEGV (buf)
1910 && CHARPOS (top) <= BUF_ZV (buf) 1899 && CHARPOS (top) <= BUF_ZV (buf)
1911 && pos_visible_p (w, posint, &x, &y, &rtop, &rbot, &rowh, &vpos) 1900 && pos_visible_p (w, posint, &x, &y, &rtop, &rbot, &rowh, &vpos))
1912 && (fully_p = !rtop && !rbot, (!NILP (partially) || fully_p))) 1901 {
1913 in_window = Qt; 1902 fully_p = !rtop && !rbot;
1903 if (!NILP (partially) || fully_p)
1904 in_window = Qt;
1905 }
1914 1906
1915 if (!NILP (in_window) && !NILP (partially)) 1907 if (!NILP (in_window) && !NILP (partially))
1916 { 1908 {
@@ -2215,7 +2207,7 @@ unshow_buffer (register struct window *w)
2215 2207
2216 eassert (b == XMARKER (w->pointm)->buffer); 2208 eassert (b == XMARKER (w->pointm)->buffer);
2217 2209
2218#if 0 2210#if false
2219 if (w == XWINDOW (selected_window) 2211 if (w == XWINDOW (selected_window)
2220 || ! EQ (buf, XWINDOW (selected_window)->contents)) 2212 || ! EQ (buf, XWINDOW (selected_window)->contents))
2221 /* Do this except when the selected window's buffer 2213 /* Do this except when the selected window's buffer
@@ -2254,14 +2246,14 @@ unshow_buffer (register struct window *w)
2254 bset_last_selected_window (b, Qnil); 2246 bset_last_selected_window (b, Qnil);
2255} 2247}
2256 2248
2257/* Put NEW into the window structure in place of OLD. SETFLAG zero 2249/* Put NEW into the window structure in place of OLD. SETFLAG false
2258 means change window structure only. Otherwise store geometry and 2250 means change window structure only. Otherwise store geometry and
2259 other settings as well. */ 2251 other settings as well. */
2260static void 2252static void
2261replace_window (Lisp_Object old, Lisp_Object new, int setflag) 2253replace_window (Lisp_Object old, Lisp_Object new, bool setflag)
2262{ 2254{
2263 register Lisp_Object tem; 2255 Lisp_Object tem;
2264 register struct window *o = XWINDOW (old), *n = XWINDOW (new); 2256 struct window *o = XWINDOW (old), *n = XWINDOW (new);
2265 2257
2266 /* If OLD is its frame's root window, then NEW is the new 2258 /* If OLD is its frame's root window, then NEW is the new
2267 root window for that frame. */ 2259 root window for that frame. */
@@ -2291,11 +2283,11 @@ replace_window (Lisp_Object old, Lisp_Object new, int setflag)
2291 n->phys_cursor_type = NO_CURSOR; 2283 n->phys_cursor_type = NO_CURSOR;
2292 n->phys_cursor_width = -1; 2284 n->phys_cursor_width = -1;
2293#endif 2285#endif
2294 n->must_be_updated_p = 0; 2286 n->must_be_updated_p = false;
2295 n->pseudo_window_p = 0; 2287 n->pseudo_window_p = false;
2296 n->window_end_vpos = 0; 2288 n->window_end_vpos = 0;
2297 n->window_end_pos = 0; 2289 n->window_end_pos = 0;
2298 n->window_end_valid = 0; 2290 n->window_end_valid = false;
2299 } 2291 }
2300 2292
2301 tem = o->next; 2293 tem = o->next;
@@ -2380,7 +2372,7 @@ recombine_windows (Lisp_Object window)
2380 } 2372 }
2381 2373
2382 /* WINDOW can be deleted now. */ 2374 /* WINDOW can be deleted now. */
2383 wset_combination (w, 0, Qnil); 2375 wset_combination (w, false, Qnil);
2384 } 2376 }
2385 } 2377 }
2386} 2378}
@@ -2401,14 +2393,14 @@ delete_deletable_window (Lisp_Object window)
2401 pointer. This is a callback function for foreach_window, used in 2393 pointer. This is a callback function for foreach_window, used in
2402 the window_list function. */ 2394 the window_list function. */
2403 2395
2404static int 2396static bool
2405add_window_to_list (struct window *w, void *user_data) 2397add_window_to_list (struct window *w, void *user_data)
2406{ 2398{
2407 Lisp_Object *list = user_data; 2399 Lisp_Object *list = user_data;
2408 Lisp_Object window; 2400 Lisp_Object window;
2409 XSETWINDOW (window, w); 2401 XSETWINDOW (window, w);
2410 *list = Fcons (window, *list); 2402 *list = Fcons (window, *list);
2411 return 1; 2403 return true;
2412} 2404}
2413 2405
2414 2406
@@ -2441,7 +2433,7 @@ window_list (void)
2441} 2433}
2442 2434
2443 2435
2444/* Value is non-zero if WINDOW satisfies the constraints given by 2436/* Value is true if WINDOW satisfies the constraints given by
2445 OWINDOW, MINIBUF and ALL_FRAMES. 2437 OWINDOW, MINIBUF and ALL_FRAMES.
2446 2438
2447 MINIBUF t means WINDOW may be minibuffer windows. 2439 MINIBUF t means WINDOW may be minibuffer windows.
@@ -2463,20 +2455,20 @@ candidate_window_p (Lisp_Object window, Lisp_Object owindow,
2463{ 2455{
2464 struct window *w = XWINDOW (window); 2456 struct window *w = XWINDOW (window);
2465 struct frame *f = XFRAME (w->frame); 2457 struct frame *f = XFRAME (w->frame);
2466 bool candidate_p = 1; 2458 bool candidate_p = true;
2467 2459
2468 if (!BUFFERP (w->contents)) 2460 if (!BUFFERP (w->contents))
2469 candidate_p = 0; 2461 candidate_p = false;
2470 else if (MINI_WINDOW_P (w) 2462 else if (MINI_WINDOW_P (w)
2471 && (EQ (minibuf, Qlambda) 2463 && (EQ (minibuf, Qlambda)
2472 || (WINDOWP (minibuf) && !EQ (minibuf, window)))) 2464 || (WINDOWP (minibuf) && !EQ (minibuf, window))))
2473 { 2465 {
2474 /* If MINIBUF is `lambda' don't consider any mini-windows. 2466 /* If MINIBUF is `lambda' don't consider any mini-windows.
2475 If it is a window, consider only that one. */ 2467 If it is a window, consider only that one. */
2476 candidate_p = 0; 2468 candidate_p = false;
2477 } 2469 }
2478 else if (EQ (all_frames, Qt)) 2470 else if (EQ (all_frames, Qt))
2479 candidate_p = 1; 2471 candidate_p = true;
2480 else if (NILP (all_frames)) 2472 else if (NILP (all_frames))
2481 { 2473 {
2482 eassert (WINDOWP (owindow)); 2474 eassert (WINDOWP (owindow));
@@ -2556,12 +2548,13 @@ decode_next_window_args (Lisp_Object *window, Lisp_Object *minibuf, Lisp_Object
2556 2548
2557 2549
2558/* Return the next or previous window of WINDOW in cyclic ordering 2550/* Return the next or previous window of WINDOW in cyclic ordering
2559 of windows. NEXT_P non-zero means return the next window. See the 2551 of windows. NEXT_P means return the next window. See the
2560 documentation string of next-window for the meaning of MINIBUF and 2552 documentation string of next-window for the meaning of MINIBUF and
2561 ALL_FRAMES. */ 2553 ALL_FRAMES. */
2562 2554
2563static Lisp_Object 2555static Lisp_Object
2564next_window (Lisp_Object window, Lisp_Object minibuf, Lisp_Object all_frames, int next_p) 2556next_window (Lisp_Object window, Lisp_Object minibuf, Lisp_Object all_frames,
2557 bool next_p)
2565{ 2558{
2566 decode_next_window_args (&window, &minibuf, &all_frames); 2559 decode_next_window_args (&window, &minibuf, &all_frames);
2567 2560
@@ -2659,7 +2652,7 @@ windows, eventually ending up back at the window you started with.
2659`previous-window' traverses the same cycle, in the reverse order. */) 2652`previous-window' traverses the same cycle, in the reverse order. */)
2660 (Lisp_Object window, Lisp_Object minibuf, Lisp_Object all_frames) 2653 (Lisp_Object window, Lisp_Object minibuf, Lisp_Object all_frames)
2661{ 2654{
2662 return next_window (window, minibuf, all_frames, 1); 2655 return next_window (window, minibuf, all_frames, true);
2663} 2656}
2664 2657
2665 2658
@@ -2699,7 +2692,7 @@ started with. `next-window' traverses the same cycle, in the
2699reverse order. */) 2692reverse order. */)
2700 (Lisp_Object window, Lisp_Object minibuf, Lisp_Object all_frames) 2693 (Lisp_Object window, Lisp_Object minibuf, Lisp_Object all_frames)
2701{ 2694{
2702 return next_window (window, minibuf, all_frames, 0); 2695 return next_window (window, minibuf, all_frames, false);
2703} 2696}
2704 2697
2705 2698
@@ -2797,7 +2790,7 @@ be listed first but no error is signaled. */)
2797 Qnil, look at just the selected frame; 2790 Qnil, look at just the selected frame;
2798 Qvisible, look at visible frames; 2791 Qvisible, look at visible frames;
2799 a frame, just look at windows on that frame. 2792 a frame, just look at windows on that frame.
2800 If MINI is non-zero, perform the operation on minibuffer windows too. */ 2793 If MINI, perform the operation on minibuffer windows too. */
2801 2794
2802enum window_loop 2795enum window_loop
2803{ 2796{
@@ -2809,10 +2802,11 @@ enum window_loop
2809}; 2802};
2810 2803
2811static Lisp_Object 2804static Lisp_Object
2812window_loop (enum window_loop type, Lisp_Object obj, int mini, Lisp_Object frames) 2805window_loop (enum window_loop type, Lisp_Object obj, bool mini,
2806 Lisp_Object frames)
2813{ 2807{
2814 Lisp_Object window, windows, best_window, frame_arg; 2808 Lisp_Object window, windows, best_window, frame_arg;
2815 int frame_best_window_flag = 0; 2809 bool frame_best_window_flag = false;
2816 struct frame *f; 2810 struct frame *f;
2817 struct gcpro gcpro1; 2811 struct gcpro gcpro1;
2818 2812
@@ -2872,7 +2866,7 @@ window_loop (enum window_loop type, Lisp_Object obj, int mini, Lisp_Object frame
2872 if (EQ (w->contents, obj) 2866 if (EQ (w->contents, obj)
2873 /* Don't find any minibuffer window except the one that 2867 /* Don't find any minibuffer window except the one that
2874 is currently in use. */ 2868 is currently in use. */
2875 && (MINI_WINDOW_P (w) ? EQ (window, minibuf_window) : 1)) 2869 && (!MINI_WINDOW_P (w) || EQ (window, minibuf_window)))
2876 { 2870 {
2877 if (EQ (window, selected_window)) 2871 if (EQ (window, selected_window))
2878 /* Preferably return the selected window. */ 2872 /* Preferably return the selected window. */
@@ -2883,7 +2877,7 @@ window_loop (enum window_loop type, Lisp_Object obj, int mini, Lisp_Object frame
2883 choose another one if we have one already). */ 2877 choose another one if we have one already). */
2884 { 2878 {
2885 best_window = window; 2879 best_window = window;
2886 frame_best_window_flag = 1; 2880 frame_best_window_flag = true;
2887 } 2881 }
2888 else if (NILP (best_window)) 2882 else if (NILP (best_window))
2889 best_window = window; 2883 best_window = window;
@@ -2900,7 +2894,7 @@ window_loop (enum window_loop type, Lisp_Object obj, int mini, Lisp_Object frame
2900 /* Make WINDOW show the buffer returned by 2894 /* Make WINDOW show the buffer returned by
2901 other_buffer_safely, don't run any hooks. */ 2895 other_buffer_safely, don't run any hooks. */
2902 set_window_buffer 2896 set_window_buffer
2903 (window, other_buffer_safely (w->contents), 0, 0); 2897 (window, other_buffer_safely (w->contents), false, false);
2904 /* If WINDOW is the selected window, make its buffer 2898 /* If WINDOW is the selected window, make its buffer
2905 current. But do so only if the window shows the 2899 current. But do so only if the window shows the
2906 current buffer (Bug#6454). */ 2900 current buffer (Bug#6454). */
@@ -2913,9 +2907,9 @@ window_loop (enum window_loop type, Lisp_Object obj, int mini, Lisp_Object frame
2913 case REDISPLAY_BUFFER_WINDOWS: 2907 case REDISPLAY_BUFFER_WINDOWS:
2914 if (EQ (w->contents, obj)) 2908 if (EQ (w->contents, obj))
2915 { 2909 {
2916 mark_window_display_accurate (window, 0); 2910 mark_window_display_accurate (window, false);
2917 w->update_mode_line = 1; 2911 w->update_mode_line = true;
2918 XBUFFER (obj)->prevent_redisplay_optimizations_p = 1; 2912 XBUFFER (obj)->prevent_redisplay_optimizations_p = true;
2919 update_mode_lines = 27; 2913 update_mode_lines = 27;
2920 best_window = window; 2914 best_window = window;
2921 } 2915 }
@@ -2952,7 +2946,7 @@ extern void check_all_windows (void) EXTERNALLY_VISIBLE;
2952void 2946void
2953check_all_windows (void) 2947check_all_windows (void)
2954{ 2948{
2955 window_loop (CHECK_ALL_WINDOWS, Qnil, 1, Qt); 2949 window_loop (CHECK_ALL_WINDOWS, Qnil, true, Qt);
2956} 2950}
2957 2951
2958DEFUN ("get-buffer-window", Fget_buffer_window, Sget_buffer_window, 0, 2, 0, 2952DEFUN ("get-buffer-window", Fget_buffer_window, Sget_buffer_window, 0, 2, 0,
@@ -2983,7 +2977,7 @@ selected frame and no others. */)
2983 buffer = Fget_buffer (buffer_or_name); 2977 buffer = Fget_buffer (buffer_or_name);
2984 2978
2985 if (BUFFERP (buffer)) 2979 if (BUFFERP (buffer))
2986 return window_loop (GET_BUFFER_WINDOW, buffer, 1, all_frames); 2980 return window_loop (GET_BUFFER_WINDOW, buffer, true, all_frames);
2987 else 2981 else
2988 return Qnil; 2982 return Qnil;
2989} 2983}
@@ -3040,7 +3034,7 @@ window-start value is reasonable when this function is called. */)
3040 struct frame *f; 3034 struct frame *f;
3041 Lisp_Object sibling, pwindow, swindow IF_LINT (= Qnil), delta; 3035 Lisp_Object sibling, pwindow, swindow IF_LINT (= Qnil), delta;
3042 ptrdiff_t startpos IF_LINT (= 0), startbyte IF_LINT (= 0); 3036 ptrdiff_t startpos IF_LINT (= 0), startbyte IF_LINT (= 0);
3043 int top IF_LINT (= 0), new_top, resize_failed; 3037 int top IF_LINT (= 0), new_top;
3044 3038
3045 w = decode_valid_window (window); 3039 w = decode_valid_window (window);
3046 XSETWINDOW (window, w); 3040 XSETWINDOW (window, w);
@@ -3097,7 +3091,7 @@ window-start value is reasonable when this function is called. */)
3097 parents and comparing each one with WINDOW. If it isn't we 3091 parents and comparing each one with WINDOW. If it isn't we
3098 need a new selected window for this frame. */ 3092 need a new selected window for this frame. */
3099 swindow = FRAME_SELECTED_WINDOW (f); 3093 swindow = FRAME_SELECTED_WINDOW (f);
3100 while (1) 3094 while (true)
3101 { 3095 {
3102 pwindow = swindow; 3096 pwindow = swindow;
3103 while (!NILP (pwindow) && !EQ (window, pwindow)) 3097 while (!NILP (pwindow) && !EQ (window, pwindow))
@@ -3129,7 +3123,7 @@ window-start value is reasonable when this function is called. */)
3129 /* We are going to free the glyph matrices of WINDOW, and with 3123 /* We are going to free the glyph matrices of WINDOW, and with
3130 that we might lose any information about glyph rows that have 3124 that we might lose any information about glyph rows that have
3131 some of their glyphs highlighted in mouse face. (These rows 3125 some of their glyphs highlighted in mouse face. (These rows
3132 are marked with a non-zero mouse_face_p flag.) If WINDOW 3126 are marked with a mouse_face_p flag.) If WINDOW
3133 indeed has some glyphs highlighted in mouse face, signal to 3127 indeed has some glyphs highlighted in mouse face, signal to
3134 frame's up-to-date hook that mouse highlight was overwritten, 3128 frame's up-to-date hook that mouse highlight was overwritten,
3135 so that it will arrange for redisplaying the highlight. */ 3129 so that it will arrange for redisplaying the highlight. */
@@ -3140,8 +3134,8 @@ window-start value is reasonable when this function is called. */)
3140 3134
3141 fset_redisplay (f); 3135 fset_redisplay (f);
3142 Vwindow_list = Qnil; 3136 Vwindow_list = Qnil;
3143 FRAME_WINDOW_SIZES_CHANGED (f) = 1; 3137 FRAME_WINDOW_SIZES_CHANGED (f) = true;
3144 resize_failed = 0; 3138 bool resize_failed = false;
3145 3139
3146 if (!WINDOW_LEAF_P (w)) 3140 if (!WINDOW_LEAF_P (w))
3147 { 3141 {
@@ -3150,21 +3144,21 @@ window-start value is reasonable when this function is called. */)
3150 w->pixel_top = r->pixel_top; 3144 w->pixel_top = r->pixel_top;
3151 w->top_line = r->top_line; 3145 w->top_line = r->top_line;
3152 resize_root_window (window, delta, Qnil, Qnil, Qt); 3146 resize_root_window (window, delta, Qnil, Qnil, Qt);
3153 if (window_resize_check (w, 0)) 3147 if (window_resize_check (w, false))
3154 { 3148 {
3155 window_resize_apply (w, 0); 3149 window_resize_apply (w, false);
3156 window_pixel_to_total (w->frame, Qnil); 3150 window_pixel_to_total (w->frame, Qnil);
3157 } 3151 }
3158 else 3152 else
3159 { 3153 {
3160 resize_root_window (window, delta, Qnil, Qt, Qt); 3154 resize_root_window (window, delta, Qnil, Qt, Qt);
3161 if (window_resize_check (w, 0)) 3155 if (window_resize_check (w, false))
3162 { 3156 {
3163 window_resize_apply (w, 0); 3157 window_resize_apply (w, false);
3164 window_pixel_to_total (w->frame, Qnil); 3158 window_pixel_to_total (w->frame, Qnil);
3165 } 3159 }
3166 else 3160 else
3167 resize_failed = 1; 3161 resize_failed = true;
3168 } 3162 }
3169 3163
3170 /* Resize child windows horizontally. */ 3164 /* Resize child windows horizontally. */
@@ -3174,21 +3168,21 @@ window-start value is reasonable when this function is called. */)
3174 w->pixel_left = r->pixel_left; 3168 w->pixel_left = r->pixel_left;
3175 XSETINT (delta, r->pixel_width - w->pixel_width); 3169 XSETINT (delta, r->pixel_width - w->pixel_width);
3176 resize_root_window (window, delta, Qt, Qnil, Qt); 3170 resize_root_window (window, delta, Qt, Qnil, Qt);
3177 if (window_resize_check (w, 1)) 3171 if (window_resize_check (w, true))
3178 { 3172 {
3179 window_resize_apply (w, 1); 3173 window_resize_apply (w, true);
3180 window_pixel_to_total (w->frame, Qt); 3174 window_pixel_to_total (w->frame, Qt);
3181 } 3175 }
3182 else 3176 else
3183 { 3177 {
3184 resize_root_window (window, delta, Qt, Qt, Qt); 3178 resize_root_window (window, delta, Qt, Qt, Qt);
3185 if (window_resize_check (w, 1)) 3179 if (window_resize_check (w, true))
3186 { 3180 {
3187 window_resize_apply (w, 1); 3181 window_resize_apply (w, true);
3188 window_pixel_to_total (w->frame, Qt); 3182 window_pixel_to_total (w->frame, Qt);
3189 } 3183 }
3190 else 3184 else
3191 resize_failed = 1; 3185 resize_failed = true;
3192 } 3186 }
3193 } 3187 }
3194 3188
@@ -3224,10 +3218,10 @@ window-start value is reasonable when this function is called. */)
3224 if (WINDOWP (r->contents)) 3218 if (WINDOWP (r->contents))
3225 { 3219 {
3226 delete_all_child_windows (r->contents); 3220 delete_all_child_windows (r->contents);
3227 wset_combination (r, 0, Qnil); 3221 wset_combination (r, false, Qnil);
3228 } 3222 }
3229 3223
3230 replace_window (root, window, 1); 3224 replace_window (root, window, true);
3231 3225
3232 /* This must become SWINDOW anyway ....... */ 3226 /* This must become SWINDOW anyway ....... */
3233 if (BUFFERP (w->contents) && !resize_failed) 3227 if (BUFFERP (w->contents) && !resize_failed)
@@ -3251,12 +3245,12 @@ window-start value is reasonable when this function is called. */)
3251 pos = *vmotion (startpos, startbyte, -top, w); 3245 pos = *vmotion (startpos, startbyte, -top, w);
3252 3246
3253 set_marker_both (w->start, w->contents, pos.bufpos, pos.bytepos); 3247 set_marker_both (w->start, w->contents, pos.bufpos, pos.bytepos);
3254 w->window_end_valid = 0; 3248 w->window_end_valid = false;
3255 w->start_at_line_beg = (pos.bytepos == BEGV_BYTE 3249 w->start_at_line_beg = (pos.bytepos == BEGV_BYTE
3256 || FETCH_BYTE (pos.bytepos - 1) == '\n'); 3250 || FETCH_BYTE (pos.bytepos - 1) == '\n');
3257 /* We need to do this, so that the window-scroll-functions 3251 /* We need to do this, so that the window-scroll-functions
3258 get called. */ 3252 get called. */
3259 w->optional_new_start = 1; 3253 w->optional_new_start = true;
3260 3254
3261 set_buffer_internal (obuf); 3255 set_buffer_internal (obuf);
3262 } 3256 }
@@ -3291,7 +3285,7 @@ replace_buffer_in_windows_safely (Lisp_Object buffer)
3291 considers frames on the current keyboard. So loop manually over 3285 considers frames on the current keyboard. So loop manually over
3292 frames, and handle each one. */ 3286 frames, and handle each one. */
3293 FOR_EACH_FRAME (tail, frame) 3287 FOR_EACH_FRAME (tail, frame)
3294 window_loop (REPLACE_BUFFER_IN_WINDOWS_SAFELY, buffer, 1, frame); 3288 window_loop (REPLACE_BUFFER_IN_WINDOWS_SAFELY, buffer, true, frame);
3295 } 3289 }
3296} 3290}
3297 3291
@@ -3391,9 +3385,9 @@ If WINDOW is omitted or nil, it defaults to the selected window. */)
3391 return Qnil; 3385 return Qnil;
3392} 3386}
3393 3387
3394/* Make WINDOW display BUFFER. RUN_HOOKS_P non-zero means it's allowed 3388/* Make WINDOW display BUFFER. RUN_HOOKS_P means it's allowed
3395 to run hooks. See make_frame for a case where it's not allowed. 3389 to run hooks. See make_frame for a case where it's not allowed.
3396 KEEP_MARGINS_P non-zero means that the current margins, fringes, and 3390 KEEP_MARGINS_P means that the current margins, fringes, and
3397 scroll-bar settings of the window are not reset from the buffer's 3391 scroll-bar settings of the window are not reset from the buffer's
3398 local settings. */ 3392 local settings. */
3399 3393
@@ -3435,15 +3429,15 @@ set_window_buffer (Lisp_Object window, Lisp_Object buffer,
3435 doc-view-mode since it resets the image's position whenever we 3429 doc-view-mode since it resets the image's position whenever we
3436 resize the frame. */ 3430 resize the frame. */
3437 w->hscroll = w->min_hscroll = w->hscroll_whole = 0; 3431 w->hscroll = w->min_hscroll = w->hscroll_whole = 0;
3438 w->suspend_auto_hscroll = 0; 3432 w->suspend_auto_hscroll = false;
3439 w->vscroll = 0; 3433 w->vscroll = 0;
3440 set_marker_both (w->pointm, buffer, BUF_PT (b), BUF_PT_BYTE (b)); 3434 set_marker_both (w->pointm, buffer, BUF_PT (b), BUF_PT_BYTE (b));
3441 set_marker_both (w->old_pointm, buffer, BUF_PT (b), BUF_PT_BYTE (b)); 3435 set_marker_both (w->old_pointm, buffer, BUF_PT (b), BUF_PT_BYTE (b));
3442 set_marker_restricted (w->start, 3436 set_marker_restricted (w->start,
3443 make_number (b->last_window_start), 3437 make_number (b->last_window_start),
3444 buffer); 3438 buffer);
3445 w->start_at_line_beg = 0; 3439 w->start_at_line_beg = false;
3446 w->force_start = 0; 3440 w->force_start = false;
3447 } 3441 }
3448 /* Maybe we could move this into the `if' but it's not obviously safe and 3442 /* Maybe we could move this into the `if' but it's not obviously safe and
3449 I doubt it's worth the trouble. */ 3443 I doubt it's worth the trouble. */
@@ -3534,7 +3528,7 @@ This function runs `window-scroll-functions' before running
3534 unshow_buffer (w); 3528 unshow_buffer (w);
3535 } 3529 }
3536 3530
3537 set_window_buffer (window, buffer, 1, !NILP (keep_margins)); 3531 set_window_buffer (window, buffer, true, !NILP (keep_margins));
3538 3532
3539 return Qnil; 3533 return Qnil;
3540} 3534}
@@ -3563,10 +3557,10 @@ displaying that buffer. */)
3563 if (WINDOWP (object)) 3557 if (WINDOWP (object))
3564 { 3558 {
3565 struct window *w = XWINDOW (object); 3559 struct window *w = XWINDOW (object);
3566 mark_window_display_accurate (object, 0); 3560 mark_window_display_accurate (object, false);
3567 w->update_mode_line = 1; 3561 w->update_mode_line = true;
3568 if (BUFFERP (w->contents)) 3562 if (BUFFERP (w->contents))
3569 XBUFFER (w->contents)->prevent_redisplay_optimizations_p = 1; 3563 XBUFFER (w->contents)->prevent_redisplay_optimizations_p = true;
3570 update_mode_lines = 29; 3564 update_mode_lines = 29;
3571 return Qt; 3565 return Qt;
3572 } 3566 }
@@ -3578,7 +3572,7 @@ displaying that buffer. */)
3578 { 3572 {
3579 /* If buffer is live and shown in at least one window, find 3573 /* If buffer is live and shown in at least one window, find
3580 all windows showing this buffer and force update of them. */ 3574 all windows showing this buffer and force update of them. */
3581 object = window_loop (REDISPLAY_BUFFER_WINDOWS, object, 0, Qvisible); 3575 object = window_loop (REDISPLAY_BUFFER_WINDOWS, object, false, Qvisible);
3582 return NILP (object) ? Qnil : Qt; 3576 return NILP (object) ? Qnil : Qt;
3583 } 3577 }
3584 3578
@@ -3614,7 +3608,7 @@ temp_output_buffer_show (register Lisp_Object buf)
3614 Vminibuf_scroll_window = window; 3608 Vminibuf_scroll_window = window;
3615 w = XWINDOW (window); 3609 w = XWINDOW (window);
3616 w->hscroll = w->min_hscroll = w->hscroll_whole = 0; 3610 w->hscroll = w->min_hscroll = w->hscroll_whole = 0;
3617 w->suspend_auto_hscroll = 0; 3611 w->suspend_auto_hscroll = false;
3618 set_marker_restricted_both (w->start, buf, BEG, BEG); 3612 set_marker_restricted_both (w->start, buf, BEG, BEG);
3619 set_marker_restricted_both (w->pointm, buf, BEG, BEG); 3613 set_marker_restricted_both (w->pointm, buf, BEG, BEG);
3620 set_marker_restricted_both (w->old_pointm, buf, BEG, BEG); 3614 set_marker_restricted_both (w->old_pointm, buf, BEG, BEG);
@@ -3651,7 +3645,7 @@ allocate_window (void)
3651} 3645}
3652 3646
3653/* Make new window, have it replace WINDOW in window-tree, and make 3647/* Make new window, have it replace WINDOW in window-tree, and make
3654 WINDOW its only vertical child (HORFLAG 1 means make WINDOW its only 3648 WINDOW its only vertical child (HORFLAG means make WINDOW its only
3655 horizontal child). */ 3649 horizontal child). */
3656static void 3650static void
3657make_parent_window (Lisp_Object window, bool horflag) 3651make_parent_window (Lisp_Object window, bool horflag)
@@ -3670,7 +3664,7 @@ make_parent_window (Lisp_Object window, bool horflag)
3670 3664
3671 p->sequence_number = ++sequence_number; 3665 p->sequence_number = ++sequence_number;
3672 3666
3673 replace_window (window, parent, 1); 3667 replace_window (window, parent, true);
3674 3668
3675 wset_next (o, Qnil); 3669 wset_next (o, Qnil);
3676 wset_prev (o, Qnil); 3670 wset_prev (o, Qnil);
@@ -3799,14 +3793,14 @@ Note: This function does not operate on any child windows of WINDOW. */)
3799 return size; 3793 return size;
3800} 3794}
3801 3795
3802/* Return 1 if setting w->pixel_height (w->pixel_width if HORFLAG is 3796/* Return true if setting w->pixel_height (w->pixel_width if HORFLAG)
3803 non-zero) to w->new_pixel would result in correct heights (widths) 3797 to w->new_pixel would result in correct heights (widths)
3804 for window W and recursively all child windows of W. 3798 for window W and recursively all child windows of W.
3805 3799
3806 Note: This function does not check any of `window-fixed-size-p', 3800 Note: This function does not check any of `window-fixed-size-p',
3807 `window-min-height' or `window-min-width'. It does check that window 3801 `window-min-height' or `window-min-width'. It does check that window
3808 sizes do not drop below one line (two columns). */ 3802 sizes do not drop below one line (two columns). */
3809static int 3803static bool
3810window_resize_check (struct window *w, bool horflag) 3804window_resize_check (struct window *w, bool horflag)
3811{ 3805{
3812 struct frame *f = XFRAME (w->frame); 3806 struct frame *f = XFRAME (w->frame);
@@ -3823,12 +3817,12 @@ window_resize_check (struct window *w, bool horflag)
3823 { 3817 {
3824 if (XINT (c->new_pixel) != XINT (w->new_pixel) 3818 if (XINT (c->new_pixel) != XINT (w->new_pixel)
3825 || !window_resize_check (c, horflag)) 3819 || !window_resize_check (c, horflag))
3826 return 0; 3820 return false;
3827 3821
3828 c = NILP (c->next) ? 0 : XWINDOW (c->next); 3822 c = NILP (c->next) ? 0 : XWINDOW (c->next);
3829 } 3823 }
3830 3824
3831 return 1; 3825 return true;
3832 } 3826 }
3833 else 3827 else
3834 /* The sum of the heights of the child windows of W must equal 3828 /* The sum of the heights of the child windows of W must equal
@@ -3839,11 +3833,11 @@ window_resize_check (struct window *w, bool horflag)
3839 while (c) 3833 while (c)
3840 { 3834 {
3841 if (!window_resize_check (c, horflag)) 3835 if (!window_resize_check (c, horflag))
3842 return 0; 3836 return false;
3843 3837
3844 remaining_pixels -= XINT (c->new_pixel); 3838 remaining_pixels -= XINT (c->new_pixel);
3845 if (remaining_pixels < 0) 3839 if (remaining_pixels < 0)
3846 return 0; 3840 return false;
3847 c = NILP (c->next) ? 0 : XWINDOW (c->next); 3841 c = NILP (c->next) ? 0 : XWINDOW (c->next);
3848 } 3842 }
3849 3843
@@ -3863,11 +3857,11 @@ window_resize_check (struct window *w, bool horflag)
3863 while (c) 3857 while (c)
3864 { 3858 {
3865 if (!window_resize_check (c, horflag)) 3859 if (!window_resize_check (c, horflag))
3866 return 0; 3860 return false;
3867 3861
3868 remaining_pixels -= XINT (c->new_pixel); 3862 remaining_pixels -= XINT (c->new_pixel);
3869 if (remaining_pixels < 0) 3863 if (remaining_pixels < 0)
3870 return 0; 3864 return false;
3871 c = NILP (c->next) ? 0 : XWINDOW (c->next); 3865 c = NILP (c->next) ? 0 : XWINDOW (c->next);
3872 } 3866 }
3873 3867
@@ -3880,12 +3874,12 @@ window_resize_check (struct window *w, bool horflag)
3880 { 3874 {
3881 if (XINT (c->new_pixel) != XINT (w->new_pixel) 3875 if (XINT (c->new_pixel) != XINT (w->new_pixel)
3882 || !window_resize_check (c, horflag)) 3876 || !window_resize_check (c, horflag))
3883 return 0; 3877 return false;
3884 3878
3885 c = NILP (c->next) ? 0 : XWINDOW (c->next); 3879 c = NILP (c->next) ? 0 : XWINDOW (c->next);
3886 } 3880 }
3887 3881
3888 return 1; 3882 return true;
3889 } 3883 }
3890 } 3884 }
3891 else 3885 else
@@ -3898,7 +3892,7 @@ window_resize_check (struct window *w, bool horflag)
3898} 3892}
3899 3893
3900 3894
3901/* Set w->pixel_height (w->pixel_width if HORFLAG is non-zero) to 3895/* Set w->pixel_height (w->pixel_width if HORFLAG) to
3902 w->new_pixel for window W and recursively all child windows of W. 3896 w->new_pixel for window W and recursively all child windows of W.
3903 Also calculate and assign the new vertical (horizontal) pixel start 3897 Also calculate and assign the new vertical (horizontal) pixel start
3904 positions of each of these windows. 3898 positions of each of these windows.
@@ -3984,11 +3978,11 @@ window_resize_apply (struct window *w, bool horflag)
3984 } 3978 }
3985 else 3979 else
3986 /* Bug#15957. */ 3980 /* Bug#15957. */
3987 w->window_end_valid = 0; 3981 w->window_end_valid = false;
3988} 3982}
3989 3983
3990 3984
3991/* Set w->total_lines (w->total_cols if HORFLAG is non-zero) to 3985/* Set w->total_lines (w->total_cols if HORFLAG) to
3992 w->new_total for window W and recursively all child windows of W. 3986 w->new_total for window W and recursively all child windows of W.
3993 Also calculate and assign the new vertical (horizontal) start 3987 Also calculate and assign the new vertical (horizontal) start
3994 positions of each of these windows. */ 3988 positions of each of these windows. */
@@ -4083,7 +4077,7 @@ be applied on the Elisp level. */)
4083 window_resize_apply (r, horflag); 4077 window_resize_apply (r, horflag);
4084 4078
4085 fset_redisplay (f); 4079 fset_redisplay (f);
4086 FRAME_WINDOW_SIZES_CHANGED (f) = 1; 4080 FRAME_WINDOW_SIZES_CHANGED (f) = true;
4087 4081
4088 adjust_frame_glyphs (f); 4082 adjust_frame_glyphs (f);
4089 unblock_input (); 4083 unblock_input ();
@@ -4133,8 +4127,8 @@ values. */)
4133 4127
4134 4128
4135/* Resize frame F's windows when number of lines of F is set to SIZE. 4129/* Resize frame F's windows when number of lines of F is set to SIZE.
4136 HORFLAG 1 means resize windows when number of columns of F is set to 4130 HORFLAG means resize windows when number of columns of F is set to
4137 SIZE. PIXELWISE 1 means to interpret SIZE as pixels. */ 4131 SIZE. PIXELWISE means to interpret SIZE as pixels. */
4138void 4132void
4139resize_frame_windows (struct frame *f, int size, bool horflag, bool pixelwise) 4133resize_frame_windows (struct frame *f, int size, bool horflag, bool pixelwise)
4140{ 4134{
@@ -4168,12 +4162,9 @@ resize_frame_windows (struct frame *f, int size, bool horflag, bool pixelwise)
4168 } 4162 }
4169 else 4163 else
4170 { 4164 {
4171 new_size = max (horflag 4165 new_size = max (size - (!horflag
4172 ? size 4166 && FRAME_HAS_MINIBUF_P (f)
4173 : (size 4167 && !FRAME_MINIBUF_ONLY_P (f)),
4174 - ((FRAME_HAS_MINIBUF_P (f)
4175 && !FRAME_MINIBUF_ONLY_P (f))
4176 ? 1 : 0)),
4177 1); 4168 1);
4178 new_pixel_size = new_size * unit; 4169 new_pixel_size = new_size * unit;
4179 } 4170 }
@@ -4224,7 +4215,7 @@ resize_frame_windows (struct frame *f, int size, bool horflag, bool pixelwise)
4224 { 4215 {
4225 window_resize_apply (r, horflag); 4216 window_resize_apply (r, horflag);
4226 window_pixel_to_total (r->frame, horflag ? Qt : Qnil); 4217 window_pixel_to_total (r->frame, horflag ? Qt : Qnil);
4227#if 0 /* Let's try without safe sizes and/or killing other windows. */ 4218#if false /* Let's try without safe sizes and/or killing other windows. */
4228 } 4219 }
4229 else 4220 else
4230 { 4221 {
@@ -4254,7 +4245,7 @@ resize_frame_windows (struct frame *f, int size, bool horflag, bool pixelwise)
4254 XWINDOW (root)->pixel_height = new_pixel_size; 4245 XWINDOW (root)->pixel_height = new_pixel_size;
4255 } 4246 }
4256 } 4247 }
4257#endif /* 0 */ 4248#endif /* false */
4258 } 4249 }
4259 } 4250 }
4260 } 4251 }
@@ -4311,14 +4302,12 @@ set correctly. See the code of `split-window' for how this is done. */)
4311 provided OLD is a leaf window, or to the frame's selected window. 4302 provided OLD is a leaf window, or to the frame's selected window.
4312 NEW (*n) is the new window created with some parameters taken from 4303 NEW (*n) is the new window created with some parameters taken from
4313 REFERENCE (*r). */ 4304 REFERENCE (*r). */
4314 register Lisp_Object new, frame, reference; 4305 Lisp_Object new, frame, reference;
4315 register struct window *o, *p, *n, *r, *c; 4306 struct window *o, *p, *n, *r, *c;
4316 struct frame *f; 4307 struct frame *f;
4317 bool horflag 4308 bool horflag
4318 /* HORFLAG is 1 when we split side-by-side, 0 otherwise. */ 4309 /* HORFLAG is true when we split side-by-side, false otherwise. */
4319 = EQ (side, Qt) || EQ (side, Qleft) || EQ (side, Qright); 4310 = EQ (side, Qt) || EQ (side, Qleft) || EQ (side, Qright);
4320 int combination_limit = 0, sum = 0;
4321 int total_size;
4322 4311
4323 CHECK_WINDOW (old); 4312 CHECK_WINDOW (old);
4324 o = XWINDOW (old); 4313 o = XWINDOW (old);
@@ -4326,20 +4315,20 @@ set correctly. See the code of `split-window' for how this is done. */)
4326 f = XFRAME (frame); 4315 f = XFRAME (frame);
4327 4316
4328 CHECK_NUMBER (pixel_size); 4317 CHECK_NUMBER (pixel_size);
4329 total_size 4318 int total_size
4330 = XINT (pixel_size) / (horflag 4319 = XINT (pixel_size) / (horflag
4331 ? FRAME_COLUMN_WIDTH (f) 4320 ? FRAME_COLUMN_WIDTH (f)
4332 : FRAME_LINE_HEIGHT (f)); 4321 : FRAME_LINE_HEIGHT (f));
4333 4322
4334 /* Set combination_limit to 1 if we have to make a new parent window. 4323 /* Set combination_limit if we have to make a new parent window.
4335 We do that if either `window-combination-limit' is t, or OLD has no 4324 We do that if either `window-combination-limit' is t, or OLD has no
4336 parent, or OLD is ortho-combined. */ 4325 parent, or OLD is ortho-combined. */
4337 combination_limit = 4326 bool combination_limit
4338 EQ (Vwindow_combination_limit, Qt) 4327 = (EQ (Vwindow_combination_limit, Qt)
4339 || NILP (o->parent) 4328 || NILP (o->parent)
4340 || (horflag 4329 || (horflag
4341 ? WINDOW_VERTICAL_COMBINATION_P (XWINDOW (o->parent)) 4330 ? WINDOW_VERTICAL_COMBINATION_P (XWINDOW (o->parent))
4342 : WINDOW_HORIZONTAL_COMBINATION_P (XWINDOW (o->parent))); 4331 : WINDOW_HORIZONTAL_COMBINATION_P (XWINDOW (o->parent))));
4343 4332
4344 /* We need a live reference window to initialize some parameters. */ 4333 /* We need a live reference window to initialize some parameters. */
4345 if (WINDOW_LIVE_P (old)) 4334 if (WINDOW_LIVE_P (old))
@@ -4405,7 +4394,7 @@ set correctly. See the code of `split-window' for how this is done. */)
4405 p = XWINDOW (o->parent); 4394 p = XWINDOW (o->parent);
4406 4395
4407 fset_redisplay (f); 4396 fset_redisplay (f);
4408 FRAME_WINDOW_SIZES_CHANGED (f) = 1; 4397 FRAME_WINDOW_SIZES_CHANGED (f) = true;
4409 new = make_window (); 4398 new = make_window ();
4410 n = XWINDOW (new); 4399 n = XWINDOW (new);
4411 wset_frame (n, frame); 4400 wset_frame (n, frame);
@@ -4430,7 +4419,7 @@ set correctly. See the code of `split-window' for how this is done. */)
4430 wset_next (o, new); 4419 wset_next (o, new);
4431 } 4420 }
4432 4421
4433 n->window_end_valid = 0; 4422 n->window_end_valid = false;
4434 n->last_cursor_vpos = 0; 4423 n->last_cursor_vpos = 0;
4435 4424
4436 /* Get special geometry settings from reference window. */ 4425 /* Get special geometry settings from reference window. */
@@ -4463,6 +4452,7 @@ set correctly. See the code of `split-window' for how this is done. */)
4463 /* Iso-coordinates and sizes are assigned by window_resize_apply, 4452 /* Iso-coordinates and sizes are assigned by window_resize_apply,
4464 get them ready here. */ 4453 get them ready here. */
4465 wset_new_pixel (n, pixel_size); 4454 wset_new_pixel (n, pixel_size);
4455 int sum = 0;
4466 c = XWINDOW (p->contents); 4456 c = XWINDOW (p->contents);
4467 while (c) 4457 while (c)
4468 { 4458 {
@@ -4481,7 +4471,7 @@ set correctly. See the code of `split-window' for how this is done. */)
4481 adjust_frame_glyphs (f); 4471 adjust_frame_glyphs (f);
4482 /* Set buffer of NEW to buffer of reference window. Don't run 4472 /* Set buffer of NEW to buffer of reference window. Don't run
4483 any hooks. */ 4473 any hooks. */
4484 set_window_buffer (new, r->contents, 0, 1); 4474 set_window_buffer (new, r->contents, false, true);
4485 unblock_input (); 4475 unblock_input ();
4486 4476
4487 /* Maybe we should run the scroll functions in Elisp (which already 4477 /* Maybe we should run the scroll functions in Elisp (which already
@@ -4498,12 +4488,12 @@ DEFUN ("delete-window-internal", Fdelete_window_internal, Sdelete_window_interna
4498 doc: /* Remove WINDOW from its frame. 4488 doc: /* Remove WINDOW from its frame.
4499WINDOW defaults to the selected window. Return nil. 4489WINDOW defaults to the selected window. Return nil.
4500Signal an error when WINDOW is the only window on its frame. */) 4490Signal an error when WINDOW is the only window on its frame. */)
4501 (register Lisp_Object window) 4491 (Lisp_Object window)
4502{ 4492{
4503 register Lisp_Object parent, sibling, frame, root; 4493 Lisp_Object parent, sibling, frame, root;
4504 struct window *w, *p, *s, *r; 4494 struct window *w, *p, *s, *r;
4505 struct frame *f; 4495 struct frame *f;
4506 bool horflag, before_sibling = 0; 4496 bool horflag, before_sibling = false;
4507 4497
4508 w = decode_any_window (window); 4498 w = decode_any_window (window);
4509 XSETWINDOW (window, w); 4499 XSETWINDOW (window, w);
@@ -4533,9 +4523,9 @@ Signal an error when WINDOW is the only window on its frame. */)
4533 if (NILP (w->prev)) 4523 if (NILP (w->prev))
4534 /* Get SIBLING below (on the right of) WINDOW. */ 4524 /* Get SIBLING below (on the right of) WINDOW. */
4535 { 4525 {
4536 /* before_sibling 1 means WINDOW is the first child of its 4526 /* before_sibling means WINDOW is the first child of its
4537 parent and thus before the sibling. */ 4527 parent and thus before the sibling. */
4538 before_sibling = 1; 4528 before_sibling = true;
4539 sibling = w->next; 4529 sibling = w->next;
4540 s = XWINDOW (sibling); 4530 s = XWINDOW (sibling);
4541 wset_prev (s, Qnil); 4531 wset_prev (s, Qnil);
@@ -4572,7 +4562,7 @@ Signal an error when WINDOW is the only window on its frame. */)
4572 4562
4573 fset_redisplay (f); 4563 fset_redisplay (f);
4574 Vwindow_list = Qnil; 4564 Vwindow_list = Qnil;
4575 FRAME_WINDOW_SIZES_CHANGED (f) = 1; 4565 FRAME_WINDOW_SIZES_CHANGED (f) = true;
4576 4566
4577 wset_next (w, Qnil); /* Don't delete w->next too. */ 4567 wset_next (w, Qnil); /* Don't delete w->next too. */
4578 free_window_matrices (w); 4568 free_window_matrices (w);
@@ -4580,7 +4570,7 @@ Signal an error when WINDOW is the only window on its frame. */)
4580 if (WINDOWP (w->contents)) 4570 if (WINDOWP (w->contents))
4581 { 4571 {
4582 delete_all_child_windows (w->contents); 4572 delete_all_child_windows (w->contents);
4583 wset_combination (w, 0, Qnil); 4573 wset_combination (w, false, Qnil);
4584 } 4574 }
4585 else 4575 else
4586 { 4576 {
@@ -4596,13 +4586,13 @@ Signal an error when WINDOW is the only window on its frame. */)
4596 PARENT. */ 4586 PARENT. */
4597 { 4587 {
4598 /* Put SIBLING into PARENT's place. */ 4588 /* Put SIBLING into PARENT's place. */
4599 replace_window (parent, sibling, 0); 4589 replace_window (parent, sibling, false);
4600 /* Have SIBLING inherit the following three slot values from 4590 /* Have SIBLING inherit the following three slot values from
4601 PARENT (the combination_limit slot is not inherited). */ 4591 PARENT (the combination_limit slot is not inherited). */
4602 wset_normal_cols (s, p->normal_cols); 4592 wset_normal_cols (s, p->normal_cols);
4603 wset_normal_lines (s, p->normal_lines); 4593 wset_normal_lines (s, p->normal_lines);
4604 /* Mark PARENT as deleted. */ 4594 /* Mark PARENT as deleted. */
4605 wset_combination (p, 0, Qnil); 4595 wset_combination (p, false, Qnil);
4606 /* Try to merge SIBLING into its new parent. */ 4596 /* Try to merge SIBLING into its new parent. */
4607 recombine_windows (sibling); 4597 recombine_windows (sibling);
4608 } 4598 }
@@ -4687,10 +4677,10 @@ grow_mini_window (struct window *w, int delta, bool pixelwise)
4687 r = XWINDOW (root); 4677 r = XWINDOW (root);
4688 height = call3 (Qwindow_resize_root_window_vertically, 4678 height = call3 (Qwindow_resize_root_window_vertically,
4689 root, make_number (- delta), pixelwise ? Qt : Qnil); 4679 root, make_number (- delta), pixelwise ? Qt : Qnil);
4690 if (INTEGERP (height) && window_resize_check (r, 0)) 4680 if (INTEGERP (height) && window_resize_check (r, false))
4691 { 4681 {
4692 block_input (); 4682 block_input ();
4693 window_resize_apply (r, 0); 4683 window_resize_apply (r, false);
4694 4684
4695 if (pixelwise) 4685 if (pixelwise)
4696 { 4686 {
@@ -4742,10 +4732,10 @@ shrink_mini_window (struct window *w, bool pixelwise)
4742 delta = call3 (Qwindow_resize_root_window_vertically, 4732 delta = call3 (Qwindow_resize_root_window_vertically,
4743 root, make_number (height - unit), 4733 root, make_number (height - unit),
4744 pixelwise ? Qt : Qnil); 4734 pixelwise ? Qt : Qnil);
4745 if (INTEGERP (delta) && window_resize_check (r, 0)) 4735 if (INTEGERP (delta) && window_resize_check (r, false))
4746 { 4736 {
4747 block_input (); 4737 block_input ();
4748 window_resize_apply (r, 0); 4738 window_resize_apply (r, false);
4749 4739
4750 /* Shrink the mini-window. */ 4740 /* Shrink the mini-window. */
4751 w->top_line = r->top_line + r->total_lines; 4741 w->top_line = r->top_line + r->total_lines;
@@ -4784,12 +4774,12 @@ DEFUN ("resize-mini-window-internal", Fresize_mini_window_internal, Sresize_mini
4784 4774
4785 r = XWINDOW (FRAME_ROOT_WINDOW (f)); 4775 r = XWINDOW (FRAME_ROOT_WINDOW (f));
4786 height = r->pixel_height + w->pixel_height; 4776 height = r->pixel_height + w->pixel_height;
4787 if (window_resize_check (r, 0) 4777 if (window_resize_check (r, false)
4788 && XINT (w->new_pixel) > 0 4778 && XINT (w->new_pixel) > 0
4789 && height == XINT (r->new_pixel) + XINT (w->new_pixel)) 4779 && height == XINT (r->new_pixel) + XINT (w->new_pixel))
4790 { 4780 {
4791 block_input (); 4781 block_input ();
4792 window_resize_apply (r, 0); 4782 window_resize_apply (r, false);
4793 4783
4794 w->pixel_height = XFASTINT (w->new_pixel); 4784 w->pixel_height = XFASTINT (w->new_pixel);
4795 w->total_lines = w->pixel_height / FRAME_LINE_HEIGHT (f); 4785 w->total_lines = w->pixel_height / FRAME_LINE_HEIGHT (f);
@@ -4797,7 +4787,7 @@ DEFUN ("resize-mini-window-internal", Fresize_mini_window_internal, Sresize_mini
4797 w->top_line = r->top_line + r->total_lines; 4787 w->top_line = r->top_line + r->total_lines;
4798 4788
4799 fset_redisplay (f); 4789 fset_redisplay (f);
4800 FRAME_WINDOW_SIZES_CHANGED (f) = 1; 4790 FRAME_WINDOW_SIZES_CHANGED (f) = true;
4801 adjust_frame_glyphs (f); 4791 adjust_frame_glyphs (f);
4802 unblock_input (); 4792 unblock_input ();
4803 return Qt; 4793 return Qt;
@@ -4819,7 +4809,7 @@ mark_window_cursors_off (struct window *w)
4819 if (WINDOWP (w->contents)) 4809 if (WINDOWP (w->contents))
4820 mark_window_cursors_off (XWINDOW (w->contents)); 4810 mark_window_cursors_off (XWINDOW (w->contents));
4821 else 4811 else
4822 w->phys_cursor_on_p = 0; 4812 w->phys_cursor_on_p = false;
4823 4813
4824 w = NILP (w->next) ? 0 : XWINDOW (w->next); 4814 w = NILP (w->next) ? 0 : XWINDOW (w->next);
4825 } 4815 }
@@ -4854,19 +4844,19 @@ window_internal_height (struct window *w)
4854 Window Scrolling 4844 Window Scrolling
4855 ***********************************************************************/ 4845 ***********************************************************************/
4856 4846
4857/* Scroll contents of window WINDOW up. If WHOLE is non-zero, scroll 4847/* Scroll contents of window WINDOW up. If WHOLE, scroll
4858 N screen-fulls, which is defined as the height of the window minus 4848 N screen-fulls, which is defined as the height of the window minus
4859 next_screen_context_lines. If WHOLE is zero, scroll up N lines 4849 next_screen_context_lines. If WHOLE is zero, scroll up N lines
4860 instead. Negative values of N mean scroll down. NOERROR non-zero 4850 instead. Negative values of N mean scroll down. NOERROR
4861 means don't signal an error if we try to move over BEGV or ZV, 4851 means don't signal an error if we try to move over BEGV or ZV,
4862 respectively. */ 4852 respectively. */
4863 4853
4864static void 4854static void
4865window_scroll (Lisp_Object window, EMACS_INT n, bool whole, int noerror) 4855window_scroll (Lisp_Object window, EMACS_INT n, bool whole, bool noerror)
4866{ 4856{
4867 ptrdiff_t count = SPECPDL_INDEX (); 4857 ptrdiff_t count = SPECPDL_INDEX ();
4868 4858
4869 immediate_quit = 1; 4859 immediate_quit = true;
4870 n = clip_to_bounds (INT_MIN, n, INT_MAX); 4860 n = clip_to_bounds (INT_MIN, n, INT_MAX);
4871 4861
4872 wset_redisplay (XWINDOW (window)); 4862 wset_redisplay (XWINDOW (window));
@@ -4884,8 +4874,8 @@ window_scroll (Lisp_Object window, EMACS_INT n, bool whole, int noerror)
4884 unbind_to (count, Qnil); 4874 unbind_to (count, Qnil);
4885 4875
4886 /* Bug#15957. */ 4876 /* Bug#15957. */
4887 XWINDOW (window)->window_end_valid = 0; 4877 XWINDOW (window)->window_end_valid = false;
4888 immediate_quit = 0; 4878 immediate_quit = false;
4889} 4879}
4890 4880
4891 4881
@@ -4894,14 +4884,14 @@ window_scroll (Lisp_Object window, EMACS_INT n, bool whole, int noerror)
4894 descriptions. */ 4884 descriptions. */
4895 4885
4896static void 4886static void
4897window_scroll_pixel_based (Lisp_Object window, int n, bool whole, int noerror) 4887window_scroll_pixel_based (Lisp_Object window, int n, bool whole, bool noerror)
4898{ 4888{
4899 struct it it; 4889 struct it it;
4900 struct window *w = XWINDOW (window); 4890 struct window *w = XWINDOW (window);
4901 struct text_pos start; 4891 struct text_pos start;
4902 int this_scroll_margin; 4892 int this_scroll_margin;
4903 /* True if we fiddled the window vscroll field without really scrolling. */ 4893 /* True if we fiddled the window vscroll field without really scrolling. */
4904 int vscrolled = 0; 4894 bool vscrolled = false;
4905 int x, y, rtop, rbot, rowh, vpos; 4895 int x, y, rtop, rbot, rowh, vpos;
4906 void *itdata = NULL; 4896 void *itdata = NULL;
4907 int window_total_lines; 4897 int window_total_lines;
@@ -4944,7 +4934,7 @@ window_scroll_pixel_based (Lisp_Object window, int n, bool whole, int noerror)
4944 } 4934 }
4945 4935
4946 start = it.current.pos; 4936 start = it.current.pos;
4947 bidi_unshelve_cache (itdata, 0); 4937 bidi_unshelve_cache (itdata, false);
4948 } 4938 }
4949 else if (auto_window_vscroll_p) 4939 else if (auto_window_vscroll_p)
4950 { 4940 {
@@ -4997,11 +4987,11 @@ window_scroll_pixel_based (Lisp_Object window, int n, bool whole, int noerror)
4997 spos = min (XINT (Fline_end_position (Qnil)) + 1, ZV); 4987 spos = min (XINT (Fline_end_position (Qnil)) + 1, ZV);
4998 set_marker_restricted (w->start, make_number (spos), 4988 set_marker_restricted (w->start, make_number (spos),
4999 w->contents); 4989 w->contents);
5000 w->start_at_line_beg = 1; 4990 w->start_at_line_beg = true;
5001 w->update_mode_line = 1; 4991 w->update_mode_line = true;
5002 /* Set force_start so that redisplay_window will run the 4992 /* Set force_start so that redisplay_window will run the
5003 window-scroll-functions. */ 4993 window-scroll-functions. */
5004 w->force_start = 1; 4994 w->force_start = true;
5005 return; 4995 return;
5006 } 4996 }
5007 } 4997 }
@@ -5095,7 +5085,7 @@ window_scroll_pixel_based (Lisp_Object window, int n, bool whole, int noerror)
5095 } 5085 }
5096 else 5086 else
5097 { 5087 {
5098 bidi_unshelve_cache (itdata, 0); 5088 bidi_unshelve_cache (itdata, false);
5099 if (noerror) 5089 if (noerror)
5100 return; 5090 return;
5101 else if (n < 0) /* could happen with empty buffers */ 5091 else if (n < 0) /* could happen with empty buffers */
@@ -5112,7 +5102,7 @@ window_scroll_pixel_based (Lisp_Object window, int n, bool whole, int noerror)
5112 w->vscroll = 0; 5102 w->vscroll = 0;
5113 else 5103 else
5114 { 5104 {
5115 bidi_unshelve_cache (itdata, 0); 5105 bidi_unshelve_cache (itdata, false);
5116 if (noerror) 5106 if (noerror)
5117 return; 5107 return;
5118 else 5108 else
@@ -5122,10 +5112,10 @@ window_scroll_pixel_based (Lisp_Object window, int n, bool whole, int noerror)
5122 5112
5123 /* If control gets here, then we vscrolled. */ 5113 /* If control gets here, then we vscrolled. */
5124 5114
5125 XBUFFER (w->contents)->prevent_redisplay_optimizations_p = 1; 5115 XBUFFER (w->contents)->prevent_redisplay_optimizations_p = true;
5126 5116
5127 /* Don't try to change the window start below. */ 5117 /* Don't try to change the window start below. */
5128 vscrolled = 1; 5118 vscrolled = true;
5129 } 5119 }
5130 5120
5131 if (! vscrolled) 5121 if (! vscrolled)
@@ -5146,10 +5136,10 @@ window_scroll_pixel_based (Lisp_Object window, int n, bool whole, int noerror)
5146 IT_BYTEPOS (it)); 5136 IT_BYTEPOS (it));
5147 bytepos = marker_byte_position (w->start); 5137 bytepos = marker_byte_position (w->start);
5148 w->start_at_line_beg = (pos == BEGV || FETCH_BYTE (bytepos - 1) == '\n'); 5138 w->start_at_line_beg = (pos == BEGV || FETCH_BYTE (bytepos - 1) == '\n');
5149 w->update_mode_line = 1; 5139 w->update_mode_line = true;
5150 /* Set force_start so that redisplay_window will run the 5140 /* Set force_start so that redisplay_window will run the
5151 window-scroll-functions. */ 5141 window-scroll-functions. */
5152 w->force_start = 1; 5142 w->force_start = true;
5153 } 5143 }
5154 5144
5155 /* The rest of this function uses current_y in a nonstandard way, 5145 /* The rest of this function uses current_y in a nonstandard way,
@@ -5182,8 +5172,8 @@ window_scroll_pixel_based (Lisp_Object window, int n, bool whole, int noerror)
5182 This is necessary because we set it.current_y to 0, above. */ 5172 This is necessary because we set it.current_y to 0, above. */
5183 move_it_to (&it, -1, 5173 move_it_to (&it, -1,
5184 window_scroll_pixel_based_preserve_x, 5174 window_scroll_pixel_based_preserve_x,
5185 window_scroll_pixel_based_preserve_y 5175 (window_scroll_pixel_based_preserve_y
5186 - (WINDOW_WANTS_HEADER_LINE_P (w) ? 1 : 0 ), 5176 - WINDOW_WANTS_HEADER_LINE_P (w)),
5187 -1, MOVE_TO_Y | MOVE_TO_X); 5177 -1, MOVE_TO_Y | MOVE_TO_X);
5188 SET_PT_BOTH (IT_CHARPOS (it), IT_BYTEPOS (it)); 5178 SET_PT_BOTH (IT_CHARPOS (it), IT_BYTEPOS (it));
5189 } 5179 }
@@ -5202,7 +5192,7 @@ window_scroll_pixel_based (Lisp_Object window, int n, bool whole, int noerror)
5202 else if (n < 0) 5192 else if (n < 0)
5203 { 5193 {
5204 ptrdiff_t charpos, bytepos; 5194 ptrdiff_t charpos, bytepos;
5205 int partial_p; 5195 bool partial_p;
5206 5196
5207 /* Save our position, for the 5197 /* Save our position, for the
5208 window_scroll_pixel_based_preserve_y case. */ 5198 window_scroll_pixel_based_preserve_y case. */
@@ -5238,12 +5228,12 @@ window_scroll_pixel_based (Lisp_Object window, int n, bool whole, int noerror)
5238 { 5228 {
5239 charpos = IT_CHARPOS (it); 5229 charpos = IT_CHARPOS (it);
5240 bytepos = IT_BYTEPOS (it); 5230 bytepos = IT_BYTEPOS (it);
5241 bidi_unshelve_cache (it_data, 1); 5231 bidi_unshelve_cache (it_data, true);
5242 } 5232 }
5243 else 5233 else
5244 { 5234 {
5245 it = it2; 5235 it = it2;
5246 bidi_unshelve_cache (it_data, 0); 5236 bidi_unshelve_cache (it_data, false);
5247 } 5237 }
5248 } 5238 }
5249 5239
@@ -5287,7 +5277,7 @@ window_scroll_pixel_based (Lisp_Object window, int n, bool whole, int noerror)
5287 SET_PT_BOTH (charpos, bytepos); 5277 SET_PT_BOTH (charpos, bytepos);
5288 } 5278 }
5289 } 5279 }
5290 bidi_unshelve_cache (itdata, 0); 5280 bidi_unshelve_cache (itdata, false);
5291 5281
5292 if (adjust_old_pointm) 5282 if (adjust_old_pointm)
5293 Fset_marker (w->old_pointm, 5283 Fset_marker (w->old_pointm,
@@ -5302,9 +5292,9 @@ window_scroll_pixel_based (Lisp_Object window, int n, bool whole, int noerror)
5302 See the comment of window_scroll for parameter descriptions. */ 5292 See the comment of window_scroll for parameter descriptions. */
5303 5293
5304static void 5294static void
5305window_scroll_line_based (Lisp_Object window, int n, bool whole, int noerror) 5295window_scroll_line_based (Lisp_Object window, int n, bool whole, bool noerror)
5306{ 5296{
5307 register struct window *w = XWINDOW (window); 5297 struct window *w = XWINDOW (window);
5308 /* Fvertical_motion enters redisplay, which can trigger 5298 /* Fvertical_motion enters redisplay, which can trigger
5309 fontification, which in turn can modify buffer text (e.g., if the 5299 fontification, which in turn can modify buffer text (e.g., if the
5310 fontification functions replace escape sequences with faces, as 5300 fontification functions replace escape sequences with faces, as
@@ -5334,7 +5324,7 @@ window_scroll_line_based (Lisp_Object window, int n, bool whole, int noerror)
5334 || NILP (Fget (KVAR (current_kboard, Vlast_command), Qscroll_command))) 5324 || NILP (Fget (KVAR (current_kboard, Vlast_command), Qscroll_command)))
5335 { 5325 {
5336 struct position posit 5326 struct position posit
5337 = *compute_motion (startpos, startbyte, 0, 0, 0, 5327 = *compute_motion (startpos, startbyte, 0, 0, false,
5338 PT, ht, 0, -1, w->hscroll, 0, w); 5328 PT, ht, 0, -1, w->hscroll, 0, w);
5339 5329
5340 window_scroll_preserve_vpos = posit.vpos; 5330 window_scroll_preserve_vpos = posit.vpos;
@@ -5380,10 +5370,10 @@ window_scroll_line_based (Lisp_Object window, int n, bool whole, int noerror)
5380 5370
5381 set_marker_restricted_both (w->start, w->contents, pos, pos_byte); 5371 set_marker_restricted_both (w->start, w->contents, pos, pos_byte);
5382 w->start_at_line_beg = !NILP (bolp); 5372 w->start_at_line_beg = !NILP (bolp);
5383 w->update_mode_line = 1; 5373 w->update_mode_line = true;
5384 /* Set force_start so that redisplay_window will run 5374 /* Set force_start so that redisplay_window will run
5385 the window-scroll-functions. */ 5375 the window-scroll-functions. */
5386 w->force_start = 1; 5376 w->force_start = true;
5387 5377
5388 if (!NILP (Vscroll_preserve_screen_position) 5378 if (!NILP (Vscroll_preserve_screen_position)
5389 && (whole || !EQ (Vscroll_preserve_screen_position, Qt))) 5379 && (whole || !EQ (Vscroll_preserve_screen_position, Qt)))
@@ -5485,13 +5475,13 @@ scroll_command (Lisp_Object n, int direction)
5485 } 5475 }
5486 5476
5487 if (NILP (n)) 5477 if (NILP (n))
5488 window_scroll (selected_window, direction, 1, 0); 5478 window_scroll (selected_window, direction, true, false);
5489 else if (EQ (n, Qminus)) 5479 else if (EQ (n, Qminus))
5490 window_scroll (selected_window, -direction, 1, 0); 5480 window_scroll (selected_window, -direction, true, false);
5491 else 5481 else
5492 { 5482 {
5493 n = Fprefix_numeric_value (n); 5483 n = Fprefix_numeric_value (n);
5494 window_scroll (selected_window, XINT (n) * direction, 0, 0); 5484 window_scroll (selected_window, XINT (n) * direction, false, false);
5495 } 5485 }
5496 5486
5497 unbind_to (count, Qnil); 5487 unbind_to (count, Qnil);
@@ -5599,15 +5589,15 @@ specifies the window to scroll. This takes precedence over
5599 SET_PT_BOTH (marker_position (w->old_pointm), marker_byte_position (w->old_pointm)); 5589 SET_PT_BOTH (marker_position (w->old_pointm), marker_byte_position (w->old_pointm));
5600 5590
5601 if (NILP (arg)) 5591 if (NILP (arg))
5602 window_scroll (window, 1, 1, 1); 5592 window_scroll (window, 1, true, true);
5603 else if (EQ (arg, Qminus)) 5593 else if (EQ (arg, Qminus))
5604 window_scroll (window, -1, 1, 1); 5594 window_scroll (window, -1, true, true);
5605 else 5595 else
5606 { 5596 {
5607 if (CONSP (arg)) 5597 if (CONSP (arg))
5608 arg = XCAR (arg); 5598 arg = XCAR (arg);
5609 CHECK_NUMBER (arg); 5599 CHECK_NUMBER (arg);
5610 window_scroll (window, XINT (arg), 0, 1); 5600 window_scroll (window, XINT (arg), false, true);
5611 } 5601 }
5612 5602
5613 set_marker_both (w->pointm, Qnil, PT, PT_BYTE); 5603 set_marker_both (w->pointm, Qnil, PT, PT_BYTE);
@@ -5637,7 +5627,7 @@ by this function. This happens in an interactive call. */)
5637 if (!NILP (set_minimum)) 5627 if (!NILP (set_minimum))
5638 w->min_hscroll = w->hscroll; 5628 w->min_hscroll = w->hscroll;
5639 5629
5640 w->suspend_auto_hscroll = 1; 5630 w->suspend_auto_hscroll = true;
5641 5631
5642 return result; 5632 return result;
5643} 5633}
@@ -5662,7 +5652,7 @@ by this function. This happens in an interactive call. */)
5662 if (!NILP (set_minimum)) 5652 if (!NILP (set_minimum))
5663 w->min_hscroll = w->hscroll; 5653 w->min_hscroll = w->hscroll;
5664 5654
5665 w->suspend_auto_hscroll = 1; 5655 w->suspend_auto_hscroll = true;
5666 5656
5667 return result; 5657 return result;
5668} 5658}
@@ -5710,7 +5700,7 @@ displayed_window_lines (struct window *w)
5710 start_display (&it, w, start); 5700 start_display (&it, w, start);
5711 move_it_vertically (&it, height); 5701 move_it_vertically (&it, height);
5712 bottom_y = line_bottom_y (&it); 5702 bottom_y = line_bottom_y (&it);
5713 bidi_unshelve_cache (itdata, 0); 5703 bidi_unshelve_cache (itdata, false);
5714 5704
5715 /* rms: On a non-window display, 5705 /* rms: On a non-window display,
5716 the value of it.vpos at the bottom of the screen 5706 the value of it.vpos at the bottom of the screen
@@ -5754,7 +5744,7 @@ and redisplay normally--don't erase and redraw the frame. */)
5754{ 5744{
5755 struct window *w = XWINDOW (selected_window); 5745 struct window *w = XWINDOW (selected_window);
5756 struct buffer *buf = XBUFFER (w->contents); 5746 struct buffer *buf = XBUFFER (w->contents);
5757 bool center_p = 0; 5747 bool center_p = false;
5758 ptrdiff_t charpos, bytepos; 5748 ptrdiff_t charpos, bytepos;
5759 EMACS_INT iarg IF_LINT (= 0); 5749 EMACS_INT iarg IF_LINT (= 0);
5760 int this_scroll_margin; 5750 int this_scroll_margin;
@@ -5783,10 +5773,10 @@ and redisplay normally--don't erase and redraw the frame. */)
5783 SET_FRAME_GARBAGED (WINDOW_XFRAME (w)); 5773 SET_FRAME_GARBAGED (WINDOW_XFRAME (w));
5784 } 5774 }
5785 5775
5786 center_p = 1; 5776 center_p = true;
5787 } 5777 }
5788 else if (CONSP (arg)) /* Just C-u. */ 5778 else if (CONSP (arg)) /* Just C-u. */
5789 center_p = 1; 5779 center_p = true;
5790 else 5780 else
5791 { 5781 {
5792 arg = Fprefix_numeric_value (arg); 5782 arg = Fprefix_numeric_value (arg);
@@ -5814,7 +5804,7 @@ and redisplay normally--don't erase and redraw the frame. */)
5814 move_it_vertically_backward (&it, window_box_height (w) / 2); 5804 move_it_vertically_backward (&it, window_box_height (w) / 2);
5815 charpos = IT_CHARPOS (it); 5805 charpos = IT_CHARPOS (it);
5816 bytepos = IT_BYTEPOS (it); 5806 bytepos = IT_BYTEPOS (it);
5817 bidi_unshelve_cache (itdata, 0); 5807 bidi_unshelve_cache (itdata, false);
5818 } 5808 }
5819 else if (iarg < 0) 5809 else if (iarg < 0)
5820 { 5810 {
@@ -5864,7 +5854,7 @@ and redisplay normally--don't erase and redraw the frame. */)
5864 } 5854 }
5865 if (h <= 0) 5855 if (h <= 0)
5866 { 5856 {
5867 bidi_unshelve_cache (itdata, 0); 5857 bidi_unshelve_cache (itdata, false);
5868 return Qnil; 5858 return Qnil;
5869 } 5859 }
5870 5860
@@ -5887,7 +5877,7 @@ and redisplay normally--don't erase and redraw the frame. */)
5887 charpos = IT_CHARPOS (it); 5877 charpos = IT_CHARPOS (it);
5888 bytepos = IT_BYTEPOS (it); 5878 bytepos = IT_BYTEPOS (it);
5889 5879
5890 bidi_unshelve_cache (itdata, 0); 5880 bidi_unshelve_cache (itdata, false);
5891 } 5881 }
5892 else 5882 else
5893 { 5883 {
@@ -5917,7 +5907,7 @@ and redisplay normally--don't erase and redraw the frame. */)
5917 charpos = IT_CHARPOS (it); 5907 charpos = IT_CHARPOS (it);
5918 bytepos = IT_BYTEPOS (it); 5908 bytepos = IT_BYTEPOS (it);
5919 5909
5920 bidi_unshelve_cache (itdata, 0); 5910 bidi_unshelve_cache (itdata, false);
5921 } 5911 }
5922 } 5912 }
5923 else 5913 else
@@ -5941,9 +5931,9 @@ and redisplay normally--don't erase and redraw the frame. */)
5941 5931
5942 /* Set the new window start. */ 5932 /* Set the new window start. */
5943 set_marker_both (w->start, w->contents, charpos, bytepos); 5933 set_marker_both (w->start, w->contents, charpos, bytepos);
5944 w->window_end_valid = 0; 5934 w->window_end_valid = false;
5945 5935
5946 w->optional_new_start = 1; 5936 w->optional_new_start = true;
5947 5937
5948 w->start_at_line_beg = (bytepos == BEGV_BYTE 5938 w->start_at_line_beg = (bytepos == BEGV_BYTE
5949 || FETCH_BYTE (bytepos - 1) == '\n'); 5939 || FETCH_BYTE (bytepos - 1) == '\n');
@@ -6007,7 +5997,7 @@ zero means top of window, negative means relative to bottom of window. */)
6007 struct window *w = XWINDOW (selected_window); 5997 struct window *w = XWINDOW (selected_window);
6008 int lines, start; 5998 int lines, start;
6009 Lisp_Object window; 5999 Lisp_Object window;
6010#if 0 6000#if false
6011 int this_scroll_margin; 6001 int this_scroll_margin;
6012#endif 6002#endif
6013 6003
@@ -6024,14 +6014,14 @@ zero means top of window, negative means relative to bottom of window. */)
6024 Fvertical_motion (make_number (- (height / 2)), window, Qnil); 6014 Fvertical_motion (make_number (- (height / 2)), window, Qnil);
6025 set_marker_both (w->start, w->contents, PT, PT_BYTE); 6015 set_marker_both (w->start, w->contents, PT, PT_BYTE);
6026 w->start_at_line_beg = !NILP (Fbolp ()); 6016 w->start_at_line_beg = !NILP (Fbolp ());
6027 w->force_start = 1; 6017 w->force_start = true;
6028 } 6018 }
6029 else 6019 else
6030 Fgoto_char (w->start); 6020 Fgoto_char (w->start);
6031 6021
6032 lines = displayed_window_lines (w); 6022 lines = displayed_window_lines (w);
6033 6023
6034#if 0 6024#if false
6035 this_scroll_margin = max (0, min (scroll_margin, lines / 4)); 6025 this_scroll_margin = max (0, min (scroll_margin, lines / 4));
6036#endif 6026#endif
6037 6027
@@ -6044,11 +6034,11 @@ zero means top of window, negative means relative to bottom of window. */)
6044 if (iarg < 0) 6034 if (iarg < 0)
6045 iarg = iarg + lines; 6035 iarg = iarg + lines;
6046 6036
6047#if 0 /* This code would prevent move-to-window-line from moving point 6037#if false /* This code would prevent move-to-window-line from moving point
6048 to a place inside the scroll margins (which would cause the 6038 to a place inside the scroll margins (which would cause the
6049 next redisplay to scroll). I wrote this code, but then concluded 6039 next redisplay to scroll). I wrote this code, but then concluded
6050 it is probably better not to install it. However, it is here 6040 it is probably better not to install it. However, it is here
6051 inside #if 0 so as not to lose it. -- rms. */ 6041 inside #if false so as not to lose it. -- rms. */
6052 6042
6053 /* Don't let it get into the margin at either top or bottom. */ 6043 /* Don't let it get into the margin at either top or bottom. */
6054 iarg = max (iarg, this_scroll_margin); 6044 iarg = max (iarg, this_scroll_margin);
@@ -6259,7 +6249,7 @@ the return value is nil. Otherwise the value is t. */)
6259 } 6249 }
6260 6250
6261 fset_redisplay (f); 6251 fset_redisplay (f);
6262 FRAME_WINDOW_SIZES_CHANGED (f) = 1; 6252 FRAME_WINDOW_SIZES_CHANGED (f) = true;
6263 6253
6264 /* Problem: Freeing all matrices and later allocating them again 6254 /* Problem: Freeing all matrices and later allocating them again
6265 is a serious redisplay flickering problem. What we would 6255 is a serious redisplay flickering problem. What we would
@@ -6390,7 +6380,7 @@ the return value is nil. Otherwise the value is t. */)
6390 (w->old_pointm, w->contents, 6380 (w->old_pointm, w->contents,
6391 BUF_PT (XBUFFER (w->contents)), 6381 BUF_PT (XBUFFER (w->contents)),
6392 BUF_PT_BYTE (XBUFFER (w->contents))); 6382 BUF_PT_BYTE (XBUFFER (w->contents)));
6393 w->start_at_line_beg = 1; 6383 w->start_at_line_beg = true;
6394 } 6384 }
6395 else if (!NILP (w->start)) 6385 else if (!NILP (w->start))
6396 /* Leaf window has no live buffer, get one. */ 6386 /* Leaf window has no live buffer, get one. */
@@ -6405,7 +6395,7 @@ the return value is nil. Otherwise the value is t. */)
6405 set_marker_restricted_both (w->start, w->contents, 0, 0); 6395 set_marker_restricted_both (w->start, w->contents, 0, 0);
6406 set_marker_restricted_both (w->pointm, w->contents, 0, 0); 6396 set_marker_restricted_both (w->pointm, w->contents, 0, 0);
6407 set_marker_restricted_both (w->old_pointm, w->contents, 0, 0); 6397 set_marker_restricted_both (w->old_pointm, w->contents, 0, 0);
6408 w->start_at_line_beg = 1; 6398 w->start_at_line_beg = true;
6409 if (!NILP (w->dedicated)) 6399 if (!NILP (w->dedicated))
6410 /* Record this window as dead. */ 6400 /* Record this window as dead. */
6411 dead_windows = Fcons (window, dead_windows); 6401 dead_windows = Fcons (window, dead_windows);
@@ -6429,7 +6419,7 @@ the return value is nil. Otherwise the value is t. */)
6429 6419
6430 Do not record the buffer here. We do that in a separate call 6420 Do not record the buffer here. We do that in a separate call
6431 to select_window below. See also Bug#16207. */ 6421 to select_window below. See also Bug#16207. */
6432 select_window (data->current_window, Qt, 1); 6422 select_window (data->current_window, Qt, true);
6433 BVAR (XBUFFER (XWINDOW (selected_window)->contents), 6423 BVAR (XBUFFER (XWINDOW (selected_window)->contents),
6434 last_selected_window) 6424 last_selected_window)
6435 = selected_window; 6425 = selected_window;
@@ -6451,7 +6441,7 @@ the return value is nil. Otherwise the value is t. */)
6451 /* Allow x_set_window_size again and apply frame size changes if 6441 /* Allow x_set_window_size again and apply frame size changes if
6452 needed. */ 6442 needed. */
6453 f->can_x_set_window_size = true; 6443 f->can_x_set_window_size = true;
6454 adjust_frame_size (f, -1, -1, 1, 0, Qset_window_configuration); 6444 adjust_frame_size (f, -1, -1, 1, false, Qset_window_configuration);
6455 6445
6456 adjust_frame_glyphs (f); 6446 adjust_frame_glyphs (f);
6457 unblock_input (); 6447 unblock_input ();
@@ -6466,7 +6456,7 @@ the return value is nil. Otherwise the value is t. */)
6466 6456
6467 /* Record the selected window's buffer here. The window should 6457 /* Record the selected window's buffer here. The window should
6468 already be the selected one from the call above. */ 6458 already be the selected one from the call above. */
6469 select_window (data->current_window, Qnil, 0); 6459 select_window (data->current_window, Qnil, false);
6470 6460
6471 /* Fselect_window will have made f the selected frame, so we 6461 /* Fselect_window will have made f the selected frame, so we
6472 reselect the proper frame here. Fhandle_switch_frame will change the 6462 reselect the proper frame here. Fhandle_switch_frame will change the
@@ -6521,7 +6511,7 @@ delete_all_child_windows (Lisp_Object window)
6521 if (WINDOWP (w->contents)) 6511 if (WINDOWP (w->contents))
6522 { 6512 {
6523 delete_all_child_windows (w->contents); 6513 delete_all_child_windows (w->contents);
6524 wset_combination (w, 0, Qnil); 6514 wset_combination (w, false, Qnil);
6525 } 6515 }
6526 else if (BUFFERP (w->contents)) 6516 else if (BUFFERP (w->contents))
6527 { 6517 {
@@ -6793,7 +6783,7 @@ apply_window_adjustment (struct window *w)
6793{ 6783{
6794 eassert (w); 6784 eassert (w);
6795 clear_glyph_matrix (w->current_matrix); 6785 clear_glyph_matrix (w->current_matrix);
6796 w->window_end_valid = 0; 6786 w->window_end_valid = false;
6797 windows_or_buffers_changed = 30; 6787 windows_or_buffers_changed = 30;
6798 wset_redisplay (w); 6788 wset_redisplay (w);
6799 adjust_frame_glyphs (XFRAME (WINDOW_FRAME (w))); 6789 adjust_frame_glyphs (XFRAME (WINDOW_FRAME (w)));
@@ -6883,7 +6873,8 @@ static struct window *
6883set_window_fringes (struct window *w, Lisp_Object left_width, 6873set_window_fringes (struct window *w, Lisp_Object left_width,
6884 Lisp_Object right_width, Lisp_Object outside_margins) 6874 Lisp_Object right_width, Lisp_Object outside_margins)
6885{ 6875{
6886 int left, right, outside = !NILP (outside_margins); 6876 int left, right;
6877 bool outside = !NILP (outside_margins);
6887 6878
6888 left = (NILP (left_width) ? -1 6879 left = (NILP (left_width) ? -1
6889 : (CHECK_NATNUM (left_width), XINT (left_width))); 6880 : (CHECK_NATNUM (left_width), XINT (left_width)));
@@ -6969,7 +6960,7 @@ set_window_scroll_bars (struct window *w, Lisp_Object width,
6969 Lisp_Object horizontal_type) 6960 Lisp_Object horizontal_type)
6970{ 6961{
6971 int iwidth = (NILP (width) ? -1 : (CHECK_NATNUM (width), XINT (width))); 6962 int iwidth = (NILP (width) ? -1 : (CHECK_NATNUM (width), XINT (width)));
6972 bool changed = 0; 6963 bool changed = false;
6973 6964
6974 if (iwidth == 0) 6965 if (iwidth == 0)
6975 vertical_type = Qnil; 6966 vertical_type = Qnil;
@@ -6992,7 +6983,7 @@ set_window_scroll_bars (struct window *w, Lisp_Object width,
6992 { 6983 {
6993 w->scroll_bar_width = iwidth; 6984 w->scroll_bar_width = iwidth;
6994 wset_vertical_scroll_bar_type (w, vertical_type); 6985 wset_vertical_scroll_bar_type (w, vertical_type);
6995 changed = 1; 6986 changed = true;
6996 } 6987 }
6997 } 6988 }
6998 6989
@@ -7020,7 +7011,7 @@ set_window_scroll_bars (struct window *w, Lisp_Object width,
7020 { 7011 {
7021 w->scroll_bar_height = iheight; 7012 w->scroll_bar_height = iheight;
7022 wset_horizontal_scroll_bar_type (w, horizontal_type); 7013 wset_horizontal_scroll_bar_type (w, horizontal_type);
7023 changed = 1; 7014 changed = true;
7024 } 7015 }
7025 } 7016 }
7026 } 7017 }
@@ -7143,7 +7134,7 @@ If PIXELS-P is non-nil, the return value is VSCROLL. */)
7143 adjust_frame_glyphs (f); 7134 adjust_frame_glyphs (f);
7144 7135
7145 /* Prevent redisplay shortcuts. */ 7136 /* Prevent redisplay shortcuts. */
7146 XBUFFER (w->contents)->prevent_redisplay_optimizations_p = 1; 7137 XBUFFER (w->contents)->prevent_redisplay_optimizations_p = true;
7147 } 7138 }
7148 } 7139 }
7149 7140
@@ -7156,7 +7147,7 @@ If PIXELS-P is non-nil, the return value is VSCROLL. */)
7156 additional argument USER_DATA. Stops when FN returns 0. */ 7147 additional argument USER_DATA. Stops when FN returns 0. */
7157 7148
7158static void 7149static void
7159foreach_window (struct frame *f, int (*fn) (struct window *, void *), 7150foreach_window (struct frame *f, bool (*fn) (struct window *, void *),
7160 void *user_data) 7151 void *user_data)
7161{ 7152{
7162 /* delete_frame may set FRAME_ROOT_WINDOW (f) to Qnil. */ 7153 /* delete_frame may set FRAME_ROOT_WINDOW (f) to Qnil. */
@@ -7168,14 +7159,15 @@ foreach_window (struct frame *f, int (*fn) (struct window *, void *),
7168/* Helper function for foreach_window. Call FN for all leaf windows 7159/* Helper function for foreach_window. Call FN for all leaf windows
7169 reachable from W. FN is called with the first argument being a 7160 reachable from W. FN is called with the first argument being a
7170 pointer to the leaf window, and with additional argument USER_DATA. 7161 pointer to the leaf window, and with additional argument USER_DATA.
7171 Stop when FN returns 0. Value is 0 if stopped by FN. */ 7162 Stop when FN returns false. Value is false if stopped by FN. */
7172 7163
7173static int 7164static bool
7174foreach_window_1 (struct window *w, int (*fn) (struct window *, void *), void *user_data) 7165foreach_window_1 (struct window *w, bool (*fn) (struct window *, void *),
7166 void *user_data)
7175{ 7167{
7176 int cont; 7168 bool cont;
7177 7169
7178 for (cont = 1; w && cont;) 7170 for (cont = true; w && cont;)
7179 { 7171 {
7180 if (WINDOWP (w->contents)) 7172 if (WINDOWP (w->contents))
7181 cont = foreach_window_1 (XWINDOW (w->contents), fn, user_data); 7173 cont = foreach_window_1 (XWINDOW (w->contents), fn, user_data);
@@ -7192,7 +7184,7 @@ foreach_window_1 (struct window *w, int (*fn) (struct window *, void *), void *u
7192 Initialization 7184 Initialization
7193 ***********************************************************************/ 7185 ***********************************************************************/
7194 7186
7195/* Return 1 if window configurations CONFIGURATION1 and CONFIGURATION2 7187/* Return true if window configurations CONFIGURATION1 and CONFIGURATION2
7196 describe the same state of affairs. This is used by Fequal. 7188 describe the same state of affairs. This is used by Fequal.
7197 7189
7198 IGNORE_POSITIONS means ignore non-matching scroll positions 7190 IGNORE_POSITIONS means ignore non-matching scroll positions
@@ -7231,7 +7223,7 @@ compare_window_configurations (Lisp_Object configuration1,
7231 || !EQ (d1->focus_frame, d2->focus_frame) 7223 || !EQ (d1->focus_frame, d2->focus_frame)
7232 /* Verify that the two configurations have the same number of windows. */ 7224 /* Verify that the two configurations have the same number of windows. */
7233 || sws1->header.size != sws2->header.size) 7225 || sws1->header.size != sws2->header.size)
7234 return 0; 7226 return false;
7235 7227
7236 for (i = 0; i < sws1->header.size; i++) 7228 for (i = 0; i < sws1->header.size; i++)
7237 { 7229 {
@@ -7275,10 +7267,10 @@ compare_window_configurations (Lisp_Object configuration1,
7275 || !EQ (sw1->scroll_bar_height, sw2->scroll_bar_height) 7267 || !EQ (sw1->scroll_bar_height, sw2->scroll_bar_height)
7276 || !EQ (sw1->vertical_scroll_bar_type, sw2->vertical_scroll_bar_type) 7268 || !EQ (sw1->vertical_scroll_bar_type, sw2->vertical_scroll_bar_type)
7277 || !EQ (sw1->horizontal_scroll_bar_type, sw2->horizontal_scroll_bar_type)) 7269 || !EQ (sw1->horizontal_scroll_bar_type, sw2->horizontal_scroll_bar_type))
7278 return 0; 7270 return false;
7279 } 7271 }
7280 7272
7281 return 1; 7273 return true;
7282} 7274}
7283 7275
7284DEFUN ("compare-window-configurations", Fcompare_window_configurations, 7276DEFUN ("compare-window-configurations", Fcompare_window_configurations,
@@ -7288,7 +7280,7 @@ This function ignores details such as the values of point
7288and scrolling positions. */) 7280and scrolling positions. */)
7289 (Lisp_Object x, Lisp_Object y) 7281 (Lisp_Object x, Lisp_Object y)
7290{ 7282{
7291 if (compare_window_configurations (x, y, 1)) 7283 if (compare_window_configurations (x, y, true))
7292 return Qt; 7284 return Qt;
7293 return Qnil; 7285 return Qnil;
7294} 7286}
diff --git a/src/window.h b/src/window.h
index 2ec28ab4e56..96e7438f46e 100644
--- a/src/window.h
+++ b/src/window.h
@@ -256,7 +256,7 @@ struct window
256 256
257 /* Scaling factor for the glyph_matrix size calculation in this window. 257 /* Scaling factor for the glyph_matrix size calculation in this window.
258 Used if window contains many small images or uses proportional fonts, 258 Used if window contains many small images or uses proportional fonts,
259 as the normal may yield a matrix which is too small. */ 259 as the normal may yield a matrix which is too small. */
260 int nrows_scale_factor, ncols_scale_factor; 260 int nrows_scale_factor, ncols_scale_factor;
261 261
262 /* Intended cursor position. This is a position within the 262 /* Intended cursor position. This is a position within the
@@ -323,7 +323,7 @@ struct window
323 /* True if this window is a minibuffer window. */ 323 /* True if this window is a minibuffer window. */
324 bool_bf mini : 1; 324 bool_bf mini : 1;
325 325
326 /* Meaningful only if contents is a window, non-zero if this 326 /* Meaningful only if contents is a window, true if this
327 internal window is used in horizontal combination. */ 327 internal window is used in horizontal combination. */
328 bool_bf horizontal : 1; 328 bool_bf horizontal : 1;
329 329
@@ -921,7 +921,7 @@ wset_next_buffers (struct window *w, Lisp_Object val)
921 : 0) 921 : 0)
922 922
923#define WINDOW_MODE_LINE_LINES(W) \ 923#define WINDOW_MODE_LINE_LINES(W) \
924 (!! WINDOW_WANTS_MODELINE_P (W)) 924 WINDOW_WANTS_MODELINE_P (W)
925 925
926/* Height in pixels, and in lines, of the header line. 926/* Height in pixels, and in lines, of the header line.
927 Zero if W doesn't have a header line. */ 927 Zero if W doesn't have a header line. */
@@ -931,7 +931,7 @@ wset_next_buffers (struct window *w, Lisp_Object val)
931 : 0) 931 : 0)
932 932
933#define WINDOW_HEADER_LINE_LINES(W) \ 933#define WINDOW_HEADER_LINE_LINES(W) \
934 (!! WINDOW_WANTS_HEADER_LINE_P (W)) 934 WINDOW_WANTS_HEADER_LINE_P (W)
935 935
936/* Pixel height of window W without mode line, bottom scroll bar and 936/* Pixel height of window W without mode line, bottom scroll bar and
937 bottom divider. */ 937 bottom divider. */
@@ -1015,7 +1015,7 @@ extern int window_relative_x_coord (struct window *, enum window_part, int);
1015 1015
1016void run_window_configuration_change_hook (struct frame *f); 1016void run_window_configuration_change_hook (struct frame *f);
1017 1017
1018/* Make WINDOW display BUFFER. RUN_HOOKS_P non-zero means it's allowed 1018/* Make WINDOW display BUFFER. RUN_HOOKS_P means it's allowed
1019 to run hooks. See make_frame for a case where it's not allowed. */ 1019 to run hooks. See make_frame for a case where it's not allowed. */
1020 1020
1021void set_window_buffer (Lisp_Object window, Lisp_Object buffer, 1021void set_window_buffer (Lisp_Object window, Lisp_Object buffer,
@@ -1067,7 +1067,7 @@ extern void redisplay_other_windows (void);
1067 1067
1068struct glyph *get_phys_cursor_glyph (struct window *w); 1068struct glyph *get_phys_cursor_glyph (struct window *w);
1069 1069
1070/* Value is non-zero if WINDOW is a valid window. */ 1070/* True if WINDOW is a valid window. */
1071#define WINDOW_VALID_P(WINDOW) \ 1071#define WINDOW_VALID_P(WINDOW) \
1072 (WINDOWP (WINDOW) && !NILP (XWINDOW (WINDOW)->contents)) \ 1072 (WINDOWP (WINDOW) && !NILP (XWINDOW (WINDOW)->contents)) \
1073 1073
@@ -1076,7 +1076,7 @@ struct glyph *get_phys_cursor_glyph (struct window *w);
1076#define CHECK_VALID_WINDOW(WINDOW) \ 1076#define CHECK_VALID_WINDOW(WINDOW) \
1077 CHECK_TYPE (WINDOW_VALID_P (WINDOW), Qwindow_valid_p, WINDOW) 1077 CHECK_TYPE (WINDOW_VALID_P (WINDOW), Qwindow_valid_p, WINDOW)
1078 1078
1079/* Value is non-zero if WINDOW is a live window. */ 1079/* True if WINDOW is a live window. */
1080#define WINDOW_LIVE_P(WINDOW) \ 1080#define WINDOW_LIVE_P(WINDOW) \
1081 (WINDOWP (WINDOW) && BUFFERP (XWINDOW (WINDOW)->contents)) 1081 (WINDOWP (WINDOW) && BUFFERP (XWINDOW (WINDOW)->contents))
1082 1082