if (it.current_y < it.last_visible_y)
move_it_past_eol (&it);
value = make_number (IT_CHARPOS (it));
- bidi_unshelve_cache (itdata);
+ bidi_unshelve_cache (itdata, 0);
if (old_buffer)
set_buffer_internal (old_buffer);
window-point> triples where buffer was previously shown in WINDOW. */)
(Lisp_Object window, Lisp_Object prev_buffers)
{
- return decode_any_window (window)->prev_buffers = prev_buffers;
+ return decode_window (window)->prev_buffers = prev_buffers;
}
DEFUN ("window-next-buffers", Fwindow_next_buffers, Swindow_next_buffers,
recently re-shown in WINDOW. */)
(Lisp_Object window, Lisp_Object next_buffers)
{
- return decode_any_window (window)->next_buffers = next_buffers;
+ return decode_window (window)->next_buffers = next_buffers;
}
DEFUN ("window-parameters", Fwindow_parameters, Swindow_parameters,
}
start = it.current.pos;
- bidi_unshelve_cache (itdata);
+ bidi_unshelve_cache (itdata, 0);
}
else if (auto_window_vscroll_p)
{
}
else
{
- bidi_unshelve_cache (itdata);
+ bidi_unshelve_cache (itdata, 0);
if (noerror)
return;
else if (n < 0) /* could happen with empty buffers */
w->vscroll = 0;
else
{
- bidi_unshelve_cache (itdata);
+ bidi_unshelve_cache (itdata, 0);
if (noerror)
return;
else
SET_PT_BOTH (charpos, bytepos);
}
}
- bidi_unshelve_cache (itdata);
+ bidi_unshelve_cache (itdata, 0);
}
if (pos < ZV)
{
- int this_scroll_margin = scroll_margin;
-
/* Don't use a scroll margin that is negative or too large. */
- if (this_scroll_margin < 0)
- this_scroll_margin = 0;
-
- if (XINT (w->total_lines) < 4 * scroll_margin)
- this_scroll_margin = XINT (w->total_lines) / 4;
+ int this_scroll_margin =
+ max (0, min (scroll_margin, XINT (w->total_lines) / 4));
set_marker_restricted_both (w->start, w->buffer, pos, pos_byte);
w->start_at_line_beg = bolp;
start_display (&it, w, start);
move_it_vertically (&it, height);
bottom_y = line_bottom_y (&it);
- bidi_unshelve_cache (itdata);
+ bidi_unshelve_cache (itdata, 0);
/* rms: On a non-window display,
the value of it.vpos at the bottom of the screen
struct buffer *obuf = current_buffer;
int center_p = 0;
EMACS_INT charpos, bytepos;
- int iarg IF_LINT (= 0);
+ EMACS_INT iarg IF_LINT (= 0);
int this_scroll_margin;
/* If redisplay is suppressed due to an error, try again. */
/* Do this after making BUF current
in case scroll_margin is buffer-local. */
- this_scroll_margin = max (0, scroll_margin);
- this_scroll_margin = min (this_scroll_margin,
- XFASTINT (w->total_lines) / 4);
+ this_scroll_margin =
+ max (0, min (scroll_margin, XFASTINT (w->total_lines) / 4));
/* Handle centering on a graphical frame specially. Such frames can
have variable-height lines and centering point on the basis of
move_it_vertically_backward (&it, window_box_height (w) / 2);
charpos = IT_CHARPOS (it);
bytepos = IT_BYTEPOS (it);
- bidi_unshelve_cache (itdata);
+ bidi_unshelve_cache (itdata, 0);
}
else if (iarg < 0)
{
struct it it;
struct text_pos pt;
- int nlines = -iarg;
+ int nlines = min (INT_MAX, -iarg);
int extra_line_spacing;
int h = window_box_height (w);
void *itdata = bidi_shelve_cache ();
}
if (h <= 0)
{
- bidi_unshelve_cache (itdata);
+ bidi_unshelve_cache (itdata, 0);
return Qnil;
}
charpos = IT_CHARPOS (it);
bytepos = IT_BYTEPOS (it);
- bidi_unshelve_cache (itdata);
+ bidi_unshelve_cache (itdata, 0);
}
else
{
lines = displayed_window_lines (w);
#if 0
- this_scroll_margin = max (0, scroll_margin);
- this_scroll_margin = min (this_scroll_margin, lines / 4);
+ this_scroll_margin = max (0, min (scroll_margin, lines / 4));
#endif
if (NILP (arg))
XSETFASTINT (arg, lines / 2);
else
{
- int iarg = XINT (Fprefix_numeric_value (arg));
+ EMACS_INT iarg = XINT (Fprefix_numeric_value (arg));
if (iarg < 0)
iarg = iarg + lines;
struct window *root_window;
struct window **leaf_windows;
int n_leaf_windows;
- int k, i, n;
+ ptrdiff_t k;
+ int i, n;
/* If the frame has been resized since this window configuration was
made, we change the frame to the size specified in the
{
register struct save_window_data *d1, *d2;
struct Lisp_Vector *sws1, *sws2;
- int i;
+ ptrdiff_t i;
CHECK_WINDOW_CONFIGURATION (configuration1);
CHECK_WINDOW_CONFIGURATION (configuration2);