From 264472a507ea275476eef5a80ee630aa007434f1 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Tue, 14 Jun 2022 20:27:12 +0300 Subject: [PATCH] Handle W = NULL in 'update_redisplay_ticks' * src/xdisp.c (update_redisplay_ticks): If W == NULL, assume we are iterating the current buffer. --- src/xdisp.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/xdisp.c b/src/xdisp.c index ae428f4b404..d14955af415 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -17179,7 +17179,11 @@ redisplay_window_1 (Lisp_Object window) means to initialize the tick count to zero. W can be NULL if TICKS is zero: that means unconditionally - re-initialize the current tick count to zero. */ + re-initialize the current tick count to zero. + + W can also be NULL if the caller doesn't know which window is being + processed by the display code. In that case, if TICKS is non-zero, + we assume it's the last window that shows the current buffer. */ void update_redisplay_ticks (int ticks, struct window *w) { @@ -17204,9 +17208,11 @@ update_redisplay_ticks (int ticks, struct window *w) the one used for the native tool bar). */ Lisp_Object contents = w ? w->contents : Qnil; char *bufname = - BUFFERP (contents) - ? SSDATA (BVAR (XBUFFER (contents), name)) - : (char *) ""; + NILP (contents) + ? SSDATA (BVAR (current_buffer, name)) + : (BUFFERP (contents) + ? SSDATA (BVAR (XBUFFER (contents), name)) + : (char *) ""); windows_or_buffers_changed = 177; error ("Window showing buffer %s takes too long to redisplay", bufname); -- 2.39.2