From: Eli Zaretskii Date: Sun, 12 Jun 2022 16:48:34 +0000 (+0300) Subject: Change the API of 'update_redisplay_ticks' X-Git-Tag: emacs-29.0.90~1447^2~1506^2~10 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=f1e1392868d282bf1ee7623fcdf3d094509ba8dd;p=emacs.git Change the API of 'update_redisplay_ticks' * src/xdisp.c (update_redisplay_ticks): Change the 2nd argument to be 'struct window'; all callers changed. --- diff --git a/src/dispextern.h b/src/dispextern.h index a919f364c1c..0ea3ac8b07b 100644 --- a/src/dispextern.h +++ b/src/dispextern.h @@ -3505,7 +3505,7 @@ extern unsigned row_hash (struct glyph_row *); extern bool buffer_flipping_blocked_p (void); -extern void update_redisplay_ticks (int, struct it *); +extern void update_redisplay_ticks (int, struct window *); /* Defined in image.c */ diff --git a/src/xdisp.c b/src/xdisp.c index 9eba0ca8867..27041cb1626 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -3222,7 +3222,7 @@ init_iterator (struct it *it, struct window *w, it->cmp_it.id = -1; - update_redisplay_ticks (0, it); + update_redisplay_ticks (0, w); /* Extra space between lines (on window systems only). */ if (base_face_id == DEFAULT_FACE_ID @@ -8177,7 +8177,7 @@ void set_iterator_to_next (struct it *it, bool reseat_p) { - update_redisplay_ticks (1, it); + update_redisplay_ticks (1, it->w); switch (it->method) { @@ -17171,17 +17171,14 @@ redisplay_window_1 (Lisp_Object window) Aborting runaway redisplay ***********************************************************************/ -/* Update the redisplay-tick count for a window, and signal an error +/* Update the redisplay-tick count for window W, and signal an error if the tick count is above some threshold, indicating that redisplay of the window takes "too long". - TICKS is the amount of ticks to add to the window's current count; - zero means to initialize the count to zero. - - IT is the iterator used for redisplay work; it->w is the window we - are working on. */ + TICKS is the amount of ticks to add to the W's current count; zero + means to initialize the count to zero. */ void -update_redisplay_ticks (int ticks, struct it *it) +update_redisplay_ticks (int ticks, struct window *w) { /* This keeps track of the window on which redisplay is working. */ static struct window *cwindow; @@ -17190,16 +17187,16 @@ update_redisplay_ticks (int ticks, struct it *it) /* We only initialize the count if this is a different window. Otherwise, this is a call from init_iterator for the same window we tracked before, and we should keep the count. */ - if (!ticks && it->w != cwindow) + if (!ticks && w != cwindow) { - cwindow = it->w; + cwindow = w; window_ticks = 0; } if (ticks > 0) window_ticks += ticks; if (max_redisplay_ticks > 0 && window_ticks > max_redisplay_ticks) error ("Window showing buffer %s takes too long to redisplay", - SSDATA (BVAR (XBUFFER (it->w->contents), name))); + SSDATA (BVAR (XBUFFER (w->contents), name))); }