Subject: bug#13007: 24.3.50; emacs_backtrace.txt

From: Dmitry Antipov <[email-masked]>
Date: Wed, 28 Nov 2012 19:51:37 +0400

On 11/28/2012 05:09 PM, Juanma Barranquero wrote:

> What result did you expect? In my use case, the assertion still fails.

OK. Your crash recipe from Bug#13012 (which I can reproduce) hits the
corner case where XBUFFER (XWINDOW (selected_window)->buffer) !=
current_buffer; this should be fixed by always examining window buffer
instead of current. This should works for mini windows too, but I'm
not 100% sure about pseudo windows.

Drew, since I can't reproduce your crash, could you please a) try this
patch and b) check whether window with non-zero pseudo_window_p field
is passed to window_outdated_p?

Dmitry

=== modified file 'src/xdisp.c'
--- src/xdisp.c	2012-11-27 03:10:32 +0000
+++ src/xdisp.c	2012-11-28 15:39:55 +0000
@@ -10898,14 +10898,17 @@
 }
 
 /* Nonzero if W doesn't reflect the actual state of
-   current buffer due to its text or overlays change.  */
+   its buffer due to its text or overlays change.  */
 
 static int
 window_outdated (struct window *w)
 {
-  eassert (XBUFFER (w->buffer) == current_buffer);
-  return (w->last_modified < MODIFF 
-	  || w->last_overlay_modified < OVERLAY_MODIFF);
+  struct buffer *b = XBUFFER (w->buffer);
+
+  eassert (BUFFER_LIVE_P (b));
+
+  return (w->last_modified < BUF_MODIFF (b)
+	  || w->last_overlay_modified < BUF_OVERLAY_MODIFF (b));
 }
 
 /* Nonzero if W's buffer was changed but not saved or Transient Mark mode