I have now gotten a bit closer to fixing the redisplay bug related to
widening.
As mentioned earlier the problem is that the redisplay start-marker is
not set correctly and that the line start cache contains a bogus entry
(this actually causes the crash in 21.0).
The problem is to detect in redisplay if this situation occurs. One
approach that works in some cases is to rely on the start_at_line_beg
member of the window structure. When this is true and we are not at
the line beginning we have to readjust the marker. The problem with
this approach is that 'start_at_line_beg' is not always set
correctly. The appended patch partially corrects this.
We still lose if start is not at the beginning of a line before
widening. Unless I have missed something this is only supposed to
happen with long wrapped lines. In this case we seem to produce bogus
line_start_cache entries anyway (unrelated to narrowing/widening). I
need to look at this more closely. Also I have to check where start_at
_line_beg gets clobbered.
I guess we could put this patch in 21.0 if some redisplay-experts
agree, after all it fixes Collin's reproduction recipe, but it's still
possible to get crashes after some scrolling.
For 21.2 I plan to examine in more detail in which cases startp is
allowed to be in the middle of a line and what to enter in the cache
then. Helpful comments are always appreciated.
Gunnar
Index: redisplay.c
===================================================================
RCS file: /usr/CVSroot/XEmacs/xemacs-20/src/redisplay.c,v
retrieving revision 1.55
diff -u -r1.55 redisplay.c
--- redisplay.c 1998/06/30 06:36:00 1.55
+++ redisplay.c 1998/09/07 17:03:12
@@ -5066,7 +5066,10 @@
temporary change to the echo area. */
&& !(MINI_WINDOW_P (w) && f->buffers_changed)
&& !f->frame_changed
- && !truncation_changed)
+ && !truncation_changed
+ /* check whether start is really at the begining of a line GE */
+ && (!w->start_at_line_beg || beginning_of_line_p (b, startp)))
{
/* Check if the cursor has actually moved. */
if (EQ (Fmarker_buffer (w->last_point[CURRENT_DISP]), w->buffer)
Index: window.c
===================================================================
RCS file: /usr/CVSroot/XEmacs/xemacs-20/src/window.c,v
retrieving revision 1.41
diff -u -r1.41 window.c
--- window.c 1998/06/30 06:36:06 1.41
+++ window.c 1998/09/07 17:03:17
@@ -3163,7 +3163,9 @@
make_int (XBUFFER (buffer)->last_window_start),
buffer);
Fset_marker (w->sb_point, w->start[CURRENT_DISP], buffer);
- w->start_at_line_beg = 0;
+ /* set start_at_line_beg correctly. GE */
+ w->start_at_line_beg = beginning_of_line_p (XBUFFER (buffer),
+ XBUFFER (buffer)->last_window_start);
w->force_start = 0; /* Lucid fix */
SET_LAST_MODIFIED (w, 1);
SET_LAST_FACECHANGE (w);
Show replies by date