Commit 30379713 authored by Paul Eggert's avatar Paul Eggert
Browse files

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.
parent 3ba6b3a9
......@@ -45,28 +45,18 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include "msdos.h"
#endif
static int displayed_window_lines (struct window *);
static int count_windows (struct window *);
static int get_leaf_windows (struct window *, struct window **, int);
static void window_scroll (Lisp_Object, EMACS_INT, bool, int);
static void window_scroll_pixel_based (Lisp_Object, int, bool, int);
static void window_scroll_line_based (Lisp_Object, int, bool, int);
static int add_window_to_list (struct window *, void *);
static Lisp_Object next_window (Lisp_Object, Lisp_Object,
Lisp_Object, int);
static void decode_next_window_args (Lisp_Object *, Lisp_Object *,
Lisp_Object *);
static void window_scroll_pixel_based (Lisp_Object, int, bool, bool);
static void window_scroll_line_based (Lisp_Object, int, bool, bool);
static void foreach_window (struct frame *,
int (* fn) (struct window *, void *),
bool (* fn) (struct window *, void *),
void *);
static int foreach_window_1 (struct window *,
int (* fn) (struct window *, void *),
void *);
static Lisp_Object window_list_1 (Lisp_Object, Lisp_Object, Lisp_Object);
static int window_resize_check (struct window *, bool);
static bool foreach_window_1 (struct window *,
bool (* fn) (struct window *, void *),
void *);
static bool window_resize_check (struct window *, bool);
static void window_resize_apply (struct window *, bool);
static void window_resize_apply_total (struct window *, bool);
static Lisp_Object select_window (Lisp_Object, Lisp_Object, int);
static void select_window_1 (Lisp_Object, bool);
static struct window *set_window_fringes (struct window *, Lisp_Object,
......@@ -74,7 +64,8 @@ static struct window *set_window_fringes (struct window *, Lisp_Object,
static struct window *set_window_margins (struct window *, Lisp_Object,
Lisp_Object);
static struct window *set_window_scroll_bars (struct window *, Lisp_Object,
Lisp_Object, Lisp_Object, Lisp_Object);
Lisp_Object, Lisp_Object,
Lisp_Object);
static void apply_window_adjustment (struct window *);
/* 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)
w->horizontal = horflag;
}
/* Nonzero if leaf window W doesn't reflect the actual state
/* True if leaf window W doesn't reflect the actual state
of displayed buffer due to its text or overlays change. */
bool
......@@ -279,7 +270,7 @@ adjust_window_count (struct window *w, int arg)
b->window_count += arg;
eassert (b->window_count >= 0);
/* These should be recalculated by redisplay code. */
w->window_end_valid = 0;
w->window_end_valid = false;
w->base_line_pos = 0;
}
}
......@@ -462,15 +453,16 @@ selected windows appears and to which many commands apply. */)
int window_select_count;
/* If select_window is called with inhibit_point_swap non-zero it will
/* If select_window is called with inhibit_point_swap true it will
not store point of the old selected window's buffer back into that
window's pointm slot. This is needed by Fset_window_configuration to
avoid that the display routine is called with selected_window set to
Qnil causing a subsequent crash. */
static Lisp_Object
select_window (Lisp_Object window, Lisp_Object norecord, int inhibit_point_swap)
select_window (Lisp_Object window, Lisp_Object norecord,
bool inhibit_point_swap)
{
register struct window *w;
struct window *w;
struct frame *sf;
CHECK_LIVE_WINDOW (window);
......@@ -577,9 +569,9 @@ time a window gets selected put it on `buffer-list-update-hook'.
Also note that the main editor command loop sets the current buffer to
the buffer of the selected window before each command. */)
(register Lisp_Object window, Lisp_Object norecord)
(Lisp_Object window, Lisp_Object norecord)
{
return select_window (window, norecord, 0);
return select_window (window, norecord, false);
}
DEFUN ("window-buffer", Fwindow_buffer, Swindow_buffer, 0, 1, 0,
......@@ -930,11 +922,10 @@ window_body_width (struct window *w, bool pixelwise)
- WINDOW_RIGHT_DIVIDER_WIDTH (w)
- (WINDOW_HAS_VERTICAL_SCROLL_BAR (w)
? WINDOW_SCROLL_BAR_AREA_WIDTH (w)
: ((!FRAME_WINDOW_P (f)
&& !WINDOW_RIGHTMOST_P (w)
&& !WINDOW_RIGHT_DIVIDER_WIDTH (w))
/* A vertical bar is either 1 or 0. */
? 1 : 0))
: (/* A vertical bar is either 1 or 0. */
!FRAME_WINDOW_P (f)
&& !WINDOW_RIGHTMOST_P (w)
&& !WINDOW_RIGHT_DIVIDER_WIDTH (w)))
- WINDOW_MARGINS_WIDTH (w)
- (FRAME_WINDOW_P (f)
? WINDOW_FRINGES_WIDTH (w)
......@@ -961,7 +952,7 @@ visible, that line is not counted. */)
(Lisp_Object window, Lisp_Object pixelwise)
{
return make_number (window_body_height (decode_live_window (window),
NILP (pixelwise) ? 0 : 1));
!NILP (pixelwise)));
}
DEFUN ("window-body-width", Fwindow_body_width, Swindow_body_width, 0, 2, 0,
......@@ -981,7 +972,7 @@ continuation glyph. */)
(Lisp_Object window, Lisp_Object pixelwise)
{
return make_number (window_body_width (decode_live_window (window),
NILP (pixelwise) ? 0 : 1));
!NILP (pixelwise)));
}
DEFUN ("window-mode-line-height", Fwindow_mode_line_height,
......@@ -1062,10 +1053,10 @@ set_window_hscroll (struct window *w, EMACS_INT hscroll)
/* Prevent redisplay shortcuts when changing the hscroll. */
if (w->hscroll != new_hscroll)
XBUFFER (w->contents)->prevent_redisplay_optimizations_p = 1;
XBUFFER (w->contents)->prevent_redisplay_optimizations_p = true;
w->hscroll = new_hscroll;
w->suspend_auto_hscroll = 1;
w->suspend_auto_hscroll = true;
return make_number (new_hscroll);
}
......@@ -1583,7 +1574,7 @@ If they are in the windows's left or right marginal areas, `left-margin'\n\
Check if window W contains coordinates *CW->x and *CW->y. If it
does, return W in *CW->window, as Lisp_Object, and return in
*CW->part the part of the window under coordinates *X,*Y. Return
zero from this function to stop iterating over windows. */
false from this function to stop iterating over windows. */
struct check_window_data
{
......@@ -1592,22 +1583,19 @@ struct check_window_data
enum window_part *part;
};
static int
static bool
check_window_containing (struct window *w, void *user_data)
{
struct check_window_data *cw = user_data;
enum window_part found;
int continue_p = 1;
found = coordinates_in_window (w, cw->x, cw->y);
if (found != ON_NOTHING)
enum window_part found = coordinates_in_window (w, cw->x, cw->y);
if (found == ON_NOTHING)
return true;
else
{
*cw->part = found;
XSETWINDOW (*cw->window, w);
continue_p = 0;
return false;
}
return continue_p;
}
......@@ -1618,7 +1606,7 @@ check_window_containing (struct window *w, void *user_data)
set *PART to the id of that element.
If there is no window under X, Y return nil and leave *PART
unmodified. TOOL_BAR_P non-zero means detect tool-bar windows.
unmodified. TOOL_BAR_P means detect tool-bar windows.
This function was previously implemented with a loop cycling over
windows with Fnext_window, and starting with the frame's selected
......@@ -1680,7 +1668,7 @@ column 0. */)
+ FRAME_INTERNAL_BORDER_WIDTH (f)),
(FRAME_PIXEL_Y_FROM_CANON_Y (f, y)
+ FRAME_INTERNAL_BORDER_WIDTH (f)),
0, 0);
0, false);
}
DEFUN ("window-point", Fwindow_point, Swindow_point, 0, 1, 0,
......@@ -1787,7 +1775,7 @@ if it isn't already recorded. */)
if (it.current_y < it.last_visible_y)
move_it_past_eol (&it);
value = make_number (IT_CHARPOS (it));
bidi_unshelve_cache (itdata, 0);
bidi_unshelve_cache (itdata, false);
if (old_buffer)
set_buffer_internal (old_buffer);
......@@ -1845,12 +1833,12 @@ overriding motion of point in order to display at this exact start. */)
set_marker_restricted (w->start, pos, w->contents);
/* This is not right, but much easier than doing what is right. */
w->start_at_line_beg = 0;
w->start_at_line_beg = false;
if (NILP (noforce))
w->force_start = 1;
w->update_mode_line = 1;
w->force_start = true;
w->update_mode_line = true;
/* Bug#15957. */
w->window_end_valid = 0;
w->window_end_valid = false;
wset_redisplay (w);
return pos;
......@@ -1878,12 +1866,13 @@ POS, ROWH is the visible height of that row, and VPOS is the row number
\(zero-based). */)
(Lisp_Object pos, Lisp_Object window, Lisp_Object partially)
{
register struct window *w;
register EMACS_INT posint;
register struct buffer *buf;
struct window *w;
EMACS_INT posint;
struct buffer *buf;
struct text_pos top;
Lisp_Object in_window = Qnil;
int rtop, rbot, rowh, vpos, fully_p = 1;
int rtop, rbot, rowh, vpos;
bool fully_p = true;
int x, y;
w = decode_live_window (window);
......@@ -1908,9 +1897,12 @@ POS, ROWH is the visible height of that row, and VPOS is the row number
|| (posint >= CHARPOS (top) && posint <= BUF_ZV (buf)))
&& CHARPOS (top) >= BUF_BEGV (buf)
&& CHARPOS (top) <= BUF_ZV (buf)
&& pos_visible_p (w, posint, &x, &y, &rtop, &rbot, &rowh, &vpos)
&& (fully_p = !rtop && !rbot, (!NILP (partially) || fully_p)))
in_window = Qt;
&& pos_visible_p (w, posint, &x, &y, &rtop, &rbot, &rowh, &vpos))
{
fully_p = !rtop && !rbot;
if (!NILP (partially) || fully_p)
in_window = Qt;
}
if (!NILP (in_window) && !NILP (partially))
{
......@@ -2215,7 +2207,7 @@ unshow_buffer (register struct window *w)
eassert (b == XMARKER (w->pointm)->buffer);
#if 0
#if false
if (w == XWINDOW (selected_window)
|| ! EQ (buf, XWINDOW (selected_window)->contents))
/* Do this except when the selected window's buffer
......@@ -2254,14 +2246,14 @@ unshow_buffer (register struct window *w)
bset_last_selected_window (b, Qnil);
}
/* Put NEW into the window structure in place of OLD. SETFLAG zero
/* Put NEW into the window structure in place of OLD. SETFLAG false
means change window structure only. Otherwise store geometry and
other settings as well. */
static void
replace_window (Lisp_Object old, Lisp_Object new, int setflag)
replace_window (Lisp_Object old, Lisp_Object new, bool setflag)
{
register Lisp_Object tem;
register struct window *o = XWINDOW (old), *n = XWINDOW (new);
Lisp_Object tem;
struct window *o = XWINDOW (old), *n = XWINDOW (new);
/* If OLD is its frame's root window, then NEW is the new
root window for that frame. */
......@@ -2291,11 +2283,11 @@ replace_window (Lisp_Object old, Lisp_Object new, int setflag)
n->phys_cursor_type = NO_CURSOR;
n->phys_cursor_width = -1;
#endif
n->must_be_updated_p = 0;
n->pseudo_window_p = 0;
n->must_be_updated_p = false;
n->pseudo_window_p = false;
n->window_end_vpos = 0;
n->window_end_pos = 0;
n->window_end_valid = 0;
n->window_end_valid = false;
}
tem = o->next;
......@@ -2380,7 +2372,7 @@ recombine_windows (Lisp_Object window)
}
/* WINDOW can be deleted now. */
wset_combination (w, 0, Qnil);
wset_combination (w, false, Qnil);
}
}
}
......@@ -2401,14 +2393,14 @@ delete_deletable_window (Lisp_Object window)
pointer. This is a callback function for foreach_window, used in
the window_list function. */
static int
static bool
add_window_to_list (struct window *w, void *user_data)
{
Lisp_Object *list = user_data;
Lisp_Object window;
XSETWINDOW (window, w);
*list = Fcons (window, *list);
return 1;
return true;
}
......@@ -2441,7 +2433,7 @@ window_list (void)
}
/* Value is non-zero if WINDOW satisfies the constraints given by
/* Value is true if WINDOW satisfies the constraints given by
OWINDOW, MINIBUF and ALL_FRAMES.
MINIBUF t means WINDOW may be minibuffer windows.
......@@ -2463,20 +2455,20 @@ candidate_window_p (Lisp_Object window, Lisp_Object owindow,
{
struct window *w = XWINDOW (window);
struct frame *f = XFRAME (w->frame);
bool candidate_p = 1;
bool candidate_p = true;
if (!BUFFERP (w->contents))
candidate_p = 0;
candidate_p = false;
else if (MINI_WINDOW_P (w)
&& (EQ (minibuf, Qlambda)
|| (WINDOWP (minibuf) && !EQ (minibuf, window))))
{
/* If MINIBUF is `lambda' don't consider any mini-windows.
If it is a window, consider only that one. */
candidate_p = 0;
candidate_p = false;
}
else if (EQ (all_frames, Qt))
candidate_p = 1;
candidate_p = true;
else if (NILP (all_frames))
{
eassert (WINDOWP (owindow));
......@@ -2556,12 +2548,13 @@ decode_next_window_args (Lisp_Object *window, Lisp_Object *minibuf, Lisp_Object
/* Return the next or previous window of WINDOW in cyclic ordering
of windows. NEXT_P non-zero means return the next window. See the
of windows. NEXT_P means return the next window. See the
documentation string of next-window for the meaning of MINIBUF and
ALL_FRAMES. */
static Lisp_Object
next_window (Lisp_Object window, Lisp_Object minibuf, Lisp_Object all_frames, int next_p)
next_window (Lisp_Object window, Lisp_Object minibuf, Lisp_Object all_frames,
bool next_p)
{
decode_next_window_args (&window, &minibuf, &all_frames);
......@@ -2659,7 +2652,7 @@ windows, eventually ending up back at the window you started with.
`previous-window' traverses the same cycle, in the reverse order. */)
(Lisp_Object window, Lisp_Object minibuf, Lisp_Object all_frames)
{
return next_window (window, minibuf, all_frames, 1);
return next_window (window, minibuf, all_frames, true);
}
......@@ -2699,7 +2692,7 @@ started with. `next-window' traverses the same cycle, in the
reverse order. */)
(Lisp_Object window, Lisp_Object minibuf, Lisp_Object all_frames)
{
return next_window (window, minibuf, all_frames, 0);
return next_window (window, minibuf, all_frames, false);
}
......@@ -2797,7 +2790,7 @@ be listed first but no error is signaled. */)
Qnil, look at just the selected frame;
Qvisible, look at visible frames;
a frame, just look at windows on that frame.
If MINI is non-zero, perform the operation on minibuffer windows too. */
If MINI, perform the operation on minibuffer windows too. */
enum window_loop
{
......@@ -2809,10 +2802,11 @@ enum window_loop
};
static Lisp_Object
window_loop (enum window_loop type, Lisp_Object obj, int mini, Lisp_Object frames)
window_loop (enum window_loop type, Lisp_Object obj, bool mini,
Lisp_Object frames)
{
Lisp_Object window, windows, best_window, frame_arg;
int frame_best_window_flag = 0;
bool frame_best_window_flag = false;
struct frame *f;
struct gcpro gcpro1;
......@@ -2872,7 +2866,7 @@ window_loop (enum window_loop type, Lisp_Object obj, int mini, Lisp_Object frame
if (EQ (w->contents, obj)
/* Don't find any minibuffer window except the one that
is currently in use. */
&& (MINI_WINDOW_P (w) ? EQ (window, minibuf_window) : 1))
&& (!MINI_WINDOW_P (w) || EQ (window, minibuf_window)))
{
if (EQ (window, selected_window))
/* Preferably return the selected window. */
......@@ -2883,7 +2877,7 @@ window_loop (enum window_loop type, Lisp_Object obj, int mini, Lisp_Object frame
choose another one if we have one already). */
{
best_window = window;
frame_best_window_flag = 1;
frame_best_window_flag = true;
}
else if (NILP (best_window))
best_window = window;
......@@ -2900,7 +2894,7 @@ window_loop (enum window_loop type, Lisp_Object obj, int mini, Lisp_Object frame
/* Make WINDOW show the buffer returned by
other_buffer_safely, don't run any hooks. */
set_window_buffer
(window, other_buffer_safely (w->contents), 0, 0);
(window, other_buffer_safely (w->contents), false, false);
/* If WINDOW is the selected window, make its buffer
current. But do so only if the window shows the
current buffer (Bug#6454). */
......@@ -2913,9 +2907,9 @@ window_loop (enum window_loop type, Lisp_Object obj, int mini, Lisp_Object frame
case REDISPLAY_BUFFER_WINDOWS:
if (EQ (w->contents, obj))
{
mark_window_display_accurate (window, 0);
w->update_mode_line = 1;
XBUFFER (obj)->prevent_redisplay_optimizations_p = 1;
mark_window_display_accurate (window, false);
w->update_mode_line = true;
XBUFFER (obj)->prevent_redisplay_optimizations_p = true;
update_mode_lines = 27;
best_window = window;
}
......@@ -2952,7 +2946,7 @@ extern void check_all_windows (void) EXTERNALLY_VISIBLE;
void
check_all_windows (void)
{
window_loop (CHECK_ALL_WINDOWS, Qnil, 1, Qt);
window_loop (CHECK_ALL_WINDOWS, Qnil, true, Qt);
}
DEFUN ("get-buffer-window", Fget_buffer_window, Sget_buffer_window, 0, 2, 0,
......@@ -2983,7 +2977,7 @@ selected frame and no others. */)
buffer = Fget_buffer (buffer_or_name);
if (BUFFERP (buffer))
return window_loop (GET_BUFFER_WINDOW, buffer, 1, all_frames);
return window_loop (GET_BUFFER_WINDOW, buffer, true, all_frames);
else
return Qnil;
}
......@@ -3040,7 +3034,7 @@ window-start value is reasonable when this function is called. */)
struct frame *f;
Lisp_Object sibling, pwindow, swindow IF_LINT (= Qnil), delta;
ptrdiff_t startpos IF_LINT (= 0), startbyte IF_LINT (= 0);
int top IF_LINT (= 0), new_top, resize_failed;
int top IF_LINT (= 0), new_top;
w = decode_valid_window (window);
XSETWINDOW (window, w);
......@@ -3097,7 +3091,7 @@ window-start value is reasonable when this function is called. */)
parents and comparing each one with WINDOW. If it isn't we
need a new selected window for this frame. */
swindow = FRAME_SELECTED_WINDOW (f);
while (1)
while (true)
{
pwindow = swindow;
while (!NILP (pwindow) && !EQ (window, pwindow))
......@@ -3129,7 +3123,7 @@ window-start value is reasonable when this function is called. */)
/* We are going to free the glyph matrices of WINDOW, and with
that we might lose any information about glyph rows that have
some of their glyphs highlighted in mouse face. (These rows
are marked with a non-zero mouse_face_p flag.) If WINDOW
are marked with a mouse_face_p flag.) If WINDOW
indeed has some glyphs highlighted in mouse face, signal to
frame's up-to-date hook that mouse highlight was overwritten,
so that it will arrange for redisplaying the highlight. */
......@@ -3140,8 +3134,8 @@ window-start value is reasonable when this function is called. */)
fset_redisplay (f);
Vwindow_list = Qnil;
FRAME_WINDOW_SIZES_CHANGED (f) = 1;
resize_failed = 0;
FRAME_WINDOW_SIZES_CHANGED (f) = true;
bool resize_failed = false;
if (!WINDOW_LEAF_P (w))
{
......@@ -3150,21 +3144,21 @@ window-start value is reasonable when this function is called. */)
w->pixel_top = r->pixel_top;
w->top_line = r->top_line;
resize_root_window (window, delta, Qnil, Qnil, Qt);
if (window_resize_check (w, 0))
if (window_resize_check (w, false))
{
window_resize_apply (w, 0);
window_resize_apply (w, false);
window_pixel_to_total (w->frame, Qnil);
}
else
{
resize_root_window (window, delta, Qnil, Qt, Qt);
if (window_resize_check (w, 0))
if (window_resize_check (w, false))
{
window_resize_apply (w, 0);
window_resize_apply (w, false);
window_pixel_to_total (w->frame, Qnil);
}
else
resize_failed = 1;
resize_failed = true;
}
/* Resize child windows horizontally. */
......@@ -3174,21 +3168,21 @@ window-start value is reasonable when this function is called. */)
w->pixel_left = r->pixel_left;
XSETINT (delta, r->pixel_width - w->pixel_width);
resize_root_window (window, delta, Qt, Qnil, Qt);
if (window_resize_check (w, 1))
if (window_resize_check (w, true))
{
window_resize_apply (w, 1);
window_resize_apply (w, true);
window_pixel_to_total (w->frame, Qt);
}
else
{
resize_root_window (window, delta, Qt, Qt, Qt);
if (window_resize_check (w, 1))
if (window_resize_check (w, true))
{
window_resize_apply (w, 1);
window_resize_apply (w, true);
window_pixel_to_total (w->frame, Qt);
}
else
resize_failed = 1;
resize_failed = true;
}
}
......@@ -3224,10 +3218,10 @@ window-start value is reasonable when this function is called. */)
if (WINDOWP (r->contents))
{
delete_all_child_windows (r->contents);
wset_combination (r, 0, Qnil);
wset_combination (r, false, Qnil);
}
replace_window (root, window, 1);
replace_window (root, window, true);
/* This must become SWINDOW anyway ....... */
if (BUFFERP (w->contents) && !resize_failed)
......@@ -3251,12 +3245,12 @@ window-start value is reasonable when this function is called. */)
pos = *vmotion (startpos, startbyte, -top, w);
set_marker_both (w->start, w->contents, pos.bufpos, pos.bytepos);
w->window_end_valid = 0;
w->window_end_valid = false;
w->start_at_line_beg = (pos.bytepos == BEGV_BYTE
|| FETCH_BYTE (pos.bytepos - 1) == '\n');
/* We need to do this, so that the window-scroll-functions
get called. */
w->optional_new_start = 1;
w->optional_new_start = true;
set_buffer_internal (obuf);
}
......@@ -3291,7 +3285,7 @@ replace_buffer_in_windows_safely (Lisp_Object buffer)
considers frames on the current keyboard. So loop manually over
frames, and handle each one. */
FOR_EACH_FRAME (tail, frame)
window_loop (REPLACE_BUFFER_IN_WINDOWS_SAFELY, buffer, 1, frame);
window_loop (REPLACE_BUFFER_IN_WINDOWS_SAFELY, buffer, true, frame);
}
}
......@@ -3391,9 +3385,9 @@ If WINDOW is omitted or nil, it defaults to the selected window. */)
return Qnil;
}
/* Make WINDOW display BUFFER. RUN_HOOKS_P non-zero means it's allowed
/* Make WINDOW display BUFFER. RUN_HOOKS_P means it's allowed
to run hooks. See make_frame for a case where it's not allowed.
KEEP_MARGINS_P non-zero means that the current margins, fringes, and
KEEP_MARGINS_P means that the current margins, fringes, and
scroll-bar settings of the window are not reset from the buffer's
local settings. */
......@@ -3435,15 +3429,15 @@ set_window_buffer (Lisp_Object window, Lisp_Object buffer,
doc-view-mode since it resets the image's position whenever we
resize the frame. */
w->hscroll = w->min_hscroll = w->hscroll_whole = 0;
w->suspend_auto_hscroll = 0;
w->suspend_auto_hscroll = false;
w->vscroll = 0;
set_marker_both (w->pointm, buffer, BUF_PT (b), BUF_PT_BYTE (b));
set_marker_both (w->old_pointm, buffer, BUF_PT (b), BUF_PT_BYTE (b));
set_marker_restricted (w->start,
make_number (b->last_window_start),
buffer);
w->start_at_line_beg = 0;
w->force_start = 0;
w->start_at_line_beg = false;
w->force_start = false;
}
/* Maybe we could move this into the `if' but it's not obviously safe and
I doubt it's worth the trouble. */
......@@ -3534,7 +3528,7 @@ This function runs `window-scroll-functions' before running
unshow_buffer (w);
}
set_window_buffer (window, buffer, 1, !NILP (keep_margins));
set_window_buffer (window, buffer, true, !NILP (keep_margins));
return Qnil;
}
......@@ -3563,10 +3557,10 @@ displaying that buffer. */)
if (WINDOWP (object))
{
struct window *w = XWINDOW (object);
mark_window_display_accurate (object, 0);
w->update_mode_line = 1;
mark_window_display_accurate (object, false);
w->update_mode_line = true;
if (BUFFERP (w->contents))
XBUFFER (w->contents)->prevent_redisplay_optimizations_p = 1;
XBUFFER (w->contents)->prevent_redisplay_optimizations_p = true;
update_mode_lines = 29;
return Qt;
}
......@@ -3578,7 +3572,7 @@ displaying that buffer. */)
{
/* If buffer is live and shown in at least one window, find
all windows showing this buffer and force update of them. */
object = window_loop (REDISPLAY_BUFFER_WINDOWS, object, 0, Qvisible);
object = window_loop (REDISPLAY_BUFFER_WINDOWS, object, false, Qvisible);
return NILP (object) ? Qnil : Qt;
}
......@@ -3614,7 +3608,7 @@ temp_output_buffer_show (register Lisp_Object buf)
Vminibuf_scroll_window = window;
w = XWINDOW (window);
w->hscroll = w->min_hscroll = w->hscroll_whole = 0;
w->suspend_auto_hscroll = 0;
w->suspend_auto_hscroll = false;
set_marker_restricted_both (w->start, buf, BEG, BEG);
set_marker_restricted_both (w->pointm, buf, BEG, BEG);
set_marker_restricted_both (w->old_pointm, buf, BEG, BEG);
......@@ -3651,7 +3645,7 @@ allocate_window (void)
}
/* Make new window, have it replace WINDOW in window-tree, and make
WINDOW its only vertical child (HORFLAG 1 means make WINDOW its only
WINDOW its only vertical child (HORFLAG means make WINDOW its only
horizontal child). */
static void
make_parent_window (Lisp_Object window, bool horflag)
......@@ -3670,7 +3664,7 @@ make_parent_window (Lisp_Object window, bool horflag)
p->sequence_number = ++sequence_number;
replace_window (window, parent, 1);
replace_window (window, parent, true);
wset_next (o, Qnil);
wset_prev (o, Qnil);
......@@ -3799,14 +3793,14 @@ Note: This function does not operate on any child windows of WINDOW. */)
return size;
}
/* Return 1 if setting w->pixel_height (w->pixel_width if HORFLAG is
non-zero) to w->new_pixel would result in correct heights (widths)
/* Return true if setting w->pixel_height (w->pixel_width if HORFLAG)
to w->new_pixel would result in correct heights (widths)
for window W and recursively all child windows of W.
Note: This function does not check any of `window-fixed-size-p',
`window-min-height' or `window-min-width'. It does check that window
sizes do not drop below one line (two columns). */
static int