Mike Alexander <mta(a)arbortext.com> writes:
> I did that. It doesn't lay out any lines because the height of the
> window is less than the height of one line. I don't know enough
> about the redisplay code to know if this is supposed to be impossible
> or if it is normal but the redisplay code isn't handling it right.
Could you try whether this (untested) attempt at fixing
update_line_start_cache helps?
Index: redisplay.c
===================================================================
RCS file: /usr/CVSroot/XEmacs/xemacs-20/src/redisplay.c,v
retrieving revision 1.55.2.56
diff -u -r1.55.2.56 redisplay.c
--- redisplay.c 2000/05/09 11:54:57 1.55.2.56
+++ redisplay.c 2000/05/11 18:15:14
@@ -87,16 +87,10 @@
#define LEFT_GLYPHS 2
#define RIGHT_GLYPHS 3
-/* Set the vertical clip to 0 if we are currently updating the line
- start cache. Otherwise for buffers of line height 1 it may fail to
- be able to work properly because regenerate_window will not layout
- a single line. */
#define VERTICAL_CLIP(w, display) \
- (updating_line_start_cache \
- ? 0 \
- : ((WINDOW_TTY_P (w) | (!display && scroll_on_clipped_lines)) \
+ ((WINDOW_TTY_P (w) | (!display && scroll_on_clipped_lines)) \
? INT_MAX \
- : vertical_clip))
+ : vertical_clip)
/* The following structures are completely private to redisplay.c so
we put them here instead of in a header file, for modularity. */
@@ -328,9 +322,6 @@
/* Minimum visible pixel width of clipped glyphs at right margin. */
int horizontal_clip;
-/* Set if currently inside update_line_start_cache. */
-static int updating_line_start_cache;
-
/* Nonzero means reading single-character input with prompt
so put cursor on minibuffer after the prompt. */
int cursor_in_echo_area;
@@ -5098,6 +5089,7 @@
int ypos = WINDOW_TEXT_TOP (w);
int yend; /* set farther down */
int yclip = WINDOW_TEXT_TOP_CLIP (w);
+ int force;
prop_block_dynarr *prop;
layout_bounds bounds;
@@ -5151,10 +5143,14 @@
else
prop = 0;
+ /* When we are computing things for scrolling purposes, make
+ sure at least one line is always generated */
+ force = (type == CMOTION_DISP);
+
/* Make sure this is set always */
/* Note the conversion at end */
w->window_end_pos[type] = start_pos;
- while (ypos < yend)
+ while (ypos < yend || force)
{
struct display_line dl;
struct display_line *dlp;
@@ -5207,7 +5203,7 @@
the top clip and the bottom clip. */
visible_height -= (dlp->clip + dlp->top_clip);
- if (visible_height < VERTICAL_CLIP (w, 1))
+ if (visible_height < VERTICAL_CLIP (w, 1) && !force)
{
if (local)
free_display_line (dlp);
@@ -5251,6 +5247,8 @@
generate_display_line call. */
if (start_pos > BUF_ZV (b))
break;
+
+ force = 0;
}
if (prop)
@@ -7834,7 +7832,6 @@
validate_line_start_cache (w);
w->line_cache_validation_override++;
- updating_line_start_cache = 1;
if (from < BUF_BEGV (b))
from = BUF_BEGV (b);
@@ -7843,7 +7840,6 @@
if (from > to)
{
- updating_line_start_cache = 0;
w->line_cache_validation_override--;
return;
}
@@ -7856,7 +7852,6 @@
/* Check to see if the desired range is already in the cache. */
if (from >= low_bound && to <= high_bound)
{
- updating_line_start_cache = 0;
w->line_cache_validation_override--;
return;
}
@@ -7885,7 +7880,6 @@
update_internal_cache_list (w, DESIRED_DISP);
if (!Dynarr_length (internal_cache))
{
- updating_line_start_cache = 0;
w->line_cache_validation_override--;
return;
}
@@ -7913,7 +7907,6 @@
{
Dynarr_add_many (cache, Dynarr_atp (internal_cache, 0),
Dynarr_length (internal_cache));
- updating_line_start_cache = 0;
w->line_cache_validation_override--;
return;
}
@@ -7922,7 +7915,6 @@
the bounds of the DESIRED structs in the first place. */
if (start >= low_bound && end <= high_bound)
{
- updating_line_start_cache = 0;
w->line_cache_validation_override--;
return;
}
@@ -7945,7 +7937,6 @@
Dynarr_reset (cache);
Dynarr_add_many (cache, Dynarr_atp (internal_cache, 0),
Dynarr_length (internal_cache));
- updating_line_start_cache = 0;
w->line_cache_validation_override--;
return;
}
@@ -7971,7 +7962,6 @@
Dynarr_reset (cache);
Dynarr_add_many (cache, Dynarr_atp (internal_cache, 0),
Dynarr_length (internal_cache));
- updating_line_start_cache = 0;
w->line_cache_validation_override--;
return;
}
@@ -7980,7 +7970,6 @@
Dynarr_length (internal_cache) - ic_elt);
}
- updating_line_start_cache = 0;
w->line_cache_validation_override--;
return;
}
@@ -8000,23 +7989,9 @@
update_internal_cache_list (w, CMOTION_DISP);
/* If this assert is triggered then regenerate_window failed
- to layout a single line. That is not supposed to be
- possible because we impose a minimum height on the buffer
- and override vertical clip when we are in here. */
- /* #### Ah, but it is because the window may temporarily
- exist but not have any lines at all if the minibuffer is
- real big. Look into that situation better. */
- if (!Dynarr_length (internal_cache))
- {
- if (old_lb == -1 && low_bound == -1)
- {
- updating_line_start_cache = 0;
- w->line_cache_validation_override--;
- return;
- }
-
- assert (Dynarr_length (internal_cache));
- }
+ to layout a single line. This is not possible since we
+ force at least a single line to be layout for CMOTION_DISP */
+ assert (Dynarr_length (internal_cache));
assert (startp == Dynarr_atp (internal_cache, 0)->start);
ic_elt = Dynarr_length (internal_cache) - 1;
@@ -8062,7 +8037,6 @@
startp = new_startp;
if (startp > BUF_ZV (b))
{
- updating_line_start_cache = 0;
w->line_cache_validation_override--;
return;
}
@@ -8096,7 +8070,6 @@
while (to > high_bound);
}
- updating_line_start_cache = 0;
w->line_cache_validation_override--;
assert (to <= high_bound);
}
@@ -9268,15 +9241,8 @@
}
void
-reinit_vars_of_redisplay (void)
-{
- updating_line_start_cache = 0;
-}
-
-void
vars_of_redisplay (void)
{
- reinit_vars_of_redisplay ();
#if 0
staticpro (&last_arrow_position);