emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 264472a507 05/14: Handle W = NULL in 'update_redisplay_ticks'


From: Eli Zaretskii
Subject: master 264472a507 05/14: Handle W = NULL in 'update_redisplay_ticks'
Date: Fri, 24 Jun 2022 03:54:18 -0400 (EDT)

branch: master
commit 264472a507ea275476eef5a80ee630aa007434f1
Author: Eli Zaretskii <eliz@gnu.org>
Commit: Eli Zaretskii <eliz@gnu.org>

    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 ae428f4b40..d14955af41 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 *) "<none>";
+       NILP (contents)
+       ? SSDATA (BVAR (current_buffer, name))
+       : (BUFFERP (contents)
+          ? SSDATA (BVAR (XBUFFER (contents), name))
+          : (char *) "<unknown>");
 
       windows_or_buffers_changed = 177;
       error ("Window showing buffer %s takes too long to redisplay", bufname);



reply via email to

[Prev in Thread] Current Thread [Next in Thread]