+#ifdef DEBUG_GUTTERS
+ printf ("gutter redisplay [%dx%d@%d+%d] triggered by %s,\n",
+ width, height, x, y, force ? "force" :
+ f->faces_changed ? "f->faces_changed" :
+ f->frame_changed ? "f->frame_changed" :
+ f->gutter_changed ? "f->gutter_changed" :
+ f->glyphs_changed ? "f->glyphs_changed" :
+ f->size_changed ? "f->size_changed" :
+ f->subwindows_changed ? "f->subwindows_changed" :
+ w->windows_changed ? "w->windows_changed" :
+ f->windows_structure_changed ? "f->windows_structure_changed" :
+ cdla_len != Dynarr_length (ddla) ? "different display structures" :
+ f->extents_changed && w->gutter_extent_modiff[pos] ?
+ "f->extents_changed && w->gutter_extent_modiff[pos]" : "<null>");
+#endif
+ /* Output each line. */
+ for (line = 0; line < Dynarr_length (ddla); line++)
+ {
+ output_display_line (w, cdla, ddla, line, -1, -1);
+ }
+
+ /* If the number of display lines has shrunk, adjust. */
+ if (cdla_len > Dynarr_length (ddla))
+ {
+ Dynarr_length (cdla) = Dynarr_length (ddla);
+ }
+
+ /* grab coordinates of last line and blank after it. */
+ if (Dynarr_length (ddla) > 0)
+ {
+ dl = Dynarr_atp (ddla, Dynarr_length (ddla) - 1);
+ ypos = dl->ypos + dl->descent - dl->clip;
+ }
+ else
+ ypos = y;
+
+ redisplay_clear_region (window, findex, x + border_width , ypos,
+ width - 2 * border_width, height - (ypos - y) - border_width);
+ /* If, for some reason, we have more to display than we have
+ room for, and we are allowed to resize the gutter, then make
+ sure this happens before the next time we try and
+ output. This can happen when face font sizes change. */
+ if (dl && EQ (w->gutter_size[pos], Qautodetect)
+ && (dl->clip > 0 ||
+ calculate_gutter_size_from_display_lines (pos, ddla) >
+ WINDOW_GUTTER_SIZE_INTERNAL (w, pos)))
+ {
+ /* #### Ideally we would just mark the specifier as dirty
+ and everything else would "just work". Unfortunately we have
+ two problems with this. One is that the specifier cache
+ won't be recalculated unless the specifier code thinks the
+ cached value has actually changed, even though we have
+ marked the specifier as dirty. Additionally, although doing
+ this results in a gutter size change, we never seem to get
+ back into redisplay so that the frame size can be updated. I
+ think this is because we are already in redisplay and later
+ on the frame will be marked as clean. Thus we also have to
+ force a pending recalculation of the frame size. */
+ w->gutter_size[pos] = Qnil;
+ Fset_specifier_dirty_flag (Vgutter_size[pos]);
+ update_gutter_geometry (f, pos);
+ }
+
+ /* bevel the gutter area if so desired */
+ if (border_width != 0)
+ {
+ MAYBE_DEVMETH (d, bevel_area,
+ (w, findex, x, y, width, height, border_width,
+ EDGE_ALL, EDGE_BEVEL_OUT));
+ }