Function: force-window-update

force-window-update is a function defined in window.c.

Signature

(force-window-update &optional OBJECT)

Documentation

Force all windows to be updated on next redisplay.

If optional arg OBJECT is a window, force redisplay of that window only. If OBJECT is a buffer or buffer name, force redisplay of all windows displaying that buffer.

View in manual

Probably introduced at or before Emacs version 22.1.

Source Code

// Defined in /usr/src/emacs/src/window.c
{
  if (NILP (object))
    {
      windows_or_buffers_changed = 29;
      update_mode_lines = 28;
      return Qt;
    }

  if (WINDOW_LIVE_P (object))
    {
      struct window *w = XWINDOW (object);
      mark_window_display_accurate (object, false);
      w->update_mode_line = true;
      if (BUFFERP (w->contents))
	XBUFFER (w->contents)->prevent_redisplay_optimizations_p = true;
      update_mode_lines = 29;
      return Qt;
    }

  if (STRINGP (object))
    object = Fget_buffer (object);
  if (BUFFERP (object) && BUFFER_LIVE_P (XBUFFER (object))
      && buffer_window_count (XBUFFER (object)))
    {
      /* If buffer is live and shown in at least one window, find
	 all windows showing this buffer and force update of them.  */
      object = window_loop (REDISPLAY_BUFFER_WINDOWS, object, false, Qvisible);
      return NILP (object) ? Qnil : Qt;
    }

  /* If nothing suitable was found, just return.
     We could signal an error, but this feature will typically be used
     asynchronously in timers or process sentinels, so we don't.  */
  return Qnil;
}