Commit 80b00b08 authored by Dmitry Antipov's avatar Dmitry Antipov
Browse files

* window.h (struct window): Change type of 'hscroll',

'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
'last_modified' and 'last_overlay_modified' to EMACS_INT.
Adjust users accordingly.
* xdisp.c (try_cursor_movement): Replace type check with eassert.
* window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
from EMACS_INT to ptrdiff_t.
(make_window): Omit redundant initialization.
parent 62b2bcf6
2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
* window.h (struct window): Change type of 'hscroll',
'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
'last_modified' and 'last_overlay_modified' to EMACS_INT.
Adjust users accordingly.
* xdisp.c (try_cursor_movement): Replace type check with eassert.
* window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
from EMACS_INT to ptrdiff_t.
(make_window): Omit redundant initialization.
2012-06-28 Juanma Barranquero <lekktu@gmail.com> 2012-06-28 Juanma Barranquero <lekktu@gmail.com>
* makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies. * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
......
...@@ -131,7 +131,7 @@ set_menu_bar_lines_1 (Lisp_Object window, int n) ...@@ -131,7 +131,7 @@ set_menu_bar_lines_1 (Lisp_Object window, int n)
{ {
struct window *w = XWINDOW (window); struct window *w = XWINDOW (window);
XSETFASTINT (w->last_modified, 0); w->last_modified = 0;
XSETFASTINT (w->top_line, XFASTINT (w->top_line) + n); XSETFASTINT (w->top_line, XFASTINT (w->top_line) + n);
XSETFASTINT (w->total_lines, XFASTINT (w->total_lines) - n); XSETFASTINT (w->total_lines, XFASTINT (w->total_lines) - n);
......
...@@ -1817,7 +1817,7 @@ static struct position val_vmotion; ...@@ -1817,7 +1817,7 @@ static struct position val_vmotion;
struct position * struct position *
vmotion (register ptrdiff_t from, register EMACS_INT vtarget, struct window *w) vmotion (register ptrdiff_t from, register EMACS_INT vtarget, struct window *w)
{ {
ptrdiff_t hscroll = XINT (w->hscroll); ptrdiff_t hscroll = w->hscroll;
struct position pos; struct position pos;
/* vpos is cumulative vertical position, changed as from is changed */ /* vpos is cumulative vertical position, changed as from is changed */
register EMACS_INT vpos = 0; register EMACS_INT vpos = 0;
......
...@@ -622,7 +622,7 @@ read_minibuf (Lisp_Object map, Lisp_Object initial, Lisp_Object prompt, ...@@ -622,7 +622,7 @@ read_minibuf (Lisp_Object map, Lisp_Object initial, Lisp_Object prompt,
/* Display this minibuffer in the proper window. */ /* Display this minibuffer in the proper window. */
Fset_window_buffer (minibuf_window, Fcurrent_buffer (), Qnil); Fset_window_buffer (minibuf_window, Fcurrent_buffer (), Qnil);
Fselect_window (minibuf_window, Qnil); Fselect_window (minibuf_window, Qnil);
XSETFASTINT (XWINDOW (minibuf_window)->hscroll, 0); XWINDOW (minibuf_window)->hscroll = 0;
Fmake_local_variable (Qprint_escape_newlines); Fmake_local_variable (Qprint_escape_newlines);
print_escape_newlines = 1; print_escape_newlines = 1;
...@@ -888,8 +888,8 @@ read_minibuf_unwind (Lisp_Object data) ...@@ -888,8 +888,8 @@ read_minibuf_unwind (Lisp_Object data)
/* Make sure minibuffer window is erased, not ignored. */ /* Make sure minibuffer window is erased, not ignored. */
windows_or_buffers_changed++; windows_or_buffers_changed++;
XSETFASTINT (XWINDOW (window)->last_modified, 0); XWINDOW (window)->last_modified = 0;
XSETFASTINT (XWINDOW (window)->last_overlay_modified, 0); XWINDOW (window)->last_overlay_modified = 0;
/* In case the previous minibuffer displayed in this miniwindow is /* In case the previous minibuffer displayed in this miniwindow is
dead, we may keep displaying this buffer (tho it's inactive), so reset it, dead, we may keep displaying this buffer (tho it's inactive), so reset it,
......
...@@ -667,7 +667,7 @@ DEFUN ("window-hscroll", Fwindow_hscroll, Swindow_hscroll, 0, 1, 0, ...@@ -667,7 +667,7 @@ DEFUN ("window-hscroll", Fwindow_hscroll, Swindow_hscroll, 0, 1, 0,
WINDOW must be a live window and defaults to the selected one. */) WINDOW must be a live window and defaults to the selected one. */)
(Lisp_Object window) (Lisp_Object window)
{ {
return decode_window (window)->hscroll; return make_number (decode_window (window)->hscroll);
} }
DEFUN ("set-window-hscroll", Fset_window_hscroll, Sset_window_hscroll, 2, 2, 0, DEFUN ("set-window-hscroll", Fset_window_hscroll, Sset_window_hscroll, 2, 2, 0,
...@@ -686,10 +686,10 @@ window so that the location of point moves off-window. */) ...@@ -686,10 +686,10 @@ window so that the location of point moves off-window. */)
hscroll = clip_to_bounds (0, XINT (ncol), PTRDIFF_MAX); hscroll = clip_to_bounds (0, XINT (ncol), PTRDIFF_MAX);
/* Prevent redisplay shortcuts when changing the hscroll. */ /* Prevent redisplay shortcuts when changing the hscroll. */
if (XINT (w->hscroll) != hscroll) if (w->hscroll != hscroll)
XBUFFER (w->buffer)->prevent_redisplay_optimizations_p = 1; XBUFFER (w->buffer)->prevent_redisplay_optimizations_p = 1;
w->hscroll = make_number (hscroll); w->hscroll = hscroll;
return ncol; return ncol;
} }
...@@ -1313,8 +1313,8 @@ if it isn't already recorded. */) ...@@ -1313,8 +1313,8 @@ if it isn't already recorded. */)
if (! NILP (update) if (! NILP (update)
&& ! (! NILP (w->window_end_valid) && ! (! NILP (w->window_end_valid)
&& XFASTINT (w->last_modified) >= BUF_MODIFF (b) && w->last_modified >= BUF_MODIFF (b)
&& XFASTINT (w->last_overlay_modified) >= BUF_OVERLAY_MODIFF (b)) && w->last_overlay_modified >= BUF_OVERLAY_MODIFF (b))
&& !noninteractive) && !noninteractive)
{ {
struct text_pos startp; struct text_pos startp;
...@@ -1397,8 +1397,8 @@ overriding motion of point in order to display at this exact start. */) ...@@ -1397,8 +1397,8 @@ overriding motion of point in order to display at this exact start. */)
if (NILP (noforce)) if (NILP (noforce))
w->force_start = 1; w->force_start = 1;
w->update_mode_line = 1; w->update_mode_line = 1;
XSETFASTINT (w->last_modified, 0); w->last_modified = 0;
XSETFASTINT (w->last_overlay_modified, 0); w->last_overlay_modified = 0;
if (!EQ (window, selected_window)) if (!EQ (window, selected_window))
windows_or_buffers_changed++; windows_or_buffers_changed++;
...@@ -1510,8 +1510,8 @@ Return nil if window display is not up-to-date. In that case, use ...@@ -1510,8 +1510,8 @@ Return nil if window display is not up-to-date. In that case, use
if (NILP (w->window_end_valid) if (NILP (w->window_end_valid)
|| current_buffer->clip_changed || current_buffer->clip_changed
|| current_buffer->prevent_redisplay_optimizations_p || current_buffer->prevent_redisplay_optimizations_p
|| XFASTINT (w->last_modified) < BUF_MODIFF (b) || w->last_modified < BUF_MODIFF (b)
|| XFASTINT (w->last_overlay_modified) < BUF_OVERLAY_MODIFF (b)) || w->last_overlay_modified < BUF_OVERLAY_MODIFF (b))
return Qnil; return Qnil;
if (NILP (line)) if (NILP (line))
...@@ -3002,7 +3002,7 @@ set_window_buffer (Lisp_Object window, Lisp_Object buffer, int run_hooks_p, int ...@@ -3002,7 +3002,7 @@ set_window_buffer (Lisp_Object window, Lisp_Object buffer, int run_hooks_p, int
Resetting hscroll and vscroll here is problematic for things like Resetting hscroll and vscroll here is problematic for things like
image-mode and doc-view-mode since it resets the image's position image-mode and doc-view-mode since it resets the image's position
whenever we resize the frame. */ whenever we resize the frame. */
w->hscroll = w->min_hscroll = make_number (0); w->hscroll = w->min_hscroll = 0;
w->vscroll = 0; w->vscroll = 0;
set_marker_both (w->pointm, buffer, BUF_PT (b), BUF_PT_BYTE (b)); set_marker_both (w->pointm, buffer, BUF_PT (b), BUF_PT_BYTE (b));
set_marker_restricted (w->start, set_marker_restricted (w->start,
...@@ -3010,8 +3010,8 @@ set_window_buffer (Lisp_Object window, Lisp_Object buffer, int run_hooks_p, int ...@@ -3010,8 +3010,8 @@ set_window_buffer (Lisp_Object window, Lisp_Object buffer, int run_hooks_p, int
buffer); buffer);
w->start_at_line_beg = 0; w->start_at_line_beg = 0;
w->force_start = 0; w->force_start = 0;
XSETFASTINT (w->last_modified, 0); w->last_modified = 0;
XSETFASTINT (w->last_overlay_modified, 0); w->last_overlay_modified = 0;
} }
/* Maybe we could move this into the `if' but it's not obviously safe and /* Maybe we could move this into the `if' but it's not obviously safe and
I doubt it's worth the trouble. */ I doubt it's worth the trouble. */
...@@ -3196,8 +3196,8 @@ temp_output_buffer_show (register Lisp_Object buf) ...@@ -3196,8 +3196,8 @@ temp_output_buffer_show (register Lisp_Object buf)
Fmake_frame_visible (WINDOW_FRAME (XWINDOW (window))); Fmake_frame_visible (WINDOW_FRAME (XWINDOW (window)));
Vminibuf_scroll_window = window; Vminibuf_scroll_window = window;
w = XWINDOW (window); w = XWINDOW (window);
XSETFASTINT (w->hscroll, 0); w->hscroll = 0;
XSETFASTINT (w->min_hscroll, 0); w->min_hscroll = 0;
set_marker_restricted_both (w->start, buf, BEG, BEG); set_marker_restricted_both (w->start, buf, BEG, BEG);
set_marker_restricted_both (w->pointm, buf, BEG, BEG); set_marker_restricted_both (w->pointm, buf, BEG, BEG);
...@@ -3286,9 +3286,6 @@ make_window (void) ...@@ -3286,9 +3286,6 @@ make_window (void)
XSETFASTINT (w->new_normal, 0); XSETFASTINT (w->new_normal, 0);
w->start = Fmake_marker (); w->start = Fmake_marker ();
w->pointm = Fmake_marker (); w->pointm = Fmake_marker ();
XSETFASTINT (w->hscroll, 0);
XSETFASTINT (w->min_hscroll, 0);
XSETFASTINT (w->last_point, 0);
w->vertical_scroll_bar_type = Qt; w->vertical_scroll_bar_type = Qt;
XSETFASTINT (w->window_end_pos, 0); XSETFASTINT (w->window_end_pos, 0);
XSETFASTINT (w->window_end_vpos, 0); XSETFASTINT (w->window_end_vpos, 0);
...@@ -3488,8 +3485,8 @@ window_resize_apply (struct window *w, int horflag) ...@@ -3488,8 +3485,8 @@ window_resize_apply (struct window *w, int horflag)
} }
/* Clear out some redisplay caches. */ /* Clear out some redisplay caches. */
XSETFASTINT (w->last_modified, 0); w->last_modified = 0;
XSETFASTINT (w->last_overlay_modified, 0); w->last_overlay_modified = 0;
} }
...@@ -4021,8 +4018,8 @@ grow_mini_window (struct window *w, int delta) ...@@ -4021,8 +4018,8 @@ grow_mini_window (struct window *w, int delta)
/* Grow the mini-window. */ /* Grow the mini-window. */
XSETFASTINT (w->top_line, XFASTINT (r->top_line) + XFASTINT (r->total_lines)); XSETFASTINT (w->top_line, XFASTINT (r->top_line) + XFASTINT (r->total_lines));
XSETFASTINT (w->total_lines, XFASTINT (w->total_lines) - XINT (value)); XSETFASTINT (w->total_lines, XFASTINT (w->total_lines) - XINT (value));
XSETFASTINT (w->last_modified, 0); w->last_modified = 0;
XSETFASTINT (w->last_overlay_modified, 0); w->last_overlay_modified = 0;
adjust_glyphs (f); adjust_glyphs (f);
UNBLOCK_INPUT; UNBLOCK_INPUT;
...@@ -4057,8 +4054,8 @@ shrink_mini_window (struct window *w) ...@@ -4057,8 +4054,8 @@ shrink_mini_window (struct window *w)
XSETFASTINT (w->top_line, XFASTINT (r->top_line) + XFASTINT (r->total_lines)); XSETFASTINT (w->top_line, XFASTINT (r->top_line) + XFASTINT (r->total_lines));
XSETFASTINT (w->total_lines, 1); XSETFASTINT (w->total_lines, 1);
XSETFASTINT (w->last_modified, 0); w->last_modified = 0;
XSETFASTINT (w->last_overlay_modified, 0); w->last_overlay_modified = 0;
adjust_glyphs (f); adjust_glyphs (f);
UNBLOCK_INPUT; UNBLOCK_INPUT;
...@@ -4285,8 +4282,8 @@ window_scroll_pixel_based (Lisp_Object window, int n, int whole, int noerror) ...@@ -4285,8 +4282,8 @@ window_scroll_pixel_based (Lisp_Object window, int n, int whole, int noerror)
w->buffer); w->buffer);
w->start_at_line_beg = 1; w->start_at_line_beg = 1;
w->update_mode_line = 1; w->update_mode_line = 1;
XSETFASTINT (w->last_modified, 0); w->last_modified = 0;
XSETFASTINT (w->last_overlay_modified, 0); w->last_overlay_modified = 0;
/* Set force_start so that redisplay_window will run the /* Set force_start so that redisplay_window will run the
window-scroll-functions. */ window-scroll-functions. */
w->force_start = 1; w->force_start = 1;
...@@ -4431,8 +4428,8 @@ window_scroll_pixel_based (Lisp_Object window, int n, int whole, int noerror) ...@@ -4431,8 +4428,8 @@ window_scroll_pixel_based (Lisp_Object window, int n, int whole, int noerror)
bytepos = XMARKER (w->start)->bytepos; bytepos = XMARKER (w->start)->bytepos;
w->start_at_line_beg = (pos == BEGV || FETCH_BYTE (bytepos - 1) == '\n'); w->start_at_line_beg = (pos == BEGV || FETCH_BYTE (bytepos - 1) == '\n');
w->update_mode_line = 1; w->update_mode_line = 1;
XSETFASTINT (w->last_modified, 0); w->last_modified = 0;
XSETFASTINT (w->last_overlay_modified, 0); w->last_overlay_modified = 0;
/* Set force_start so that redisplay_window will run the /* Set force_start so that redisplay_window will run the
window-scroll-functions. */ window-scroll-functions. */
w->force_start = 1; w->force_start = 1;
...@@ -4585,10 +4582,10 @@ window_scroll_line_based (Lisp_Object window, int n, int whole, int noerror) ...@@ -4585,10 +4582,10 @@ window_scroll_line_based (Lisp_Object window, int n, int whole, int noerror)
struct position posit struct position posit
= *compute_motion (startpos, 0, 0, 0, = *compute_motion (startpos, 0, 0, 0,
PT, ht, 0, PT, ht, 0,
-1, XINT (w->hscroll), -1, w->hscroll,
0, w); 0, w);
window_scroll_preserve_vpos = posit.vpos; window_scroll_preserve_vpos = posit.vpos;
window_scroll_preserve_hpos = posit.hpos + XINT (w->hscroll); window_scroll_preserve_hpos = posit.hpos + w->hscroll;
} }
original_pos = Fcons (make_number (window_scroll_preserve_hpos), original_pos = Fcons (make_number (window_scroll_preserve_hpos),
...@@ -4630,8 +4627,8 @@ window_scroll_line_based (Lisp_Object window, int n, int whole, int noerror) ...@@ -4630,8 +4627,8 @@ window_scroll_line_based (Lisp_Object window, int n, int whole, int noerror)
set_marker_restricted_both (w->start, w->buffer, pos, pos_byte); set_marker_restricted_both (w->start, w->buffer, pos, pos_byte);
w->start_at_line_beg = !NILP (bolp); w->start_at_line_beg = !NILP (bolp);
w->update_mode_line = 1; w->update_mode_line = 1;
XSETFASTINT (w->last_modified, 0); w->last_modified = 0;
XSETFASTINT (w->last_overlay_modified, 0); w->last_overlay_modified = 0;
/* Set force_start so that redisplay_window will run /* Set force_start so that redisplay_window will run
the window-scroll-functions. */ the window-scroll-functions. */
w->force_start = 1; w->force_start = 1;
...@@ -4872,7 +4869,7 @@ by this function. This happens in an interactive call. */) ...@@ -4872,7 +4869,7 @@ by this function. This happens in an interactive call. */)
(register Lisp_Object arg, Lisp_Object set_minimum) (register Lisp_Object arg, Lisp_Object set_minimum)
{ {
Lisp_Object result; Lisp_Object result;
EMACS_INT hscroll; ptrdiff_t hscroll;
struct window *w = XWINDOW (selected_window); struct window *w = XWINDOW (selected_window);
if (NILP (arg)) if (NILP (arg))
...@@ -4880,7 +4877,7 @@ by this function. This happens in an interactive call. */) ...@@ -4880,7 +4877,7 @@ by this function. This happens in an interactive call. */)
else else
arg = Fprefix_numeric_value (arg); arg = Fprefix_numeric_value (arg);
hscroll = XINT (w->hscroll) + XINT (arg); hscroll = w->hscroll + XINT (arg);
result = Fset_window_hscroll (selected_window, make_number (hscroll)); result = Fset_window_hscroll (selected_window, make_number (hscroll));
if (!NILP (set_minimum)) if (!NILP (set_minimum))
...@@ -4901,7 +4898,7 @@ by this function. This happens in an interactive call. */) ...@@ -4901,7 +4898,7 @@ by this function. This happens in an interactive call. */)
(register Lisp_Object arg, Lisp_Object set_minimum) (register Lisp_Object arg, Lisp_Object set_minimum)
{ {
Lisp_Object result; Lisp_Object result;
EMACS_INT hscroll; ptrdiff_t hscroll;
struct window *w = XWINDOW (selected_window); struct window *w = XWINDOW (selected_window);
if (NILP (arg)) if (NILP (arg))
...@@ -4909,7 +4906,7 @@ by this function. This happens in an interactive call. */) ...@@ -4909,7 +4906,7 @@ by this function. This happens in an interactive call. */)
else else
arg = Fprefix_numeric_value (arg); arg = Fprefix_numeric_value (arg);
hscroll = XINT (w->hscroll) - XINT (arg); hscroll = w->hscroll - XINT (arg);
result = Fset_window_hscroll (selected_window, make_number (hscroll)); result = Fset_window_hscroll (selected_window, make_number (hscroll));
if (!NILP (set_minimum)) if (!NILP (set_minimum))
...@@ -5537,8 +5534,8 @@ the return value is nil. Otherwise the value is t. */) ...@@ -5537,8 +5534,8 @@ the return value is nil. Otherwise the value is t. */)
w->total_lines = p->total_lines; w->total_lines = p->total_lines;
w->normal_cols = p->normal_cols; w->normal_cols = p->normal_cols;
w->normal_lines = p->normal_lines; w->normal_lines = p->normal_lines;
w->hscroll = p->hscroll; w->hscroll = XFASTINT (p->hscroll);
w->min_hscroll = p->min_hscroll; w->min_hscroll = XFASTINT (p->min_hscroll);
w->display_table = p->display_table; w->display_table = p->display_table;
w->left_margin_cols = p->left_margin_cols; w->left_margin_cols = p->left_margin_cols;
w->right_margin_cols = p->right_margin_cols; w->right_margin_cols = p->right_margin_cols;
...@@ -5571,8 +5568,8 @@ the return value is nil. Otherwise the value is t. */) ...@@ -5571,8 +5568,8 @@ the return value is nil. Otherwise the value is t. */)
} }
} }
XSETFASTINT (w->last_modified, 0); w->last_modified = 0;
XSETFASTINT (w->last_overlay_modified, 0); w->last_overlay_modified = 0;
/* Reinstall the saved buffer and pointers into it. */ /* Reinstall the saved buffer and pointers into it. */
if (NILP (p->buffer)) if (NILP (p->buffer))
...@@ -5811,7 +5808,7 @@ get_phys_cursor_glyph (struct window *w) ...@@ -5811,7 +5808,7 @@ get_phys_cursor_glyph (struct window *w)
if (!row->enabled_p) if (!row->enabled_p)
return NULL; return NULL;
if (XINT (w->hscroll)) if (w->hscroll)
{ {
/* When the window is hscrolled, cursor hpos can legitimately be /* When the window is hscrolled, cursor hpos can legitimately be
out of bounds, but we draw the cursor at the corresponding out of bounds, but we draw the cursor at the corresponding
...@@ -5853,8 +5850,8 @@ save_window_save (Lisp_Object window, struct Lisp_Vector *vector, int i) ...@@ -5853,8 +5850,8 @@ save_window_save (Lisp_Object window, struct Lisp_Vector *vector, int i)
p->total_lines = w->total_lines; p->total_lines = w->total_lines;
p->normal_cols = w->normal_cols; p->normal_cols = w->normal_cols;
p->normal_lines = w->normal_lines; p->normal_lines = w->normal_lines;
p->hscroll = w->hscroll; XSETFASTINT (p->hscroll, w->hscroll);
p->min_hscroll = w->min_hscroll; XSETFASTINT (p->min_hscroll, w->min_hscroll);
p->display_table = w->display_table; p->display_table = w->display_table;
p->left_margin_cols = w->left_margin_cols; p->left_margin_cols = w->left_margin_cols;
p->right_margin_cols = w->right_margin_cols; p->right_margin_cols = w->right_margin_cols;
......
...@@ -141,24 +141,10 @@ struct window ...@@ -141,24 +141,10 @@ struct window
each one can have its own value of point. */ each one can have its own value of point. */
Lisp_Object pointm; Lisp_Object pointm;
/* Number of columns display within the window is scrolled to the left. */
Lisp_Object hscroll;
/* Minimum hscroll for automatic hscrolling. This is the value
the user has set, by set-window-hscroll for example. */
Lisp_Object min_hscroll;
/* No permanent meaning; used by save-window-excursion's /* No permanent meaning; used by save-window-excursion's
bookkeeping. */ bookkeeping. */
Lisp_Object temslot; Lisp_Object temslot;
/* text.modified of displayed buffer as of last time display
completed. */
Lisp_Object last_modified;
/* BUF_OVERLAY_MODIFIED of displayed buffer as of last complete update. */
Lisp_Object last_overlay_modified;
/* Value of point at that time. */
Lisp_Object last_point;
/* This window's vertical scroll bar. This field is only for use /* This window's vertical scroll bar. This field is only for use
by the window-system-dependent code which implements the by the window-system-dependent code which implements the
scroll bars; it can store anything it likes here. If this scroll bars; it can store anything it likes here. If this
...@@ -254,6 +240,25 @@ struct window ...@@ -254,6 +240,25 @@ struct window
/* Unique number of window assigned when it was created. */ /* Unique number of window assigned when it was created. */
int sequence_number; int sequence_number;
/* Number of columns display within the window is scrolled to the left. */
ptrdiff_t hscroll;
/* Minimum hscroll for automatic hscrolling. This is the value
the user has set, by set-window-hscroll for example. */
ptrdiff_t min_hscroll;
/* Displayed buffer's text modification events counter as of last time
display completed. */
EMACS_INT last_modified;
/* Displayed buffer's overlays modification events counter as of last
complete update. */
EMACS_INT last_overlay_modified;
/* Value of point at that time. Since this is a position in a buffer,
it should be positive. */
ptrdiff_t last_point;
/* Scaling factor for the glyph_matrix size calculation in this window. /* Scaling factor for the glyph_matrix size calculation in this window.
Used if window contains many small images or uses proportional fonts, Used if window contains many small images or uses proportional fonts,
as the normal may yield a matrix which is too small. */ as the normal may yield a matrix which is too small. */
......
...@@ -1562,8 +1562,8 @@ pos_visible_p (struct window *w, ptrdiff_t charpos, int *x, int *y, ...@@ -1562,8 +1562,8 @@ pos_visible_p (struct window *w, ptrdiff_t charpos, int *x, int *y,
current_header_line_height = current_mode_line_height = -1; current_header_line_height = current_mode_line_height = -1;
if (visible_p && XFASTINT (w->hscroll) > 0) if (visible_p && w->hscroll > 0)
*x -= XFASTINT (w->hscroll) * WINDOW_FRAME_COLUMN_WIDTH (w); *x -= w->hscroll * WINDOW_FRAME_COLUMN_WIDTH (w);
#if 0 #if 0
/* Debugging code. */ /* Debugging code. */
...@@ -2697,7 +2697,7 @@ init_iterator (struct it *it, struct window *w, ...@@ -2697,7 +2697,7 @@ init_iterator (struct it *it, struct window *w,
/* Are lines in the display truncated? */ /* Are lines in the display truncated? */
if (base_face_id != DEFAULT_FACE_ID if (base_face_id != DEFAULT_FACE_ID
|| XINT (it->w->hscroll) || it->w->hscroll
|| (! WINDOW_FULL_WIDTH_P (it->w) || (! WINDOW_FULL_WIDTH_P (it->w)
&& ((!NILP (Vtruncate_partial_width_windows) && ((!NILP (Vtruncate_partial_width_windows)
&& !INTEGERP (Vtruncate_partial_width_windows)) && !INTEGERP (Vtruncate_partial_width_windows))
...@@ -2760,7 +2760,7 @@ init_iterator (struct it *it, struct window *w, ...@@ -2760,7 +2760,7 @@ init_iterator (struct it *it, struct window *w,
else else
{ {
it->first_visible_x it->first_visible_x
= XFASTINT (it->w->hscroll) * FRAME_COLUMN_WIDTH (it->f); = it->w->hscroll * FRAME_COLUMN_WIDTH (it->f);
it->last_visible_x = (it->first_visible_x it->last_visible_x = (it->first_visible_x
+ window_box_width (w, TEXT_AREA)); + window_box_width (w, TEXT_AREA));
...@@ -12309,7 +12309,7 @@ hscroll_window_tree (Lisp_Object window) ...@@ -12309,7 +12309,7 @@ hscroll_window_tree (Lisp_Object window)
inside the left margin and the window is already inside the left margin and the window is already
hscrolled. */ hscrolled. */
&& ((!row_r2l_p && ((!row_r2l_p
&& ((XFASTINT (w->hscroll) && ((w->hscroll
&& w->cursor.x <= h_margin) && w->cursor.x <= h_margin)
|| (cursor_row->enabled_p || (cursor_row->enabled_p
&& cursor_row->truncated_on_right_p && cursor_row->truncated_on_right_p
...@@ -12327,7 +12327,7 @@ hscroll_window_tree (Lisp_Object window) ...@@ -12327,7 +12327,7 @@ hscroll_window_tree (Lisp_Object window)
are actually truncated on the left. */ are actually truncated on the left. */
&& cursor_row->truncated_on_right_p && cursor_row->truncated_on_right_p
&& w->cursor.x <= h_margin) && w->cursor.x <= h_margin)
|| (XFASTINT (w->hscroll) || (w->hscroll
&& (w->cursor.x >= text_area_width - h_margin)))))) && (w->cursor.x >= text_area_width - h_margin))))))
{ {
struct it it; struct it it;
...@@ -12388,15 +12388,15 @@ hscroll_window_tree (Lisp_Object window) ...@@ -12388,15 +12388,15 @@ hscroll_window_tree (Lisp_Object window)
hscroll hscroll
= max (0, it.current_x - wanted_x) / FRAME_COLUMN_WIDTH (it.f); = max (0, it.current_x - wanted_x) / FRAME_COLUMN_WIDTH (it.f);
} }
hscroll = max (hscroll, XFASTINT (w->min_hscroll)); hscroll = max (hscroll, w->min_hscroll);
/* Don't prevent redisplay optimizations if hscroll /* Don't prevent redisplay optimizations if hscroll
hasn't changed, as it will unnecessarily slow down hasn't changed, as it will unnecessarily slow down
redisplay. */ redisplay. */
if (XFASTINT (w->hscroll) != hscroll) if (w->hscroll != hscroll)
{ {
XBUFFER (w->buffer)->prevent_redisplay_optimizations_p = 1; XBUFFER (w->buffer)->prevent_redisplay_optimizations_p = 1;
w->hscroll = make_number (hscroll); w->hscroll = hscroll;
hscrolled_p = 1; hscrolled_p = 1;
} }
} }
...@@ -12508,8 +12508,8 @@ text_outside_line_unchanged_p (struct window *w, ...@@ -12508,8 +12508,8 @@ text_outside_line_unchanged_p (struct window *w,
int unchanged_p = 1; int unchanged_p = 1;
/* If text or overlays have changed, see where. */ /* If text or overlays have changed, see where. */
if (XFASTINT (w->last_modified) < MODIFF if (w->last_modified < MODIFF
|| XFASTINT (w->last_overlay_modified) < OVERLAY_MODIFF) || w->last_overlay_modified < OVERLAY_MODIFF)
{ {
/* Gap in the line? */ /* Gap in the line? */
if (GPT < start || Z - GPT < end) if (GPT < start || Z - GPT < end)
...@@ -12788,9 +12788,9 @@ reconsider_clip_changes (struct window *w, struct buffer *b) ...@@ -12788,9 +12788,9 @@ reconsider_clip_changes (struct window *w, struct buffer *b)
pt = marker_position (w->pointm); pt = marker_position (w->pointm);
if ((w->current_matrix->buffer != XBUFFER (w->buffer) if ((w->current_matrix->buffer != XBUFFER (w->buffer)
|| pt != XINT (w->last_point)) || pt != w->last_point)
&& check_point_in_composition (w->current_matrix->buffer, && check_point_in_composition (w->current_matrix->buffer,
XINT (w->last_point), w->last_point,
XBUFFER (w->buffer), pt)) XBUFFER (w->buffer), pt))
b->clip_changed = 1; b->clip_changed = 1;
} }
...@@ -13012,9 +13012,9 @@ redisplay_internal (void) ...@@ -13012,9 +13012,9 @@ redisplay_internal (void)
if (!NILP (w->column_number_displayed) if (!NILP (w->column_number_displayed)
/* This alternative quickly identifies a common case /* This alternative quickly identifies a common case
where no change is needed. */